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
|
@@ -1,240 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.languageSet = exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _useDocusaurusContext = _interopRequireDefault(require("@docusaurus/useDocusaurusContext"));
|
|
9
|
-
var _postmanCodeGenerators = _interopRequireDefault(require("@paloaltonetworks/postman-code-generators"));
|
|
10
|
-
var _buildPostmanRequest = _interopRequireDefault(require("@theme/ApiDemoPanel/buildPostmanRequest"));
|
|
11
|
-
var _CodeTabs = _interopRequireDefault(require("@theme/ApiDemoPanel/CodeTabs"));
|
|
12
|
-
var _hooks = require("@theme/ApiItem/hooks");
|
|
13
|
-
var _CodeBlock = _interopRequireDefault(require("@theme/CodeBlock"));
|
|
14
|
-
var _clsx = _interopRequireDefault(require("clsx"));
|
|
15
|
-
var _merge = _interopRequireDefault(require("lodash/merge"));
|
|
16
|
-
var _stylesModule = _interopRequireDefault(require("./styles.module.css"));
|
|
17
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
20
|
-
/* ============================================================================
|
|
21
|
-
* Copyright (c) Palo Alto Networks
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
* ========================================================================== */
|
|
26
|
-
|
|
27
|
-
const languageSet = [{
|
|
28
|
-
highlight: "bash",
|
|
29
|
-
language: "curl",
|
|
30
|
-
logoClass: "bash",
|
|
31
|
-
options: {
|
|
32
|
-
longFormat: false,
|
|
33
|
-
followRedirect: true,
|
|
34
|
-
trimRequestBody: true
|
|
35
|
-
},
|
|
36
|
-
variant: "cURL"
|
|
37
|
-
}, {
|
|
38
|
-
highlight: "python",
|
|
39
|
-
language: "python",
|
|
40
|
-
logoClass: "python",
|
|
41
|
-
options: {
|
|
42
|
-
followRedirect: true,
|
|
43
|
-
trimRequestBody: true
|
|
44
|
-
},
|
|
45
|
-
variant: "requests"
|
|
46
|
-
}, {
|
|
47
|
-
highlight: "go",
|
|
48
|
-
language: "go",
|
|
49
|
-
logoClass: "go",
|
|
50
|
-
options: {
|
|
51
|
-
followRedirect: true,
|
|
52
|
-
trimRequestBody: true
|
|
53
|
-
},
|
|
54
|
-
variant: "native"
|
|
55
|
-
}, {
|
|
56
|
-
highlight: "javascript",
|
|
57
|
-
language: "nodejs",
|
|
58
|
-
logoClass: "nodejs",
|
|
59
|
-
options: {
|
|
60
|
-
ES6_enabled: true,
|
|
61
|
-
followRedirect: true,
|
|
62
|
-
trimRequestBody: true
|
|
63
|
-
},
|
|
64
|
-
variant: "axios"
|
|
65
|
-
}, {
|
|
66
|
-
highlight: "ruby",
|
|
67
|
-
language: "ruby",
|
|
68
|
-
logoClass: "ruby",
|
|
69
|
-
options: {
|
|
70
|
-
followRedirect: true,
|
|
71
|
-
trimRequestBody: true
|
|
72
|
-
},
|
|
73
|
-
variant: "Net::HTTP"
|
|
74
|
-
}, {
|
|
75
|
-
highlight: "csharp",
|
|
76
|
-
language: "csharp",
|
|
77
|
-
logoClass: "csharp",
|
|
78
|
-
options: {
|
|
79
|
-
followRedirect: true,
|
|
80
|
-
trimRequestBody: true
|
|
81
|
-
},
|
|
82
|
-
variant: "RestSharp"
|
|
83
|
-
}, {
|
|
84
|
-
highlight: "php",
|
|
85
|
-
language: "php",
|
|
86
|
-
logoClass: "php",
|
|
87
|
-
options: {
|
|
88
|
-
followRedirect: true,
|
|
89
|
-
trimRequestBody: true
|
|
90
|
-
},
|
|
91
|
-
variant: "cURL"
|
|
92
|
-
}, {
|
|
93
|
-
highlight: "java",
|
|
94
|
-
language: "java",
|
|
95
|
-
logoClass: "java",
|
|
96
|
-
options: {
|
|
97
|
-
followRedirect: true,
|
|
98
|
-
trimRequestBody: true
|
|
99
|
-
},
|
|
100
|
-
variant: "OkHttp"
|
|
101
|
-
}, {
|
|
102
|
-
highlight: "powershell",
|
|
103
|
-
language: "powershell",
|
|
104
|
-
logoClass: "powershell",
|
|
105
|
-
options: {
|
|
106
|
-
followRedirect: true,
|
|
107
|
-
trimRequestBody: true
|
|
108
|
-
},
|
|
109
|
-
variant: "RestMethod"
|
|
110
|
-
}];
|
|
111
|
-
exports.languageSet = languageSet;
|
|
112
|
-
function CodeTab({
|
|
113
|
-
children,
|
|
114
|
-
hidden,
|
|
115
|
-
className,
|
|
116
|
-
onClick
|
|
117
|
-
}) {
|
|
118
|
-
return <div role="tabpanel" className={(0, _clsx.default)(_stylesModule.default.tabItem, className)} {...{
|
|
119
|
-
hidden
|
|
120
|
-
}}>
|
|
121
|
-
{children}
|
|
122
|
-
</div>;
|
|
123
|
-
}
|
|
124
|
-
function Curl({
|
|
125
|
-
postman,
|
|
126
|
-
codeSamples
|
|
127
|
-
}) {
|
|
128
|
-
var _ref, _siteConfig$themeConf;
|
|
129
|
-
// TODO: match theme for vscode.
|
|
130
|
-
|
|
131
|
-
const {
|
|
132
|
-
siteConfig
|
|
133
|
-
} = (0, _useDocusaurusContext.default)();
|
|
134
|
-
const contentType = (0, _hooks.useTypedSelector)(state => state.contentType.value);
|
|
135
|
-
const accept = (0, _hooks.useTypedSelector)(state => state.accept.value);
|
|
136
|
-
const server = (0, _hooks.useTypedSelector)(state => state.server.value);
|
|
137
|
-
const body = (0, _hooks.useTypedSelector)(state => state.body);
|
|
138
|
-
const pathParams = (0, _hooks.useTypedSelector)(state => state.params.path);
|
|
139
|
-
const queryParams = (0, _hooks.useTypedSelector)(state => state.params.query);
|
|
140
|
-
const cookieParams = (0, _hooks.useTypedSelector)(state => state.params.cookie);
|
|
141
|
-
const headerParams = (0, _hooks.useTypedSelector)(state => state.params.header);
|
|
142
|
-
const auth = (0, _hooks.useTypedSelector)(state => state.auth);
|
|
143
|
-
|
|
144
|
-
// User-defined languages array
|
|
145
|
-
// Can override languageSet, change order of langs, override options and variants
|
|
146
|
-
const langs = [...((_ref = siteConfig === null || siteConfig === void 0 ? void 0 : (_siteConfig$themeConf = siteConfig.themeConfig) === null || _siteConfig$themeConf === void 0 ? void 0 : _siteConfig$themeConf.languageTabs) !== null && _ref !== void 0 ? _ref : languageSet), ...codeSamples];
|
|
147
|
-
|
|
148
|
-
// Filter languageSet by user-defined langs
|
|
149
|
-
const filteredLanguageSet = languageSet.filter(ls => {
|
|
150
|
-
return langs.some(lang => {
|
|
151
|
-
return lang.language === ls.language;
|
|
152
|
-
});
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
// Merge user-defined langs into languageSet
|
|
156
|
-
const mergedLangs = (0, _merge.default)(filteredLanguageSet, langs);
|
|
157
|
-
|
|
158
|
-
// Read defaultLang from localStorage
|
|
159
|
-
const defaultLang = mergedLangs.filter(lang => lang.language === localStorage.getItem("docusaurus.tab.code-samples"));
|
|
160
|
-
const [language, setLanguage] = (0, _react.useState)(() => {
|
|
161
|
-
var _defaultLang$;
|
|
162
|
-
// Return first index if only 1 user-defined language exists
|
|
163
|
-
if (mergedLangs.length === 1) {
|
|
164
|
-
return mergedLangs[0];
|
|
165
|
-
}
|
|
166
|
-
// Fall back to language in localStorage or first user-defined language
|
|
167
|
-
return (_defaultLang$ = defaultLang[0]) !== null && _defaultLang$ !== void 0 ? _defaultLang$ : mergedLangs[0];
|
|
168
|
-
});
|
|
169
|
-
const [codeText, setCodeText] = (0, _react.useState)("");
|
|
170
|
-
(0, _react.useEffect)(() => {
|
|
171
|
-
if (language && !!language.options) {
|
|
172
|
-
const postmanRequest = (0, _buildPostmanRequest.default)(postman, {
|
|
173
|
-
queryParams,
|
|
174
|
-
pathParams,
|
|
175
|
-
cookieParams,
|
|
176
|
-
contentType,
|
|
177
|
-
accept,
|
|
178
|
-
headerParams,
|
|
179
|
-
body,
|
|
180
|
-
server,
|
|
181
|
-
auth
|
|
182
|
-
});
|
|
183
|
-
_postmanCodeGenerators.default.convert(language.language, language.variant, postmanRequest, language.options, (error, snippet) => {
|
|
184
|
-
if (error) {
|
|
185
|
-
return;
|
|
186
|
-
}
|
|
187
|
-
setCodeText(snippet);
|
|
188
|
-
});
|
|
189
|
-
} else if (language && !!language.source) {
|
|
190
|
-
setCodeText(language.source);
|
|
191
|
-
} else if (language && !language.options) {
|
|
192
|
-
const langSource = mergedLangs.filter(lang => lang.language === language.language);
|
|
193
|
-
|
|
194
|
-
// Merges user-defined language with default languageSet
|
|
195
|
-
// This allows users to define only the minimal properties necessary in languageTabs
|
|
196
|
-
// User-defined properties should override languageSet properties
|
|
197
|
-
const mergedLanguage = {
|
|
198
|
-
...langSource[0],
|
|
199
|
-
...language
|
|
200
|
-
};
|
|
201
|
-
const postmanRequest = (0, _buildPostmanRequest.default)(postman, {
|
|
202
|
-
queryParams,
|
|
203
|
-
pathParams,
|
|
204
|
-
cookieParams,
|
|
205
|
-
contentType,
|
|
206
|
-
accept,
|
|
207
|
-
headerParams,
|
|
208
|
-
body,
|
|
209
|
-
server,
|
|
210
|
-
auth
|
|
211
|
-
});
|
|
212
|
-
_postmanCodeGenerators.default.convert(mergedLanguage.language, mergedLanguage.variant, postmanRequest, mergedLanguage.options, (error, snippet) => {
|
|
213
|
-
if (error) {
|
|
214
|
-
return;
|
|
215
|
-
}
|
|
216
|
-
setCodeText(snippet);
|
|
217
|
-
});
|
|
218
|
-
} else {
|
|
219
|
-
setCodeText("");
|
|
220
|
-
}
|
|
221
|
-
}, [accept, body, contentType, cookieParams, headerParams, language, pathParams, postman, queryParams, server, auth, mergedLangs]);
|
|
222
|
-
if (language === undefined) {
|
|
223
|
-
return null;
|
|
224
|
-
}
|
|
225
|
-
return <>
|
|
226
|
-
<_CodeTabs.default groupId="code-samples" action={setLanguage}>
|
|
227
|
-
{mergedLangs.map(lang => {
|
|
228
|
-
return <CodeTab value={lang.language} label={""} key={lang.variant ? `${lang.language}-${lang.variant}` : lang.language} attributes={{
|
|
229
|
-
className: `code__tab--${lang.logoClass}`
|
|
230
|
-
}}>
|
|
231
|
-
<_CodeBlock.default language={lang.highlight} className={_stylesModule.default.codeBlock} title={`${lang.language} / ${lang.variant}`}>
|
|
232
|
-
{codeText}
|
|
233
|
-
</_CodeBlock.default>
|
|
234
|
-
</CodeTab>;
|
|
235
|
-
})}
|
|
236
|
-
</_CodeTabs.default>
|
|
237
|
-
</>;
|
|
238
|
-
}
|
|
239
|
-
var _default = Curl;
|
|
240
|
-
exports.default = _default;
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
.buttonGroup {
|
|
2
|
-
background: var(--openapi-card-background-color);
|
|
3
|
-
color: var(--ifm-pre-color);
|
|
4
|
-
font-family: var(--ifm-font-family-monospace);
|
|
5
|
-
/* font-size: var(--ifm-code-font-size); */
|
|
6
|
-
/* line-height: var(--ifm-pre-line-height); */
|
|
7
|
-
/* margin-bottom: calc(var(--ifm-spacing-vertical) / 4); */
|
|
8
|
-
margin-bottom: 1px;
|
|
9
|
-
margin-top: 0;
|
|
10
|
-
border-radius: var(--openapi-card-border-radius)
|
|
11
|
-
var(--openapi-card-border-radius) 2px 2px;
|
|
12
|
-
display: flex;
|
|
13
|
-
justify-content: flex-end;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.buttonGroup button {
|
|
17
|
-
-webkit-appearance: none;
|
|
18
|
-
-moz-appearance: none;
|
|
19
|
-
appearance: none;
|
|
20
|
-
|
|
21
|
-
cursor: pointer;
|
|
22
|
-
/* font-size: calc(0.875rem * var(--ifm-button-size-multiplier)); */
|
|
23
|
-
/* line-height: 1.5; */
|
|
24
|
-
/* font-weight: var(--ifm-button-font-weight); */
|
|
25
|
-
|
|
26
|
-
/* font-size: var(--ifm-code-font-size); */
|
|
27
|
-
font-size: 13.3333px;
|
|
28
|
-
line-height: var(--ifm-pre-line-height);
|
|
29
|
-
font-weight: var(--ifm-font-weight-semibold);
|
|
30
|
-
|
|
31
|
-
padding: calc(
|
|
32
|
-
var(--ifm-button-padding-vertical) * var(--ifm-button-size-multiplier)
|
|
33
|
-
)
|
|
34
|
-
calc(
|
|
35
|
-
var(--ifm-button-padding-horizontal) * var(--ifm-button-size-multiplier)
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
text-align: center;
|
|
39
|
-
|
|
40
|
-
transition: color var(--ifm-button-transition-duration)
|
|
41
|
-
cubic-bezier(0.08, 0.52, 0.52, 1),
|
|
42
|
-
background var(--ifm-button-transition-duration)
|
|
43
|
-
cubic-bezier(0.08, 0.52, 0.52, 1),
|
|
44
|
-
border-color var(--ifm-button-transition-duration)
|
|
45
|
-
cubic-bezier(0.08, 0.52, 0.52, 1);
|
|
46
|
-
-webkit-user-select: none;
|
|
47
|
-
user-select: none;
|
|
48
|
-
white-space: nowrap;
|
|
49
|
-
|
|
50
|
-
background: transparent;
|
|
51
|
-
|
|
52
|
-
color: var(--ifm-menu-color);
|
|
53
|
-
border: 0px solid transparent;
|
|
54
|
-
/* border-radius: var(--ifm-pre-border-radius); */
|
|
55
|
-
|
|
56
|
-
--margin: 0.25rem;
|
|
57
|
-
|
|
58
|
-
border-radius: calc(var(--margin));
|
|
59
|
-
/* border-radius: 0.25rem; */
|
|
60
|
-
|
|
61
|
-
display: block;
|
|
62
|
-
width: 100%;
|
|
63
|
-
|
|
64
|
-
/* margin: 2px; */
|
|
65
|
-
margin: var(--margin);
|
|
66
|
-
margin-right: 0;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.buttonGroup button:last-child {
|
|
70
|
-
margin-right: 0.25rem;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.buttonGroup button:hover {
|
|
74
|
-
background: var(--ifm-menu-color-background-active);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.buttonGroup button:focus {
|
|
78
|
-
outline: 0;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.buttonGroup button.selected {
|
|
82
|
-
background: var(--ifm-menu-color-background-active);
|
|
83
|
-
color: var(--ifm-menu-color-active);
|
|
84
|
-
}
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _buildPostmanRequest = _interopRequireDefault(require("@theme/ApiDemoPanel/buildPostmanRequest"));
|
|
9
|
-
var _slice = require("@theme/ApiDemoPanel/Response/slice");
|
|
10
|
-
var _hooks = require("@theme/ApiItem/hooks");
|
|
11
|
-
var _reactModal = _interopRequireDefault(require("react-modal"));
|
|
12
|
-
var _makeRequest = _interopRequireDefault(require("./makeRequest"));
|
|
13
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
/* ============================================================================
|
|
15
|
-
* Copyright (c) Palo Alto Networks
|
|
16
|
-
*
|
|
17
|
-
* This source code is licensed under the MIT license found in the
|
|
18
|
-
* LICENSE file in the root directory of this source tree.
|
|
19
|
-
* ========================================================================== */
|
|
20
|
-
|
|
21
|
-
function validateRequest(params) {
|
|
22
|
-
for (let paramList of Object.values(params)) {
|
|
23
|
-
for (let param of paramList) {
|
|
24
|
-
if (param.required && !param.value) {
|
|
25
|
-
return false;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
return true;
|
|
30
|
-
}
|
|
31
|
-
function Execute({
|
|
32
|
-
postman,
|
|
33
|
-
proxy
|
|
34
|
-
}) {
|
|
35
|
-
const pathParams = (0, _hooks.useTypedSelector)(state => state.params.path);
|
|
36
|
-
const queryParams = (0, _hooks.useTypedSelector)(state => state.params.query);
|
|
37
|
-
const cookieParams = (0, _hooks.useTypedSelector)(state => state.params.cookie);
|
|
38
|
-
const headerParams = (0, _hooks.useTypedSelector)(state => state.params.header);
|
|
39
|
-
const contentType = (0, _hooks.useTypedSelector)(state => state.contentType.value);
|
|
40
|
-
const body = (0, _hooks.useTypedSelector)(state => state.body);
|
|
41
|
-
const accept = (0, _hooks.useTypedSelector)(state => state.accept.value);
|
|
42
|
-
const server = (0, _hooks.useTypedSelector)(state => state.server.value);
|
|
43
|
-
const params = (0, _hooks.useTypedSelector)(state => state.params);
|
|
44
|
-
const auth = (0, _hooks.useTypedSelector)(state => state.auth);
|
|
45
|
-
const isValidRequest = validateRequest(params);
|
|
46
|
-
const dispatch = (0, _hooks.useTypedDispatch)();
|
|
47
|
-
const postmanRequest = (0, _buildPostmanRequest.default)(postman, {
|
|
48
|
-
queryParams,
|
|
49
|
-
pathParams,
|
|
50
|
-
cookieParams,
|
|
51
|
-
contentType,
|
|
52
|
-
accept,
|
|
53
|
-
headerParams,
|
|
54
|
-
body,
|
|
55
|
-
server,
|
|
56
|
-
auth
|
|
57
|
-
});
|
|
58
|
-
const delay = ms => new Promise(resolve => setTimeout(resolve, ms));
|
|
59
|
-
function openModal() {
|
|
60
|
-
setIsOpen(true);
|
|
61
|
-
}
|
|
62
|
-
function closeModal() {
|
|
63
|
-
setIsOpen(false);
|
|
64
|
-
}
|
|
65
|
-
function acceptAgreement() {
|
|
66
|
-
setIsOpen(false);
|
|
67
|
-
setAgreementAccepted(true);
|
|
68
|
-
sessionStorage.setItem("agreement-ack", "true");
|
|
69
|
-
}
|
|
70
|
-
const [modalIsOpen, setIsOpen] = _react.default.useState(false);
|
|
71
|
-
// Set the following as default value to persist to session and enable modal
|
|
72
|
-
// sessionStorage.getItem("agreement-ack") === "true"
|
|
73
|
-
const [agreementAccepted, setAgreementAccepted] = _react.default.useState(true);
|
|
74
|
-
const customStyles = {
|
|
75
|
-
overlay: {
|
|
76
|
-
backdropFilter: "blur(10px)",
|
|
77
|
-
backgroundColor: "transparent"
|
|
78
|
-
},
|
|
79
|
-
content: {
|
|
80
|
-
top: "50%",
|
|
81
|
-
left: "50%",
|
|
82
|
-
right: "auto",
|
|
83
|
-
bottom: "auto",
|
|
84
|
-
marginRight: "-50%",
|
|
85
|
-
border: "none",
|
|
86
|
-
padding: "none",
|
|
87
|
-
borderRadius: "var(--openapi-card-border-radius)",
|
|
88
|
-
background: "var(--ifm-card-background-color)",
|
|
89
|
-
transform: "translate(-50%, -50%)",
|
|
90
|
-
maxWidth: "550px"
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
if (agreementAccepted) {
|
|
94
|
-
return <button className="button button--sm button--secondary" disabled={!isValidRequest} style={!isValidRequest ? {
|
|
95
|
-
pointerEvents: "all"
|
|
96
|
-
} : {}} onClick={async () => {
|
|
97
|
-
dispatch((0, _slice.setResponse)("Fetching..."));
|
|
98
|
-
try {
|
|
99
|
-
await delay(1200);
|
|
100
|
-
const res = await (0, _makeRequest.default)(postmanRequest, proxy, body);
|
|
101
|
-
dispatch((0, _slice.setResponse)(res));
|
|
102
|
-
} catch (e) {
|
|
103
|
-
console.log(e);
|
|
104
|
-
dispatch((0, _slice.setResponse)("Connection failed"));
|
|
105
|
-
}
|
|
106
|
-
}}>
|
|
107
|
-
Send API Request
|
|
108
|
-
</button>;
|
|
109
|
-
} else {
|
|
110
|
-
return <_react.default.Fragment>
|
|
111
|
-
<button className="button button--sm button--secondary" onClick={openModal}>
|
|
112
|
-
Send API Request
|
|
113
|
-
</button>
|
|
114
|
-
<_reactModal.default isOpen={modalIsOpen} onRequestClose={closeModal} style={customStyles} contentLabel="Terms of Use">
|
|
115
|
-
<form>
|
|
116
|
-
<div className="card">
|
|
117
|
-
<div className="card__header">
|
|
118
|
-
<h2>Terms of Use</h2>
|
|
119
|
-
<hr></hr>
|
|
120
|
-
</div>
|
|
121
|
-
<div className="card__body">
|
|
122
|
-
<p>
|
|
123
|
-
By accepting this agreement the end user acknowledges the
|
|
124
|
-
risks of performing authenticated and non-authenticated API
|
|
125
|
-
requests from the browser.
|
|
126
|
-
</p>
|
|
127
|
-
<p>
|
|
128
|
-
The end user also accepts the responsibility of safeguarding
|
|
129
|
-
API credentials and any potentially sensitive data returned by
|
|
130
|
-
the API.
|
|
131
|
-
</p>
|
|
132
|
-
<br></br>
|
|
133
|
-
</div>
|
|
134
|
-
<div className="card__footer">
|
|
135
|
-
<div className="button-group button-group--block">
|
|
136
|
-
<button className="button button--sm button--outline button--success" onClick={acceptAgreement}>
|
|
137
|
-
AGREE
|
|
138
|
-
</button>
|
|
139
|
-
<button className="button button--sm button--outline button--danger" onClick={closeModal}>
|
|
140
|
-
DISAGREE
|
|
141
|
-
</button>
|
|
142
|
-
</div>
|
|
143
|
-
</div>
|
|
144
|
-
</div>
|
|
145
|
-
</form>
|
|
146
|
-
</_reactModal.default>
|
|
147
|
-
</_react.default.Fragment>;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
var _default = Execute;
|
|
151
|
-
exports.default = _default;
|
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
/* ============================================================================
|
|
8
|
-
* Copyright (c) Palo Alto Networks
|
|
9
|
-
*
|
|
10
|
-
* This source code is licensed under the MIT license found in the
|
|
11
|
-
* LICENSE file in the root directory of this source tree.
|
|
12
|
-
* ========================================================================== */
|
|
13
|
-
|
|
14
|
-
function fetchWithtimeout(url, options, timeout = 5000) {
|
|
15
|
-
return Promise.race([fetch(url, options), new Promise((_, reject) => setTimeout(() => reject(new Error("Request timed out")), timeout))]);
|
|
16
|
-
}
|
|
17
|
-
async function loadImage(content) {
|
|
18
|
-
return new Promise((accept, reject) => {
|
|
19
|
-
const reader = new FileReader();
|
|
20
|
-
reader.onabort = () => {
|
|
21
|
-
console.log("file reading was aborted");
|
|
22
|
-
reject();
|
|
23
|
-
};
|
|
24
|
-
reader.onerror = () => {
|
|
25
|
-
console.log("file reading has failed");
|
|
26
|
-
reject();
|
|
27
|
-
};
|
|
28
|
-
reader.onload = () => {
|
|
29
|
-
// Do whatever you want with the file contents
|
|
30
|
-
const binaryStr = reader.result;
|
|
31
|
-
accept(binaryStr);
|
|
32
|
-
};
|
|
33
|
-
reader.readAsArrayBuffer(content);
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
async function makeRequest(request, proxy, _body) {
|
|
37
|
-
var _request$body;
|
|
38
|
-
const headers = request.toJSON().header;
|
|
39
|
-
let myHeaders = new Headers();
|
|
40
|
-
if (headers) {
|
|
41
|
-
headers.forEach(header => {
|
|
42
|
-
if (header.key && header.value) {
|
|
43
|
-
myHeaders.append(header.key, header.value);
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// The following code handles multiple files in the same formdata param.
|
|
49
|
-
// It removes the form data params where the src property is an array of filepath strings
|
|
50
|
-
// Splits that array into different form data params with src set as a single filepath string
|
|
51
|
-
// TODO:
|
|
52
|
-
// if (request.body && request.body.mode === 'formdata') {
|
|
53
|
-
// let formdata = request.body.formdata,
|
|
54
|
-
// formdataArray = [];
|
|
55
|
-
// formdata.members.forEach((param) => {
|
|
56
|
-
// let key = param.key,
|
|
57
|
-
// type = param.type,
|
|
58
|
-
// disabled = param.disabled,
|
|
59
|
-
// contentType = param.contentType;
|
|
60
|
-
// // check if type is file or text
|
|
61
|
-
// if (type === 'file') {
|
|
62
|
-
// // if src is not of type string we check for array(multiple files)
|
|
63
|
-
// if (typeof param.src !== 'string') {
|
|
64
|
-
// // if src is an array(not empty), iterate over it and add files as separate form fields
|
|
65
|
-
// if (Array.isArray(param.src) && param.src.length) {
|
|
66
|
-
// param.src.forEach((filePath) => {
|
|
67
|
-
// addFormParam(
|
|
68
|
-
// formdataArray,
|
|
69
|
-
// key,
|
|
70
|
-
// param.type,
|
|
71
|
-
// filePath,
|
|
72
|
-
// disabled,
|
|
73
|
-
// contentType
|
|
74
|
-
// );
|
|
75
|
-
// });
|
|
76
|
-
// }
|
|
77
|
-
// // if src is not an array or string, or is an empty array, add a placeholder for file path(no files case)
|
|
78
|
-
// else {
|
|
79
|
-
// addFormParam(
|
|
80
|
-
// formdataArray,
|
|
81
|
-
// key,
|
|
82
|
-
// param.type,
|
|
83
|
-
// '/path/to/file',
|
|
84
|
-
// disabled,
|
|
85
|
-
// contentType
|
|
86
|
-
// );
|
|
87
|
-
// }
|
|
88
|
-
// }
|
|
89
|
-
// // if src is string, directly add the param with src as filepath
|
|
90
|
-
// else {
|
|
91
|
-
// addFormParam(
|
|
92
|
-
// formdataArray,
|
|
93
|
-
// key,
|
|
94
|
-
// param.type,
|
|
95
|
-
// param.src,
|
|
96
|
-
// disabled,
|
|
97
|
-
// contentType
|
|
98
|
-
// );
|
|
99
|
-
// }
|
|
100
|
-
// }
|
|
101
|
-
// // if type is text, directly add it to formdata array
|
|
102
|
-
// else {
|
|
103
|
-
// addFormParam(
|
|
104
|
-
// formdataArray,
|
|
105
|
-
// key,
|
|
106
|
-
// param.type,
|
|
107
|
-
// param.value,
|
|
108
|
-
// disabled,
|
|
109
|
-
// contentType
|
|
110
|
-
// );
|
|
111
|
-
// }
|
|
112
|
-
// });
|
|
113
|
-
// request.body.update({
|
|
114
|
-
// mode: 'formdata',
|
|
115
|
-
// formdata: formdataArray,
|
|
116
|
-
// });
|
|
117
|
-
// }
|
|
118
|
-
|
|
119
|
-
const body = (_request$body = request.body) === null || _request$body === void 0 ? void 0 : _request$body.toJSON();
|
|
120
|
-
let myBody = undefined;
|
|
121
|
-
if (body !== undefined && Object.keys(body).length > 0) {
|
|
122
|
-
switch (body.mode) {
|
|
123
|
-
case "urlencoded":
|
|
124
|
-
{
|
|
125
|
-
myBody = new URLSearchParams();
|
|
126
|
-
if (Array.isArray(body.urlencoded)) {
|
|
127
|
-
for (const data of body.urlencoded) {
|
|
128
|
-
if (data.key && data.value) {
|
|
129
|
-
myBody.append(data.key, data.value);
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
break;
|
|
134
|
-
}
|
|
135
|
-
case "raw":
|
|
136
|
-
{
|
|
137
|
-
var _body$raw;
|
|
138
|
-
myBody = ((_body$raw = body.raw) !== null && _body$raw !== void 0 ? _body$raw : "").toString();
|
|
139
|
-
break;
|
|
140
|
-
}
|
|
141
|
-
case "formdata":
|
|
142
|
-
{
|
|
143
|
-
myBody = new FormData();
|
|
144
|
-
if (Array.isArray(body.formdata)) {
|
|
145
|
-
for (const data of body.formdata) {
|
|
146
|
-
if (data.key && data.value) {
|
|
147
|
-
myBody.append(data.key, data.value);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
break;
|
|
152
|
-
}
|
|
153
|
-
case "file":
|
|
154
|
-
{
|
|
155
|
-
var _body$content;
|
|
156
|
-
if (_body.type === "raw" && ((_body$content = _body.content) === null || _body$content === void 0 ? void 0 : _body$content.type) === "file") {
|
|
157
|
-
myBody = await loadImage(_body.content.value.content);
|
|
158
|
-
}
|
|
159
|
-
break;
|
|
160
|
-
}
|
|
161
|
-
default:
|
|
162
|
-
break;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
const requestOptions = {
|
|
166
|
-
method: request.method,
|
|
167
|
-
headers: myHeaders,
|
|
168
|
-
body: myBody
|
|
169
|
-
};
|
|
170
|
-
let finalUrl = request.url.toString();
|
|
171
|
-
if (proxy) {
|
|
172
|
-
// Ensure the proxy ends with a slash.
|
|
173
|
-
let normalizedProxy = proxy.replace(/\/$/, "") + "/";
|
|
174
|
-
finalUrl = normalizedProxy + request.url.toString();
|
|
175
|
-
}
|
|
176
|
-
return await fetchWithtimeout(finalUrl, requestOptions).then(response => {
|
|
177
|
-
return response.text();
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
var _default = makeRequest;
|
|
181
|
-
exports.default = _default;
|