docusaurus-theme-openapi-docs 0.0.0-618 → 0.0.0-684
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,47 @@
|
|
|
1
|
+
/* ============================================================================
|
|
2
|
+
* Copyright (c) Palo Alto Networks
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
* ========================================================================== */
|
|
7
|
+
|
|
8
|
+
import React from "react";
|
|
9
|
+
|
|
10
|
+
import clsx from "clsx";
|
|
11
|
+
|
|
12
|
+
export default function CodeBlockLine({
|
|
13
|
+
line,
|
|
14
|
+
classNames,
|
|
15
|
+
showLineNumbers,
|
|
16
|
+
getLineProps,
|
|
17
|
+
getTokenProps,
|
|
18
|
+
}) {
|
|
19
|
+
if (line.length === 1 && line[0].content === "\n") {
|
|
20
|
+
line[0].content = "";
|
|
21
|
+
}
|
|
22
|
+
const lineProps = getLineProps({
|
|
23
|
+
line,
|
|
24
|
+
className: clsx(
|
|
25
|
+
classNames,
|
|
26
|
+
showLineNumbers && "openapi-explorer__code-block-code-line"
|
|
27
|
+
),
|
|
28
|
+
});
|
|
29
|
+
const lineTokens = line.map((token, key) => (
|
|
30
|
+
<span key={key} {...getTokenProps({ token, key })} />
|
|
31
|
+
));
|
|
32
|
+
return (
|
|
33
|
+
<span {...lineProps}>
|
|
34
|
+
{showLineNumbers ? (
|
|
35
|
+
<>
|
|
36
|
+
<span className="openapi-explorer__code-block-code-line-number" />
|
|
37
|
+
<span className="openapi-explorer__code-block-code-line-content">
|
|
38
|
+
{lineTokens}
|
|
39
|
+
</span>
|
|
40
|
+
</>
|
|
41
|
+
) : (
|
|
42
|
+
lineTokens
|
|
43
|
+
)}
|
|
44
|
+
<br />
|
|
45
|
+
</span>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/* ============================================================================
|
|
2
|
+
* Copyright (c) Palo Alto Networks
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
* ========================================================================== */
|
|
7
|
+
|
|
8
|
+
import React from "react";
|
|
9
|
+
|
|
10
|
+
import { translate } from "@docusaurus/Translate";
|
|
11
|
+
import clsx from "clsx";
|
|
12
|
+
|
|
13
|
+
export default function WordWrapButton({ className, onClick, isEnabled }) {
|
|
14
|
+
const title = translate({
|
|
15
|
+
id: "theme.CodeBlock.wordWrapToggle",
|
|
16
|
+
message: "Toggle word wrap",
|
|
17
|
+
description:
|
|
18
|
+
"The title attribute for toggle word wrapping button of code block lines",
|
|
19
|
+
});
|
|
20
|
+
return (
|
|
21
|
+
<button
|
|
22
|
+
type="button"
|
|
23
|
+
onClick={onClick}
|
|
24
|
+
className={clsx(
|
|
25
|
+
"clean-btn",
|
|
26
|
+
className,
|
|
27
|
+
isEnabled && "openapi-explorer__code-block-word-wrap-btn--enabled"
|
|
28
|
+
)}
|
|
29
|
+
aria-label={title}
|
|
30
|
+
title={title}
|
|
31
|
+
>
|
|
32
|
+
<svg
|
|
33
|
+
className="openapi-explorer__code-block-word-wrap-btn-icon"
|
|
34
|
+
viewBox="0 0 24 24"
|
|
35
|
+
aria-hidden="true"
|
|
36
|
+
>
|
|
37
|
+
<path
|
|
38
|
+
fill="currentColor"
|
|
39
|
+
d="M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"
|
|
40
|
+
/>
|
|
41
|
+
</svg>
|
|
42
|
+
</button>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/* ============================================================================
|
|
2
|
+
* Copyright (c) Palo Alto Networks
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
* ========================================================================== */
|
|
7
|
+
|
|
8
|
+
import React, { isValidElement } from "react";
|
|
9
|
+
|
|
10
|
+
import useIsBrowser from "@docusaurus/useIsBrowser";
|
|
11
|
+
import ElementContent from "@theme/ApiExplorer/ApiCodeBlock/Content/Element";
|
|
12
|
+
import StringContent from "@theme/ApiExplorer/ApiCodeBlock/Content/String";
|
|
13
|
+
/**
|
|
14
|
+
* Best attempt to make the children a plain string so it is copyable. If there
|
|
15
|
+
* are react elements, we will not be able to copy the content, and it will
|
|
16
|
+
* return `children` as-is; otherwise, it concatenates the string children
|
|
17
|
+
* together.
|
|
18
|
+
*/
|
|
19
|
+
function maybeStringifyChildren(children) {
|
|
20
|
+
if (React.Children.toArray(children).some((el) => isValidElement(el))) {
|
|
21
|
+
return children;
|
|
22
|
+
}
|
|
23
|
+
// The children is now guaranteed to be one/more plain strings
|
|
24
|
+
return Array.isArray(children) ? children.join("") : children;
|
|
25
|
+
}
|
|
26
|
+
export default function ApiCodeBlock({ children: rawChildren, ...props }) {
|
|
27
|
+
// The Prism theme on SSR is always the default theme but the site theme can
|
|
28
|
+
// be in a different mode. React hydration doesn't update DOM styles that come
|
|
29
|
+
// from SSR. Hence force a re-render after mounting to apply the current
|
|
30
|
+
// relevant styles.
|
|
31
|
+
const isBrowser = useIsBrowser();
|
|
32
|
+
const children = maybeStringifyChildren(rawChildren);
|
|
33
|
+
const CodeBlockComp =
|
|
34
|
+
typeof children === "string" ? StringContent : ElementContent;
|
|
35
|
+
return (
|
|
36
|
+
<CodeBlockComp key={String(isBrowser)} {...props}>
|
|
37
|
+
{children}
|
|
38
|
+
</CodeBlockComp>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
|
|
8
8
|
import React from "react";
|
|
9
9
|
|
|
10
|
-
import FormItem from "@theme/
|
|
11
|
-
import FormSelect from "@theme/
|
|
12
|
-
import FormTextInput from "@theme/
|
|
10
|
+
import FormItem from "@theme/ApiExplorer/FormItem";
|
|
11
|
+
import FormSelect from "@theme/ApiExplorer/FormSelect";
|
|
12
|
+
import FormTextInput from "@theme/ApiExplorer/FormTextInput";
|
|
13
13
|
import { useTypedDispatch, useTypedSelector } from "@theme/ApiItem/hooks";
|
|
14
14
|
|
|
15
15
|
import { setAuthData, setSelectedAuth } from "./slice";
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* ========================================================================== */
|
|
7
7
|
|
|
8
8
|
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
|
|
9
|
-
import { createStorage, hashArray } from "@theme/
|
|
9
|
+
import { createStorage, hashArray } from "@theme/ApiExplorer/storage-utils";
|
|
10
10
|
import {
|
|
11
11
|
SecurityRequirementObject,
|
|
12
12
|
SecuritySchemeObject,
|
|
@@ -7,13 +7,12 @@
|
|
|
7
7
|
|
|
8
8
|
import React from "react";
|
|
9
9
|
|
|
10
|
-
import json2xml from "@theme/
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import LiveApp from "@theme/ApiDemoPanel/LiveEditor";
|
|
10
|
+
import json2xml from "@theme/ApiExplorer/Body/json2xml";
|
|
11
|
+
import FormFileUpload from "@theme/ApiExplorer/FormFileUpload";
|
|
12
|
+
import FormItem from "@theme/ApiExplorer/FormItem";
|
|
13
|
+
import FormSelect from "@theme/ApiExplorer/FormSelect";
|
|
14
|
+
import FormTextInput from "@theme/ApiExplorer/FormTextInput";
|
|
15
|
+
import LiveApp from "@theme/ApiExplorer/LiveEditor";
|
|
17
16
|
import { useTypedDispatch, useTypedSelector } from "@theme/ApiItem/hooks";
|
|
18
17
|
import SchemaTabs from "@theme/SchemaTabs";
|
|
19
18
|
import TabItem from "@theme/TabItem";
|
|
@@ -31,9 +30,16 @@ import {
|
|
|
31
30
|
export interface Props {
|
|
32
31
|
jsonRequestBodyExample: string;
|
|
33
32
|
requestBodyMetadata?: RequestBodyObject;
|
|
33
|
+
methods?: any;
|
|
34
|
+
required?: boolean;
|
|
34
35
|
}
|
|
35
36
|
|
|
36
|
-
function BodyWrap({
|
|
37
|
+
function BodyWrap({
|
|
38
|
+
requestBodyMetadata,
|
|
39
|
+
jsonRequestBodyExample,
|
|
40
|
+
methods,
|
|
41
|
+
required,
|
|
42
|
+
}: Props) {
|
|
37
43
|
const contentType = useTypedSelector((state: any) => state.contentType.value);
|
|
38
44
|
|
|
39
45
|
// NOTE: We used to check if body was required, but opted to always show the request body
|
|
@@ -45,20 +51,21 @@ function BodyWrap({ requestBodyMetadata, jsonRequestBodyExample }: Props) {
|
|
|
45
51
|
}
|
|
46
52
|
|
|
47
53
|
return (
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
/>
|
|
54
|
-
</>
|
|
54
|
+
<Body
|
|
55
|
+
requestBodyMetadata={requestBodyMetadata}
|
|
56
|
+
jsonRequestBodyExample={jsonRequestBodyExample}
|
|
57
|
+
required={required}
|
|
58
|
+
/>
|
|
55
59
|
);
|
|
56
60
|
}
|
|
57
61
|
|
|
58
|
-
function Body({
|
|
62
|
+
function Body({
|
|
63
|
+
requestBodyMetadata,
|
|
64
|
+
jsonRequestBodyExample,
|
|
65
|
+
methods,
|
|
66
|
+
required,
|
|
67
|
+
}: Props) {
|
|
59
68
|
const contentType = useTypedSelector((state: any) => state.contentType.value);
|
|
60
|
-
const required = requestBodyMetadata?.required;
|
|
61
|
-
|
|
62
69
|
const dispatch = useTypedDispatch();
|
|
63
70
|
|
|
64
71
|
// Lot's of possible content-types:
|
|
@@ -88,7 +95,7 @@ function Body({ requestBodyMetadata, jsonRequestBodyExample }: Props) {
|
|
|
88
95
|
|
|
89
96
|
if (schema?.format === "binary") {
|
|
90
97
|
return (
|
|
91
|
-
<FormItem
|
|
98
|
+
<FormItem>
|
|
92
99
|
<FormFileUpload
|
|
93
100
|
placeholder={schema.description || "Body"}
|
|
94
101
|
onChange={(file: any) => {
|
|
@@ -107,22 +114,14 @@ function Body({ requestBodyMetadata, jsonRequestBodyExample }: Props) {
|
|
|
107
114
|
</FormItem>
|
|
108
115
|
);
|
|
109
116
|
}
|
|
110
|
-
|
|
111
117
|
if (
|
|
112
118
|
(contentType === "multipart/form-data" ||
|
|
113
119
|
contentType === "application/x-www-form-urlencoded") &&
|
|
114
120
|
schema?.type === "object"
|
|
115
121
|
) {
|
|
116
122
|
return (
|
|
117
|
-
<FormItem
|
|
118
|
-
<div
|
|
119
|
-
style={{
|
|
120
|
-
marginTop: "calc(var(--ifm-pre-padding) / 2)",
|
|
121
|
-
borderRadius: "4px",
|
|
122
|
-
padding: "var(--ifm-pre-padding)",
|
|
123
|
-
border: "1px solid var(--openapi-monaco-border-color)",
|
|
124
|
-
}}
|
|
125
|
-
>
|
|
123
|
+
<FormItem className="openapi-explorer__form-item-body-container">
|
|
124
|
+
<div>
|
|
126
125
|
{Object.entries(schema.properties ?? {}).map(([key, val]: any) => {
|
|
127
126
|
if (val.format === "binary") {
|
|
128
127
|
return (
|
|
@@ -196,6 +195,11 @@ function Body({ requestBodyMetadata, jsonRequestBodyExample }: Props) {
|
|
|
196
195
|
}
|
|
197
196
|
>
|
|
198
197
|
<FormTextInput
|
|
198
|
+
paramName={key}
|
|
199
|
+
isRequired={
|
|
200
|
+
Array.isArray(schema.required) &&
|
|
201
|
+
schema.required.includes(key)
|
|
202
|
+
}
|
|
199
203
|
placeholder={val.description || key}
|
|
200
204
|
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
|
201
205
|
dispatch(
|
|
@@ -216,7 +220,10 @@ function Body({ requestBodyMetadata, jsonRequestBodyExample }: Props) {
|
|
|
216
220
|
let exampleBody;
|
|
217
221
|
let examplesBodies = [] as any;
|
|
218
222
|
|
|
219
|
-
if (
|
|
223
|
+
if (
|
|
224
|
+
contentType.includes("application/json") ||
|
|
225
|
+
contentType.endsWith("+json")
|
|
226
|
+
) {
|
|
220
227
|
if (jsonRequestBodyExample) {
|
|
221
228
|
defaultBody = JSON.stringify(jsonRequestBodyExample, null, 2);
|
|
222
229
|
}
|
|
@@ -282,16 +289,26 @@ function Body({ requestBodyMetadata, jsonRequestBodyExample }: Props) {
|
|
|
282
289
|
|
|
283
290
|
if (exampleBody) {
|
|
284
291
|
return (
|
|
285
|
-
<FormItem
|
|
286
|
-
<SchemaTabs lazy>
|
|
287
|
-
|
|
288
|
-
|
|
292
|
+
<FormItem>
|
|
293
|
+
<SchemaTabs className="openapi-tabs__schema" lazy>
|
|
294
|
+
{/* @ts-ignore */}
|
|
295
|
+
<TabItem
|
|
296
|
+
label="Example (from schema)"
|
|
297
|
+
value="Example (from schema)"
|
|
298
|
+
default
|
|
299
|
+
>
|
|
300
|
+
<LiveApp action={dispatch} language={language} required={required}>
|
|
289
301
|
{defaultBody}
|
|
290
302
|
</LiveApp>
|
|
291
303
|
</TabItem>
|
|
304
|
+
{/* @ts-ignore */}
|
|
292
305
|
<TabItem label="Example" value="example">
|
|
293
306
|
{exampleBody && (
|
|
294
|
-
<LiveApp
|
|
307
|
+
<LiveApp
|
|
308
|
+
action={dispatch}
|
|
309
|
+
language={language}
|
|
310
|
+
required={required}
|
|
311
|
+
>
|
|
295
312
|
{exampleBody}
|
|
296
313
|
</LiveApp>
|
|
297
314
|
)}
|
|
@@ -303,15 +320,21 @@ function Body({ requestBodyMetadata, jsonRequestBodyExample }: Props) {
|
|
|
303
320
|
|
|
304
321
|
if (examplesBodies && examplesBodies.length > 0) {
|
|
305
322
|
return (
|
|
306
|
-
<FormItem
|
|
307
|
-
<SchemaTabs lazy>
|
|
308
|
-
|
|
309
|
-
|
|
323
|
+
<FormItem className="openapi-explorer__form-item-body-container">
|
|
324
|
+
<SchemaTabs className="openapi-tabs__schema" lazy>
|
|
325
|
+
{/* @ts-ignore */}
|
|
326
|
+
<TabItem
|
|
327
|
+
label="Example (from schema)"
|
|
328
|
+
value="Example (from schema)"
|
|
329
|
+
default
|
|
330
|
+
>
|
|
331
|
+
<LiveApp action={dispatch} language={language} required={required}>
|
|
310
332
|
{defaultBody}
|
|
311
333
|
</LiveApp>
|
|
312
334
|
</TabItem>
|
|
313
335
|
{examplesBodies.map((example: any) => {
|
|
314
336
|
return (
|
|
337
|
+
// @ts-ignore
|
|
315
338
|
<TabItem
|
|
316
339
|
label={example.label}
|
|
317
340
|
value={example.label}
|
|
@@ -332,8 +355,8 @@ function Body({ requestBodyMetadata, jsonRequestBodyExample }: Props) {
|
|
|
332
355
|
}
|
|
333
356
|
|
|
334
357
|
return (
|
|
335
|
-
<FormItem
|
|
336
|
-
<LiveApp action={dispatch} language={language}>
|
|
358
|
+
<FormItem>
|
|
359
|
+
<LiveApp action={dispatch} language={language} required={required}>
|
|
337
360
|
{defaultBody}
|
|
338
361
|
</LiveApp>
|
|
339
362
|
</FormItem>
|
|
@@ -10,21 +10,19 @@ import React, { useState, useEffect } from "react";
|
|
|
10
10
|
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
|
|
11
11
|
import codegen from "@paloaltonetworks/postman-code-generators";
|
|
12
12
|
import sdk from "@paloaltonetworks/postman-collection";
|
|
13
|
-
import
|
|
14
|
-
import
|
|
13
|
+
import ApiCodeBlock from "@theme/ApiExplorer/ApiCodeBlock";
|
|
14
|
+
import buildPostmanRequest from "@theme/ApiExplorer/buildPostmanRequest";
|
|
15
|
+
import CodeTabs from "@theme/ApiExplorer/CodeTabs";
|
|
15
16
|
import { useTypedSelector } from "@theme/ApiItem/hooks";
|
|
16
|
-
import CodeBlock from "@theme/CodeBlock";
|
|
17
|
-
import clsx from "clsx";
|
|
18
17
|
import merge from "lodash/merge";
|
|
19
18
|
|
|
20
|
-
import styles from "./styles.module.css";
|
|
21
|
-
|
|
22
19
|
export interface Language {
|
|
23
|
-
highlight
|
|
20
|
+
highlight: string;
|
|
24
21
|
language: string;
|
|
25
|
-
logoClass
|
|
26
|
-
variant
|
|
27
|
-
|
|
22
|
+
logoClass: string;
|
|
23
|
+
variant: string;
|
|
24
|
+
variants: string[];
|
|
25
|
+
options: { [key: string]: boolean };
|
|
28
26
|
source?: string;
|
|
29
27
|
}
|
|
30
28
|
|
|
@@ -39,6 +37,7 @@ export const languageSet: Language[] = [
|
|
|
39
37
|
trimRequestBody: true,
|
|
40
38
|
},
|
|
41
39
|
variant: "cURL",
|
|
40
|
+
variants: ["curl"],
|
|
42
41
|
},
|
|
43
42
|
{
|
|
44
43
|
highlight: "python",
|
|
@@ -49,6 +48,7 @@ export const languageSet: Language[] = [
|
|
|
49
48
|
trimRequestBody: true,
|
|
50
49
|
},
|
|
51
50
|
variant: "requests",
|
|
51
|
+
variants: ["requests", "http.client"],
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
54
|
highlight: "go",
|
|
@@ -59,6 +59,7 @@ export const languageSet: Language[] = [
|
|
|
59
59
|
trimRequestBody: true,
|
|
60
60
|
},
|
|
61
61
|
variant: "native",
|
|
62
|
+
variants: ["native"],
|
|
62
63
|
},
|
|
63
64
|
{
|
|
64
65
|
highlight: "javascript",
|
|
@@ -70,6 +71,7 @@ export const languageSet: Language[] = [
|
|
|
70
71
|
trimRequestBody: true,
|
|
71
72
|
},
|
|
72
73
|
variant: "axios",
|
|
74
|
+
variants: ["axios", "native", "request", "unirest"],
|
|
73
75
|
},
|
|
74
76
|
{
|
|
75
77
|
highlight: "ruby",
|
|
@@ -80,6 +82,7 @@ export const languageSet: Language[] = [
|
|
|
80
82
|
trimRequestBody: true,
|
|
81
83
|
},
|
|
82
84
|
variant: "Net::HTTP",
|
|
85
|
+
variants: ["net::http"],
|
|
83
86
|
},
|
|
84
87
|
{
|
|
85
88
|
highlight: "csharp",
|
|
@@ -90,6 +93,7 @@ export const languageSet: Language[] = [
|
|
|
90
93
|
trimRequestBody: true,
|
|
91
94
|
},
|
|
92
95
|
variant: "RestSharp",
|
|
96
|
+
variants: ["restsharp", "httpclient"],
|
|
93
97
|
},
|
|
94
98
|
{
|
|
95
99
|
highlight: "php",
|
|
@@ -100,6 +104,7 @@ export const languageSet: Language[] = [
|
|
|
100
104
|
trimRequestBody: true,
|
|
101
105
|
},
|
|
102
106
|
variant: "cURL",
|
|
107
|
+
variants: ["curl", "guzzle", "pecl_http", "http_request2"],
|
|
103
108
|
},
|
|
104
109
|
{
|
|
105
110
|
highlight: "java",
|
|
@@ -110,6 +115,7 @@ export const languageSet: Language[] = [
|
|
|
110
115
|
trimRequestBody: true,
|
|
111
116
|
},
|
|
112
117
|
variant: "OkHttp",
|
|
118
|
+
variants: ["okhttp", "unirest"],
|
|
113
119
|
},
|
|
114
120
|
{
|
|
115
121
|
highlight: "powershell",
|
|
@@ -120,6 +126,7 @@ export const languageSet: Language[] = [
|
|
|
120
126
|
trimRequestBody: true,
|
|
121
127
|
},
|
|
122
128
|
variant: "RestMethod",
|
|
129
|
+
variants: ["restmethod"],
|
|
123
130
|
},
|
|
124
131
|
];
|
|
125
132
|
|
|
@@ -130,17 +137,13 @@ export interface Props {
|
|
|
130
137
|
|
|
131
138
|
function CodeTab({ children, hidden, className, onClick }: any): JSX.Element {
|
|
132
139
|
return (
|
|
133
|
-
<div
|
|
134
|
-
role="tabpanel"
|
|
135
|
-
className={clsx(styles.tabItem, className)}
|
|
136
|
-
{...{ hidden }}
|
|
137
|
-
>
|
|
140
|
+
<div role="tabpanel" className={className} {...{ hidden }}>
|
|
138
141
|
{children}
|
|
139
142
|
</div>
|
|
140
143
|
);
|
|
141
144
|
}
|
|
142
145
|
|
|
143
|
-
function
|
|
146
|
+
function CodeSnippets({ postman, codeSamples }: Props) {
|
|
144
147
|
// TODO: match theme for vscode.
|
|
145
148
|
|
|
146
149
|
const { siteConfig } = useDocusaurusContext();
|
|
@@ -180,7 +183,7 @@ function Curl({ postman, codeSamples }: Props) {
|
|
|
180
183
|
(lang) =>
|
|
181
184
|
lang.language === localStorage.getItem("docusaurus.tab.code-samples")
|
|
182
185
|
);
|
|
183
|
-
|
|
186
|
+
const [selectedVariant, setSelectedVariant] = useState();
|
|
184
187
|
const [language, setLanguage] = useState(() => {
|
|
185
188
|
// Return first index if only 1 user-defined language exists
|
|
186
189
|
if (mergedLangs.length === 1) {
|
|
@@ -189,7 +192,6 @@ function Curl({ postman, codeSamples }: Props) {
|
|
|
189
192
|
// Fall back to language in localStorage or first user-defined language
|
|
190
193
|
return defaultLang[0] ?? mergedLangs[0];
|
|
191
194
|
});
|
|
192
|
-
|
|
193
195
|
const [codeText, setCodeText] = useState("");
|
|
194
196
|
|
|
195
197
|
useEffect(() => {
|
|
@@ -205,7 +207,6 @@ function Curl({ postman, codeSamples }: Props) {
|
|
|
205
207
|
server,
|
|
206
208
|
auth,
|
|
207
209
|
});
|
|
208
|
-
|
|
209
210
|
codegen.convert(
|
|
210
211
|
language.language,
|
|
211
212
|
language.variant,
|
|
@@ -271,32 +272,91 @@ function Curl({ postman, codeSamples }: Props) {
|
|
|
271
272
|
mergedLangs,
|
|
272
273
|
]);
|
|
273
274
|
|
|
275
|
+
useEffect(() => {
|
|
276
|
+
if (selectedVariant && selectedVariant !== language.variant) {
|
|
277
|
+
const postmanRequest = buildPostmanRequest(postman, {
|
|
278
|
+
queryParams,
|
|
279
|
+
pathParams,
|
|
280
|
+
cookieParams,
|
|
281
|
+
contentType,
|
|
282
|
+
accept,
|
|
283
|
+
headerParams,
|
|
284
|
+
body,
|
|
285
|
+
server,
|
|
286
|
+
auth,
|
|
287
|
+
});
|
|
288
|
+
codegen.convert(
|
|
289
|
+
language.language,
|
|
290
|
+
selectedVariant,
|
|
291
|
+
postmanRequest,
|
|
292
|
+
language.options,
|
|
293
|
+
(error: any, snippet: string) => {
|
|
294
|
+
if (error) {
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
setCodeText(snippet);
|
|
298
|
+
}
|
|
299
|
+
);
|
|
300
|
+
}
|
|
301
|
+
});
|
|
302
|
+
|
|
274
303
|
if (language === undefined) {
|
|
275
304
|
return null;
|
|
276
305
|
}
|
|
277
306
|
|
|
278
307
|
return (
|
|
279
308
|
<>
|
|
280
|
-
<CodeTabs
|
|
309
|
+
<CodeTabs
|
|
310
|
+
groupId="code-samples"
|
|
311
|
+
action={{
|
|
312
|
+
setLanguage: setLanguage,
|
|
313
|
+
setSelectedVariant: setSelectedVariant,
|
|
314
|
+
}}
|
|
315
|
+
lazy
|
|
316
|
+
>
|
|
281
317
|
{mergedLangs.map((lang) => {
|
|
282
318
|
return (
|
|
283
319
|
<CodeTab
|
|
284
320
|
value={lang.language}
|
|
285
|
-
label={
|
|
286
|
-
key={
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
}
|
|
291
|
-
attributes={{ className: `code__tab--${lang.logoClass}` }}
|
|
321
|
+
label={lang.language}
|
|
322
|
+
key={lang.language}
|
|
323
|
+
attributes={{
|
|
324
|
+
className: `openapi-tabs__code-item--${lang.logoClass}`,
|
|
325
|
+
}}
|
|
292
326
|
>
|
|
293
|
-
<
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
327
|
+
<CodeTabs
|
|
328
|
+
className="openapi-tabs__code-container-inner"
|
|
329
|
+
action={{
|
|
330
|
+
setLanguage: setLanguage,
|
|
331
|
+
setSelectedVariant: setSelectedVariant,
|
|
332
|
+
}}
|
|
333
|
+
includeVariant={true}
|
|
334
|
+
currentLanguage={lang.language}
|
|
335
|
+
defaultValue={selectedVariant}
|
|
336
|
+
lazy
|
|
297
337
|
>
|
|
298
|
-
{
|
|
299
|
-
|
|
338
|
+
{lang.variants.map((variant) => {
|
|
339
|
+
return (
|
|
340
|
+
<CodeTab
|
|
341
|
+
value={variant.toLowerCase()}
|
|
342
|
+
label={variant.toUpperCase()}
|
|
343
|
+
key={`${lang.language}-${lang.variant}`}
|
|
344
|
+
attributes={{
|
|
345
|
+
className: `openapi-tabs__code-item--variant`,
|
|
346
|
+
}}
|
|
347
|
+
>
|
|
348
|
+
{/* @ts-ignore */}
|
|
349
|
+
<ApiCodeBlock
|
|
350
|
+
language={lang.highlight}
|
|
351
|
+
className="openapi-explorer__code-block"
|
|
352
|
+
showLineNumbers={true}
|
|
353
|
+
>
|
|
354
|
+
{codeText}
|
|
355
|
+
</ApiCodeBlock>
|
|
356
|
+
</CodeTab>
|
|
357
|
+
);
|
|
358
|
+
})}
|
|
359
|
+
</CodeTabs>
|
|
300
360
|
</CodeTab>
|
|
301
361
|
);
|
|
302
362
|
})}
|
|
@@ -305,4 +365,4 @@ function Curl({ postman, codeSamples }: Props) {
|
|
|
305
365
|
);
|
|
306
366
|
}
|
|
307
367
|
|
|
308
|
-
export default
|
|
368
|
+
export default CodeSnippets;
|