docusaurus-theme-openapi-docs 2.0.0-beta.2 → 2.0.0-beta.4
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 -55
- 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 +360 -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-next/theme/ApiDemoPanel → lib/theme/ApiExplorer}/CodeTabs/index.js +26 -8
- 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/{src/theme/ApiDemoPanel → lib/theme/ApiExplorer}/FloatingButton/_FloatingButton.scss +4 -4
- package/lib/theme/ApiExplorer/FloatingButton/index.d.ts +8 -0
- package/lib/theme/ApiExplorer/FloatingButton/index.js +28 -0
- package/{lib-next/theme/ApiDemoPanel → lib/theme/ApiExplorer}/FormFileUpload/_FormFileUpload.scss +6 -6
- 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/{ApiDemoPanel → ApiExplorer}/FormMultiSelect/_FormMultiSelect.scss +9 -5
- package/lib/theme/ApiExplorer/FormMultiSelect/index.d.ts +9 -0
- package/lib/theme/ApiExplorer/FormMultiSelect/index.js +51 -0
- package/lib/theme/{ApiDemoPanel → ApiExplorer}/FormSelect/_FormSelect.scss +5 -5
- 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/{src/theme/ApiDemoPanel → lib/theme/ApiExplorer}/LiveEditor/_LiveEditor.scss +2 -2
- 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 +82 -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 → lib/theme/ApiExplorer}/ParamOptions/_ParamOptions.scss +15 -34
- 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 +363 -0
- package/lib/theme/ApiExplorer/Request/makeRequest.d.ts +4 -0
- package/{lib-next/theme/ApiDemoPanel/Execute → lib/theme/ApiExplorer/Request}/makeRequest.js +9 -8
- package/lib/theme/ApiExplorer/Response/_Response.scss +81 -0
- package/lib/theme/ApiExplorer/Response/index.d.ts +6 -0
- package/lib/theme/ApiExplorer/Response/index.js +184 -0
- package/lib/theme/ApiExplorer/Response/slice.d.ts +17 -0
- package/{lib-next/theme/ApiDemoPanel → lib/theme/ApiExplorer}/Response/slice.js +21 -12
- package/lib/theme/ApiExplorer/SecuritySchemes/index.d.ts +3 -0
- package/lib/theme/ApiExplorer/SecuritySchemes/index.js +380 -0
- package/{src/theme/ApiDemoPanel → lib/theme/ApiExplorer}/Server/_Server.scss +11 -1
- 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 +36 -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 +144 -116
- 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 +29 -22
- package/lib/theme/ApiTabs/index.js +4 -3
- package/lib/theme/DiscriminatorTabs/_DiscriminatorTabs.scss +16 -13
- package/lib/theme/Markdown/Details/_Details.scss +82 -3
- package/lib/theme/MimeTabs/_MimeTabs.scss +13 -8
- package/lib/theme/MimeTabs/index.js +2 -2
- package/lib/theme/ParamsItem/_ParamsItem.scss +24 -9
- package/lib/theme/ParamsItem/index.js +9 -6
- package/lib/theme/SchemaItem/_SchemaItem.scss +47 -11
- package/lib/theme/SchemaItem/index.js +23 -12
- package/lib/theme/SchemaTabs/_SchemaTabs.scss +23 -17
- package/lib/theme/SchemaTabs/index.js +50 -54
- package/lib/theme/styles.scss +55 -18
- package/lib/types.d.ts +157 -0
- package/lib/types.js +8 -1
- package/package.json +13 -21
- package/src/index.ts +31 -40
- 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 +54 -37
- package/src/theme/{ApiDemoPanel/Curl → ApiExplorer/CodeSnippets}/index.tsx +90 -25
- package/src/theme/ApiExplorer/CodeTabs/_CodeTabs.scss +291 -0
- package/{lib/theme/ApiDemoPanel → src/theme/ApiExplorer}/CodeTabs/index.js +26 -8
- package/src/theme/{ApiDemoPanel → ApiExplorer}/ContentType/index.tsx +2 -2
- package/{lib/theme/ApiDemoPanel → src/theme/ApiExplorer}/FloatingButton/_FloatingButton.scss +4 -4
- package/src/theme/{ApiDemoPanel → ApiExplorer}/FloatingButton/index.tsx +1 -1
- package/src/theme/{ApiDemoPanel → ApiExplorer}/FormFileUpload/_FormFileUpload.scss +6 -6
- package/src/theme/{ApiDemoPanel → ApiExplorer}/FormFileUpload/index.tsx +8 -4
- package/src/theme/ApiExplorer/FormItem/_FormItem.scss +21 -0
- package/src/theme/{ApiDemoPanel → ApiExplorer}/FormItem/index.tsx +9 -11
- package/{lib-next/theme/ApiDemoPanel → src/theme/ApiExplorer}/FormMultiSelect/_FormMultiSelect.scss +9 -5
- package/src/theme/{ApiDemoPanel → ApiExplorer}/FormMultiSelect/index.tsx +7 -2
- package/src/theme/{ApiDemoPanel → ApiExplorer}/FormSelect/_FormSelect.scss +5 -5
- package/src/theme/{ApiDemoPanel → ApiExplorer}/FormSelect/index.tsx +1 -1
- package/src/theme/ApiExplorer/FormTextInput/_FormTextInput.scss +34 -0
- package/src/theme/ApiExplorer/FormTextInput/index.tsx +80 -0
- package/{lib/theme/ApiDemoPanel → src/theme/ApiExplorer}/LiveEditor/_LiveEditor.scss +2 -2
- package/src/theme/ApiExplorer/LiveEditor/index.tsx +112 -0
- package/src/theme/ApiExplorer/MethodEndpoint/_MethodEndpoint.scss +22 -0
- package/src/theme/{ApiDemoPanel → ApiExplorer}/MethodEndpoint/index.tsx +12 -9
- 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 → src/theme/ApiExplorer}/ParamOptions/_ParamOptions.scss +15 -34
- 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 +8 -5
- package/src/theme/ApiExplorer/Response/_Response.scss +81 -0
- package/src/theme/{ApiDemoPanel → ApiExplorer}/Response/index.tsx +53 -33
- package/src/theme/{ApiDemoPanel → ApiExplorer}/SecuritySchemes/index.tsx +5 -3
- package/{lib-next/theme/ApiDemoPanel → src/theme/ApiExplorer}/Server/_Server.scss +11 -1
- package/src/theme/{ApiDemoPanel → ApiExplorer}/Server/index.tsx +13 -16
- package/src/theme/{ApiDemoPanel → ApiExplorer}/buildPostmanRequest.ts +2 -2
- package/src/theme/{ApiDemoPanel → ApiExplorer}/index.tsx +10 -12
- package/src/theme/{ApiDemoPanel → ApiExplorer}/persistanceMiddleware.ts +1 -1
- package/src/theme/ApiItem/index.tsx +17 -8
- package/src/theme/ApiItem/store.ts +7 -7
- package/src/theme/ApiTabs/_ApiTabs.scss +29 -22
- package/src/theme/ApiTabs/index.js +4 -3
- package/src/theme/DiscriminatorTabs/_DiscriminatorTabs.scss +16 -13
- package/src/theme/Markdown/Details/_Details.scss +82 -3
- package/src/theme/MimeTabs/_MimeTabs.scss +13 -8
- package/src/theme/MimeTabs/index.js +2 -2
- package/src/theme/ParamsItem/_ParamsItem.scss +24 -9
- package/src/theme/ParamsItem/index.js +9 -6
- package/src/theme/SchemaItem/_SchemaItem.scss +47 -11
- package/src/theme/SchemaItem/index.js +23 -12
- package/src/theme/SchemaTabs/_SchemaTabs.scss +23 -17
- package/src/theme/SchemaTabs/index.js +50 -54
- package/src/theme/styles.scss +55 -18
- package/src/theme-openapi.d.ts +89 -46
- 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 -262
- package/lib/theme/ApiDemoPanel/Body/slice.js +0 -102
- package/lib/theme/ApiDemoPanel/CodeTabs/_CodeTabs.scss +0 -238
- 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 -238
- package/lib/theme/ApiDemoPanel/Execute/index.js +0 -155
- 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 -29
- package/lib/theme/ApiDemoPanel/FormFileUpload/_FormFileUpload.scss +0 -72
- package/lib/theme/ApiDemoPanel/FormFileUpload/index.js +0 -82
- package/lib/theme/ApiDemoPanel/FormItem/_FormItem.scss +0 -12
- package/lib/theme/ApiDemoPanel/FormItem/index.js +0 -37
- package/lib/theme/ApiDemoPanel/FormMultiSelect/index.js +0 -44
- package/lib/theme/ApiDemoPanel/FormSelect/index.js +0 -33
- package/lib/theme/ApiDemoPanel/FormTextInput/_FormTextInput.scss +0 -15
- package/lib/theme/ApiDemoPanel/FormTextInput/index.js +0 -27
- package/lib/theme/ApiDemoPanel/LiveEditor/index.js +0 -61
- package/lib/theme/ApiDemoPanel/MethodEndpoint/_MethodEndpoint.scss +0 -6
- package/lib/theme/ApiDemoPanel/MethodEndpoint/index.js +0 -73
- package/lib/theme/ApiDemoPanel/ParamOptions/_ParamOptions.scss +0 -141
- package/lib/theme/ApiDemoPanel/ParamOptions/index.js +0 -215
- package/lib/theme/ApiDemoPanel/ParamOptions/slice.js +0 -34
- package/lib/theme/ApiDemoPanel/Request/_Request.scss +0 -48
- package/lib/theme/ApiDemoPanel/Request/index.js +0 -66
- package/lib/theme/ApiDemoPanel/Response/_Response.scss +0 -27
- package/lib/theme/ApiDemoPanel/Response/index.js +0 -100
- package/lib/theme/ApiDemoPanel/Response/slice.js +0 -56
- package/lib/theme/ApiDemoPanel/SecuritySchemes/index.js +0 -257
- package/lib/theme/ApiDemoPanel/Server/_Server.scss +0 -16
- package/lib/theme/ApiDemoPanel/Server/index.js +0 -103
- package/lib/theme/ApiDemoPanel/Server/slice.js +0 -40
- package/lib/theme/ApiDemoPanel/buildPostmanRequest.js +0 -303
- package/lib/theme/ApiDemoPanel/index.js +0 -35
- 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-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 -68
- 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 -328
- package/lib-next/theme/ApiDemoPanel/CodeTabs/_CodeTabs.scss +0 -238
- package/lib-next/theme/ApiDemoPanel/ContentType/index.js +0 -30
- package/lib-next/theme/ApiDemoPanel/Curl/index.js +0 -281
- package/lib-next/theme/ApiDemoPanel/Execute/index.js +0 -178
- package/lib-next/theme/ApiDemoPanel/Export/index.js +0 -45
- package/lib-next/theme/ApiDemoPanel/FloatingButton/_FloatingButton.scss +0 -25
- package/lib-next/theme/ApiDemoPanel/FloatingButton/index.js +0 -21
- package/lib-next/theme/ApiDemoPanel/FormFileUpload/index.js +0 -107
- package/lib-next/theme/ApiDemoPanel/FormItem/_FormItem.scss +0 -12
- package/lib-next/theme/ApiDemoPanel/FormItem/index.js +0 -35
- package/lib-next/theme/ApiDemoPanel/FormMultiSelect/index.js +0 -44
- package/lib-next/theme/ApiDemoPanel/FormSelect/_FormSelect.scss +0 -43
- package/lib-next/theme/ApiDemoPanel/FormSelect/index.js +0 -29
- package/lib-next/theme/ApiDemoPanel/FormTextInput/_FormTextInput.scss +0 -15
- package/lib-next/theme/ApiDemoPanel/FormTextInput/index.js +0 -23
- package/lib-next/theme/ApiDemoPanel/LiveEditor/_LiveEditor.scss +0 -15
- package/lib-next/theme/ApiDemoPanel/LiveEditor/index.js +0 -58
- package/lib-next/theme/ApiDemoPanel/MethodEndpoint/_MethodEndpoint.scss +0 -6
- package/lib-next/theme/ApiDemoPanel/MethodEndpoint/index.js +0 -68
- package/lib-next/theme/ApiDemoPanel/ParamOptions/index.js +0 -299
- package/lib-next/theme/ApiDemoPanel/Request/_Request.scss +0 -48
- package/lib-next/theme/ApiDemoPanel/Request/index.js +0 -59
- package/lib-next/theme/ApiDemoPanel/Response/_Response.scss +0 -27
- package/lib-next/theme/ApiDemoPanel/Response/index.js +0 -122
- package/lib-next/theme/ApiDemoPanel/SecuritySchemes/index.js +0 -274
- package/lib-next/theme/ApiDemoPanel/Server/index.js +0 -131
- package/lib-next/theme/ApiDemoPanel/index.js +0 -25
- 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 -150
- package/lib-next/theme/ApiItem/store.js +0 -38
- package/lib-next/theme/ApiLogo/index.js +0 -48
- package/lib-next/theme/ApiTabs/_ApiTabs.scss +0 -133
- package/lib-next/theme/ApiTabs/index.js +0 -191
- package/lib-next/theme/DiscriminatorTabs/_DiscriminatorTabs.scss +0 -94
- package/lib-next/theme/DiscriminatorTabs/index.js +0 -185
- package/lib-next/theme/Markdown/Details/_Details.scss +0 -40
- package/lib-next/theme/MimeTabs/_MimeTabs.scss +0 -64
- package/lib-next/theme/MimeTabs/index.js +0 -221
- package/lib-next/theme/ParamsItem/_ParamsItem.scss +0 -39
- package/lib-next/theme/ParamsItem/index.js +0 -133
- package/lib-next/theme/ResponseSamples/_ResponseSamples.scss +0 -3
- package/lib-next/theme/ResponseSamples/index.js +0 -22
- package/lib-next/theme/SchemaItem/_SchemaItem.scss +0 -53
- package/lib-next/theme/SchemaItem/index.js +0 -112
- package/lib-next/theme/SchemaTabs/_SchemaTabs.scss +0 -58
- package/lib-next/theme/SchemaTabs/index.js +0 -186
- package/lib-next/theme/styles.scss +0 -123
- 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/_CodeTabs.scss +0 -238
- package/src/theme/ApiDemoPanel/CodeTabs/index.js +0 -156
- package/src/theme/ApiDemoPanel/Curl/languages.json +0 -1386
- package/src/theme/ApiDemoPanel/Execute/index.tsx +0 -200
- package/src/theme/ApiDemoPanel/FormItem/_FormItem.scss +0 -12
- package/src/theme/ApiDemoPanel/FormMultiSelect/_FormMultiSelect.scss +0 -26
- package/src/theme/ApiDemoPanel/FormTextInput/_FormTextInput.scss +0 -15
- package/src/theme/ApiDemoPanel/FormTextInput/index.tsx +0 -32
- package/src/theme/ApiDemoPanel/LiveEditor/index.tsx +0 -73
- package/src/theme/ApiDemoPanel/MethodEndpoint/_MethodEndpoint.scss +0 -6
- package/src/theme/ApiDemoPanel/ParamOptions/index.tsx +0 -333
- package/src/theme/ApiDemoPanel/Request/_Request.scss +0 -48
- package/src/theme/ApiDemoPanel/Request/index.tsx +0 -69
- package/src/theme/ApiDemoPanel/Response/_Response.scss +0 -27
- package/src/theme/ApiDemoPanel/postman-collection.d.ts +0 -10
- package/src/theme/ApiDemoPanel/react-modal.d.ts +0 -8
- /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}/Response/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
package/lib-next/index.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
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 path from "path";
|
|
9
|
-
const NodePolyfillPlugin = require("node-polyfill-webpack-plugin");
|
|
10
|
-
export default function docusaurusThemeOpenAPI() {
|
|
11
|
-
return {
|
|
12
|
-
name: "docusaurus-theme-openapi",
|
|
13
|
-
getClientModules() {
|
|
14
|
-
const modules = [require.resolve("./theme/styles.scss")];
|
|
15
|
-
return modules;
|
|
16
|
-
},
|
|
17
|
-
getThemePath() {
|
|
18
|
-
return path.join(__dirname, "..", "lib-next", "theme");
|
|
19
|
-
},
|
|
20
|
-
getTypeScriptThemePath() {
|
|
21
|
-
return path.resolve(__dirname, "..", "src", "theme");
|
|
22
|
-
},
|
|
23
|
-
configureWebpack(_, isServer, utils) {
|
|
24
|
-
const { getStyleLoaders } = utils;
|
|
25
|
-
const isProd = process.env.NODE_ENV === "production";
|
|
26
|
-
return {
|
|
27
|
-
plugins: [new NodePolyfillPlugin()],
|
|
28
|
-
module: {
|
|
29
|
-
rules: [
|
|
30
|
-
{
|
|
31
|
-
test: /\.s[ca]ss$/,
|
|
32
|
-
oneOf: [
|
|
33
|
-
{
|
|
34
|
-
test: /\.module\.s[ca]ss$/,
|
|
35
|
-
use: [
|
|
36
|
-
...getStyleLoaders(isServer, {
|
|
37
|
-
modules: {
|
|
38
|
-
localIdentName: isProd
|
|
39
|
-
? `[local]_[hash:base64:4]`
|
|
40
|
-
: `[local]_[path][name]`,
|
|
41
|
-
exportOnlyLocals: isServer,
|
|
42
|
-
},
|
|
43
|
-
importLoaders: 2,
|
|
44
|
-
sourceMap: !isProd,
|
|
45
|
-
}),
|
|
46
|
-
{
|
|
47
|
-
loader: require.resolve("sass-loader"),
|
|
48
|
-
options: {},
|
|
49
|
-
},
|
|
50
|
-
],
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
use: [
|
|
54
|
-
...getStyleLoaders(isServer, {}),
|
|
55
|
-
{
|
|
56
|
-
loader: require.resolve("sass-loader"),
|
|
57
|
-
options: {},
|
|
58
|
-
},
|
|
59
|
-
],
|
|
60
|
-
},
|
|
61
|
-
],
|
|
62
|
-
},
|
|
63
|
-
],
|
|
64
|
-
},
|
|
65
|
-
};
|
|
66
|
-
},
|
|
67
|
-
};
|
|
68
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
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
|
-
export function createDescription(description) {
|
|
9
|
-
if (!description) {
|
|
10
|
-
return "";
|
|
11
|
-
}
|
|
12
|
-
return `\n\n${description}\n\n`;
|
|
13
|
-
}
|
|
@@ -1,153 +0,0 @@
|
|
|
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
|
-
function prettyName(schema, circular) {
|
|
9
|
-
if (schema.format) {
|
|
10
|
-
return schema.format;
|
|
11
|
-
}
|
|
12
|
-
if (schema.allOf) {
|
|
13
|
-
if (typeof schema.allOf[0] === "string") {
|
|
14
|
-
// @ts-ignore
|
|
15
|
-
if (schema.allOf[0].includes("circular")) {
|
|
16
|
-
return schema.allOf[0];
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return "object";
|
|
20
|
-
}
|
|
21
|
-
if (schema.oneOf) {
|
|
22
|
-
return "object";
|
|
23
|
-
}
|
|
24
|
-
if (schema.anyOf) {
|
|
25
|
-
return "object";
|
|
26
|
-
}
|
|
27
|
-
if (schema.type === "object") {
|
|
28
|
-
return schema.xml?.name ?? schema.type;
|
|
29
|
-
// return schema.type;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
if (schema.type === "array") {
|
|
33
|
-
return schema.xml?.name ?? schema.type;
|
|
34
|
-
// return schema.type;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return schema.title ?? schema.type;
|
|
38
|
-
}
|
|
39
|
-
export function getSchemaName(schema, circular) {
|
|
40
|
-
if (schema.items) {
|
|
41
|
-
return prettyName(schema.items, circular) + "[]";
|
|
42
|
-
}
|
|
43
|
-
return prettyName(schema, circular) ?? "";
|
|
44
|
-
}
|
|
45
|
-
export function getQualifierMessage(schema) {
|
|
46
|
-
// TODO:
|
|
47
|
-
// - uniqueItems
|
|
48
|
-
// - maxProperties
|
|
49
|
-
// - minProperties
|
|
50
|
-
// - multipleOf
|
|
51
|
-
if (!schema) {
|
|
52
|
-
return undefined;
|
|
53
|
-
}
|
|
54
|
-
if (
|
|
55
|
-
schema.items &&
|
|
56
|
-
schema.minItems === undefined &&
|
|
57
|
-
schema.maxItems === undefined
|
|
58
|
-
) {
|
|
59
|
-
return getQualifierMessage(schema.items);
|
|
60
|
-
}
|
|
61
|
-
let message = "**Possible values:** ";
|
|
62
|
-
let qualifierGroups = [];
|
|
63
|
-
if (schema.items && schema.items.enum) {
|
|
64
|
-
if (schema.items.enum) {
|
|
65
|
-
qualifierGroups.push(
|
|
66
|
-
`[${schema.items.enum.map((e) => `\`${e}\``).join(", ")}]`
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
if (schema.minLength || schema.maxLength) {
|
|
71
|
-
let lengthQualifier = "";
|
|
72
|
-
let minLength;
|
|
73
|
-
let maxLength;
|
|
74
|
-
if (schema.minLength && schema.minLength > 1) {
|
|
75
|
-
minLength = `\`>= ${schema.minLength} characters\``;
|
|
76
|
-
}
|
|
77
|
-
if (schema.minLength && schema.minLength === 1) {
|
|
78
|
-
minLength = `\`non-empty\``;
|
|
79
|
-
}
|
|
80
|
-
if (schema.maxLength) {
|
|
81
|
-
maxLength = `\`<= ${schema.maxLength} characters\``;
|
|
82
|
-
}
|
|
83
|
-
if (minLength && !maxLength) {
|
|
84
|
-
lengthQualifier += minLength;
|
|
85
|
-
}
|
|
86
|
-
if (maxLength && !minLength) {
|
|
87
|
-
lengthQualifier += maxLength;
|
|
88
|
-
}
|
|
89
|
-
if (minLength && maxLength) {
|
|
90
|
-
lengthQualifier += `${minLength} and ${maxLength}`;
|
|
91
|
-
}
|
|
92
|
-
qualifierGroups.push(lengthQualifier);
|
|
93
|
-
}
|
|
94
|
-
if (
|
|
95
|
-
schema.minimum ||
|
|
96
|
-
schema.maximum ||
|
|
97
|
-
typeof schema.exclusiveMinimum === "number" ||
|
|
98
|
-
typeof schema.exclusiveMaximum === "number"
|
|
99
|
-
) {
|
|
100
|
-
let minmaxQualifier = "";
|
|
101
|
-
let minimum;
|
|
102
|
-
let maximum;
|
|
103
|
-
if (typeof schema.exclusiveMinimum === "number") {
|
|
104
|
-
minimum = `\`> ${schema.exclusiveMinimum}\``;
|
|
105
|
-
} else if (schema.minimum && !schema.exclusiveMinimum) {
|
|
106
|
-
minimum = `\`>= ${schema.minimum}\``;
|
|
107
|
-
} else if (schema.minimum && schema.exclusiveMinimum === true) {
|
|
108
|
-
minimum = `\`> ${schema.minimum}\``;
|
|
109
|
-
}
|
|
110
|
-
if (typeof schema.exclusiveMaximum === "number") {
|
|
111
|
-
maximum = `\`< ${schema.exclusiveMaximum}\``;
|
|
112
|
-
} else if (schema.maximum && !schema.exclusiveMaximum) {
|
|
113
|
-
maximum = `\`<= ${schema.maximum}\``;
|
|
114
|
-
} else if (schema.maximum && schema.exclusiveMaximum === true) {
|
|
115
|
-
maximum = `\`< ${schema.maximum}\``;
|
|
116
|
-
}
|
|
117
|
-
if (minimum && !maximum) {
|
|
118
|
-
minmaxQualifier += minimum;
|
|
119
|
-
}
|
|
120
|
-
if (maximum && !minimum) {
|
|
121
|
-
minmaxQualifier += maximum;
|
|
122
|
-
}
|
|
123
|
-
if (minimum && maximum) {
|
|
124
|
-
minmaxQualifier += `${minimum} and ${maximum}`;
|
|
125
|
-
}
|
|
126
|
-
qualifierGroups.push(minmaxQualifier);
|
|
127
|
-
}
|
|
128
|
-
if (schema.pattern) {
|
|
129
|
-
qualifierGroups.push(
|
|
130
|
-
`Value must match regular expression \`${schema.pattern}\``
|
|
131
|
-
);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
// Check if discriminator mapping
|
|
135
|
-
const discriminator = schema;
|
|
136
|
-
if (discriminator.mapping) {
|
|
137
|
-
const values = Object.keys(discriminator.mapping);
|
|
138
|
-
qualifierGroups.push(`[${values.map((e) => `\`${e}\``).join(", ")}]`);
|
|
139
|
-
}
|
|
140
|
-
if (schema.enum) {
|
|
141
|
-
qualifierGroups.push(`[${schema.enum.map((e) => `\`${e}\``).join(", ")}]`);
|
|
142
|
-
}
|
|
143
|
-
if (schema.minItems) {
|
|
144
|
-
qualifierGroups.push(`\`>= ${schema.minItems}\``);
|
|
145
|
-
}
|
|
146
|
-
if (schema.maxItems) {
|
|
147
|
-
qualifierGroups.push(`\`<= ${schema.maxItems}\``);
|
|
148
|
-
}
|
|
149
|
-
if (qualifierGroups.length === 0) {
|
|
150
|
-
return undefined;
|
|
151
|
-
}
|
|
152
|
-
return message + qualifierGroups.join(", ");
|
|
153
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
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
|
-
export function create(tag, props) {
|
|
9
|
-
const { children, ...rest } = props;
|
|
10
|
-
let propString = "";
|
|
11
|
-
for (const [key, value] of Object.entries(rest)) {
|
|
12
|
-
propString += ` ${key}={${JSON.stringify(value)}}`;
|
|
13
|
-
}
|
|
14
|
-
return `<${tag}${propString}>${render(children)}</${tag}>`;
|
|
15
|
-
}
|
|
16
|
-
export function guard(value, cb) {
|
|
17
|
-
if (!!value) {
|
|
18
|
-
const children = cb(value);
|
|
19
|
-
return render(children);
|
|
20
|
-
}
|
|
21
|
-
return "";
|
|
22
|
-
}
|
|
23
|
-
export function render(children) {
|
|
24
|
-
if (Array.isArray(children)) {
|
|
25
|
-
return children.filter((c) => c !== undefined).join("");
|
|
26
|
-
}
|
|
27
|
-
return children ?? "";
|
|
28
|
-
}
|
|
29
|
-
export function toString(value) {
|
|
30
|
-
// Return as-is if already string
|
|
31
|
-
if (typeof value === "string") {
|
|
32
|
-
return value;
|
|
33
|
-
}
|
|
34
|
-
// Return undefined if null or undefined
|
|
35
|
-
if (value == null) {
|
|
36
|
-
return undefined;
|
|
37
|
-
}
|
|
38
|
-
// Return formatted array if Array
|
|
39
|
-
if (Array.isArray(value)) {
|
|
40
|
-
return `[${value.join(", ")}]`;
|
|
41
|
-
}
|
|
42
|
-
// Coerce to string in all other cases,
|
|
43
|
-
return value + "";
|
|
44
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
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
|
-
// TODO: Remove this when https://github.com/facebook/docusaurus/issues/6087 is resolved.
|
|
9
|
-
declare module "@paloaltonetworks/postman-code-generators";
|
|
@@ -1,9 +0,0 @@
|
|
|
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
|
-
// TODO: Remove this when https://github.com/facebook/docusaurus/issues/6087 is resolved.
|
|
9
|
-
declare module "react-magic-dropzone";
|
|
@@ -1,30 +0,0 @@
|
|
|
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
|
-
import FormItem from "@theme/ApiDemoPanel/FormItem";
|
|
10
|
-
import FormSelect from "@theme/ApiDemoPanel/FormSelect";
|
|
11
|
-
import { useTypedDispatch, useTypedSelector } from "@theme/ApiItem/hooks";
|
|
12
|
-
import { setAccept } from "./slice";
|
|
13
|
-
function Accept() {
|
|
14
|
-
const value = useTypedSelector((state) => state.accept.value);
|
|
15
|
-
const options = useTypedSelector((state) => state.accept.options);
|
|
16
|
-
const dispatch = useTypedDispatch();
|
|
17
|
-
if (options.length <= 1) {
|
|
18
|
-
return null;
|
|
19
|
-
}
|
|
20
|
-
return (
|
|
21
|
-
<FormItem label="Accept">
|
|
22
|
-
<FormSelect
|
|
23
|
-
value={value}
|
|
24
|
-
options={options}
|
|
25
|
-
onChange={(e) => dispatch(setAccept(e.target.value))}
|
|
26
|
-
/>
|
|
27
|
-
</FormItem>
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
export default Accept;
|
|
@@ -1,29 +0,0 @@
|
|
|
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
|
-
export function getAuthDataKeys(security) {
|
|
9
|
-
// Bearer Auth
|
|
10
|
-
if (security.type === "http" && security.scheme === "bearer") {
|
|
11
|
-
return ["token"];
|
|
12
|
-
}
|
|
13
|
-
if (security.type === "oauth2") {
|
|
14
|
-
return ["token"];
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// Basic Auth
|
|
18
|
-
if (security.type === "http" && security.scheme === "basic") {
|
|
19
|
-
return ["username", "password"];
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// API Auth
|
|
23
|
-
if (security.type === "apiKey") {
|
|
24
|
-
return ["apiKey"];
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// none
|
|
28
|
-
return [];
|
|
29
|
-
}
|
|
@@ -1,142 +0,0 @@
|
|
|
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
|
-
import FormItem from "@theme/ApiDemoPanel/FormItem";
|
|
10
|
-
import FormSelect from "@theme/ApiDemoPanel/FormSelect";
|
|
11
|
-
import FormTextInput from "@theme/ApiDemoPanel/FormTextInput";
|
|
12
|
-
import { useTypedDispatch, useTypedSelector } from "@theme/ApiItem/hooks";
|
|
13
|
-
import { setAuthData, setSelectedAuth } from "./slice";
|
|
14
|
-
function Authorization() {
|
|
15
|
-
const data = useTypedSelector((state) => state.auth.data);
|
|
16
|
-
const options = useTypedSelector((state) => state.auth.options);
|
|
17
|
-
const selected = useTypedSelector((state) => state.auth.selected);
|
|
18
|
-
const dispatch = useTypedDispatch();
|
|
19
|
-
if (selected === undefined) {
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
const selectedAuth = options[selected];
|
|
23
|
-
const optionKeys = Object.keys(options);
|
|
24
|
-
return (
|
|
25
|
-
<div>
|
|
26
|
-
{optionKeys.length > 1 && (
|
|
27
|
-
<FormItem label="Security Scheme">
|
|
28
|
-
<FormSelect
|
|
29
|
-
options={optionKeys}
|
|
30
|
-
value={selected}
|
|
31
|
-
onChange={(e) => {
|
|
32
|
-
dispatch(setSelectedAuth(e.target.value));
|
|
33
|
-
}}
|
|
34
|
-
/>
|
|
35
|
-
</FormItem>
|
|
36
|
-
)}
|
|
37
|
-
{selectedAuth.map((a) => {
|
|
38
|
-
if (a.type === "http" && a.scheme === "bearer") {
|
|
39
|
-
return (
|
|
40
|
-
<FormItem label="Bearer Token" key={a.key + "-bearer"}>
|
|
41
|
-
<FormTextInput
|
|
42
|
-
placeholder="Bearer Token"
|
|
43
|
-
value={data[a.key].token ?? ""}
|
|
44
|
-
onChange={(e) => {
|
|
45
|
-
const value = e.target.value;
|
|
46
|
-
dispatch(
|
|
47
|
-
setAuthData({
|
|
48
|
-
scheme: a.key,
|
|
49
|
-
key: "token",
|
|
50
|
-
value: value ? value : undefined,
|
|
51
|
-
})
|
|
52
|
-
);
|
|
53
|
-
}}
|
|
54
|
-
/>
|
|
55
|
-
</FormItem>
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
if (a.type === "oauth2") {
|
|
59
|
-
return (
|
|
60
|
-
<FormItem label="Bearer Token" key={a.key + "-oauth2"}>
|
|
61
|
-
<FormTextInput
|
|
62
|
-
placeholder="Bearer Token"
|
|
63
|
-
value={data[a.key].token ?? ""}
|
|
64
|
-
onChange={(e) => {
|
|
65
|
-
const value = e.target.value;
|
|
66
|
-
dispatch(
|
|
67
|
-
setAuthData({
|
|
68
|
-
scheme: a.key,
|
|
69
|
-
key: "token",
|
|
70
|
-
value: value ? value : undefined,
|
|
71
|
-
})
|
|
72
|
-
);
|
|
73
|
-
}}
|
|
74
|
-
/>
|
|
75
|
-
</FormItem>
|
|
76
|
-
);
|
|
77
|
-
}
|
|
78
|
-
if (a.type === "http" && a.scheme === "basic") {
|
|
79
|
-
return (
|
|
80
|
-
<React.Fragment key={a.key + "-basic"}>
|
|
81
|
-
<FormItem label="Username">
|
|
82
|
-
<FormTextInput
|
|
83
|
-
placeholder="Username"
|
|
84
|
-
value={data[a.key].username ?? ""}
|
|
85
|
-
onChange={(e) => {
|
|
86
|
-
const value = e.target.value;
|
|
87
|
-
dispatch(
|
|
88
|
-
setAuthData({
|
|
89
|
-
scheme: a.key,
|
|
90
|
-
key: "username",
|
|
91
|
-
value: value ? value : undefined,
|
|
92
|
-
})
|
|
93
|
-
);
|
|
94
|
-
}}
|
|
95
|
-
/>
|
|
96
|
-
</FormItem>
|
|
97
|
-
<FormItem label="Password">
|
|
98
|
-
<FormTextInput
|
|
99
|
-
placeholder="Password"
|
|
100
|
-
password
|
|
101
|
-
value={data[a.key].password ?? ""}
|
|
102
|
-
onChange={(e) => {
|
|
103
|
-
const value = e.target.value;
|
|
104
|
-
dispatch(
|
|
105
|
-
setAuthData({
|
|
106
|
-
scheme: a.key,
|
|
107
|
-
key: "password",
|
|
108
|
-
value: value ? value : undefined,
|
|
109
|
-
})
|
|
110
|
-
);
|
|
111
|
-
}}
|
|
112
|
-
/>
|
|
113
|
-
</FormItem>
|
|
114
|
-
</React.Fragment>
|
|
115
|
-
);
|
|
116
|
-
}
|
|
117
|
-
if (a.type === "apiKey") {
|
|
118
|
-
return (
|
|
119
|
-
<FormItem label={`${a.key}`} key={a.key + "-apikey"}>
|
|
120
|
-
<FormTextInput
|
|
121
|
-
placeholder={`${a.key}`}
|
|
122
|
-
value={data[a.key].apiKey ?? ""}
|
|
123
|
-
onChange={(e) => {
|
|
124
|
-
const value = e.target.value;
|
|
125
|
-
dispatch(
|
|
126
|
-
setAuthData({
|
|
127
|
-
scheme: a.key,
|
|
128
|
-
key: "apiKey",
|
|
129
|
-
value: value ? value : undefined,
|
|
130
|
-
})
|
|
131
|
-
);
|
|
132
|
-
}}
|
|
133
|
-
/>
|
|
134
|
-
</FormItem>
|
|
135
|
-
);
|
|
136
|
-
}
|
|
137
|
-
return null;
|
|
138
|
-
})}
|
|
139
|
-
</div>
|
|
140
|
-
);
|
|
141
|
-
}
|
|
142
|
-
export default Authorization;
|