@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,30 @@
1
+ .openapi-explorer__multi-select-input {
2
+ width: 100%;
3
+ margin-top: calc(var(--ifm-pre-padding) / 2);
4
+ padding: 1rem;
5
+ border-radius: 4px;
6
+ border: 1px solid transparent;
7
+ background-color: var(--openapi-input-background);
8
+ outline: none;
9
+ font-size: var(--openapi-explorer-font-size-input);
10
+ color: var(--ifm-pre-color);
11
+ -moz-appearance: none;
12
+ -webkit-appearance: none;
13
+ appearance: none;
14
+
15
+ &:focus {
16
+ border: 1px solid var(--openapi-input-border);
17
+ }
18
+
19
+ &.error {
20
+ border: 1px solid var(--ifm-color-danger);
21
+ }
22
+
23
+ option {
24
+ border-radius: 0.25rem;
25
+ color: var(--ifm-menu-color);
26
+ margin: 0.25rem 0;
27
+ padding: var(--ifm-menu-link-padding-vertical)
28
+ var(--ifm-menu-link-padding-horizontal);
29
+ }
30
+ }
@@ -0,0 +1,57 @@
1
+ /* ============================================================================
2
+ * Copyright (c) Palo Alto Networks
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ * ========================================================================== */
7
+
8
+ import React from "react";
9
+
10
+ import clsx from "clsx";
11
+
12
+ export interface Props {
13
+ value?: string;
14
+ options: string[];
15
+ onChange?: React.ChangeEventHandler<HTMLSelectElement>;
16
+ showErrors?: boolean;
17
+ }
18
+
19
+ function FormMultiSelect({ value, options, onChange, showErrors }: Props) {
20
+ if (options.length === 0) {
21
+ return null;
22
+ }
23
+
24
+ let height;
25
+ if (options.length < 6) {
26
+ const selectPadding = 12 * 2;
27
+ const rawHeight = options.length * 29;
28
+ const innerMargins = 4 * options.length - 1;
29
+ const outerMargins = 4 * 2;
30
+ const mysteryScroll = 1;
31
+ height =
32
+ rawHeight + innerMargins + outerMargins + selectPadding + mysteryScroll;
33
+ }
34
+
35
+ return (
36
+ <select
37
+ style={{ height: height }}
38
+ className={clsx("openapi-explorer__multi-select-input", {
39
+ error: showErrors,
40
+ })}
41
+ value={value}
42
+ onChange={onChange}
43
+ size={Math.min(6, options.length + 1)}
44
+ multiple
45
+ >
46
+ {options.map((option) => {
47
+ return (
48
+ <option key={option} value={option}>
49
+ {option}
50
+ </option>
51
+ );
52
+ })}
53
+ </select>
54
+ );
55
+ }
56
+
57
+ export default FormMultiSelect;
@@ -0,0 +1,43 @@
1
+ html[data-theme="dark"] .openapi-explorer__select-input {
2
+ margin-top: calc(var(--ifm-pre-padding) / 2);
3
+ background-color: var(--openapi-input-background);
4
+ border: none;
5
+ outline: none;
6
+ width: 100%;
7
+ color: var(--ifm-pre-color);
8
+
9
+ border-radius: 4px;
10
+ -moz-appearance: none;
11
+ -webkit-appearance: none;
12
+ appearance: none;
13
+
14
+ background-image: url('data:image/svg+xml;charset=US-ASCII,<svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" fill="white"><path d="M8 11L3 6 3.7 5.3 8 9.6 12.3 5.3 13 6z"></path></svg>');
15
+ background-repeat: no-repeat;
16
+ background-position: right var(--ifm-pre-padding) top 50%;
17
+ background-size: auto auto;
18
+ }
19
+
20
+ .openapi-explorer__select-input {
21
+ width: 100%;
22
+ margin-top: calc(var(--ifm-pre-padding) / 2);
23
+ padding: var(--openapi-explorer-padding-input);
24
+ border: none;
25
+ outline: none;
26
+ border-radius: 4px;
27
+ background-color: var(--openapi-input-background);
28
+ font-size: var(--openapi-explorer-font-size-input);
29
+ font-family: var(--ifm-font-family-monospace);
30
+ color: var(--ifm-pre-color);
31
+ -moz-appearance: none;
32
+ -webkit-appearance: none;
33
+ appearance: none;
34
+
35
+ background-image: url('data:image/svg+xml;charset=US-ASCII,<svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true"><path d="M8 11L3 6 3.7 5.3 8 9.6 12.3 5.3 13 6z"></path></svg>');
36
+ background-repeat: no-repeat;
37
+ background-position: right var(--ifm-pre-padding) top 50%;
38
+ background-size: auto auto;
39
+
40
+ &:focus {
41
+ box-shadow: inset 0px 0px 0px 2px var(--openapi-input-border);
42
+ }
43
+ }
@@ -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
+ export interface Props {
11
+ value?: string;
12
+ options?: string[];
13
+ onChange?: React.ChangeEventHandler<HTMLSelectElement>;
14
+ }
15
+
16
+ function FormSelect({ value, options, onChange }: Props) {
17
+ if (!Array.isArray(options) || options.length === 0) {
18
+ return null;
19
+ }
20
+
21
+ return (
22
+ <select
23
+ className="openapi-explorer__select-input"
24
+ value={value}
25
+ onChange={onChange}
26
+ >
27
+ {options.map((option) => {
28
+ return (
29
+ <option key={option} value={option}>
30
+ {option}
31
+ </option>
32
+ );
33
+ })}
34
+ </select>
35
+ );
36
+ }
37
+
38
+ export default FormSelect;
@@ -0,0 +1,34 @@
1
+ .openapi-explorer__form-item-input {
2
+ margin-top: calc(var(--ifm-pre-padding) / 2);
3
+ background-color: var(--openapi-input-background);
4
+ border: 1px solid transparent;
5
+ outline: none;
6
+ width: 100%;
7
+ color: var(--ifm-pre-color);
8
+ padding: var(--openapi-explorer-padding-input);
9
+ border-radius: 4px;
10
+
11
+ &:hover {
12
+ border: 1px solid var(--ifm-toc-border-color);
13
+ }
14
+
15
+ &:focus {
16
+ border: 1px solid var(--ifm-color-primary);
17
+ box-shadow: none;
18
+ }
19
+
20
+ &.error {
21
+ border: 1px solid var(--openapi-required);
22
+ }
23
+ }
24
+
25
+ .openapi-explorer__input-error {
26
+ font-size: var(--openapi-explorer-font-size-input);
27
+ color: var(--openapi-required);
28
+ padding-top: var(--openapi-explorer-padding-input);
29
+
30
+ &::before {
31
+ display: inline;
32
+ content: "⚠ ";
33
+ }
34
+ }
@@ -0,0 +1,89 @@
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
+ // @ts-nocheck
9
+ import React from "react";
10
+
11
+ import { translate } from "@docusaurus/Translate";
12
+ import { ErrorMessage } from "@hookform/error-message";
13
+ import { OPENAPI_FORM } from "@theme/translationIds";
14
+ import clsx from "clsx";
15
+ import { useFormContext } from "react-hook-form";
16
+
17
+ export interface Props {
18
+ value?: string;
19
+ placeholder?: string;
20
+ password?: boolean;
21
+ onChange?: React.ChangeEventHandler<HTMLInputElement>;
22
+ paramName?: string;
23
+ isRequired?: boolean;
24
+ }
25
+
26
+ function FormTextInput({
27
+ isRequired,
28
+ value,
29
+ placeholder,
30
+ password,
31
+ onChange,
32
+ paramName,
33
+ }: Props) {
34
+ placeholder = placeholder?.split("\n")[0];
35
+
36
+ const {
37
+ register,
38
+ formState: { errors },
39
+ } = useFormContext();
40
+
41
+ const showErrorMessage = errors?.[paramName]?.message;
42
+
43
+ return (
44
+ <>
45
+ {paramName ? (
46
+ <input
47
+ {...register(paramName, {
48
+ required: isRequired
49
+ ? translate({
50
+ id: OPENAPI_FORM.FIELD_REQUIRED,
51
+ message: "This field is required",
52
+ })
53
+ : false,
54
+ })}
55
+ className={clsx("openapi-explorer__form-item-input", {
56
+ error: showErrorMessage,
57
+ })}
58
+ type={password ? "password" : "text"}
59
+ placeholder={placeholder}
60
+ title={placeholder}
61
+ value={value}
62
+ onChange={onChange}
63
+ autoComplete="off"
64
+ />
65
+ ) : (
66
+ <input
67
+ className="openapi-explorer__form-item-input"
68
+ type={password ? "password" : "text"}
69
+ placeholder={placeholder}
70
+ title={placeholder}
71
+ value={value}
72
+ onChange={onChange}
73
+ autoComplete="off"
74
+ />
75
+ )}
76
+ {showErrorMessage && (
77
+ <ErrorMessage
78
+ errors={errors}
79
+ name={paramName}
80
+ render={({ message }) => (
81
+ <div className="openapi-explorer__input-error">{message}</div>
82
+ )}
83
+ />
84
+ )}
85
+ </>
86
+ );
87
+ }
88
+
89
+ export default FormTextInput;
@@ -0,0 +1,15 @@
1
+ .openapi-explorer__playground-container {
2
+ margin-top: 1rem;
3
+ margin-bottom: var(--ifm-leading);
4
+ border-radius: var(--ifm-global-radius);
5
+ box-shadow: var(--ifm-global-shadow-lw);
6
+ overflow: auto;
7
+ max-height: 500px;
8
+ }
9
+
10
+ .openapi-explorer__playground-editor {
11
+ font: var(--ifm-code-font-size) / var(--ifm-pre-line-height)
12
+ var(--ifm-font-family-monospace) !important;
13
+ /* rtl:ignore */
14
+ direction: ltr;
15
+ }
@@ -0,0 +1,122 @@
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, { type JSX, useEffect, useState } from "react";
9
+
10
+ import { usePrismTheme } from "@docusaurus/theme-common";
11
+ import { translate } from "@docusaurus/Translate";
12
+ import useIsBrowser from "@docusaurus/useIsBrowser";
13
+ import { ErrorMessage } from "@hookform/error-message";
14
+ import { setStringRawBody } from "@theme/ApiExplorer/Body/slice";
15
+ import { OPENAPI_FORM } from "@theme/translationIds";
16
+ import clsx from "clsx";
17
+ import { Controller, useFormContext } from "react-hook-form";
18
+ import { LiveProvider, LiveEditor, withLive } from "react-live";
19
+
20
+ function Live({ onEdit, showErrors }: any) {
21
+ const isBrowser = useIsBrowser();
22
+ const [editorDisabled, setEditorDisabled] = useState(false);
23
+
24
+ return (
25
+ <div
26
+ onClick={() => setEditorDisabled(false)}
27
+ onBlur={() => setEditorDisabled(true)}
28
+ >
29
+ <LiveEditor
30
+ key={String(isBrowser)}
31
+ className={clsx({
32
+ "openapi-explorer__playground-editor": true,
33
+ "openapi-explorer__form-item-input": showErrors,
34
+ error: showErrors,
35
+ })}
36
+ onChange={onEdit}
37
+ disabled={editorDisabled}
38
+ tabMode="focus"
39
+ />
40
+ </div>
41
+ );
42
+ }
43
+
44
+ const LiveComponent = withLive(Live);
45
+
46
+ function App({
47
+ children,
48
+ transformCode,
49
+ value,
50
+ language,
51
+ action,
52
+ required: isRequired,
53
+ ...props
54
+ }: any): JSX.Element {
55
+ const prismTheme = usePrismTheme();
56
+ const [code, setCode] = React.useState(children.replace(/\n$/, ""));
57
+
58
+ useEffect(() => {
59
+ action(setStringRawBody(code));
60
+ }, [action, code]);
61
+
62
+ const {
63
+ control,
64
+ formState: { errors },
65
+ } = useFormContext();
66
+
67
+ const showErrorMessage = errors?.requestBody;
68
+
69
+ const handleChange = (snippet: string, onChange: any) => {
70
+ setCode(snippet);
71
+ onChange(snippet);
72
+ };
73
+
74
+ return (
75
+ <div
76
+ className={clsx({
77
+ "openapi-explorer__playground-container": true,
78
+ })}
79
+ >
80
+ <LiveProvider
81
+ code={code}
82
+ transformCode={transformCode ?? ((code) => `${code};`)}
83
+ theme={prismTheme}
84
+ language={language}
85
+ {...props}
86
+ >
87
+ <Controller
88
+ control={control}
89
+ rules={{
90
+ required:
91
+ isRequired && !code
92
+ ? translate({
93
+ id: OPENAPI_FORM.FIELD_REQUIRED,
94
+ message: "This field is required",
95
+ })
96
+ : false,
97
+ }}
98
+ name="requestBody"
99
+ render={({ field: { onChange, name } }) => (
100
+ <LiveComponent
101
+ onEdit={(e: any) => handleChange(e, onChange)}
102
+ name={name}
103
+ showErrors={showErrorMessage}
104
+ />
105
+ )}
106
+ />
107
+ {showErrorMessage && (
108
+ <ErrorMessage
109
+ errors={errors}
110
+ name="requestBody"
111
+ render={({ message }) => (
112
+ <div className="openapi-explorer__input-error">{message}</div>
113
+ )}
114
+ />
115
+ )}
116
+ </LiveProvider>
117
+ </div>
118
+ );
119
+ }
120
+
121
+ const LiveApp = withLive(App);
122
+ export default LiveApp;
@@ -0,0 +1,22 @@
1
+ .openapi__method-endpoint {
2
+ display: flex;
3
+ align-items: center;
4
+ max-width: 100%;
5
+ width: fit-content;
6
+ padding: 0.65rem;
7
+ border: 1px solid var(--ifm-toc-border-color);
8
+ }
9
+
10
+ .openapi__method-endpoint-path {
11
+ margin-bottom: 0;
12
+ margin-left: 0.5rem;
13
+ font-size: 12px;
14
+ font-weight: normal;
15
+ font-family: var(--ifm-font-family-monospace);
16
+ }
17
+
18
+ .openapi__divider {
19
+ width: 100%;
20
+ margin: 1.5rem 0;
21
+ border-bottom: 1px solid var(--ifm-toc-border-color);
22
+ }
@@ -0,0 +1,91 @@
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 BrowserOnly from "@docusaurus/BrowserOnly";
11
+ import { useTypedSelector } from "@theme/ApiItem/hooks";
12
+
13
+ function colorForMethod(method: string) {
14
+ switch (method.toLowerCase()) {
15
+ case "get":
16
+ return "primary";
17
+ case "post":
18
+ return "success";
19
+ case "delete":
20
+ return "danger";
21
+ case "put":
22
+ return "info";
23
+ case "patch":
24
+ return "warning";
25
+ case "head":
26
+ return "secondary";
27
+ case "event":
28
+ return "secondary";
29
+ default:
30
+ return undefined;
31
+ }
32
+ }
33
+
34
+ export interface Props {
35
+ method: string;
36
+ path: string;
37
+ context?: "endpoint" | "callback";
38
+ }
39
+
40
+ function MethodEndpoint({ method, path, context }: Props) {
41
+ let serverValue = useTypedSelector((state: any) => state.server.value);
42
+ let serverUrlWithVariables = "";
43
+
44
+ const renderServerUrl = () => {
45
+ if (context === "callback") {
46
+ return "";
47
+ }
48
+
49
+ if (serverValue && serverValue.variables) {
50
+ serverUrlWithVariables = serverValue.url.replace(/\/$/, "");
51
+
52
+ Object.keys(serverValue.variables).forEach((variable) => {
53
+ serverUrlWithVariables = serverUrlWithVariables.replace(
54
+ `{${variable}}`,
55
+ serverValue.variables?.[variable].default ?? ""
56
+ );
57
+ });
58
+ }
59
+
60
+ return (
61
+ <BrowserOnly>
62
+ {() => {
63
+ if (serverUrlWithVariables.length) {
64
+ return serverUrlWithVariables;
65
+ } else if (serverValue && serverValue.url) {
66
+ return serverValue.url;
67
+ }
68
+ }}
69
+ </BrowserOnly>
70
+ );
71
+ };
72
+
73
+ return (
74
+ <>
75
+ <pre className="openapi__method-endpoint">
76
+ <span className={"badge badge--" + colorForMethod(method)}>
77
+ {method === "event" ? "Webhook" : method.toUpperCase()}
78
+ </span>{" "}
79
+ {method !== "event" && (
80
+ <h2 className="openapi__method-endpoint-path">
81
+ {renderServerUrl()}
82
+ {`${path.replace(/{([a-z0-9-_]+)}/gi, ":$1")}`}
83
+ </h2>
84
+ )}
85
+ </pre>
86
+ <div className="openapi__divider" />
87
+ </>
88
+ );
89
+ }
90
+
91
+ export default MethodEndpoint;