docusaurus-theme-openapi-docs 0.0.0-619 → 0.0.0-685
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/lib/index.d.ts +2 -0
- package/lib/index.js +53 -27
- package/lib/markdown/createDescription.d.ts +1 -0
- package/lib/markdown/createDescription.js +8 -11
- package/lib/markdown/schema.d.ts +3 -0
- package/lib/markdown/schema.js +138 -139
- package/lib/markdown/utils.d.ts +8 -0
- package/lib/markdown/utils.js +36 -42
- package/lib/theme/ApiDemoPanel/ApiCodeBlock/ExpandButton/index.js +165 -0
- package/lib/theme/ApiDemoPanel/ApiCodeBlock/Line/_Line.scss +46 -0
- package/lib/theme/ApiExplorer/Accept/index.d.ts +3 -0
- package/lib/theme/ApiExplorer/Accept/index.js +38 -0
- package/lib/theme/ApiExplorer/Accept/slice.d.ts +11 -0
- package/{lib-next/theme/ApiDemoPanel → lib/theme/ApiExplorer}/Accept/slice.js +7 -5
- package/lib/theme/ApiExplorer/ApiCodeBlock/Container/_Container.scss +7 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Container/index.js +29 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Content/Element.js +30 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Content/String.js +134 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Content/_Content.scss +91 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/CopyButton/_CopyButton.scss +44 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/CopyButton/index.js +74 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/ExitButton/_ExitButton.scss +16 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/ExitButton/index.js +47 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/ExpandButton/_ExpandButton.scss +62 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/ExpandButton/index.js +156 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Line/_Line.scss +46 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Line/index.js +47 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/_WordWrapButton.scss +10 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/index.js +44 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/index.js +40 -0
- package/lib/theme/ApiExplorer/Authorization/auth-types.d.ts +3 -0
- package/lib/theme/{ApiDemoPanel → ApiExplorer}/Authorization/auth-types.js +4 -10
- package/lib/theme/ApiExplorer/Authorization/index.d.ts +3 -0
- package/lib/theme/ApiExplorer/Authorization/index.js +157 -0
- package/lib/theme/ApiExplorer/Authorization/slice.d.ts +40 -0
- package/{lib-next/theme/ApiDemoPanel → lib/theme/ApiExplorer}/Authorization/slice.js +23 -16
- package/lib/theme/ApiExplorer/Body/index.d.ts +10 -0
- package/lib/theme/ApiExplorer/Body/index.js +363 -0
- package/lib/theme/ApiExplorer/Body/slice.d.ts +82 -0
- package/{lib-next/theme/ApiDemoPanel → lib/theme/ApiExplorer}/Body/slice.js +21 -12
- package/lib/theme/ApiExplorer/CodeSnippets/index.d.ts +20 -0
- package/lib/theme/ApiExplorer/CodeSnippets/index.js +406 -0
- package/lib/theme/ApiExplorer/CodeTabs/_CodeTabs.scss +291 -0
- package/lib/theme/ApiExplorer/CodeTabs/index.js +174 -0
- package/lib/theme/ApiExplorer/ContentType/index.d.ts +3 -0
- package/lib/theme/ApiExplorer/ContentType/index.js +40 -0
- package/lib/theme/ApiExplorer/ContentType/slice.d.ts +11 -0
- package/{lib-next/theme/ApiDemoPanel → lib/theme/ApiExplorer}/ContentType/slice.js +7 -5
- package/lib/theme/ApiExplorer/Export/index.d.ts +3 -0
- package/lib/theme/ApiExplorer/Export/index.js +57 -0
- package/lib/theme/ApiExplorer/FloatingButton/_FloatingButton.scss +25 -0
- package/lib/theme/ApiExplorer/FloatingButton/index.d.ts +8 -0
- package/lib/theme/ApiExplorer/FloatingButton/index.js +28 -0
- package/{lib-next/theme/ApiDemoPanel/FormFileUpload/styles.module.css → lib/theme/ApiExplorer/FormFileUpload/_FormFileUpload.scss} +32 -35
- package/lib/theme/ApiExplorer/FormFileUpload/index.d.ts +7 -0
- package/lib/theme/ApiExplorer/FormFileUpload/index.js +161 -0
- package/lib/theme/ApiExplorer/FormItem/_FormItem.scss +21 -0
- package/lib/theme/ApiExplorer/FormItem/index.d.ts +10 -0
- package/lib/theme/ApiExplorer/FormItem/index.js +44 -0
- package/lib/theme/ApiExplorer/FormMultiSelect/_FormMultiSelect.scss +30 -0
- package/lib/theme/ApiExplorer/FormMultiSelect/index.d.ts +9 -0
- package/lib/theme/ApiExplorer/FormMultiSelect/index.js +51 -0
- package/{src/theme/ApiDemoPanel/FormSelect/styles.module.css → lib/theme/ApiExplorer/FormSelect/_FormSelect.scss} +15 -23
- package/lib/theme/ApiExplorer/FormSelect/index.d.ts +8 -0
- package/lib/theme/ApiExplorer/FormSelect/index.js +35 -0
- package/lib/theme/ApiExplorer/FormTextInput/_FormTextInput.scss +34 -0
- package/lib/theme/ApiExplorer/FormTextInput/index.d.ts +9 -0
- package/lib/theme/ApiExplorer/FormTextInput/index.js +73 -0
- package/lib/theme/ApiExplorer/LiveEditor/_LiveEditor.scss +15 -0
- package/lib/theme/ApiExplorer/LiveEditor/index.d.ts +6 -0
- package/lib/theme/ApiExplorer/LiveEditor/index.js +154 -0
- package/lib/theme/ApiExplorer/MethodEndpoint/_MethodEndpoint.scss +22 -0
- package/lib/theme/ApiExplorer/MethodEndpoint/index.d.ts +7 -0
- package/lib/theme/ApiExplorer/MethodEndpoint/index.js +83 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.d.ts +6 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.js +194 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.d.ts +6 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.js +63 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.d.ts +6 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.js +89 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.d.ts +6 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.js +63 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamTextFormItem.d.ts +6 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamTextFormItem.js +38 -0
- package/{src/theme/ApiDemoPanel/ParamOptions/styles.module.css → lib/theme/ApiExplorer/ParamOptions/_ParamOptions.scss} +38 -92
- package/lib/theme/ApiExplorer/ParamOptions/index.d.ts +7 -0
- package/lib/theme/ApiExplorer/ParamOptions/index.js +210 -0
- package/lib/theme/ApiExplorer/ParamOptions/slice.d.ts +17 -0
- package/{lib-next/theme/ApiDemoPanel → lib/theme/ApiExplorer}/ParamOptions/slice.js +7 -5
- package/lib/theme/ApiExplorer/Request/_Request.scss +122 -0
- package/lib/theme/ApiExplorer/Request/index.d.ts +6 -0
- package/lib/theme/ApiExplorer/Request/index.js +365 -0
- package/lib/theme/ApiExplorer/Request/makeRequest.d.ts +4 -0
- package/{lib-next/theme/ApiDemoPanel/Execute → lib/theme/ApiExplorer/Request}/makeRequest.js +10 -9
- package/lib/theme/ApiExplorer/Response/_Response.scss +119 -0
- package/lib/theme/ApiExplorer/Response/index.d.ts +6 -0
- package/lib/theme/ApiExplorer/Response/index.js +190 -0
- package/lib/theme/ApiExplorer/Response/slice.d.ts +17 -0
- package/lib/theme/ApiExplorer/Response/slice.js +51 -0
- package/lib/theme/ApiExplorer/SecuritySchemes/index.d.ts +3 -0
- package/lib/theme/ApiExplorer/SecuritySchemes/index.js +380 -0
- package/{src/theme/ApiDemoPanel/Request/styles.module.css → lib/theme/ApiExplorer/Server/_Server.scss} +15 -7
- package/lib/theme/ApiExplorer/Server/index.d.ts +3 -0
- package/lib/theme/ApiExplorer/Server/index.js +187 -0
- package/lib/theme/ApiExplorer/Server/slice.d.ts +13 -0
- package/{lib-next/theme/ApiDemoPanel → lib/theme/ApiExplorer}/Server/slice.js +10 -5
- package/lib/theme/ApiExplorer/buildPostmanRequest.d.ts +20 -0
- package/{lib-next/theme/ApiDemoPanel → lib/theme/ApiExplorer}/buildPostmanRequest.js +27 -40
- package/lib/theme/ApiExplorer/index.d.ts +7 -0
- package/lib/theme/ApiExplorer/index.js +37 -0
- package/lib/theme/ApiExplorer/persistanceMiddleware.d.ts +3 -0
- package/{lib-next/theme/ApiDemoPanel → lib/theme/ApiExplorer}/persistanceMiddleware.js +11 -14
- package/lib/theme/ApiExplorer/storage-utils.d.ts +4 -0
- package/lib/theme/{ApiDemoPanel → ApiExplorer}/storage-utils.js +14 -13
- package/lib/theme/ApiItem/Layout/index.d.ts +4 -0
- package/lib/theme/ApiItem/Layout/index.js +78 -56
- package/lib/theme/ApiItem/hooks.d.ts +12 -0
- package/lib/theme/ApiItem/hooks.js +5 -10
- package/lib/theme/ApiItem/index.d.ts +4 -0
- package/lib/theme/ApiItem/index.js +141 -118
- package/lib/theme/ApiItem/store.d.ts +46 -0
- package/lib/theme/ApiItem/store.js +44 -34
- package/lib/theme/ApiLogo/index.d.ts +2 -0
- package/lib/theme/ApiLogo/index.js +34 -32
- package/lib/theme/ApiTabs/_ApiTabs.scss +140 -0
- package/lib/theme/ApiTabs/index.js +105 -190
- package/lib/theme/DiscriminatorTabs/_DiscriminatorTabs.scss +97 -0
- package/lib/theme/DiscriminatorTabs/index.js +102 -189
- package/lib/theme/Markdown/Details/_Details.scss +119 -0
- package/lib/theme/MimeTabs/_MimeTabs.scss +69 -0
- package/lib/theme/MimeTabs/index.js +125 -199
- package/lib/theme/ParamsItem/_ParamsItem.scss +54 -0
- package/lib/theme/ParamsItem/index.js +9 -8
- package/lib/theme/ResponseSamples/_ResponseSamples.scss +3 -0
- package/lib/theme/ResponseSamples/index.js +2 -7
- package/lib/theme/SchemaItem/_SchemaItem.scss +89 -0
- package/lib/theme/SchemaItem/index.js +31 -22
- package/lib/theme/SchemaTabs/_SchemaTabs.scss +64 -0
- package/lib/theme/SchemaTabs/index.js +97 -185
- package/lib/theme/styles.scss +160 -0
- package/lib/types.d.ts +157 -0
- package/lib/types.js +8 -1
- package/package.json +17 -23
- package/src/index.ts +33 -3
- package/src/theme/ApiDemoPanel/ApiCodeBlock/ExpandButton/index.js +165 -0
- package/src/theme/ApiDemoPanel/ApiCodeBlock/Line/_Line.scss +46 -0
- package/src/theme/{ApiDemoPanel → ApiExplorer}/Accept/index.tsx +2 -2
- package/src/theme/ApiExplorer/ApiCodeBlock/Container/_Container.scss +7 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/Container/index.js +29 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/Content/Element.js +30 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/Content/String.js +134 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/Content/_Content.scss +91 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/CopyButton/_CopyButton.scss +44 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/CopyButton/index.js +74 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/ExitButton/_ExitButton.scss +16 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/ExitButton/index.js +47 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/ExpandButton/_ExpandButton.scss +62 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/ExpandButton/index.js +156 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/Line/_Line.scss +46 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/Line/index.js +47 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/_WordWrapButton.scss +10 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/index.js +44 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/index.js +40 -0
- package/src/theme/{ApiDemoPanel → ApiExplorer}/Authorization/index.tsx +3 -3
- package/src/theme/{ApiDemoPanel → ApiExplorer}/Authorization/slice.ts +1 -1
- package/src/theme/{ApiDemoPanel → ApiExplorer}/Body/index.tsx +64 -41
- package/src/theme/{ApiDemoPanel/Curl → ApiExplorer/CodeSnippets}/index.tsx +94 -34
- package/src/theme/ApiExplorer/CodeTabs/_CodeTabs.scss +291 -0
- package/src/theme/ApiExplorer/CodeTabs/index.js +174 -0
- package/src/theme/{ApiDemoPanel → ApiExplorer}/ContentType/index.tsx +2 -2
- package/src/theme/ApiExplorer/FloatingButton/_FloatingButton.scss +25 -0
- package/src/theme/{ApiDemoPanel → ApiExplorer}/FloatingButton/index.tsx +1 -3
- package/src/theme/{ApiDemoPanel/FormFileUpload/styles.module.css → ApiExplorer/FormFileUpload/_FormFileUpload.scss} +32 -35
- package/src/theme/{ApiDemoPanel → ApiExplorer}/FormFileUpload/index.tsx +10 -6
- package/src/theme/ApiExplorer/FormItem/_FormItem.scss +21 -0
- package/src/theme/{ApiDemoPanel → ApiExplorer}/FormItem/index.tsx +8 -12
- package/src/theme/ApiExplorer/FormMultiSelect/_FormMultiSelect.scss +30 -0
- package/src/theme/{ApiDemoPanel → ApiExplorer}/FormMultiSelect/index.tsx +6 -3
- package/{lib/theme/ApiDemoPanel/FormSelect/styles.module.css → src/theme/ApiExplorer/FormSelect/_FormSelect.scss} +15 -23
- package/src/theme/{ApiDemoPanel → ApiExplorer}/FormSelect/index.tsx +5 -3
- package/src/theme/ApiExplorer/FormTextInput/_FormTextInput.scss +34 -0
- package/src/theme/ApiExplorer/FormTextInput/index.tsx +80 -0
- package/src/theme/ApiExplorer/LiveEditor/_LiveEditor.scss +15 -0
- package/src/theme/ApiExplorer/LiveEditor/index.tsx +112 -0
- package/src/theme/ApiExplorer/MethodEndpoint/_MethodEndpoint.scss +22 -0
- package/src/theme/ApiExplorer/MethodEndpoint/index.tsx +87 -0
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.tsx +156 -0
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.tsx +64 -0
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.tsx +86 -0
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.tsx +65 -0
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamTextFormItem.tsx +38 -0
- package/{lib-next/theme/ApiDemoPanel/ParamOptions/styles.module.css → src/theme/ApiExplorer/ParamOptions/_ParamOptions.scss} +38 -92
- package/src/theme/ApiExplorer/ParamOptions/index.tsx +145 -0
- package/src/theme/ApiExplorer/Request/_Request.scss +122 -0
- package/src/theme/ApiExplorer/Request/index.tsx +286 -0
- package/src/theme/{ApiDemoPanel/Execute → ApiExplorer/Request}/makeRequest.ts +9 -6
- package/src/theme/ApiExplorer/Response/_Response.scss +119 -0
- package/src/theme/ApiExplorer/Response/index.tsx +154 -0
- package/src/theme/{ApiDemoPanel → ApiExplorer}/Response/slice.ts +22 -1
- package/src/theme/{ApiDemoPanel → ApiExplorer}/SecuritySchemes/index.tsx +5 -3
- package/{lib/theme/ApiDemoPanel/Request/styles.module.css → src/theme/ApiExplorer/Server/_Server.scss} +15 -7
- package/src/theme/{ApiDemoPanel → ApiExplorer}/Server/index.tsx +13 -17
- package/src/theme/{ApiDemoPanel → ApiExplorer}/buildPostmanRequest.ts +2 -2
- package/src/theme/{ApiDemoPanel → ApiExplorer}/index.tsx +14 -17
- package/src/theme/{ApiDemoPanel → ApiExplorer}/persistanceMiddleware.ts +1 -1
- package/src/theme/ApiItem/index.tsx +7 -7
- package/src/theme/ApiItem/store.ts +7 -7
- package/src/theme/ApiTabs/_ApiTabs.scss +140 -0
- package/src/theme/ApiTabs/index.js +105 -190
- package/src/theme/DiscriminatorTabs/_DiscriminatorTabs.scss +97 -0
- package/src/theme/DiscriminatorTabs/index.js +102 -189
- package/src/theme/Markdown/Details/_Details.scss +119 -0
- package/src/theme/MimeTabs/_MimeTabs.scss +69 -0
- package/src/theme/MimeTabs/index.js +125 -199
- package/src/theme/ParamsItem/_ParamsItem.scss +54 -0
- package/src/theme/ParamsItem/index.js +9 -8
- package/src/theme/ResponseSamples/_ResponseSamples.scss +3 -0
- package/src/theme/ResponseSamples/index.js +2 -7
- package/src/theme/SchemaItem/_SchemaItem.scss +89 -0
- package/src/theme/SchemaItem/index.js +31 -22
- package/src/theme/SchemaTabs/_SchemaTabs.scss +64 -0
- package/src/theme/SchemaTabs/index.js +97 -185
- package/src/theme/styles.scss +160 -0
- package/src/theme-openapi.d.ts +90 -47
- package/tsconfig.json +6 -3
- package/lib/postman-code-generators.d.ts +0 -9
- package/lib/react-magic-dropzone.d.ts +0 -9
- package/lib/theme/ApiDemoPanel/Accept/index.js +0 -32
- package/lib/theme/ApiDemoPanel/Accept/slice.js +0 -31
- package/lib/theme/ApiDemoPanel/Authorization/index.js +0 -107
- package/lib/theme/ApiDemoPanel/Authorization/slice.js +0 -123
- package/lib/theme/ApiDemoPanel/Body/index.js +0 -256
- package/lib/theme/ApiDemoPanel/Body/slice.js +0 -102
- package/lib/theme/ApiDemoPanel/CodeTabs/index.js +0 -161
- package/lib/theme/ApiDemoPanel/CodeTabs/styles.module.css +0 -17
- package/lib/theme/ApiDemoPanel/ContentType/index.js +0 -32
- package/lib/theme/ApiDemoPanel/ContentType/slice.js +0 -31
- package/lib/theme/ApiDemoPanel/Curl/index.js +0 -240
- package/lib/theme/ApiDemoPanel/Curl/styles.module.css +0 -84
- package/lib/theme/ApiDemoPanel/Execute/index.js +0 -151
- package/lib/theme/ApiDemoPanel/Execute/makeRequest.js +0 -181
- package/lib/theme/ApiDemoPanel/Export/index.js +0 -47
- package/lib/theme/ApiDemoPanel/FloatingButton/index.js +0 -30
- package/lib/theme/ApiDemoPanel/FloatingButton/styles.module.css +0 -26
- package/lib/theme/ApiDemoPanel/FormFileUpload/index.js +0 -83
- package/lib/theme/ApiDemoPanel/FormFileUpload/styles.module.css +0 -75
- package/lib/theme/ApiDemoPanel/FormItem/index.js +0 -38
- package/lib/theme/ApiDemoPanel/FormItem/styles.module.css +0 -12
- package/lib/theme/ApiDemoPanel/FormMultiSelect/index.js +0 -45
- package/lib/theme/ApiDemoPanel/FormMultiSelect/styles.module.css +0 -38
- package/lib/theme/ApiDemoPanel/FormSelect/index.js +0 -34
- package/lib/theme/ApiDemoPanel/FormTextInput/index.js +0 -28
- package/lib/theme/ApiDemoPanel/FormTextInput/styles.module.css +0 -21
- package/lib/theme/ApiDemoPanel/LiveEditor/index.js +0 -62
- package/lib/theme/ApiDemoPanel/LiveEditor/styles.module.css +0 -35
- package/lib/theme/ApiDemoPanel/MethodEndpoint/index.js +0 -56
- package/lib/theme/ApiDemoPanel/ParamOptions/index.js +0 -216
- package/lib/theme/ApiDemoPanel/ParamOptions/slice.js +0 -34
- package/lib/theme/ApiDemoPanel/ParamOptions/styles.module.css +0 -176
- package/lib/theme/ApiDemoPanel/Request/index.js +0 -67
- package/lib/theme/ApiDemoPanel/Response/index.js +0 -66
- package/lib/theme/ApiDemoPanel/Response/slice.js +0 -36
- package/lib/theme/ApiDemoPanel/SecuritySchemes/index.js +0 -257
- package/lib/theme/ApiDemoPanel/Server/index.js +0 -104
- package/lib/theme/ApiDemoPanel/Server/slice.js +0 -40
- package/lib/theme/ApiDemoPanel/Server/styles.module.css +0 -56
- package/lib/theme/ApiDemoPanel/buildPostmanRequest.js +0 -303
- package/lib/theme/ApiDemoPanel/index.js +0 -41
- package/lib/theme/ApiDemoPanel/persistanceMiddleware.js +0 -59
- package/lib/theme/ApiDemoPanel/postman-collection.d.ts +0 -10
- package/lib/theme/ApiDemoPanel/react-modal.d.ts +0 -8
- package/lib/theme/ApiTabs/styles.module.css +0 -120
- package/lib/theme/DiscriminatorTabs/styles.module.css +0 -119
- package/lib/theme/MimeTabs/styles.module.css +0 -126
- package/lib/theme/ParamsItem/styles.module.css +0 -24
- package/lib/theme/ResponseSamples/styles.module.css +0 -7
- package/lib/theme/SchemaItem/styles.module.css +0 -38
- package/lib/theme/SchemaTabs/styles.module.css +0 -110
- package/lib/theme/styles.css +0 -520
- package/lib/theme-classic.d.ts +0 -13
- package/lib/theme-openapi.d.ts +0 -234
- package/lib/theme-translations.d.ts +0 -9
- package/lib-next/index.js +0 -29
- package/lib-next/markdown/createDescription.js +0 -13
- package/lib-next/markdown/schema.js +0 -153
- package/lib-next/markdown/utils.js +0 -44
- package/lib-next/postman-code-generators.d.ts +0 -9
- package/lib-next/react-magic-dropzone.d.ts +0 -9
- package/lib-next/theme/ApiDemoPanel/Accept/index.js +0 -30
- package/lib-next/theme/ApiDemoPanel/Authorization/auth-types.js +0 -29
- package/lib-next/theme/ApiDemoPanel/Authorization/index.js +0 -142
- package/lib-next/theme/ApiDemoPanel/Body/index.js +0 -324
- package/lib-next/theme/ApiDemoPanel/CodeTabs/index.js +0 -201
- package/lib-next/theme/ApiDemoPanel/CodeTabs/styles.module.css +0 -17
- package/lib-next/theme/ApiDemoPanel/ContentType/index.js +0 -30
- package/lib-next/theme/ApiDemoPanel/Curl/index.js +0 -283
- package/lib-next/theme/ApiDemoPanel/Curl/styles.module.css +0 -84
- package/lib-next/theme/ApiDemoPanel/Execute/index.js +0 -167
- package/lib-next/theme/ApiDemoPanel/Export/index.js +0 -45
- package/lib-next/theme/ApiDemoPanel/FloatingButton/index.js +0 -22
- package/lib-next/theme/ApiDemoPanel/FloatingButton/styles.module.css +0 -26
- package/lib-next/theme/ApiDemoPanel/FormFileUpload/index.js +0 -106
- package/lib-next/theme/ApiDemoPanel/FormItem/index.js +0 -36
- package/lib-next/theme/ApiDemoPanel/FormItem/styles.module.css +0 -12
- package/lib-next/theme/ApiDemoPanel/FormMultiSelect/index.js +0 -45
- package/lib-next/theme/ApiDemoPanel/FormMultiSelect/styles.module.css +0 -38
- package/lib-next/theme/ApiDemoPanel/FormSelect/index.js +0 -26
- package/lib-next/theme/ApiDemoPanel/FormSelect/styles.module.css +0 -51
- package/lib-next/theme/ApiDemoPanel/FormTextInput/index.js +0 -24
- package/lib-next/theme/ApiDemoPanel/FormTextInput/styles.module.css +0 -21
- package/lib-next/theme/ApiDemoPanel/LiveEditor/index.js +0 -59
- package/lib-next/theme/ApiDemoPanel/LiveEditor/styles.module.css +0 -35
- package/lib-next/theme/ApiDemoPanel/MethodEndpoint/index.js +0 -53
- package/lib-next/theme/ApiDemoPanel/ParamOptions/index.js +0 -292
- package/lib-next/theme/ApiDemoPanel/Request/index.js +0 -60
- package/lib-next/theme/ApiDemoPanel/Request/styles.module.css +0 -18
- package/lib-next/theme/ApiDemoPanel/Response/index.js +0 -67
- package/lib-next/theme/ApiDemoPanel/Response/slice.js +0 -23
- package/lib-next/theme/ApiDemoPanel/SecuritySchemes/index.js +0 -274
- package/lib-next/theme/ApiDemoPanel/Server/index.js +0 -132
- package/lib-next/theme/ApiDemoPanel/Server/styles.module.css +0 -56
- package/lib-next/theme/ApiDemoPanel/index.js +0 -28
- package/lib-next/theme/ApiDemoPanel/storage-utils.js +0 -33
- package/lib-next/theme/ApiItem/Layout/index.js +0 -68
- package/lib-next/theme/ApiItem/Layout/styles.module.css +0 -17
- package/lib-next/theme/ApiItem/hooks.js +0 -10
- package/lib-next/theme/ApiItem/index.js +0 -155
- package/lib-next/theme/ApiItem/store.js +0 -38
- package/lib-next/theme/ApiLogo/index.js +0 -48
- package/lib-next/theme/ApiTabs/index.js +0 -277
- package/lib-next/theme/ApiTabs/styles.module.css +0 -120
- package/lib-next/theme/DiscriminatorTabs/index.js +0 -272
- package/lib-next/theme/DiscriminatorTabs/styles.module.css +0 -119
- package/lib-next/theme/MimeTabs/index.js +0 -295
- package/lib-next/theme/MimeTabs/styles.module.css +0 -126
- package/lib-next/theme/ParamsItem/index.js +0 -135
- package/lib-next/theme/ParamsItem/styles.module.css +0 -24
- package/lib-next/theme/ResponseSamples/index.js +0 -27
- package/lib-next/theme/ResponseSamples/styles.module.css +0 -7
- package/lib-next/theme/SchemaItem/index.js +0 -114
- package/lib-next/theme/SchemaItem/styles.module.css +0 -38
- package/lib-next/theme/SchemaTabs/index.js +0 -270
- package/lib-next/theme/SchemaTabs/styles.module.css +0 -110
- package/lib-next/theme/styles.css +0 -520
- package/lib-next/theme-classic.d.ts +0 -13
- package/lib-next/theme-openapi.d.ts +0 -234
- package/lib-next/theme-translations.d.ts +0 -9
- package/lib-next/types.js +0 -1
- package/src/theme/ApiDemoPanel/Body/json2xml.js +0 -43
- package/src/theme/ApiDemoPanel/CodeTabs/index.tsx +0 -239
- package/src/theme/ApiDemoPanel/CodeTabs/styles.module.css +0 -17
- package/src/theme/ApiDemoPanel/Curl/languages.json +0 -1386
- package/src/theme/ApiDemoPanel/Curl/styles.module.css +0 -84
- package/src/theme/ApiDemoPanel/Execute/index.tsx +0 -189
- package/src/theme/ApiDemoPanel/FloatingButton/styles.module.css +0 -26
- package/src/theme/ApiDemoPanel/FormItem/styles.module.css +0 -12
- package/src/theme/ApiDemoPanel/FormMultiSelect/styles.module.css +0 -38
- package/src/theme/ApiDemoPanel/FormTextInput/index.tsx +0 -34
- package/src/theme/ApiDemoPanel/FormTextInput/styles.module.css +0 -21
- package/src/theme/ApiDemoPanel/LiveEditor/index.tsx +0 -75
- package/src/theme/ApiDemoPanel/LiveEditor/styles.module.css +0 -35
- package/src/theme/ApiDemoPanel/MethodEndpoint/index.tsx +0 -62
- package/src/theme/ApiDemoPanel/ParamOptions/index.tsx +0 -326
- package/src/theme/ApiDemoPanel/Request/index.tsx +0 -71
- package/src/theme/ApiDemoPanel/Response/index.tsx +0 -75
- package/src/theme/ApiDemoPanel/Server/styles.module.css +0 -56
- package/src/theme/ApiDemoPanel/postman-collection.d.ts +0 -10
- package/src/theme/ApiDemoPanel/react-modal.d.ts +0 -8
- package/src/theme/ApiTabs/styles.module.css +0 -120
- package/src/theme/DiscriminatorTabs/styles.module.css +0 -119
- package/src/theme/MimeTabs/styles.module.css +0 -126
- package/src/theme/ParamsItem/styles.module.css +0 -24
- package/src/theme/ResponseSamples/styles.module.css +0 -7
- package/src/theme/SchemaItem/styles.module.css +0 -38
- package/src/theme/SchemaTabs/styles.module.css +0 -110
- package/src/theme/styles.css +0 -520
- /package/{lib-next/theme/ApiDemoPanel → lib/theme/ApiExplorer}/Body/json2xml.js +0 -0
- /package/{lib-next/theme/ApiDemoPanel/Curl → lib/theme/ApiExplorer/CodeSnippets}/languages.json +0 -0
- /package/src/theme/{ApiDemoPanel → ApiExplorer}/Accept/slice.ts +0 -0
- /package/src/theme/{ApiDemoPanel → ApiExplorer}/Authorization/auth-types.ts +0 -0
- /package/{lib/theme/ApiDemoPanel → src/theme/ApiExplorer}/Body/json2xml.js +0 -0
- /package/src/theme/{ApiDemoPanel → ApiExplorer}/Body/slice.ts +0 -0
- /package/{lib/theme/ApiDemoPanel/Curl → src/theme/ApiExplorer/CodeSnippets}/languages.json +0 -0
- /package/src/theme/{ApiDemoPanel → ApiExplorer}/ContentType/slice.ts +0 -0
- /package/src/theme/{ApiDemoPanel → ApiExplorer}/Export/index.tsx +0 -0
- /package/src/theme/{ApiDemoPanel → ApiExplorer}/ParamOptions/slice.ts +0 -0
- /package/src/theme/{ApiDemoPanel → ApiExplorer}/Server/slice.ts +0 -0
- /package/{lib-next/theme/ApiDemoPanel → src/theme/ApiExplorer}/postman-collection.d.ts +0 -0
- /package/{lib-next/theme/ApiDemoPanel → src/theme/ApiExplorer}/react-modal.d.ts +0 -0
- /package/src/theme/{ApiDemoPanel → ApiExplorer}/storage-utils.ts +0 -0
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* ============================================================================
|
|
3
|
+
* Copyright (c) Palo Alto Networks
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
* ========================================================================== */
|
|
8
|
+
var __createBinding =
|
|
9
|
+
(this && this.__createBinding) ||
|
|
10
|
+
(Object.create
|
|
11
|
+
? function (o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
14
|
+
if (
|
|
15
|
+
!desc ||
|
|
16
|
+
("get" in desc ? !m.__esModule : desc.writable || desc.configurable)
|
|
17
|
+
) {
|
|
18
|
+
desc = {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return m[k];
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
Object.defineProperty(o, k2, desc);
|
|
26
|
+
}
|
|
27
|
+
: function (o, m, k, k2) {
|
|
28
|
+
if (k2 === undefined) k2 = k;
|
|
29
|
+
o[k2] = m[k];
|
|
30
|
+
});
|
|
31
|
+
var __setModuleDefault =
|
|
32
|
+
(this && this.__setModuleDefault) ||
|
|
33
|
+
(Object.create
|
|
34
|
+
? function (o, v) {
|
|
35
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
36
|
+
}
|
|
37
|
+
: function (o, v) {
|
|
38
|
+
o["default"] = v;
|
|
39
|
+
});
|
|
40
|
+
var __importStar =
|
|
41
|
+
(this && this.__importStar) ||
|
|
42
|
+
function (mod) {
|
|
43
|
+
if (mod && mod.__esModule) return mod;
|
|
44
|
+
var result = {};
|
|
45
|
+
if (mod != null)
|
|
46
|
+
for (var k in mod)
|
|
47
|
+
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
48
|
+
__createBinding(result, mod, k);
|
|
49
|
+
__setModuleDefault(result, mod);
|
|
50
|
+
return result;
|
|
51
|
+
};
|
|
52
|
+
var __importDefault =
|
|
53
|
+
(this && this.__importDefault) ||
|
|
54
|
+
function (mod) {
|
|
55
|
+
return mod && mod.__esModule ? mod : { default: mod };
|
|
56
|
+
};
|
|
57
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
58
|
+
const react_1 = __importStar(require("react"));
|
|
59
|
+
const FloatingButton_1 = __importDefault(
|
|
60
|
+
require("@theme/ApiExplorer/FloatingButton")
|
|
61
|
+
);
|
|
62
|
+
const FormItem_1 = __importDefault(require("@theme/ApiExplorer/FormItem"));
|
|
63
|
+
const FormSelect_1 = __importDefault(require("@theme/ApiExplorer/FormSelect"));
|
|
64
|
+
const FormTextInput_1 = __importDefault(
|
|
65
|
+
require("@theme/ApiExplorer/FormTextInput")
|
|
66
|
+
);
|
|
67
|
+
const hooks_1 = require("@theme/ApiItem/hooks");
|
|
68
|
+
const slice_1 = require("./slice");
|
|
69
|
+
function Server() {
|
|
70
|
+
const [isEditing, setIsEditing] = (0, react_1.useState)(false);
|
|
71
|
+
const value = (0, hooks_1.useTypedSelector)((state) => state.server.value);
|
|
72
|
+
const options = (0, hooks_1.useTypedSelector)(
|
|
73
|
+
(state) => state.server.options
|
|
74
|
+
);
|
|
75
|
+
const dispatch = (0, hooks_1.useTypedDispatch)();
|
|
76
|
+
if (options.length <= 0) {
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
if (options.length < 1 && value?.variables === undefined) {
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
if (!value) {
|
|
83
|
+
const defaultOption = options[0];
|
|
84
|
+
dispatch((0, slice_1.setServer)(JSON.stringify(defaultOption)));
|
|
85
|
+
}
|
|
86
|
+
// Default to first option when existing server state is mismatched
|
|
87
|
+
if (value) {
|
|
88
|
+
const urlExists = options.find((s) => s.url === value.url);
|
|
89
|
+
if (!urlExists) {
|
|
90
|
+
const defaultOption = options[0];
|
|
91
|
+
dispatch((0, slice_1.setServer)(JSON.stringify(defaultOption)));
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (!isEditing) {
|
|
95
|
+
let url = "";
|
|
96
|
+
if (value) {
|
|
97
|
+
url = value.url.replace(/\/$/, "");
|
|
98
|
+
if (value.variables) {
|
|
99
|
+
Object.keys(value.variables).forEach((variable) => {
|
|
100
|
+
url = url.replace(
|
|
101
|
+
`{${variable}}`,
|
|
102
|
+
value.variables?.[variable].default ?? ""
|
|
103
|
+
);
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return react_1.default.createElement(
|
|
108
|
+
FloatingButton_1.default,
|
|
109
|
+
{ onClick: () => setIsEditing(true), label: "Edit" },
|
|
110
|
+
react_1.default.createElement(
|
|
111
|
+
FormItem_1.default,
|
|
112
|
+
null,
|
|
113
|
+
react_1.default.createElement(
|
|
114
|
+
"span",
|
|
115
|
+
{ className: "openapi-explorer__server-url", title: url },
|
|
116
|
+
url
|
|
117
|
+
)
|
|
118
|
+
)
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
return react_1.default.createElement(
|
|
122
|
+
"div",
|
|
123
|
+
{ className: "openapi-explorer__server-container" },
|
|
124
|
+
react_1.default.createElement(
|
|
125
|
+
FloatingButton_1.default,
|
|
126
|
+
{ onClick: () => setIsEditing(false), label: "Hide" },
|
|
127
|
+
react_1.default.createElement(
|
|
128
|
+
FormItem_1.default,
|
|
129
|
+
null,
|
|
130
|
+
react_1.default.createElement(FormSelect_1.default, {
|
|
131
|
+
options: options.map((s) => s.url),
|
|
132
|
+
onChange: (e) => {
|
|
133
|
+
dispatch(
|
|
134
|
+
(0, slice_1.setServer)(
|
|
135
|
+
JSON.stringify(
|
|
136
|
+
options.filter((s) => s.url === e.target.value)[0]
|
|
137
|
+
)
|
|
138
|
+
)
|
|
139
|
+
);
|
|
140
|
+
},
|
|
141
|
+
value: value?.url,
|
|
142
|
+
}),
|
|
143
|
+
react_1.default.createElement(
|
|
144
|
+
"small",
|
|
145
|
+
{ className: "openapi-explorer__server-description" },
|
|
146
|
+
value?.description
|
|
147
|
+
)
|
|
148
|
+
),
|
|
149
|
+
value?.variables &&
|
|
150
|
+
Object.keys(value.variables).map((key) => {
|
|
151
|
+
if (value.variables?.[key].enum !== undefined) {
|
|
152
|
+
return react_1.default.createElement(
|
|
153
|
+
FormItem_1.default,
|
|
154
|
+
{ label: key },
|
|
155
|
+
react_1.default.createElement(FormSelect_1.default, {
|
|
156
|
+
options: value.variables[key].enum,
|
|
157
|
+
onChange: (e) => {
|
|
158
|
+
dispatch(
|
|
159
|
+
(0, slice_1.setServerVariable)(
|
|
160
|
+
JSON.stringify({ key, value: e.target.value })
|
|
161
|
+
)
|
|
162
|
+
);
|
|
163
|
+
},
|
|
164
|
+
value: value?.variables[key].default,
|
|
165
|
+
})
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
return react_1.default.createElement(
|
|
169
|
+
FormItem_1.default,
|
|
170
|
+
{ label: key },
|
|
171
|
+
react_1.default.createElement(FormTextInput_1.default, {
|
|
172
|
+
placeholder: value.variables?.[key].default,
|
|
173
|
+
onChange: (e) => {
|
|
174
|
+
dispatch(
|
|
175
|
+
(0, slice_1.setServerVariable)(
|
|
176
|
+
JSON.stringify({ key, value: e.target.value })
|
|
177
|
+
)
|
|
178
|
+
);
|
|
179
|
+
},
|
|
180
|
+
value: value?.variables?.[key].default,
|
|
181
|
+
})
|
|
182
|
+
);
|
|
183
|
+
})
|
|
184
|
+
)
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
exports.default = Server;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PayloadAction } from "@reduxjs/toolkit";
|
|
2
|
+
import { ServerObject } from "docusaurus-plugin-openapi-docs/src/openapi/types";
|
|
3
|
+
export interface State {
|
|
4
|
+
value?: ServerObject;
|
|
5
|
+
options: ServerObject[];
|
|
6
|
+
}
|
|
7
|
+
export declare const slice: import("@reduxjs/toolkit").Slice<State, {
|
|
8
|
+
setServer: (state: import("immer/dist/internal").WritableDraft<State>, action: PayloadAction<string>) => void;
|
|
9
|
+
setServerVariable: (state: import("immer/dist/internal").WritableDraft<State>, action: PayloadAction<string>) => void;
|
|
10
|
+
}, "server">;
|
|
11
|
+
export declare const setServer: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "server/setServer">, setServerVariable: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "server/setServerVariable">;
|
|
12
|
+
declare const _default: import("redux").Reducer<State, import("redux").AnyAction>;
|
|
13
|
+
export default _default;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/* ============================================================================
|
|
2
3
|
* Copyright (c) Palo Alto Networks
|
|
3
4
|
*
|
|
4
5
|
* This source code is licensed under the MIT license found in the
|
|
5
6
|
* LICENSE file in the root directory of this source tree.
|
|
6
7
|
* ========================================================================== */
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
var _a;
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.setServerVariable = exports.setServer = exports.slice = void 0;
|
|
11
|
+
const toolkit_1 = require("@reduxjs/toolkit");
|
|
9
12
|
const initialState = {};
|
|
10
|
-
|
|
13
|
+
exports.slice = (0, toolkit_1.createSlice)({
|
|
11
14
|
name: "server",
|
|
12
15
|
initialState,
|
|
13
16
|
reducers: {
|
|
@@ -24,5 +27,7 @@ export const slice = createSlice({
|
|
|
24
27
|
},
|
|
25
28
|
},
|
|
26
29
|
});
|
|
27
|
-
|
|
28
|
-
|
|
30
|
+
(_a = exports.slice.actions),
|
|
31
|
+
(exports.setServer = _a.setServer),
|
|
32
|
+
(exports.setServerVariable = _a.setServerVariable);
|
|
33
|
+
exports.default = exports.slice.reducer;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import sdk from "@paloaltonetworks/postman-collection";
|
|
2
|
+
import { AuthState } from "@theme/ApiExplorer/Authorization/slice";
|
|
3
|
+
import { Body } from "@theme/ApiExplorer/Body/slice";
|
|
4
|
+
import { ParameterObject, ServerObject } from "docusaurus-plugin-openapi-docs/src/openapi/types";
|
|
5
|
+
declare type Param = {
|
|
6
|
+
value?: string | string[];
|
|
7
|
+
} & ParameterObject;
|
|
8
|
+
interface Options {
|
|
9
|
+
server?: ServerObject;
|
|
10
|
+
queryParams: Param[];
|
|
11
|
+
pathParams: Param[];
|
|
12
|
+
cookieParams: Param[];
|
|
13
|
+
headerParams: Param[];
|
|
14
|
+
contentType: string;
|
|
15
|
+
accept: string;
|
|
16
|
+
body: Body;
|
|
17
|
+
auth: AuthState;
|
|
18
|
+
}
|
|
19
|
+
declare function buildPostmanRequest(postman: sdk.Request, { queryParams, pathParams, cookieParams, contentType, accept, headerParams, body, server, auth, }: Options): sdk.Request;
|
|
20
|
+
export default buildPostmanRequest;
|
|
@@ -1,12 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/* ============================================================================
|
|
2
3
|
* Copyright (c) Palo Alto Networks
|
|
3
4
|
*
|
|
4
5
|
* This source code is licensed under the MIT license found in the
|
|
5
6
|
* LICENSE file in the root directory of this source tree.
|
|
6
7
|
* ========================================================================== */
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
var __importDefault =
|
|
9
|
+
(this && this.__importDefault) ||
|
|
10
|
+
function (mod) {
|
|
11
|
+
return mod && mod.__esModule ? mod : { default: mod };
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
const postman_collection_1 = __importDefault(
|
|
15
|
+
require("@paloaltonetworks/postman-collection")
|
|
16
|
+
);
|
|
17
|
+
const cloneDeep_1 = __importDefault(require("lodash/cloneDeep"));
|
|
10
18
|
function setQueryParams(postman, queryParams) {
|
|
11
19
|
postman.url.query.clear();
|
|
12
20
|
const qp = queryParams
|
|
@@ -15,23 +23,22 @@ function setQueryParams(postman, queryParams) {
|
|
|
15
23
|
return undefined;
|
|
16
24
|
}
|
|
17
25
|
if (Array.isArray(param.value)) {
|
|
18
|
-
return new
|
|
26
|
+
return new postman_collection_1.default.QueryParam({
|
|
19
27
|
key: param.name,
|
|
20
28
|
value: param.value.join(","),
|
|
21
29
|
});
|
|
22
30
|
}
|
|
23
|
-
|
|
24
31
|
// Parameter allows empty value: "/hello?extended"
|
|
25
32
|
if (param.allowEmptyValue) {
|
|
26
33
|
if (param.value === "true") {
|
|
27
|
-
return new
|
|
34
|
+
return new postman_collection_1.default.QueryParam({
|
|
28
35
|
key: param.name,
|
|
29
36
|
value: null,
|
|
30
37
|
});
|
|
31
38
|
}
|
|
32
39
|
return undefined;
|
|
33
40
|
}
|
|
34
|
-
return new
|
|
41
|
+
return new postman_collection_1.default.QueryParam({
|
|
35
42
|
key: param.name,
|
|
36
43
|
value: param.value,
|
|
37
44
|
});
|
|
@@ -43,7 +50,7 @@ function setQueryParams(postman, queryParams) {
|
|
|
43
50
|
}
|
|
44
51
|
function setPathParams(postman, queryParams) {
|
|
45
52
|
const source = queryParams.map((param) => {
|
|
46
|
-
return new
|
|
53
|
+
return new postman_collection_1.default.Variable({
|
|
47
54
|
key: param.name,
|
|
48
55
|
value: param.value || `:${param.name}`,
|
|
49
56
|
});
|
|
@@ -54,7 +61,7 @@ function buildCookie(cookieParams) {
|
|
|
54
61
|
const cookies = cookieParams
|
|
55
62
|
.map((param) => {
|
|
56
63
|
if (param.value && !Array.isArray(param.value)) {
|
|
57
|
-
return new
|
|
64
|
+
return new postman_collection_1.default.Cookie({
|
|
58
65
|
// TODO: Is this right?
|
|
59
66
|
path: "",
|
|
60
67
|
domain: "",
|
|
@@ -65,42 +72,29 @@ function buildCookie(cookieParams) {
|
|
|
65
72
|
return undefined;
|
|
66
73
|
})
|
|
67
74
|
.filter((item) => item !== undefined);
|
|
68
|
-
const list = new
|
|
75
|
+
const list = new postman_collection_1.default.CookieList(null, cookies);
|
|
69
76
|
return list.toString();
|
|
70
77
|
}
|
|
71
78
|
function setHeaders(postman, contentType, accept, cookie, headerParams, other) {
|
|
72
79
|
postman.headers.clear();
|
|
73
80
|
if (contentType) {
|
|
74
|
-
postman.addHeader({
|
|
75
|
-
key: "Content-Type",
|
|
76
|
-
value: contentType,
|
|
77
|
-
});
|
|
81
|
+
postman.addHeader({ key: "Content-Type", value: contentType });
|
|
78
82
|
}
|
|
79
83
|
if (accept) {
|
|
80
|
-
postman.addHeader({
|
|
81
|
-
key: "Accept",
|
|
82
|
-
value: accept,
|
|
83
|
-
});
|
|
84
|
+
postman.addHeader({ key: "Accept", value: accept });
|
|
84
85
|
}
|
|
85
86
|
headerParams.forEach((param) => {
|
|
86
87
|
if (param.value && !Array.isArray(param.value)) {
|
|
87
|
-
postman.addHeader({
|
|
88
|
-
key: param.name,
|
|
89
|
-
value: param.value,
|
|
90
|
-
});
|
|
88
|
+
postman.addHeader({ key: param.name, value: param.value });
|
|
91
89
|
}
|
|
92
90
|
});
|
|
93
91
|
other.forEach((header) => {
|
|
94
92
|
postman.addHeader(header);
|
|
95
93
|
});
|
|
96
94
|
if (cookie) {
|
|
97
|
-
postman.addHeader({
|
|
98
|
-
key: "Cookie",
|
|
99
|
-
value: cookie,
|
|
100
|
-
});
|
|
95
|
+
postman.addHeader({ key: "Cookie", value: cookie });
|
|
101
96
|
}
|
|
102
97
|
}
|
|
103
|
-
|
|
104
98
|
// TODO: this is all a bit hacky
|
|
105
99
|
function setBody(clonedPostman, body) {
|
|
106
100
|
if (clonedPostman.body === undefined) {
|
|
@@ -113,9 +107,7 @@ function setBody(clonedPostman, body) {
|
|
|
113
107
|
if (body.type === "raw" && body.content?.type === "file") {
|
|
114
108
|
// treat it like file.
|
|
115
109
|
clonedPostman.body.mode = "file";
|
|
116
|
-
clonedPostman.body.file = {
|
|
117
|
-
src: body.content.value.src,
|
|
118
|
-
};
|
|
110
|
+
clonedPostman.body.file = { src: body.content.value.src };
|
|
119
111
|
return;
|
|
120
112
|
}
|
|
121
113
|
switch (clonedPostman.body.mode) {
|
|
@@ -140,12 +132,12 @@ function setBody(clonedPostman, body) {
|
|
|
140
132
|
.filter((entry) => !!entry[1])
|
|
141
133
|
.map(([key, content]) => {
|
|
142
134
|
if (content.type === "file") {
|
|
143
|
-
return new
|
|
135
|
+
return new postman_collection_1.default.FormParam({
|
|
144
136
|
key: key,
|
|
145
137
|
...content,
|
|
146
138
|
});
|
|
147
139
|
}
|
|
148
|
-
return new
|
|
140
|
+
return new postman_collection_1.default.FormParam({
|
|
149
141
|
key: key,
|
|
150
142
|
value: content.value,
|
|
151
143
|
});
|
|
@@ -165,7 +157,7 @@ function setBody(clonedPostman, body) {
|
|
|
165
157
|
.filter((entry) => !!entry[1])
|
|
166
158
|
.map(([key, content]) => {
|
|
167
159
|
if (content.type !== "file" && content.value) {
|
|
168
|
-
return new
|
|
160
|
+
return new postman_collection_1.default.QueryParam({
|
|
169
161
|
key: key,
|
|
170
162
|
value: content.value,
|
|
171
163
|
});
|
|
@@ -180,9 +172,6 @@ function setBody(clonedPostman, body) {
|
|
|
180
172
|
return;
|
|
181
173
|
}
|
|
182
174
|
}
|
|
183
|
-
|
|
184
|
-
// TODO: finish these types
|
|
185
|
-
|
|
186
175
|
function buildPostmanRequest(
|
|
187
176
|
postman,
|
|
188
177
|
{
|
|
@@ -197,7 +186,7 @@ function buildPostmanRequest(
|
|
|
197
186
|
auth,
|
|
198
187
|
}
|
|
199
188
|
) {
|
|
200
|
-
const clonedPostman =
|
|
189
|
+
const clonedPostman = (0, cloneDeep_1.default)(postman);
|
|
201
190
|
clonedPostman.url.protocol = undefined;
|
|
202
191
|
clonedPostman.url.host = [window.location.origin];
|
|
203
192
|
if (server) {
|
|
@@ -253,7 +242,6 @@ function buildPostmanRequest(
|
|
|
253
242
|
});
|
|
254
243
|
continue;
|
|
255
244
|
}
|
|
256
|
-
|
|
257
245
|
// Basic Auth
|
|
258
246
|
if (a.type === "http" && a.scheme === "basic") {
|
|
259
247
|
const { username, password } = auth.data[a.key];
|
|
@@ -266,7 +254,6 @@ function buildPostmanRequest(
|
|
|
266
254
|
});
|
|
267
255
|
continue;
|
|
268
256
|
}
|
|
269
|
-
|
|
270
257
|
// API Key
|
|
271
258
|
if (a.type === "apiKey" && a.in === "header") {
|
|
272
259
|
const { apiKey } = auth.data[a.key];
|
|
@@ -295,4 +282,4 @@ function buildPostmanRequest(
|
|
|
295
282
|
setBody(clonedPostman, body);
|
|
296
283
|
return clonedPostman;
|
|
297
284
|
}
|
|
298
|
-
|
|
285
|
+
exports.default = buildPostmanRequest;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* ============================================================================
|
|
3
|
+
* Copyright (c) Palo Alto Networks
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
* ========================================================================== */
|
|
8
|
+
var __importDefault =
|
|
9
|
+
(this && this.__importDefault) ||
|
|
10
|
+
function (mod) {
|
|
11
|
+
return mod && mod.__esModule ? mod : { default: mod };
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
const react_1 = __importDefault(require("react"));
|
|
15
|
+
const postman_collection_1 = __importDefault(
|
|
16
|
+
require("@paloaltonetworks/postman-collection")
|
|
17
|
+
);
|
|
18
|
+
const CodeSnippets_1 = __importDefault(
|
|
19
|
+
require("@theme/ApiExplorer/CodeSnippets")
|
|
20
|
+
);
|
|
21
|
+
const Request_1 = __importDefault(require("@theme/ApiExplorer/Request"));
|
|
22
|
+
const Response_1 = __importDefault(require("@theme/ApiExplorer/Response"));
|
|
23
|
+
function ApiExplorer({ item, infoPath }) {
|
|
24
|
+
const postman = new postman_collection_1.default.Request(item.postman);
|
|
25
|
+
return react_1.default.createElement(
|
|
26
|
+
react_1.default.Fragment,
|
|
27
|
+
null,
|
|
28
|
+
item.method !== "event" &&
|
|
29
|
+
react_1.default.createElement(CodeSnippets_1.default, {
|
|
30
|
+
postman: postman,
|
|
31
|
+
codeSamples: item["x-code-samples"] ?? [],
|
|
32
|
+
}),
|
|
33
|
+
react_1.default.createElement(Request_1.default, { item: item }),
|
|
34
|
+
react_1.default.createElement(Response_1.default, { item: item })
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
exports.default = ApiExplorer;
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/* ============================================================================
|
|
2
3
|
* Copyright (c) Palo Alto Networks
|
|
3
4
|
*
|
|
4
5
|
* This source code is licensed under the MIT license found in the
|
|
5
6
|
* LICENSE file in the root directory of this source tree.
|
|
6
7
|
* ========================================================================== */
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import { createStorage, hashArray } from "./storage-utils";
|
|
13
|
-
export function createPersistanceMiddleware(options) {
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.createPersistanceMiddleware = void 0;
|
|
10
|
+
const slice_1 = require("@theme/ApiExplorer/Authorization/slice");
|
|
11
|
+
const storage_utils_1 = require("./storage-utils");
|
|
12
|
+
function createPersistanceMiddleware(options) {
|
|
14
13
|
const persistanceMiddleware = (storeAPI) => (next) => (action) => {
|
|
15
14
|
const result = next(action);
|
|
16
15
|
const state = storeAPI.getState();
|
|
17
|
-
const storage = createStorage("sessionStorage");
|
|
18
|
-
if (action.type === setAuthData.type) {
|
|
16
|
+
const storage = (0, storage_utils_1.createStorage)("sessionStorage");
|
|
17
|
+
if (action.type === slice_1.setAuthData.type) {
|
|
19
18
|
for (const [key, value] of Object.entries(state.auth.data)) {
|
|
20
19
|
if (Object.values(value).filter(Boolean).length > 0) {
|
|
21
20
|
storage.setItem(key, JSON.stringify(value));
|
|
@@ -24,24 +23,21 @@ export function createPersistanceMiddleware(options) {
|
|
|
24
23
|
}
|
|
25
24
|
}
|
|
26
25
|
}
|
|
27
|
-
if (action.type === setSelectedAuth.type) {
|
|
26
|
+
if (action.type === slice_1.setSelectedAuth.type) {
|
|
28
27
|
if (state.auth.selected) {
|
|
29
28
|
storage.setItem(
|
|
30
|
-
hashArray(Object.keys(state.auth.options)),
|
|
29
|
+
(0, storage_utils_1.hashArray)(Object.keys(state.auth.options)),
|
|
31
30
|
state.auth.selected
|
|
32
31
|
);
|
|
33
32
|
}
|
|
34
33
|
}
|
|
35
|
-
|
|
36
34
|
// TODO: determine way to rehydrate without flashing
|
|
37
35
|
// if (action.type === "contentType/setContentType") {
|
|
38
36
|
// storage.setItem("contentType", action.payload);
|
|
39
37
|
// }
|
|
40
|
-
|
|
41
38
|
// if (action.type === "accept/setAccept") {
|
|
42
39
|
// storage.setItem("accept", action.payload);
|
|
43
40
|
// }
|
|
44
|
-
|
|
45
41
|
if (action.type === "server/setServer") {
|
|
46
42
|
storage.setItem("server", action.payload);
|
|
47
43
|
}
|
|
@@ -56,3 +52,4 @@ export function createPersistanceMiddleware(options) {
|
|
|
56
52
|
};
|
|
57
53
|
return persistanceMiddleware;
|
|
58
54
|
}
|
|
55
|
+
exports.createPersistanceMiddleware = createPersistanceMiddleware;
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createStorage = createStorage;
|
|
7
|
-
exports.hashArray = hashArray;
|
|
8
|
-
var _cryptoJs = _interopRequireDefault(require("crypto-js"));
|
|
9
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
2
|
/* ============================================================================
|
|
11
3
|
* Copyright (c) Palo Alto Networks
|
|
12
4
|
*
|
|
13
5
|
* This source code is licensed under the MIT license found in the
|
|
14
6
|
* LICENSE file in the root directory of this source tree.
|
|
15
7
|
* ========================================================================== */
|
|
16
|
-
|
|
8
|
+
var __importDefault =
|
|
9
|
+
(this && this.__importDefault) ||
|
|
10
|
+
function (mod) {
|
|
11
|
+
return mod && mod.__esModule ? mod : { default: mod };
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.createStorage = exports.hashArray = void 0;
|
|
15
|
+
const crypto_js_1 = __importDefault(require("crypto-js"));
|
|
17
16
|
function hashArray(arr) {
|
|
18
17
|
function hash(message) {
|
|
19
|
-
return
|
|
18
|
+
return crypto_js_1.default.SHA1(message).toString();
|
|
20
19
|
}
|
|
21
|
-
const hashed = arr.map(item => hash(item));
|
|
20
|
+
const hashed = arr.map((item) => hash(item));
|
|
22
21
|
hashed.sort();
|
|
23
22
|
const res = hashed.join();
|
|
24
23
|
return hash(res);
|
|
25
24
|
}
|
|
25
|
+
exports.hashArray = hashArray;
|
|
26
26
|
function createStorage(persistance) {
|
|
27
27
|
if (persistance === false) {
|
|
28
28
|
return {
|
|
@@ -31,11 +31,12 @@ function createStorage(persistance) {
|
|
|
31
31
|
clear: () => {},
|
|
32
32
|
key: () => null,
|
|
33
33
|
removeItem: () => {},
|
|
34
|
-
length: 0
|
|
34
|
+
length: 0,
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
if (persistance === "sessionStorage") {
|
|
38
38
|
return sessionStorage;
|
|
39
39
|
}
|
|
40
40
|
return localStorage;
|
|
41
|
-
}
|
|
41
|
+
}
|
|
42
|
+
exports.createStorage = createStorage;
|