@camunda8/docusaurus-theme-openapi-docs 4.5.1

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/babel.config.js +35 -0
  2. package/lib/index.d.ts +2 -0
  3. package/lib/index.js +81 -0
  4. package/lib/markdown/createDescription.d.ts +1 -0
  5. package/lib/markdown/createDescription.js +15 -0
  6. package/lib/markdown/schema.d.ts +3 -0
  7. package/lib/markdown/schema.js +154 -0
  8. package/lib/markdown/utils.d.ts +10 -0
  9. package/lib/markdown/utils.js +49 -0
  10. package/lib/markdown/utils.test.d.ts +1 -0
  11. package/lib/markdown/utils.test.js +43 -0
  12. package/lib/theme/ApiExplorer/Accept/index.d.ts +3 -0
  13. package/lib/theme/ApiExplorer/Accept/index.js +38 -0
  14. package/lib/theme/ApiExplorer/Accept/slice.d.ts +11 -0
  15. package/lib/theme/ApiExplorer/Accept/slice.js +22 -0
  16. package/lib/theme/ApiExplorer/ApiCodeBlock/Container/_Container.scss +7 -0
  17. package/lib/theme/ApiExplorer/ApiCodeBlock/Container/index.d.ts +4 -0
  18. package/lib/theme/ApiExplorer/ApiCodeBlock/Container/index.js +35 -0
  19. package/lib/theme/ApiExplorer/ApiCodeBlock/Content/Element.d.ts +3 -0
  20. package/lib/theme/ApiExplorer/ApiCodeBlock/Content/Element.js +41 -0
  21. package/lib/theme/ApiExplorer/ApiCodeBlock/Content/String.d.ts +3 -0
  22. package/lib/theme/ApiExplorer/ApiCodeBlock/Content/String.js +153 -0
  23. package/lib/theme/ApiExplorer/ApiCodeBlock/Content/_Content.scss +91 -0
  24. package/lib/theme/ApiExplorer/ApiCodeBlock/CopyButton/_CopyButton.scss +44 -0
  25. package/lib/theme/ApiExplorer/ApiCodeBlock/CopyButton/index.d.ts +7 -0
  26. package/lib/theme/ApiExplorer/ApiCodeBlock/CopyButton/index.js +147 -0
  27. package/lib/theme/ApiExplorer/ApiCodeBlock/ExitButton/_ExitButton.scss +16 -0
  28. package/lib/theme/ApiExplorer/ApiCodeBlock/ExitButton/index.d.ts +6 -0
  29. package/lib/theme/ApiExplorer/ApiCodeBlock/ExitButton/index.js +58 -0
  30. package/lib/theme/ApiExplorer/ApiCodeBlock/ExpandButton/_ExpandButton.scss +62 -0
  31. package/lib/theme/ApiExplorer/ApiCodeBlock/ExpandButton/index.d.ts +14 -0
  32. package/lib/theme/ApiExplorer/ApiCodeBlock/ExpandButton/index.js +248 -0
  33. package/lib/theme/ApiExplorer/ApiCodeBlock/Line/_Line.scss +34 -0
  34. package/lib/theme/ApiExplorer/ApiCodeBlock/Line/index.d.ts +3 -0
  35. package/lib/theme/ApiExplorer/ApiCodeBlock/Line/index.js +59 -0
  36. package/lib/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/_WordWrapButton.scss +10 -0
  37. package/lib/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/index.d.ts +7 -0
  38. package/lib/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/index.js +51 -0
  39. package/lib/theme/ApiExplorer/ApiCodeBlock/index.d.ts +3 -0
  40. package/lib/theme/ApiExplorer/ApiCodeBlock/index.js +110 -0
  41. package/lib/theme/ApiExplorer/Authorization/auth-types.d.ts +3 -0
  42. package/lib/theme/ApiExplorer/Authorization/auth-types.js +28 -0
  43. package/lib/theme/ApiExplorer/Authorization/index.d.ts +3 -0
  44. package/lib/theme/ApiExplorer/Authorization/index.js +201 -0
  45. package/lib/theme/ApiExplorer/Authorization/slice.d.ts +40 -0
  46. package/lib/theme/ApiExplorer/Authorization/slice.js +102 -0
  47. package/lib/theme/ApiExplorer/Body/index.d.ts +10 -0
  48. package/lib/theme/ApiExplorer/Body/index.js +394 -0
  49. package/lib/theme/ApiExplorer/Body/json2xml.js +43 -0
  50. package/lib/theme/ApiExplorer/Body/slice.d.ts +82 -0
  51. package/lib/theme/ApiExplorer/Body/slice.js +97 -0
  52. package/lib/theme/ApiExplorer/CodeSnippets/code-snippets-types.d.ts +21 -0
  53. package/lib/theme/ApiExplorer/CodeSnippets/code-snippets-types.js +8 -0
  54. package/lib/theme/ApiExplorer/CodeSnippets/index.d.ts +11 -0
  55. package/lib/theme/ApiExplorer/CodeSnippets/index.js +435 -0
  56. package/lib/theme/ApiExplorer/CodeSnippets/languages.d.ts +5 -0
  57. package/lib/theme/ApiExplorer/CodeSnippets/languages.js +133 -0
  58. package/lib/theme/ApiExplorer/CodeSnippets/languages.json +1290 -0
  59. package/lib/theme/ApiExplorer/CodeTabs/_CodeTabs.scss +505 -0
  60. package/lib/theme/ApiExplorer/CodeTabs/index.d.ts +15 -0
  61. package/lib/theme/ApiExplorer/CodeTabs/index.js +283 -0
  62. package/lib/theme/ApiExplorer/ContentType/index.d.ts +3 -0
  63. package/lib/theme/ApiExplorer/ContentType/index.js +40 -0
  64. package/lib/theme/ApiExplorer/ContentType/slice.d.ts +11 -0
  65. package/lib/theme/ApiExplorer/ContentType/slice.js +22 -0
  66. package/lib/theme/ApiExplorer/Export/index.d.ts +3 -0
  67. package/lib/theme/ApiExplorer/Export/index.js +57 -0
  68. package/lib/theme/ApiExplorer/FloatingButton/_FloatingButton.scss +27 -0
  69. package/lib/theme/ApiExplorer/FloatingButton/index.d.ts +8 -0
  70. package/lib/theme/ApiExplorer/FloatingButton/index.js +28 -0
  71. package/lib/theme/ApiExplorer/FormFileUpload/_FormFileUpload.scss +74 -0
  72. package/lib/theme/ApiExplorer/FormFileUpload/index.d.ts +7 -0
  73. package/lib/theme/ApiExplorer/FormFileUpload/index.js +178 -0
  74. package/lib/theme/ApiExplorer/FormItem/_FormItem.scss +21 -0
  75. package/lib/theme/ApiExplorer/FormItem/index.d.ts +10 -0
  76. package/lib/theme/ApiExplorer/FormItem/index.js +49 -0
  77. package/lib/theme/ApiExplorer/FormMultiSelect/_FormMultiSelect.scss +30 -0
  78. package/lib/theme/ApiExplorer/FormMultiSelect/index.d.ts +9 -0
  79. package/lib/theme/ApiExplorer/FormMultiSelect/index.js +51 -0
  80. package/lib/theme/ApiExplorer/FormSelect/_FormSelect.scss +43 -0
  81. package/lib/theme/ApiExplorer/FormSelect/index.d.ts +8 -0
  82. package/lib/theme/ApiExplorer/FormSelect/index.js +35 -0
  83. package/lib/theme/ApiExplorer/FormTextInput/_FormTextInput.scss +34 -0
  84. package/lib/theme/ApiExplorer/FormTextInput/index.d.ts +11 -0
  85. package/lib/theme/ApiExplorer/FormTextInput/index.js +80 -0
  86. package/lib/theme/ApiExplorer/LiveEditor/_LiveEditor.scss +15 -0
  87. package/lib/theme/ApiExplorer/LiveEditor/index.d.ts +6 -0
  88. package/lib/theme/ApiExplorer/LiveEditor/index.js +176 -0
  89. package/lib/theme/ApiExplorer/MethodEndpoint/_MethodEndpoint.scss +22 -0
  90. package/lib/theme/ApiExplorer/MethodEndpoint/index.d.ts +8 -0
  91. package/lib/theme/ApiExplorer/MethodEndpoint/index.js +86 -0
  92. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.d.ts +6 -0
  93. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.js +230 -0
  94. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.d.ts +6 -0
  95. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.js +71 -0
  96. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.d.ts +6 -0
  97. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.js +97 -0
  98. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.d.ts +6 -0
  99. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.js +72 -0
  100. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamTextFormItem.d.ts +6 -0
  101. package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamTextFormItem.js +38 -0
  102. package/lib/theme/ApiExplorer/ParamOptions/_ParamOptions.scss +123 -0
  103. package/lib/theme/ApiExplorer/ParamOptions/index.d.ts +7 -0
  104. package/lib/theme/ApiExplorer/ParamOptions/index.js +233 -0
  105. package/lib/theme/ApiExplorer/ParamOptions/slice.d.ts +17 -0
  106. package/lib/theme/ApiExplorer/ParamOptions/slice.js +25 -0
  107. package/lib/theme/ApiExplorer/Request/_Request.scss +129 -0
  108. package/lib/theme/ApiExplorer/Request/index.d.ts +6 -0
  109. package/lib/theme/ApiExplorer/Request/index.js +443 -0
  110. package/lib/theme/ApiExplorer/Request/makeRequest.d.ts +4 -0
  111. package/lib/theme/ApiExplorer/Request/makeRequest.js +223 -0
  112. package/lib/theme/ApiExplorer/Response/_Response.scss +121 -0
  113. package/lib/theme/ApiExplorer/Response/index.d.ts +6 -0
  114. package/lib/theme/ApiExplorer/Response/index.js +207 -0
  115. package/lib/theme/ApiExplorer/Response/slice.d.ts +17 -0
  116. package/lib/theme/ApiExplorer/Response/slice.js +51 -0
  117. package/lib/theme/ApiExplorer/SecuritySchemes/index.d.ts +3 -0
  118. package/lib/theme/ApiExplorer/SecuritySchemes/index.js +519 -0
  119. package/lib/theme/ApiExplorer/Server/_Server.scss +26 -0
  120. package/lib/theme/ApiExplorer/Server/index.d.ts +3 -0
  121. package/lib/theme/ApiExplorer/Server/index.js +213 -0
  122. package/lib/theme/ApiExplorer/Server/slice.d.ts +13 -0
  123. package/lib/theme/ApiExplorer/Server/slice.js +33 -0
  124. package/lib/theme/ApiExplorer/buildPostmanRequest.d.ts +20 -0
  125. package/lib/theme/ApiExplorer/buildPostmanRequest.js +511 -0
  126. package/lib/theme/ApiExplorer/index.d.ts +7 -0
  127. package/lib/theme/ApiExplorer/index.js +107 -0
  128. package/lib/theme/ApiExplorer/persistanceMiddleware.d.ts +19 -0
  129. package/lib/theme/ApiExplorer/persistanceMiddleware.js +54 -0
  130. package/lib/theme/ApiExplorer/storage-utils.d.ts +4 -0
  131. package/lib/theme/ApiExplorer/storage-utils.js +41 -0
  132. package/lib/theme/ApiItem/Layout/index.d.ts +3 -0
  133. package/lib/theme/ApiItem/Layout/index.js +121 -0
  134. package/lib/theme/ApiItem/Layout/styles.module.css +17 -0
  135. package/lib/theme/ApiItem/hooks.d.ts +12 -0
  136. package/lib/theme/ApiItem/hooks.js +13 -0
  137. package/lib/theme/ApiItem/index.d.ts +2 -0
  138. package/lib/theme/ApiItem/index.js +238 -0
  139. package/lib/theme/ApiItem/store.d.ts +58 -0
  140. package/lib/theme/ApiItem/store.js +53 -0
  141. package/lib/theme/ApiLogo/index.d.ts +2 -0
  142. package/lib/theme/ApiLogo/index.js +51 -0
  143. package/lib/theme/ApiTabs/_ApiTabs.scss +142 -0
  144. package/lib/theme/ApiTabs/index.d.ts +7 -0
  145. package/lib/theme/ApiTabs/index.js +275 -0
  146. package/lib/theme/ArrayBrackets/index.d.ts +3 -0
  147. package/lib/theme/ArrayBrackets/index.js +50 -0
  148. package/lib/theme/CodeSamples/_CodeSamples.scss +3 -0
  149. package/lib/theme/CodeSamples/index.d.ts +8 -0
  150. package/lib/theme/CodeSamples/index.js +27 -0
  151. package/lib/theme/DiscriminatorTabs/_DiscriminatorTabs.scss +98 -0
  152. package/lib/theme/DiscriminatorTabs/index.d.ts +3 -0
  153. package/lib/theme/DiscriminatorTabs/index.js +258 -0
  154. package/lib/theme/Markdown/Details/_Details.scss +122 -0
  155. package/lib/theme/Markdown/index.js +179 -0
  156. package/lib/theme/MimeTabs/_MimeTabs.scss +70 -0
  157. package/lib/theme/MimeTabs/index.d.ts +6 -0
  158. package/lib/theme/MimeTabs/index.js +286 -0
  159. package/lib/theme/OperationTabs/_OperationTabs.scss +72 -0
  160. package/lib/theme/OperationTabs/index.d.ts +3 -0
  161. package/lib/theme/OperationTabs/index.js +248 -0
  162. package/lib/theme/ParamsDetails/index.d.ts +6 -0
  163. package/lib/theme/ParamsDetails/index.js +93 -0
  164. package/lib/theme/ParamsItem/_ParamsItem.scss +54 -0
  165. package/lib/theme/ParamsItem/index.d.ts +22 -0
  166. package/lib/theme/ParamsItem/index.js +281 -0
  167. package/lib/theme/RequestSchema/index.d.ts +15 -0
  168. package/lib/theme/RequestSchema/index.js +208 -0
  169. package/lib/theme/ResponseExamples/index.d.ts +18 -0
  170. package/lib/theme/ResponseExamples/index.js +213 -0
  171. package/lib/theme/ResponseHeaders/index.d.ts +13 -0
  172. package/lib/theme/ResponseHeaders/index.js +39 -0
  173. package/lib/theme/ResponseSchema/index.d.ts +15 -0
  174. package/lib/theme/ResponseSchema/index.js +165 -0
  175. package/lib/theme/Schema/index.d.ts +8 -0
  176. package/lib/theme/Schema/index.js +853 -0
  177. package/lib/theme/SchemaItem/_SchemaItem.scss +89 -0
  178. package/lib/theme/SchemaItem/index.d.ts +12 -0
  179. package/lib/theme/SchemaItem/index.js +314 -0
  180. package/lib/theme/SchemaTabs/_SchemaTabs.scss +61 -0
  181. package/lib/theme/SchemaTabs/index.d.ts +3 -0
  182. package/lib/theme/SchemaTabs/index.js +255 -0
  183. package/lib/theme/SkeletonLoader/index.d.ts +6 -0
  184. package/lib/theme/SkeletonLoader/index.js +20 -0
  185. package/lib/theme/StatusCodes/index.d.ts +9 -0
  186. package/lib/theme/StatusCodes/index.js +90 -0
  187. package/lib/theme/styles.scss +215 -0
  188. package/lib/theme/translationIds.d.ts +83 -0
  189. package/lib/theme/translationIds.js +106 -0
  190. package/lib/types.d.ts +46 -0
  191. package/lib/types.js +8 -0
  192. package/package.json +85 -0
  193. package/src/index.ts +85 -0
  194. package/src/markdown/createDescription.ts +13 -0
  195. package/src/markdown/schema.ts +186 -0
  196. package/src/markdown/utils.test.ts +49 -0
  197. package/src/markdown/utils.ts +59 -0
  198. package/src/plugin-content-docs.d.ts +20 -0
  199. package/src/postman-code-generators.d.ts +9 -0
  200. package/src/react-magic-dropzone.d.ts +9 -0
  201. package/src/theme/ApiExplorer/Accept/index.tsx +36 -0
  202. package/src/theme/ApiExplorer/Accept/slice.ts +29 -0
  203. package/src/theme/ApiExplorer/ApiCodeBlock/Container/_Container.scss +7 -0
  204. package/src/theme/ApiExplorer/ApiCodeBlock/Container/index.tsx +32 -0
  205. package/src/theme/ApiExplorer/ApiCodeBlock/Content/Element.tsx +34 -0
  206. package/src/theme/ApiExplorer/ApiCodeBlock/Content/String.tsx +134 -0
  207. package/src/theme/ApiExplorer/ApiCodeBlock/Content/_Content.scss +91 -0
  208. package/src/theme/ApiExplorer/ApiCodeBlock/CopyButton/_CopyButton.scss +44 -0
  209. package/src/theme/ApiExplorer/ApiCodeBlock/CopyButton/index.tsx +83 -0
  210. package/src/theme/ApiExplorer/ApiCodeBlock/ExitButton/_ExitButton.scss +16 -0
  211. package/src/theme/ApiExplorer/ApiCodeBlock/ExitButton/index.tsx +55 -0
  212. package/src/theme/ApiExplorer/ApiCodeBlock/ExpandButton/_ExpandButton.scss +62 -0
  213. package/src/theme/ApiExplorer/ApiCodeBlock/ExpandButton/index.tsx +166 -0
  214. package/src/theme/ApiExplorer/ApiCodeBlock/Line/_Line.scss +34 -0
  215. package/src/theme/ApiExplorer/ApiCodeBlock/Line/index.tsx +48 -0
  216. package/src/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/_WordWrapButton.scss +10 -0
  217. package/src/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/index.tsx +54 -0
  218. package/src/theme/ApiExplorer/ApiCodeBlock/index.tsx +45 -0
  219. package/src/theme/ApiExplorer/Authorization/auth-types.ts +30 -0
  220. package/src/theme/ApiExplorer/Authorization/index.tsx +199 -0
  221. package/src/theme/ApiExplorer/Authorization/slice.ts +146 -0
  222. package/src/theme/ApiExplorer/Body/index.tsx +388 -0
  223. package/src/theme/ApiExplorer/Body/json2xml.d.ts +8 -0
  224. package/src/theme/ApiExplorer/Body/json2xml.js +43 -0
  225. package/src/theme/ApiExplorer/Body/slice.ts +133 -0
  226. package/src/theme/ApiExplorer/CodeSnippets/code-snippets-types.ts +57 -0
  227. package/src/theme/ApiExplorer/CodeSnippets/index.tsx +383 -0
  228. package/src/theme/ApiExplorer/CodeSnippets/languages.json +1290 -0
  229. package/src/theme/ApiExplorer/CodeSnippets/languages.ts +139 -0
  230. package/src/theme/ApiExplorer/CodeTabs/_CodeTabs.scss +505 -0
  231. package/src/theme/ApiExplorer/CodeTabs/index.tsx +261 -0
  232. package/src/theme/ApiExplorer/ContentType/index.tsx +38 -0
  233. package/src/theme/ApiExplorer/ContentType/slice.ts +29 -0
  234. package/src/theme/ApiExplorer/Export/index.tsx +47 -0
  235. package/src/theme/ApiExplorer/FloatingButton/_FloatingButton.scss +27 -0
  236. package/src/theme/ApiExplorer/FloatingButton/index.tsx +29 -0
  237. package/src/theme/ApiExplorer/FormFileUpload/_FormFileUpload.scss +74 -0
  238. package/src/theme/ApiExplorer/FormFileUpload/index.tsx +124 -0
  239. package/src/theme/ApiExplorer/FormItem/_FormItem.scss +21 -0
  240. package/src/theme/ApiExplorer/FormItem/index.tsx +40 -0
  241. package/src/theme/ApiExplorer/FormMultiSelect/_FormMultiSelect.scss +30 -0
  242. package/src/theme/ApiExplorer/FormMultiSelect/index.tsx +57 -0
  243. package/src/theme/ApiExplorer/FormSelect/_FormSelect.scss +43 -0
  244. package/src/theme/ApiExplorer/FormSelect/index.tsx +38 -0
  245. package/src/theme/ApiExplorer/FormTextInput/_FormTextInput.scss +34 -0
  246. package/src/theme/ApiExplorer/FormTextInput/index.tsx +89 -0
  247. package/src/theme/ApiExplorer/LiveEditor/_LiveEditor.scss +15 -0
  248. package/src/theme/ApiExplorer/LiveEditor/index.tsx +122 -0
  249. package/src/theme/ApiExplorer/MethodEndpoint/_MethodEndpoint.scss +22 -0
  250. package/src/theme/ApiExplorer/MethodEndpoint/index.tsx +91 -0
  251. package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.tsx +185 -0
  252. package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.tsx +72 -0
  253. package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.tsx +94 -0
  254. package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.tsx +74 -0
  255. package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamTextFormItem.tsx +38 -0
  256. package/src/theme/ApiExplorer/ParamOptions/_ParamOptions.scss +123 -0
  257. package/src/theme/ApiExplorer/ParamOptions/index.tsx +154 -0
  258. package/src/theme/ApiExplorer/ParamOptions/slice.ts +37 -0
  259. package/src/theme/ApiExplorer/Request/_Request.scss +129 -0
  260. package/src/theme/ApiExplorer/Request/index.tsx +352 -0
  261. package/src/theme/ApiExplorer/Request/makeRequest.ts +255 -0
  262. package/src/theme/ApiExplorer/Response/_Response.scss +121 -0
  263. package/src/theme/ApiExplorer/Response/index.tsx +173 -0
  264. package/src/theme/ApiExplorer/Response/slice.ts +52 -0
  265. package/src/theme/ApiExplorer/SecuritySchemes/index.tsx +375 -0
  266. package/src/theme/ApiExplorer/Server/_Server.scss +26 -0
  267. package/src/theme/ApiExplorer/Server/index.tsx +138 -0
  268. package/src/theme/ApiExplorer/Server/slice.ts +39 -0
  269. package/src/theme/ApiExplorer/buildPostmanRequest.ts +524 -0
  270. package/src/theme/ApiExplorer/index.tsx +52 -0
  271. package/src/theme/ApiExplorer/persistanceMiddleware.ts +73 -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 +243 -0
  281. package/src/theme/ArrayBrackets/index.tsx +37 -0
  282. package/src/theme/CodeSamples/_CodeSamples.scss +3 -0
  283. package/src/theme/CodeSamples/index.tsx +26 -0
  284. package/src/theme/DiscriminatorTabs/_DiscriminatorTabs.scss +98 -0
  285. package/src/theme/DiscriminatorTabs/index.tsx +229 -0
  286. package/src/theme/Markdown/Details/_Details.scss +122 -0
  287. package/src/theme/Markdown/index.d.ts +8 -0
  288. package/src/theme/Markdown/index.js +179 -0
  289. package/src/theme/MimeTabs/_MimeTabs.scss +70 -0
  290. package/src/theme/MimeTabs/index.tsx +257 -0
  291. package/src/theme/OperationTabs/_OperationTabs.scss +72 -0
  292. package/src/theme/OperationTabs/index.tsx +220 -0
  293. package/src/theme/ParamsDetails/index.tsx +90 -0
  294. package/src/theme/ParamsItem/_ParamsItem.scss +54 -0
  295. package/src/theme/ParamsItem/index.tsx +246 -0
  296. package/src/theme/RequestSchema/index.tsx +172 -0
  297. package/src/theme/ResponseExamples/index.tsx +209 -0
  298. package/src/theme/ResponseHeaders/index.tsx +49 -0
  299. package/src/theme/ResponseSchema/index.tsx +150 -0
  300. package/src/theme/Schema/index.tsx +938 -0
  301. package/src/theme/SchemaItem/_SchemaItem.scss +89 -0
  302. package/src/theme/SchemaItem/index.tsx +273 -0
  303. package/src/theme/SchemaTabs/_SchemaTabs.scss +61 -0
  304. package/src/theme/SchemaTabs/index.tsx +224 -0
  305. package/src/theme/SkeletonLoader/index.tsx +18 -0
  306. package/src/theme/StatusCodes/index.tsx +83 -0
  307. package/src/theme/styles.scss +215 -0
  308. package/src/theme/translationIds.ts +103 -0
  309. package/src/theme-classic.d.ts +80 -0
  310. package/src/theme-openapi.d.ts +20 -0
  311. package/src/types.ts +72 -0
  312. package/tsconfig.json +16 -0
@@ -0,0 +1,185 @@
1
+ /* ============================================================================
2
+ * Copyright (c) Palo Alto Networks
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ * ========================================================================== */
7
+
8
+ import React, { useEffect, useState } from "react";
9
+
10
+ import { translate } from "@docusaurus/Translate";
11
+ import { ErrorMessage } from "@hookform/error-message";
12
+ import { nanoid } from "@reduxjs/toolkit";
13
+ import FormSelect from "@theme/ApiExplorer/FormSelect";
14
+ import FormTextInput from "@theme/ApiExplorer/FormTextInput";
15
+ import { Param, setParam } from "@theme/ApiExplorer/ParamOptions/slice";
16
+ import { useTypedDispatch } from "@theme/ApiItem/hooks";
17
+ import { OPENAPI_FORM } from "@theme/translationIds";
18
+ import { Controller, useFormContext } from "react-hook-form";
19
+
20
+ export interface ParamProps {
21
+ param: Param;
22
+ }
23
+
24
+ function ArrayItem({
25
+ param,
26
+ onChange,
27
+ initialValue,
28
+ }: ParamProps & { onChange(value?: string): any; initialValue?: string }) {
29
+ const [value, setValue] = useState(initialValue || "");
30
+
31
+ if (param.schema?.items?.type === "boolean") {
32
+ return (
33
+ <FormSelect
34
+ options={["---", "true", "false"]}
35
+ onChange={(e: React.ChangeEvent<HTMLSelectElement>) => {
36
+ const val = e.target.value;
37
+ onChange(val === "---" ? undefined : val);
38
+ }}
39
+ />
40
+ );
41
+ }
42
+
43
+ return (
44
+ <FormTextInput
45
+ placeholder={param.description || param.name}
46
+ value={value}
47
+ onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
48
+ setValue(e.target.value);
49
+ onChange(e.target.value);
50
+ }}
51
+ />
52
+ );
53
+ }
54
+
55
+ export default function ParamArrayFormItem({ param }: ParamProps) {
56
+ const [items, setItems] = useState<{ id: string; value?: string }[]>([]);
57
+ const dispatch = useTypedDispatch();
58
+
59
+ const {
60
+ control,
61
+ formState: { errors },
62
+ } = useFormContext();
63
+
64
+ const showErrorMessage = errors?.paramArray?.message;
65
+
66
+ function handleAddItem(e: any) {
67
+ e.preventDefault(); // prevent form from submitting
68
+ setItems((i) => [
69
+ ...i,
70
+ {
71
+ id: nanoid(),
72
+ },
73
+ ]);
74
+ }
75
+
76
+ useEffect(() => {
77
+ const values = items
78
+ .map((item) => item.value)
79
+ .filter((item): item is string => !!item);
80
+
81
+ dispatch(
82
+ setParam({
83
+ ...param,
84
+ value: values.length > 0 ? values : undefined,
85
+ })
86
+ );
87
+
88
+ // eslint-disable-next-line react-hooks/exhaustive-deps
89
+ }, [items]);
90
+
91
+ useEffect(() => {
92
+ const example = param.schema?.example;
93
+ if (Array.isArray(example) && example.length > 0) {
94
+ const examplesWithIds = example.map((item: any) => ({
95
+ id: nanoid(),
96
+ value: item.toString(),
97
+ }));
98
+
99
+ setItems(examplesWithIds);
100
+ }
101
+ }, [param.schema?.example]);
102
+
103
+ function handleDeleteItem(itemToDelete: { id: string }) {
104
+ return () => {
105
+ const newItems = items.filter((i) => i.id !== itemToDelete.id);
106
+ setItems(newItems);
107
+ };
108
+ }
109
+
110
+ function handleChangeItem(itemToUpdate: { id: string }, onChange: any) {
111
+ return (value: string) => {
112
+ const newItems = items.map((i) => {
113
+ if (i.id === itemToUpdate.id) {
114
+ return { ...i, value: value };
115
+ }
116
+ return i;
117
+ });
118
+ setItems(newItems);
119
+ onChange(newItems);
120
+ };
121
+ }
122
+
123
+ return (
124
+ <>
125
+ <Controller
126
+ control={control}
127
+ rules={{
128
+ required: param.required
129
+ ? translate({
130
+ id: OPENAPI_FORM.FIELD_REQUIRED,
131
+ message: "This field is required",
132
+ })
133
+ : false,
134
+ }}
135
+ name="paramArray"
136
+ render={({ field: { onChange } }) => (
137
+ <>
138
+ {items.map((item) => (
139
+ <div key={item.id} style={{ display: "flex" }}>
140
+ <ArrayItem
141
+ param={param}
142
+ onChange={handleChangeItem(item, onChange)}
143
+ initialValue={item.value}
144
+ />
145
+ <button
146
+ className="openapi-explorer__delete-btn"
147
+ onClick={handleDeleteItem(item)}
148
+ >
149
+ <svg
150
+ focusable="false"
151
+ preserveAspectRatio="xMidYMid meet"
152
+ xmlns="http://www.w3.org/2000/svg"
153
+ fill="currentColor"
154
+ width="16"
155
+ height="16"
156
+ viewBox="0 0 32 32"
157
+ aria-hidden="true"
158
+ >
159
+ <path d="M24 9.4L22.6 8 16 14.6 9.4 8 8 9.4 14.6 16 8 22.6 9.4 24 16 17.4 22.6 24 24 22.6 17.4 16 24 9.4z"></path>
160
+ <title>Delete</title>
161
+ </svg>
162
+ </button>
163
+ </div>
164
+ ))}
165
+ <button
166
+ className="openapi-explorer__thin-btn"
167
+ onClick={handleAddItem}
168
+ >
169
+ Add item
170
+ </button>
171
+ </>
172
+ )}
173
+ />
174
+ {showErrorMessage && (
175
+ <ErrorMessage
176
+ errors={errors}
177
+ name="paramArray"
178
+ render={({ message }) => (
179
+ <div className="openapi-explorer__input-error">{message}</div>
180
+ )}
181
+ />
182
+ )}
183
+ </>
184
+ );
185
+ }
@@ -0,0 +1,72 @@
1
+ /* ============================================================================
2
+ * Copyright (c) Palo Alto Networks
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ * ========================================================================== */
7
+
8
+ import React from "react";
9
+
10
+ import { translate } from "@docusaurus/Translate";
11
+ import { ErrorMessage } from "@hookform/error-message";
12
+ import FormSelect from "@theme/ApiExplorer/FormSelect";
13
+ import { Param, setParam } from "@theme/ApiExplorer/ParamOptions/slice";
14
+ import { useTypedDispatch } from "@theme/ApiItem/hooks";
15
+ import { OPENAPI_FORM } from "@theme/translationIds";
16
+ import { Controller, useFormContext } from "react-hook-form";
17
+
18
+ export interface ParamProps {
19
+ param: Param;
20
+ }
21
+
22
+ export default function ParamBooleanFormItem({ param }: ParamProps) {
23
+ const dispatch = useTypedDispatch();
24
+
25
+ const {
26
+ control,
27
+ formState: { errors },
28
+ } = useFormContext();
29
+
30
+ const showErrorMessage = errors?.paramBoolean;
31
+
32
+ return (
33
+ <>
34
+ <Controller
35
+ control={control}
36
+ rules={{
37
+ required: param.required
38
+ ? translate({
39
+ id: OPENAPI_FORM.FIELD_REQUIRED,
40
+ message: "This field is required",
41
+ })
42
+ : false,
43
+ }}
44
+ name="paramBoolean"
45
+ render={({ field: { onChange } }) => (
46
+ <FormSelect
47
+ options={["---", "true", "false"]}
48
+ onChange={(e: React.ChangeEvent<HTMLSelectElement>) => {
49
+ const val = e.target.value;
50
+ dispatch(
51
+ setParam({
52
+ ...param,
53
+ value: val === "---" ? undefined : val,
54
+ })
55
+ );
56
+ onChange(val);
57
+ }}
58
+ />
59
+ )}
60
+ />
61
+ {showErrorMessage && (
62
+ <ErrorMessage
63
+ errors={errors}
64
+ name="paramBoolean"
65
+ render={({ message }) => (
66
+ <div className="openapi-explorer__input-error">{message}</div>
67
+ )}
68
+ />
69
+ )}
70
+ </>
71
+ );
72
+ }
@@ -0,0 +1,94 @@
1
+ /* ============================================================================
2
+ * Copyright (c) Palo Alto Networks
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ * ========================================================================== */
7
+
8
+ import React from "react";
9
+
10
+ import { translate } from "@docusaurus/Translate";
11
+ import { ErrorMessage } from "@hookform/error-message";
12
+ import FormMultiSelect from "@theme/ApiExplorer/FormMultiSelect";
13
+ import { Param, setParam } from "@theme/ApiExplorer/ParamOptions/slice";
14
+ import { useTypedDispatch, useTypedSelector } from "@theme/ApiItem/hooks";
15
+ import { OPENAPI_FORM } from "@theme/translationIds";
16
+ import { Controller, useFormContext } from "react-hook-form";
17
+
18
+ export interface ParamProps {
19
+ param: Param;
20
+ }
21
+
22
+ export default function ParamMultiSelectFormItem({ param }: ParamProps) {
23
+ const {
24
+ control,
25
+ formState: { errors },
26
+ } = useFormContext();
27
+
28
+ const showErrorMessage = errors?.paramMultiSelect;
29
+
30
+ const dispatch = useTypedDispatch();
31
+
32
+ const options = param.schema?.items?.enum ?? [];
33
+
34
+ const pathParams = useTypedSelector((state: any) => state.params.path);
35
+ const queryParams = useTypedSelector((state: any) => state.params.query);
36
+ const cookieParams = useTypedSelector((state: any) => state.params.cookie);
37
+ const headerParams = useTypedSelector((state: any) => state.params.header);
38
+
39
+ const paramTypeToWatch = pathParams.length
40
+ ? pathParams
41
+ : queryParams.length
42
+ ? queryParams
43
+ : cookieParams.length
44
+ ? cookieParams
45
+ : headerParams;
46
+
47
+ const handleChange = (e: any, onChange: any) => {
48
+ const values = Array.prototype.filter
49
+ .call(e.target.options, (o) => o.selected)
50
+ .map((o) => o.value);
51
+
52
+ dispatch(
53
+ setParam({
54
+ ...param,
55
+ value: values.length > 0 ? values : undefined,
56
+ })
57
+ );
58
+
59
+ onChange(paramTypeToWatch);
60
+ };
61
+
62
+ return (
63
+ <>
64
+ <Controller
65
+ control={control}
66
+ rules={{
67
+ required: param.required
68
+ ? translate({
69
+ id: OPENAPI_FORM.FIELD_REQUIRED,
70
+ message: "This field is required",
71
+ })
72
+ : false,
73
+ }}
74
+ name="paramMultiSelect"
75
+ render={({ field: { onChange } }) => (
76
+ <FormMultiSelect
77
+ options={options as string[]}
78
+ onChange={(e: any) => handleChange(e, onChange)}
79
+ showErrors={!!showErrorMessage}
80
+ />
81
+ )}
82
+ />
83
+ {showErrorMessage && (
84
+ <ErrorMessage
85
+ errors={errors}
86
+ name="paramMultiSelect"
87
+ render={({ message }) => (
88
+ <div className="openapi-explorer__input-error">{message}</div>
89
+ )}
90
+ />
91
+ )}
92
+ </>
93
+ );
94
+ }
@@ -0,0 +1,74 @@
1
+ /* ============================================================================
2
+ * Copyright (c) Palo Alto Networks
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ * ========================================================================== */
7
+
8
+ import React from "react";
9
+
10
+ import { translate } from "@docusaurus/Translate";
11
+ import { ErrorMessage } from "@hookform/error-message";
12
+ import FormSelect from "@theme/ApiExplorer/FormSelect";
13
+ import { Param, setParam } from "@theme/ApiExplorer/ParamOptions/slice";
14
+ import { useTypedDispatch } from "@theme/ApiItem/hooks";
15
+ import { OPENAPI_FORM } from "@theme/translationIds";
16
+ import { Controller, useFormContext } from "react-hook-form";
17
+
18
+ export interface ParamProps {
19
+ param: Param;
20
+ }
21
+
22
+ export default function ParamSelectFormItem({ param }: ParamProps) {
23
+ const {
24
+ control,
25
+ formState: { errors },
26
+ } = useFormContext();
27
+
28
+ const showErrorMessage = errors?.paramSelect;
29
+
30
+ const dispatch = useTypedDispatch();
31
+
32
+ const options = param.schema?.enum ?? [];
33
+
34
+ return (
35
+ <>
36
+ <Controller
37
+ control={control}
38
+ rules={{
39
+ required: param.required
40
+ ? translate({
41
+ id: OPENAPI_FORM.FIELD_REQUIRED,
42
+ message: "This field is required",
43
+ })
44
+ : false,
45
+ }}
46
+ name="paramSelect"
47
+ render={({ field: { onChange } }) => (
48
+ <FormSelect
49
+ options={["---", ...(options as string[])]}
50
+ onChange={(e: React.ChangeEvent<HTMLSelectElement>) => {
51
+ const val = e.target.value;
52
+ dispatch(
53
+ setParam({
54
+ ...param,
55
+ value: val === "---" ? undefined : val,
56
+ })
57
+ );
58
+ onChange(val);
59
+ }}
60
+ />
61
+ )}
62
+ />
63
+ {showErrorMessage && (
64
+ <ErrorMessage
65
+ errors={errors}
66
+ name="paramSelect"
67
+ render={({ message }) => (
68
+ <div className="openapi-explorer__input-error">{message}</div>
69
+ )}
70
+ />
71
+ )}
72
+ </>
73
+ );
74
+ }
@@ -0,0 +1,38 @@
1
+ /* ============================================================================
2
+ * Copyright (c) Palo Alto Networks
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ * ========================================================================== */
7
+
8
+ import React from "react";
9
+
10
+ import FormTextInput from "@theme/ApiExplorer/FormTextInput";
11
+ import { Param, setParam } from "@theme/ApiExplorer/ParamOptions/slice";
12
+ import { useTypedDispatch } from "@theme/ApiItem/hooks";
13
+
14
+ export interface ParamProps {
15
+ param: Param;
16
+ }
17
+
18
+ export default function ParamTextFormItem({ param }: ParamProps) {
19
+ const dispatch = useTypedDispatch();
20
+ return (
21
+ <FormTextInput
22
+ isRequired={param.required}
23
+ paramName={param.name}
24
+ placeholder={param.description || param.name}
25
+ onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
26
+ dispatch(
27
+ setParam({
28
+ ...param,
29
+ value:
30
+ param.in === "path" || param.in === "query"
31
+ ? e.target.value.replace(/\s/g, "%20")
32
+ : e.target.value,
33
+ })
34
+ )
35
+ }
36
+ />
37
+ );
38
+ }
@@ -0,0 +1,123 @@
1
+ .openapi-explorer__plus-btn--expanded {
2
+ transition: transform 0.2s ease;
3
+ display: inline-block;
4
+ transform: rotate(0deg);
5
+ transform-origin: center;
6
+ margin-right: 6px;
7
+ transform: rotate(45deg);
8
+ }
9
+
10
+ .openapi-explorer__show-more-btn {
11
+ width: 100%;
12
+ -webkit-appearance: none;
13
+ -moz-appearance: none;
14
+ appearance: none;
15
+ margin-left: 0.25rem;
16
+ margin-bottom: 0.5rem;
17
+ padding: 0;
18
+ cursor: pointer;
19
+ font-size: var(--openapi-explorer-font-size-input);
20
+ user-select: none;
21
+ white-space: nowrap;
22
+ border: 0px solid transparent;
23
+ display: block;
24
+ background-color: transparent;
25
+ color: var(--ifm-color-primary);
26
+ text-align: left;
27
+
28
+ &:hover {
29
+ color: var(--ifm-color-primary-hover);
30
+ }
31
+
32
+ &:first-child {
33
+ margin-top: 0;
34
+ }
35
+ }
36
+
37
+ .openapi-explorer__delete-btn {
38
+ -webkit-appearance: none;
39
+ -moz-appearance: none;
40
+ appearance: none;
41
+
42
+ cursor: pointer;
43
+ font-size: calc(0.875rem * var(--ifm-button-size-multiplier));
44
+ font-weight: normal;
45
+ line-height: 1.5;
46
+
47
+ transition-property: color, background, border-color, box-shadow;
48
+ transition-duration:
49
+ 100ms, 100ms, 100ms, var(--ifm-button-transition-duration);
50
+ transition-timing-function: cubic-bezier(0.08, 0.52, 0.52, 1);
51
+
52
+ -webkit-user-select: none;
53
+ user-select: none;
54
+ white-space: nowrap;
55
+
56
+ display: flex;
57
+
58
+ align-items: center;
59
+ justify-content: center;
60
+
61
+ padding: 0 12px;
62
+
63
+ margin-top: calc(var(--ifm-pre-padding) / 2);
64
+ background-color: var(--openapi-input-background);
65
+ border: none;
66
+ outline: none;
67
+ color: var(--ifm-pre-color);
68
+ border-radius: 4px;
69
+ margin-left: 4px;
70
+
71
+ &:focus {
72
+ outline: 0;
73
+ }
74
+
75
+ &:active {
76
+ box-shadow: inset 0px 0px 0px 2px var(--openapi-input-border);
77
+ }
78
+ }
79
+
80
+ .openapi-explorer__thin-btn {
81
+ -webkit-appearance: none;
82
+ -moz-appearance: none;
83
+ cursor: pointer;
84
+ font-weight: bold;
85
+ padding: 0.5rem 1rem;
86
+ font-size: 12px;
87
+ transition-property: color, background, border-color, box-shadow;
88
+ transition-duration:
89
+ 100ms, 100ms, 100ms, var(--ifm-button-transition-duration);
90
+ transition-timing-function: cubic-bezier(0.08, 0.52, 0.52, 1);
91
+ user-select: none;
92
+ white-space: nowrap;
93
+ background-color: transparent;
94
+ color: var(--openapi-input-border);
95
+ border: 1px solid var(--openapi-input-border);
96
+ border-radius: var(--ifm-pre-border-radius);
97
+ margin-top: calc(var(--ifm-pre-padding) / 2);
98
+ text-transform: uppercase;
99
+
100
+ &:hover {
101
+ color: var(--openapi-inverse-color);
102
+ background-color: var(--openapi-input-border);
103
+ }
104
+
105
+ &:focus {
106
+ outline: 0;
107
+ }
108
+
109
+ &:active {
110
+ box-shadow:
111
+ inset 0 0 0 1px var(--openapi-input-border),
112
+ inset 0 0 0 2px var(--openapi-inverse-color);
113
+ }
114
+ }
115
+
116
+ .openapi-explorer__show-options {
117
+ visibility: visible;
118
+ }
119
+
120
+ .openapi-explorer__hide-options {
121
+ display: none;
122
+ visibility: hidden;
123
+ }