docusaurus-theme-openapi-docs 0.0.0-1000

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.
Files changed (312) hide show
  1. package/LICENSE +21 -0
  2. package/babel.config.js +35 -0
  3. package/lib/index.d.ts +2 -0
  4. package/lib/index.js +81 -0
  5. package/lib/markdown/createDescription.d.ts +1 -0
  6. package/lib/markdown/createDescription.js +15 -0
  7. package/lib/markdown/schema.d.ts +3 -0
  8. package/lib/markdown/schema.js +149 -0
  9. package/lib/markdown/utils.d.ts +10 -0
  10. package/lib/markdown/utils.js +49 -0
  11. package/lib/markdown/utils.test.d.ts +1 -0
  12. package/lib/markdown/utils.test.js +43 -0
  13. package/lib/theme/ApiExplorer/Accept/index.d.ts +3 -0
  14. package/lib/theme/ApiExplorer/Accept/index.js +38 -0
  15. package/lib/theme/ApiExplorer/Accept/slice.d.ts +11 -0
  16. package/lib/theme/ApiExplorer/Accept/slice.js +22 -0
  17. package/lib/theme/ApiExplorer/ApiCodeBlock/Container/_Container.scss +7 -0
  18. package/lib/theme/ApiExplorer/ApiCodeBlock/Container/index.d.ts +4 -0
  19. package/lib/theme/ApiExplorer/ApiCodeBlock/Container/index.js +35 -0
  20. package/lib/theme/ApiExplorer/ApiCodeBlock/Content/Element.d.ts +3 -0
  21. package/lib/theme/ApiExplorer/ApiCodeBlock/Content/Element.js +41 -0
  22. package/lib/theme/ApiExplorer/ApiCodeBlock/Content/String.d.ts +3 -0
  23. package/lib/theme/ApiExplorer/ApiCodeBlock/Content/String.js +153 -0
  24. package/lib/theme/ApiExplorer/ApiCodeBlock/Content/_Content.scss +91 -0
  25. package/lib/theme/ApiExplorer/ApiCodeBlock/CopyButton/_CopyButton.scss +44 -0
  26. package/lib/theme/ApiExplorer/ApiCodeBlock/CopyButton/index.d.ts +3 -0
  27. package/lib/theme/ApiExplorer/ApiCodeBlock/CopyButton/index.js +147 -0
  28. package/lib/theme/ApiExplorer/ApiCodeBlock/ExitButton/_ExitButton.scss +16 -0
  29. package/lib/theme/ApiExplorer/ApiCodeBlock/ExitButton/index.d.ts +6 -0
  30. package/lib/theme/ApiExplorer/ApiCodeBlock/ExitButton/index.js +58 -0
  31. package/lib/theme/ApiExplorer/ApiCodeBlock/ExpandButton/_ExpandButton.scss +62 -0
  32. package/lib/theme/ApiExplorer/ApiCodeBlock/ExpandButton/index.d.ts +14 -0
  33. package/lib/theme/ApiExplorer/ApiCodeBlock/ExpandButton/index.js +248 -0
  34. package/lib/theme/ApiExplorer/ApiCodeBlock/Line/_Line.scss +34 -0
  35. package/lib/theme/ApiExplorer/ApiCodeBlock/Line/index.d.ts +3 -0
  36. package/lib/theme/ApiExplorer/ApiCodeBlock/Line/index.js +59 -0
  37. package/lib/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/_WordWrapButton.scss +10 -0
  38. package/lib/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/index.d.ts +7 -0
  39. package/lib/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/index.js +51 -0
  40. package/lib/theme/ApiExplorer/ApiCodeBlock/index.d.ts +3 -0
  41. package/lib/theme/ApiExplorer/ApiCodeBlock/index.js +110 -0
  42. package/lib/theme/ApiExplorer/Authorization/auth-types.d.ts +3 -0
  43. package/lib/theme/ApiExplorer/Authorization/auth-types.js +28 -0
  44. package/lib/theme/ApiExplorer/Authorization/index.d.ts +3 -0
  45. package/lib/theme/ApiExplorer/Authorization/index.js +160 -0
  46. package/lib/theme/ApiExplorer/Authorization/slice.d.ts +40 -0
  47. package/lib/theme/ApiExplorer/Authorization/slice.js +102 -0
  48. package/lib/theme/ApiExplorer/Body/index.d.ts +10 -0
  49. package/lib/theme/ApiExplorer/Body/index.js +381 -0
  50. package/lib/theme/ApiExplorer/Body/json2xml.js +43 -0
  51. package/lib/theme/ApiExplorer/Body/slice.d.ts +82 -0
  52. package/lib/theme/ApiExplorer/Body/slice.js +97 -0
  53. package/lib/theme/ApiExplorer/CodeSnippets/code-snippets-types.d.ts +21 -0
  54. package/lib/theme/ApiExplorer/CodeSnippets/code-snippets-types.js +8 -0
  55. package/lib/theme/ApiExplorer/CodeSnippets/index.d.ts +10 -0
  56. package/lib/theme/ApiExplorer/CodeSnippets/index.js +389 -0
  57. package/lib/theme/ApiExplorer/CodeSnippets/languages.d.ts +5 -0
  58. package/lib/theme/ApiExplorer/CodeSnippets/languages.js +95 -0
  59. package/lib/theme/ApiExplorer/CodeSnippets/languages.json +1290 -0
  60. package/lib/theme/ApiExplorer/CodeTabs/_CodeTabs.scss +501 -0
  61. package/lib/theme/ApiExplorer/CodeTabs/index.d.ts +15 -0
  62. package/lib/theme/ApiExplorer/CodeTabs/index.js +271 -0
  63. package/lib/theme/ApiExplorer/ContentType/index.d.ts +3 -0
  64. package/lib/theme/ApiExplorer/ContentType/index.js +40 -0
  65. package/lib/theme/ApiExplorer/ContentType/slice.d.ts +11 -0
  66. package/lib/theme/ApiExplorer/ContentType/slice.js +22 -0
  67. package/lib/theme/ApiExplorer/Export/index.d.ts +3 -0
  68. package/lib/theme/ApiExplorer/Export/index.js +57 -0
  69. package/lib/theme/ApiExplorer/FloatingButton/_FloatingButton.scss +27 -0
  70. package/lib/theme/ApiExplorer/FloatingButton/index.d.ts +8 -0
  71. package/lib/theme/ApiExplorer/FloatingButton/index.js +28 -0
  72. package/lib/theme/ApiExplorer/FormFileUpload/_FormFileUpload.scss +74 -0
  73. package/lib/theme/ApiExplorer/FormFileUpload/index.d.ts +7 -0
  74. package/lib/theme/ApiExplorer/FormFileUpload/index.js +173 -0
  75. package/lib/theme/ApiExplorer/FormItem/_FormItem.scss +21 -0
  76. package/lib/theme/ApiExplorer/FormItem/index.d.ts +10 -0
  77. package/lib/theme/ApiExplorer/FormItem/index.js +44 -0
  78. package/lib/theme/ApiExplorer/FormMultiSelect/_FormMultiSelect.scss +30 -0
  79. package/lib/theme/ApiExplorer/FormMultiSelect/index.d.ts +9 -0
  80. package/lib/theme/ApiExplorer/FormMultiSelect/index.js +51 -0
  81. package/lib/theme/ApiExplorer/FormSelect/_FormSelect.scss +43 -0
  82. package/lib/theme/ApiExplorer/FormSelect/index.d.ts +8 -0
  83. package/lib/theme/ApiExplorer/FormSelect/index.js +35 -0
  84. package/lib/theme/ApiExplorer/FormTextInput/_FormTextInput.scss +34 -0
  85. package/lib/theme/ApiExplorer/FormTextInput/index.d.ts +9 -0
  86. package/lib/theme/ApiExplorer/FormTextInput/index.js +73 -0
  87. package/lib/theme/ApiExplorer/LiveEditor/_LiveEditor.scss +15 -0
  88. package/lib/theme/ApiExplorer/LiveEditor/index.d.ts +6 -0
  89. package/lib/theme/ApiExplorer/LiveEditor/index.js +168 -0
  90. package/lib/theme/ApiExplorer/MethodEndpoint/_MethodEndpoint.scss +22 -0
  91. package/lib/theme/ApiExplorer/MethodEndpoint/index.d.ts +8 -0
  92. package/lib/theme/ApiExplorer/MethodEndpoint/index.js +86 -0
  93. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.d.ts +6 -0
  94. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.js +220 -0
  95. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.d.ts +6 -0
  96. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.js +63 -0
  97. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.d.ts +6 -0
  98. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.js +89 -0
  99. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.d.ts +6 -0
  100. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.js +63 -0
  101. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamTextFormItem.d.ts +6 -0
  102. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamTextFormItem.js +38 -0
  103. package/lib/theme/ApiExplorer/ParamOptions/_ParamOptions.scss +123 -0
  104. package/lib/theme/ApiExplorer/ParamOptions/index.d.ts +7 -0
  105. package/lib/theme/ApiExplorer/ParamOptions/index.js +223 -0
  106. package/lib/theme/ApiExplorer/ParamOptions/slice.d.ts +17 -0
  107. package/lib/theme/ApiExplorer/ParamOptions/slice.js +25 -0
  108. package/lib/theme/ApiExplorer/Request/_Request.scss +129 -0
  109. package/lib/theme/ApiExplorer/Request/index.d.ts +6 -0
  110. package/lib/theme/ApiExplorer/Request/index.js +396 -0
  111. package/lib/theme/ApiExplorer/Request/makeRequest.d.ts +4 -0
  112. package/lib/theme/ApiExplorer/Request/makeRequest.js +222 -0
  113. package/lib/theme/ApiExplorer/Response/_Response.scss +121 -0
  114. package/lib/theme/ApiExplorer/Response/index.d.ts +6 -0
  115. package/lib/theme/ApiExplorer/Response/index.js +193 -0
  116. package/lib/theme/ApiExplorer/Response/slice.d.ts +17 -0
  117. package/lib/theme/ApiExplorer/Response/slice.js +51 -0
  118. package/lib/theme/ApiExplorer/SecuritySchemes/index.d.ts +3 -0
  119. package/lib/theme/ApiExplorer/SecuritySchemes/index.js +380 -0
  120. package/lib/theme/ApiExplorer/Server/_Server.scss +26 -0
  121. package/lib/theme/ApiExplorer/Server/index.d.ts +3 -0
  122. package/lib/theme/ApiExplorer/Server/index.js +199 -0
  123. package/lib/theme/ApiExplorer/Server/slice.d.ts +13 -0
  124. package/lib/theme/ApiExplorer/Server/slice.js +33 -0
  125. package/lib/theme/ApiExplorer/buildPostmanRequest.d.ts +20 -0
  126. package/lib/theme/ApiExplorer/buildPostmanRequest.js +465 -0
  127. package/lib/theme/ApiExplorer/index.d.ts +7 -0
  128. package/lib/theme/ApiExplorer/index.js +41 -0
  129. package/lib/theme/ApiExplorer/persistanceMiddleware.d.ts +3 -0
  130. package/lib/theme/ApiExplorer/persistanceMiddleware.js +54 -0
  131. package/lib/theme/ApiExplorer/storage-utils.d.ts +4 -0
  132. package/lib/theme/ApiExplorer/storage-utils.js +41 -0
  133. package/lib/theme/ApiItem/Layout/index.d.ts +3 -0
  134. package/lib/theme/ApiItem/Layout/index.js +121 -0
  135. package/lib/theme/ApiItem/Layout/styles.module.css +17 -0
  136. package/lib/theme/ApiItem/hooks.d.ts +12 -0
  137. package/lib/theme/ApiItem/hooks.js +13 -0
  138. package/lib/theme/ApiItem/index.d.ts +2 -0
  139. package/lib/theme/ApiItem/index.js +238 -0
  140. package/lib/theme/ApiItem/store.d.ts +46 -0
  141. package/lib/theme/ApiItem/store.js +53 -0
  142. package/lib/theme/ApiLogo/index.d.ts +2 -0
  143. package/lib/theme/ApiLogo/index.js +51 -0
  144. package/lib/theme/ApiTabs/_ApiTabs.scss +142 -0
  145. package/lib/theme/ApiTabs/index.d.ts +7 -0
  146. package/lib/theme/ApiTabs/index.js +270 -0
  147. package/lib/theme/ArrayBrackets/index.d.ts +3 -0
  148. package/lib/theme/ArrayBrackets/index.js +50 -0
  149. package/lib/theme/DiscriminatorTabs/_DiscriminatorTabs.scss +98 -0
  150. package/lib/theme/DiscriminatorTabs/index.d.ts +3 -0
  151. package/lib/theme/DiscriminatorTabs/index.js +258 -0
  152. package/lib/theme/Markdown/Details/_Details.scss +122 -0
  153. package/lib/theme/Markdown/index.js +179 -0
  154. package/lib/theme/MimeTabs/_MimeTabs.scss +70 -0
  155. package/lib/theme/MimeTabs/index.d.ts +6 -0
  156. package/lib/theme/MimeTabs/index.js +286 -0
  157. package/lib/theme/OperationTabs/_OperationTabs.scss +72 -0
  158. package/lib/theme/OperationTabs/index.d.ts +3 -0
  159. package/lib/theme/OperationTabs/index.js +248 -0
  160. package/lib/theme/ParamsDetails/index.d.ts +6 -0
  161. package/lib/theme/ParamsDetails/index.js +85 -0
  162. package/lib/theme/ParamsItem/_ParamsItem.scss +54 -0
  163. package/lib/theme/ParamsItem/index.d.ts +25 -0
  164. package/lib/theme/ParamsItem/index.js +218 -0
  165. package/lib/theme/RequestSchema/index.d.ts +15 -0
  166. package/lib/theme/RequestSchema/index.js +194 -0
  167. package/lib/theme/ResponseExamples/index.d.ts +18 -0
  168. package/lib/theme/ResponseExamples/index.js +193 -0
  169. package/lib/theme/ResponseHeaders/index.d.ts +13 -0
  170. package/lib/theme/ResponseHeaders/index.js +39 -0
  171. package/lib/theme/ResponseSamples/_ResponseSamples.scss +3 -0
  172. package/lib/theme/ResponseSamples/index.d.ts +8 -0
  173. package/lib/theme/ResponseSamples/index.js +27 -0
  174. package/lib/theme/ResponseSchema/index.d.ts +15 -0
  175. package/lib/theme/ResponseSchema/index.js +159 -0
  176. package/lib/theme/Schema/index.d.ts +8 -0
  177. package/lib/theme/Schema/index.js +885 -0
  178. package/lib/theme/SchemaItem/_SchemaItem.scss +89 -0
  179. package/lib/theme/SchemaItem/index.d.ts +12 -0
  180. package/lib/theme/SchemaItem/index.js +213 -0
  181. package/lib/theme/SchemaTabs/_SchemaTabs.scss +61 -0
  182. package/lib/theme/SchemaTabs/index.d.ts +3 -0
  183. package/lib/theme/SchemaTabs/index.js +255 -0
  184. package/lib/theme/SkeletonLoader/index.d.ts +6 -0
  185. package/lib/theme/SkeletonLoader/index.js +20 -0
  186. package/lib/theme/StatusCodes/index.d.ts +9 -0
  187. package/lib/theme/StatusCodes/index.js +81 -0
  188. package/lib/theme/styles.scss +212 -0
  189. package/lib/types.d.ts +157 -0
  190. package/lib/types.js +8 -0
  191. package/package.json +83 -0
  192. package/src/index.ts +85 -0
  193. package/src/markdown/createDescription.ts +13 -0
  194. package/src/markdown/schema.ts +181 -0
  195. package/src/markdown/utils.test.ts +49 -0
  196. package/src/markdown/utils.ts +59 -0
  197. package/src/plugin-content-docs.d.ts +20 -0
  198. package/src/postman-code-generators.d.ts +9 -0
  199. package/src/react-magic-dropzone.d.ts +9 -0
  200. package/src/theme/ApiExplorer/Accept/index.tsx +36 -0
  201. package/src/theme/ApiExplorer/Accept/slice.ts +29 -0
  202. package/src/theme/ApiExplorer/ApiCodeBlock/Container/_Container.scss +7 -0
  203. package/src/theme/ApiExplorer/ApiCodeBlock/Container/index.tsx +32 -0
  204. package/src/theme/ApiExplorer/ApiCodeBlock/Content/Element.tsx +34 -0
  205. package/src/theme/ApiExplorer/ApiCodeBlock/Content/String.tsx +134 -0
  206. package/src/theme/ApiExplorer/ApiCodeBlock/Content/_Content.scss +91 -0
  207. package/src/theme/ApiExplorer/ApiCodeBlock/CopyButton/_CopyButton.scss +44 -0
  208. package/src/theme/ApiExplorer/ApiCodeBlock/CopyButton/index.tsx +79 -0
  209. package/src/theme/ApiExplorer/ApiCodeBlock/ExitButton/_ExitButton.scss +16 -0
  210. package/src/theme/ApiExplorer/ApiCodeBlock/ExitButton/index.tsx +55 -0
  211. package/src/theme/ApiExplorer/ApiCodeBlock/ExpandButton/_ExpandButton.scss +62 -0
  212. package/src/theme/ApiExplorer/ApiCodeBlock/ExpandButton/index.tsx +166 -0
  213. package/src/theme/ApiExplorer/ApiCodeBlock/Line/_Line.scss +34 -0
  214. package/src/theme/ApiExplorer/ApiCodeBlock/Line/index.tsx +48 -0
  215. package/src/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/_WordWrapButton.scss +10 -0
  216. package/src/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/index.tsx +54 -0
  217. package/src/theme/ApiExplorer/ApiCodeBlock/index.tsx +45 -0
  218. package/src/theme/ApiExplorer/Authorization/auth-types.ts +30 -0
  219. package/src/theme/ApiExplorer/Authorization/index.tsx +158 -0
  220. package/src/theme/ApiExplorer/Authorization/slice.ts +146 -0
  221. package/src/theme/ApiExplorer/Body/index.tsx +376 -0
  222. package/src/theme/ApiExplorer/Body/json2xml.js +43 -0
  223. package/src/theme/ApiExplorer/Body/slice.ts +133 -0
  224. package/src/theme/ApiExplorer/CodeSnippets/code-snippets-types.ts +57 -0
  225. package/src/theme/ApiExplorer/CodeSnippets/index.tsx +338 -0
  226. package/src/theme/ApiExplorer/CodeSnippets/languages.json +1290 -0
  227. package/src/theme/ApiExplorer/CodeSnippets/languages.ts +96 -0
  228. package/src/theme/ApiExplorer/CodeTabs/_CodeTabs.scss +501 -0
  229. package/src/theme/ApiExplorer/CodeTabs/index.tsx +248 -0
  230. package/src/theme/ApiExplorer/ContentType/index.tsx +38 -0
  231. package/src/theme/ApiExplorer/ContentType/slice.ts +29 -0
  232. package/src/theme/ApiExplorer/Export/index.tsx +47 -0
  233. package/src/theme/ApiExplorer/FloatingButton/_FloatingButton.scss +27 -0
  234. package/src/theme/ApiExplorer/FloatingButton/index.tsx +29 -0
  235. package/src/theme/ApiExplorer/FormFileUpload/_FormFileUpload.scss +74 -0
  236. package/src/theme/ApiExplorer/FormFileUpload/index.tsx +119 -0
  237. package/src/theme/ApiExplorer/FormItem/_FormItem.scss +21 -0
  238. package/src/theme/ApiExplorer/FormItem/index.tsx +33 -0
  239. package/src/theme/ApiExplorer/FormMultiSelect/_FormMultiSelect.scss +30 -0
  240. package/src/theme/ApiExplorer/FormMultiSelect/index.tsx +57 -0
  241. package/src/theme/ApiExplorer/FormSelect/_FormSelect.scss +43 -0
  242. package/src/theme/ApiExplorer/FormSelect/index.tsx +38 -0
  243. package/src/theme/ApiExplorer/FormTextInput/_FormTextInput.scss +34 -0
  244. package/src/theme/ApiExplorer/FormTextInput/index.tsx +80 -0
  245. package/src/theme/ApiExplorer/LiveEditor/_LiveEditor.scss +15 -0
  246. package/src/theme/ApiExplorer/LiveEditor/index.tsx +114 -0
  247. package/src/theme/ApiExplorer/MethodEndpoint/_MethodEndpoint.scss +22 -0
  248. package/src/theme/ApiExplorer/MethodEndpoint/index.tsx +91 -0
  249. package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.tsx +175 -0
  250. package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.tsx +64 -0
  251. package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.tsx +86 -0
  252. package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.tsx +65 -0
  253. package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamTextFormItem.tsx +38 -0
  254. package/src/theme/ApiExplorer/ParamOptions/_ParamOptions.scss +123 -0
  255. package/src/theme/ApiExplorer/ParamOptions/index.tsx +146 -0
  256. package/src/theme/ApiExplorer/ParamOptions/slice.ts +37 -0
  257. package/src/theme/ApiExplorer/Request/_Request.scss +129 -0
  258. package/src/theme/ApiExplorer/Request/index.tsx +309 -0
  259. package/src/theme/ApiExplorer/Request/makeRequest.ts +254 -0
  260. package/src/theme/ApiExplorer/Response/_Response.scss +121 -0
  261. package/src/theme/ApiExplorer/Response/index.tsx +157 -0
  262. package/src/theme/ApiExplorer/Response/slice.ts +52 -0
  263. package/src/theme/ApiExplorer/SecuritySchemes/index.tsx +287 -0
  264. package/src/theme/ApiExplorer/Server/_Server.scss +26 -0
  265. package/src/theme/ApiExplorer/Server/index.tsx +130 -0
  266. package/src/theme/ApiExplorer/Server/slice.ts +39 -0
  267. package/src/theme/ApiExplorer/buildPostmanRequest.ts +526 -0
  268. package/src/theme/ApiExplorer/index.tsx +41 -0
  269. package/src/theme/ApiExplorer/persistanceMiddleware.ts +71 -0
  270. package/src/theme/ApiExplorer/postman-collection.d.ts +10 -0
  271. package/src/theme/ApiExplorer/react-modal.d.ts +8 -0
  272. package/src/theme/ApiExplorer/storage-utils.ts +39 -0
  273. package/src/theme/ApiItem/Layout/index.tsx +85 -0
  274. package/src/theme/ApiItem/Layout/styles.module.css +17 -0
  275. package/src/theme/ApiItem/hooks.ts +13 -0
  276. package/src/theme/ApiItem/index.tsx +222 -0
  277. package/src/theme/ApiItem/store.ts +51 -0
  278. package/src/theme/ApiLogo/index.tsx +52 -0
  279. package/src/theme/ApiTabs/_ApiTabs.scss +142 -0
  280. package/src/theme/ApiTabs/index.tsx +238 -0
  281. package/src/theme/ArrayBrackets/index.tsx +37 -0
  282. package/src/theme/DiscriminatorTabs/_DiscriminatorTabs.scss +98 -0
  283. package/src/theme/DiscriminatorTabs/index.tsx +229 -0
  284. package/src/theme/Markdown/Details/_Details.scss +122 -0
  285. package/src/theme/Markdown/index.js +179 -0
  286. package/src/theme/MimeTabs/_MimeTabs.scss +70 -0
  287. package/src/theme/MimeTabs/index.tsx +257 -0
  288. package/src/theme/OperationTabs/_OperationTabs.scss +72 -0
  289. package/src/theme/OperationTabs/index.tsx +220 -0
  290. package/src/theme/ParamsDetails/index.tsx +81 -0
  291. package/src/theme/ParamsItem/_ParamsItem.scss +54 -0
  292. package/src/theme/ParamsItem/index.tsx +205 -0
  293. package/src/theme/RequestSchema/index.tsx +157 -0
  294. package/src/theme/ResponseExamples/index.tsx +192 -0
  295. package/src/theme/ResponseHeaders/index.tsx +49 -0
  296. package/src/theme/ResponseSamples/_ResponseSamples.scss +3 -0
  297. package/src/theme/ResponseSamples/index.tsx +31 -0
  298. package/src/theme/ResponseSchema/index.tsx +144 -0
  299. package/src/theme/Schema/index.tsx +939 -0
  300. package/src/theme/SchemaItem/_SchemaItem.scss +89 -0
  301. package/src/theme/SchemaItem/index.tsx +198 -0
  302. package/src/theme/SchemaTabs/_SchemaTabs.scss +61 -0
  303. package/src/theme/SchemaTabs/index.tsx +224 -0
  304. package/src/theme/SkeletonLoader/index.tsx +18 -0
  305. package/src/theme/StatusCodes/index.tsx +72 -0
  306. package/src/theme/styles.scss +212 -0
  307. package/src/theme-classic.d.ts +80 -0
  308. package/src/theme-openapi.d.ts +288 -0
  309. package/src/theme-translations.d.ts +9 -0
  310. package/src/types.ts +182 -0
  311. package/tsconfig.json +16 -0
  312. package/tsconfig.tsbuildinfo +1 -0
@@ -0,0 +1,465 @@
1
+ "use strict";
2
+ /* ============================================================================
3
+ * Copyright (c) Palo Alto Networks
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ * ========================================================================== */
8
+ var __importDefault =
9
+ (this && this.__importDefault) ||
10
+ function (mod) {
11
+ return mod && mod.__esModule ? mod : { default: mod };
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ const cloneDeep_1 = __importDefault(require("lodash/cloneDeep"));
15
+ const postman_collection_1 = __importDefault(require("postman-collection"));
16
+ function setQueryParams(postman, queryParams) {
17
+ postman.url.query.clear();
18
+ const qp = queryParams
19
+ .map((param) => {
20
+ if (!param.value) {
21
+ return undefined;
22
+ }
23
+ // Handle array values
24
+ if (Array.isArray(param.value)) {
25
+ if (param.style === "spaceDelimited") {
26
+ return new postman_collection_1.default.QueryParam({
27
+ key: param.name,
28
+ value: param.value.join(" "),
29
+ });
30
+ } else if (param.style === "pipeDelimited") {
31
+ return new postman_collection_1.default.QueryParam({
32
+ key: param.name,
33
+ value: param.value.join("|"),
34
+ });
35
+ } else if (param.explode) {
36
+ return param.value.map(
37
+ (val) =>
38
+ new postman_collection_1.default.QueryParam({
39
+ key: param.name,
40
+ value: val,
41
+ })
42
+ );
43
+ } else {
44
+ return new postman_collection_1.default.QueryParam({
45
+ key: param.name,
46
+ value: param.value.join(","),
47
+ });
48
+ }
49
+ }
50
+ const decodedValue = decodeURI(param.value);
51
+ const tryJson = () => {
52
+ try {
53
+ return JSON.parse(decodedValue);
54
+ } catch (e) {
55
+ return false;
56
+ }
57
+ };
58
+ const jsonResult = tryJson();
59
+ // Handle object values
60
+ if (jsonResult && typeof jsonResult === "object") {
61
+ if (param.style === "deepObject") {
62
+ return Object.entries(jsonResult).map(
63
+ ([key, val]) =>
64
+ new postman_collection_1.default.QueryParam({
65
+ key: `${param.name}[${key}]`,
66
+ value: val,
67
+ })
68
+ );
69
+ } else if (param.explode) {
70
+ return Object.entries(jsonResult).map(
71
+ ([key, val]) =>
72
+ new postman_collection_1.default.QueryParam({
73
+ key: key,
74
+ value: val,
75
+ })
76
+ );
77
+ } else {
78
+ return new postman_collection_1.default.QueryParam({
79
+ key: param.name,
80
+ value: Object.entries(jsonResult)
81
+ .map(([key, val]) => `${key},${val}`)
82
+ .join(","),
83
+ });
84
+ }
85
+ }
86
+ // Handle boolean values
87
+ if (typeof decodedValue === "boolean") {
88
+ return new postman_collection_1.default.QueryParam({
89
+ key: param.name,
90
+ value: decodedValue ? "true" : "false",
91
+ });
92
+ }
93
+ // Parameter allows empty value: "/hello?extended"
94
+ if (param.allowEmptyValue) {
95
+ if (decodedValue === "true") {
96
+ return new postman_collection_1.default.QueryParam({
97
+ key: param.name,
98
+ value: null,
99
+ });
100
+ }
101
+ return undefined;
102
+ }
103
+ return new postman_collection_1.default.QueryParam({
104
+ key: param.name,
105
+ value: param.value,
106
+ });
107
+ })
108
+ .flat() // Flatten the array in case of nested arrays from map
109
+ .filter((item) => item !== undefined);
110
+ if (qp.length > 0) {
111
+ postman.addQueryParams(qp);
112
+ }
113
+ }
114
+ function setPathParams(postman, pathParams) {
115
+ // Map through the path parameters
116
+ const source = pathParams.map((param) => {
117
+ if (!param.value) {
118
+ return undefined;
119
+ }
120
+ let serializedValue;
121
+ // Handle different styles
122
+ if (Array.isArray(param.value)) {
123
+ if (param.style === "label") {
124
+ serializedValue = `.${param.value.join(".")}`;
125
+ } else if (param.style === "matrix") {
126
+ serializedValue = `;${param.name}=${param.value.join(";")}`;
127
+ } else {
128
+ serializedValue = param.value.join(",");
129
+ }
130
+ return new postman_collection_1.default.Variable({
131
+ key: param.name,
132
+ value: serializedValue,
133
+ });
134
+ }
135
+ const decodedValue = decodeURI(param.value);
136
+ const tryJson = () => {
137
+ try {
138
+ return JSON.parse(decodedValue);
139
+ } catch (e) {
140
+ return false;
141
+ }
142
+ };
143
+ const jsonResult = tryJson();
144
+ if (typeof jsonResult === "object") {
145
+ if (param.style === "matrix") {
146
+ serializedValue = Object.entries(jsonResult)
147
+ .map(([key, val]) => `;${key}=${val}`)
148
+ .join("");
149
+ } else {
150
+ serializedValue = Object.entries(jsonResult)
151
+ .map(([key, val]) => `${key}=${val}`)
152
+ .join(",");
153
+ }
154
+ } else {
155
+ serializedValue = decodedValue || `:${param.name}`;
156
+ }
157
+ return new postman_collection_1.default.Variable({
158
+ key: param.name,
159
+ value: serializedValue,
160
+ });
161
+ });
162
+ postman.url.variables.assimilate(source, false);
163
+ }
164
+ function buildCookie(cookieParams) {
165
+ const cookies = cookieParams
166
+ .map((param) => {
167
+ if (param.value) {
168
+ const decodedValue = decodeURI(param.value);
169
+ const tryJson = () => {
170
+ try {
171
+ return JSON.parse(decodedValue);
172
+ } catch (e) {
173
+ return false;
174
+ }
175
+ };
176
+ const jsonResult = tryJson();
177
+ if (typeof jsonResult === "object") {
178
+ if (param.style === "form") {
179
+ // Handle form style
180
+ if (param.explode) {
181
+ // Serialize each key-value pair as a separate cookie
182
+ return Object.entries(jsonResult).map(
183
+ ([key, val]) =>
184
+ new postman_collection_1.default.Cookie({
185
+ key: key,
186
+ value: val,
187
+ })
188
+ );
189
+ } else {
190
+ // Serialize the object as a single cookie with key-value pairs joined by commas
191
+ return new postman_collection_1.default.Cookie({
192
+ key: param.name,
193
+ value: Object.entries(jsonResult)
194
+ .map(([key, val]) => `${key},${val}`)
195
+ .join(","),
196
+ });
197
+ }
198
+ }
199
+ } else {
200
+ // Handle scalar values
201
+ return new postman_collection_1.default.Cookie({
202
+ key: param.name,
203
+ value: param.value,
204
+ });
205
+ }
206
+ }
207
+ return undefined;
208
+ })
209
+ .flat() // Flatten the array in case of nested arrays from map
210
+ .filter((item) => item !== undefined);
211
+ const list = new postman_collection_1.default.CookieList(null, cookies);
212
+ return list.toString();
213
+ }
214
+ function setHeaders(postman, contentType, accept, cookie, headerParams, other) {
215
+ postman.headers.clear();
216
+ if (contentType) {
217
+ postman.addHeader({ key: "Content-Type", value: contentType });
218
+ }
219
+ if (accept) {
220
+ postman.addHeader({ key: "Accept", value: accept });
221
+ }
222
+ headerParams.forEach((param) => {
223
+ if (param.value) {
224
+ const decodedValue = decodeURI(param.value);
225
+ const tryJson = () => {
226
+ try {
227
+ return JSON.parse(decodedValue);
228
+ } catch (e) {
229
+ return false;
230
+ }
231
+ };
232
+ const jsonResult = tryJson();
233
+ if (Array.isArray(param.value)) {
234
+ if (param.style === "simple") {
235
+ if (param.explode) {
236
+ // Each item in the array is a separate header
237
+ jsonResult.forEach((val) => {
238
+ postman.addHeader({ key: param.name, value: val });
239
+ });
240
+ } else {
241
+ // Array values are joined by commas
242
+ postman.addHeader({
243
+ key: param.name,
244
+ value: param.value.join(","),
245
+ });
246
+ }
247
+ }
248
+ } else if (typeof jsonResult === "object") {
249
+ if (param.style === "simple") {
250
+ if (param.explode) {
251
+ // Each key-value pair in the object is a separate header
252
+ Object.entries(jsonResult).forEach(([key, val]) => {
253
+ postman.addHeader({ key: param.name, value: `${key}=${val}` });
254
+ });
255
+ } else {
256
+ // Object is serialized as a single header with key-value pairs joined by commas
257
+ postman.addHeader({
258
+ key: param.name,
259
+ value: Object.entries(jsonResult)
260
+ .map(([key, val]) => `${key},${val}`)
261
+ .join(","),
262
+ });
263
+ }
264
+ }
265
+ } else {
266
+ // Handle scalar values
267
+ postman.addHeader({ key: param.name, value: param.value });
268
+ }
269
+ }
270
+ });
271
+ other.forEach((header) => {
272
+ postman.addHeader(header);
273
+ });
274
+ if (cookie) {
275
+ postman.addHeader({ key: "Cookie", value: cookie });
276
+ }
277
+ }
278
+ // TODO: this is all a bit hacky
279
+ function setBody(clonedPostman, body) {
280
+ if (clonedPostman.body === undefined) {
281
+ return;
282
+ }
283
+ if (body.type === "empty") {
284
+ clonedPostman.body = undefined;
285
+ return;
286
+ }
287
+ if (body.type === "raw" && body.content?.type === "file") {
288
+ // treat it like file.
289
+ clonedPostman.body.mode = "file";
290
+ clonedPostman.body.file = { src: body.content.value.src };
291
+ return;
292
+ }
293
+ switch (clonedPostman.body.mode) {
294
+ case "raw": {
295
+ // check file even though it should already be set from above
296
+ if (body.type !== "raw" || body.content?.type === "file") {
297
+ clonedPostman.body = undefined;
298
+ return;
299
+ }
300
+ clonedPostman.body.raw = body.content?.value ?? "";
301
+ return;
302
+ }
303
+ case "formdata": {
304
+ clonedPostman.body.formdata?.clear();
305
+ if (body.type !== "form") {
306
+ // treat it like raw.
307
+ clonedPostman.body.mode = "raw";
308
+ clonedPostman.body.raw = `${body.content?.value}`;
309
+ return;
310
+ }
311
+ const params = Object.entries(body.content)
312
+ .filter((entry) => !!entry[1])
313
+ .map(([key, content]) => {
314
+ if (content.type === "file") {
315
+ return new postman_collection_1.default.FormParam({
316
+ key: key,
317
+ ...content,
318
+ });
319
+ }
320
+ return new postman_collection_1.default.FormParam({
321
+ key: key,
322
+ value: content.value,
323
+ });
324
+ });
325
+ clonedPostman.body.formdata?.assimilate(params, false);
326
+ return;
327
+ }
328
+ case "urlencoded": {
329
+ clonedPostman.body.urlencoded?.clear();
330
+ if (body.type !== "form") {
331
+ // treat it like raw.
332
+ clonedPostman.body.mode = "raw";
333
+ clonedPostman.body.raw = `${body.content?.value}`;
334
+ return;
335
+ }
336
+ const params = Object.entries(body.content)
337
+ .filter((entry) => !!entry[1])
338
+ .map(([key, content]) => {
339
+ if (content.type !== "file" && content.value) {
340
+ return new postman_collection_1.default.QueryParam({
341
+ key: key,
342
+ value: content.value,
343
+ });
344
+ }
345
+ return undefined;
346
+ })
347
+ .filter((item) => item !== undefined);
348
+ clonedPostman.body.urlencoded?.assimilate(params, false);
349
+ return;
350
+ }
351
+ default:
352
+ return;
353
+ }
354
+ }
355
+ function buildPostmanRequest(
356
+ postman,
357
+ {
358
+ queryParams,
359
+ pathParams,
360
+ cookieParams,
361
+ contentType,
362
+ accept,
363
+ headerParams,
364
+ body,
365
+ server,
366
+ auth,
367
+ }
368
+ ) {
369
+ const clonedPostman = (0, cloneDeep_1.default)(postman);
370
+ clonedPostman.url.protocol = undefined;
371
+ clonedPostman.url.host = [window.location.origin];
372
+ if (server) {
373
+ let url = server.url.replace(/\/$/, "");
374
+ const variables = server.variables;
375
+ if (variables) {
376
+ Object.keys(variables).forEach((variable) => {
377
+ url = url.replace(`{${variable}}`, variables[variable].default);
378
+ });
379
+ }
380
+ clonedPostman.url.host = [url];
381
+ }
382
+ setQueryParams(clonedPostman, queryParams);
383
+ setPathParams(clonedPostman, pathParams);
384
+ const cookie = buildCookie(cookieParams);
385
+ let otherHeaders = [];
386
+ let selectedAuth = [];
387
+ if (auth.selected !== undefined) {
388
+ selectedAuth = auth.options[auth.selected];
389
+ }
390
+ for (const a of selectedAuth) {
391
+ // Bearer Auth
392
+ if (a.type === "http" && a.scheme === "bearer") {
393
+ const { token } = auth.data[a.key];
394
+ if (token === undefined) {
395
+ otherHeaders.push({
396
+ key: "Authorization",
397
+ value: "Bearer <TOKEN>",
398
+ });
399
+ continue;
400
+ }
401
+ otherHeaders.push({
402
+ key: "Authorization",
403
+ value: `Bearer ${token}`,
404
+ });
405
+ continue;
406
+ }
407
+ if (a.type === "oauth2") {
408
+ let token;
409
+ if (auth.data[a.key]) {
410
+ token = auth.data[a.key].token;
411
+ }
412
+ if (token === undefined) {
413
+ otherHeaders.push({
414
+ key: "Authorization",
415
+ value: "Bearer <TOKEN>",
416
+ });
417
+ continue;
418
+ }
419
+ otherHeaders.push({
420
+ key: "Authorization",
421
+ value: `Bearer ${token}`,
422
+ });
423
+ continue;
424
+ }
425
+ // Basic Auth
426
+ if (a.type === "http" && a.scheme === "basic") {
427
+ const { username, password } = auth.data[a.key];
428
+ if (username === undefined || password === undefined) {
429
+ continue;
430
+ }
431
+ otherHeaders.push({
432
+ key: "Authorization",
433
+ value: `Basic ${window.btoa(`${username}:${password}`)}`,
434
+ });
435
+ continue;
436
+ }
437
+ // API Key
438
+ if (a.type === "apiKey" && a.in === "header") {
439
+ const { apiKey } = auth.data[a.key];
440
+ if (apiKey === undefined) {
441
+ otherHeaders.push({
442
+ key: a.name,
443
+ value: `<${a.name ?? a.type}>`,
444
+ });
445
+ continue;
446
+ }
447
+ otherHeaders.push({
448
+ key: a.name,
449
+ value: apiKey,
450
+ });
451
+ continue;
452
+ }
453
+ }
454
+ setHeaders(
455
+ clonedPostman,
456
+ contentType,
457
+ accept,
458
+ cookie,
459
+ headerParams,
460
+ otherHeaders
461
+ );
462
+ setBody(clonedPostman, body);
463
+ return clonedPostman;
464
+ }
465
+ exports.default = buildPostmanRequest;
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ import { ApiItem } from "docusaurus-plugin-openapi-docs/src/types";
3
+ declare function ApiExplorer({ item, infoPath, }: {
4
+ item: NonNullable<ApiItem>;
5
+ infoPath: string;
6
+ }): React.JSX.Element;
7
+ export default ApiExplorer;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ /* ============================================================================
3
+ * Copyright (c) Palo Alto Networks
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ * ========================================================================== */
8
+ var __importDefault =
9
+ (this && this.__importDefault) ||
10
+ function (mod) {
11
+ return mod && mod.__esModule ? mod : { default: mod };
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ const react_1 = __importDefault(require("react"));
15
+ const CodeSnippets_1 = __importDefault(
16
+ require("@theme/ApiExplorer/CodeSnippets")
17
+ );
18
+ const Request_1 = __importDefault(require("@theme/ApiExplorer/Request"));
19
+ const Response_1 = __importDefault(require("@theme/ApiExplorer/Response"));
20
+ const SecuritySchemes_1 = __importDefault(
21
+ require("@theme/ApiExplorer/SecuritySchemes")
22
+ );
23
+ const postman_collection_1 = __importDefault(require("postman-collection"));
24
+ function ApiExplorer({ item, infoPath }) {
25
+ const postman = new postman_collection_1.default.Request(item.postman);
26
+ return react_1.default.createElement(
27
+ react_1.default.Fragment,
28
+ null,
29
+ react_1.default.createElement(SecuritySchemes_1.default, {
30
+ infoPath: infoPath,
31
+ }),
32
+ item.method !== "event" &&
33
+ react_1.default.createElement(CodeSnippets_1.default, {
34
+ postman: postman,
35
+ codeSamples: item["x-codeSamples"] ?? [],
36
+ }),
37
+ react_1.default.createElement(Request_1.default, { item: item }),
38
+ react_1.default.createElement(Response_1.default, { item: item })
39
+ );
40
+ }
41
+ exports.default = ApiExplorer;
@@ -0,0 +1,3 @@
1
+ import { Middleware } from "@reduxjs/toolkit";
2
+ import { ThemeConfig } from "docusaurus-theme-openapi-docs/src/types";
3
+ export declare function createPersistanceMiddleware(options: ThemeConfig["api"]): Middleware<{}, RootState, AppDispatch>;
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ /* ============================================================================
3
+ * Copyright (c) Palo Alto Networks
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ * ========================================================================== */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.createPersistanceMiddleware = createPersistanceMiddleware;
10
+ const slice_1 = require("@theme/ApiExplorer/Authorization/slice");
11
+ const storage_utils_1 = require("./storage-utils");
12
+ function createPersistanceMiddleware(options) {
13
+ const persistanceMiddleware = (storeAPI) => (next) => (action) => {
14
+ const result = next(action);
15
+ const state = storeAPI.getState();
16
+ const storage = (0, storage_utils_1.createStorage)("sessionStorage");
17
+ if (action.type === slice_1.setAuthData.type) {
18
+ for (const [key, value] of Object.entries(state.auth.data)) {
19
+ if (Object.values(value).filter(Boolean).length > 0) {
20
+ storage.setItem(key, JSON.stringify(value));
21
+ } else {
22
+ storage.removeItem(key);
23
+ }
24
+ }
25
+ }
26
+ if (action.type === slice_1.setSelectedAuth.type) {
27
+ if (state.auth.selected) {
28
+ storage.setItem(
29
+ (0, storage_utils_1.hashArray)(Object.keys(state.auth.options)),
30
+ state.auth.selected
31
+ );
32
+ }
33
+ }
34
+ // TODO: determine way to rehydrate without flashing
35
+ if (action.type === "contentType/setContentType") {
36
+ storage.setItem("contentType", action.payload);
37
+ }
38
+ if (action.type === "accept/setAccept") {
39
+ storage.setItem("accept", action.payload);
40
+ }
41
+ if (action.type === "server/setServer") {
42
+ storage.setItem("server", action.payload);
43
+ }
44
+ if (action.type === "server/setServerVariable") {
45
+ const server = storage.getItem("server") ?? "{}";
46
+ const variables = JSON.parse(action.payload);
47
+ let serverObject = JSON.parse(server);
48
+ serverObject.variables[variables.key].default = variables.value;
49
+ storage.setItem("server", JSON.stringify(serverObject));
50
+ }
51
+ return result;
52
+ };
53
+ return persistanceMiddleware;
54
+ }
@@ -0,0 +1,4 @@
1
+ export declare function hashArray(arr: string[]): string;
2
+ type Persistance = false | "localStorage" | "sessionStorage" | undefined;
3
+ export declare function createStorage(persistance: Persistance): Storage;
4
+ export {};
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ /* ============================================================================
3
+ * Copyright (c) Palo Alto Networks
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ * ========================================================================== */
8
+ var __importDefault =
9
+ (this && this.__importDefault) ||
10
+ function (mod) {
11
+ return mod && mod.__esModule ? mod : { default: mod };
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.hashArray = hashArray;
15
+ exports.createStorage = createStorage;
16
+ const crypto_js_1 = __importDefault(require("crypto-js"));
17
+ function hashArray(arr) {
18
+ function hash(message) {
19
+ return crypto_js_1.default.SHA1(message).toString();
20
+ }
21
+ const hashed = arr.map((item) => hash(item));
22
+ hashed.sort();
23
+ const res = hashed.join();
24
+ return hash(res);
25
+ }
26
+ function createStorage(persistance) {
27
+ if (persistance === false) {
28
+ return {
29
+ getItem: () => null,
30
+ setItem: () => {},
31
+ clear: () => {},
32
+ key: () => null,
33
+ removeItem: () => {},
34
+ length: 0,
35
+ };
36
+ }
37
+ if (persistance === "sessionStorage") {
38
+ return sessionStorage;
39
+ }
40
+ return localStorage;
41
+ }
@@ -0,0 +1,3 @@
1
+ import { type JSX } from "react";
2
+ import type { Props } from "@theme/ApiItem/Layout";
3
+ export default function DocItemLayout({ children }: Props): JSX.Element;