@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,394 @@
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 Translate_1 = require("@docusaurus/Translate");
16
+ const json2xml_1 = __importDefault(require("@theme/ApiExplorer/Body/json2xml"));
17
+ const FormFileUpload_1 = __importDefault(
18
+ require("@theme/ApiExplorer/FormFileUpload")
19
+ );
20
+ const FormItem_1 = __importDefault(require("@theme/ApiExplorer/FormItem"));
21
+ const FormSelect_1 = __importDefault(require("@theme/ApiExplorer/FormSelect"));
22
+ const FormTextInput_1 = __importDefault(
23
+ require("@theme/ApiExplorer/FormTextInput")
24
+ );
25
+ const LiveEditor_1 = __importDefault(require("@theme/ApiExplorer/LiveEditor"));
26
+ const hooks_1 = require("@theme/ApiItem/hooks");
27
+ const Markdown_1 = __importDefault(require("@theme/Markdown"));
28
+ const SchemaTabs_1 = __importDefault(require("@theme/SchemaTabs"));
29
+ const TabItem_1 = __importDefault(require("@theme/TabItem"));
30
+ const translationIds_1 = require("@theme/translationIds");
31
+ const xml_formatter_1 = __importDefault(require("xml-formatter"));
32
+ const slice_1 = require("./slice");
33
+ function BodyWrap({
34
+ requestBodyMetadata,
35
+ jsonRequestBodyExample,
36
+ methods,
37
+ required,
38
+ }) {
39
+ const contentType = (0, hooks_1.useTypedSelector)(
40
+ (state) => state.contentType.value
41
+ );
42
+ // NOTE: We used to check if body was required, but opted to always show the request body
43
+ // to reduce confusion, see: https://github.com/cloud-annotations/docusaurus-openapi/issues/145
44
+ // No body
45
+ if (contentType === undefined) {
46
+ return null;
47
+ }
48
+ return react_1.default.createElement(Body, {
49
+ requestBodyMetadata: requestBodyMetadata,
50
+ jsonRequestBodyExample: jsonRequestBodyExample,
51
+ required: required,
52
+ });
53
+ }
54
+ function Body({
55
+ requestBodyMetadata,
56
+ jsonRequestBodyExample,
57
+ methods,
58
+ required,
59
+ }) {
60
+ const contentType = (0, hooks_1.useTypedSelector)(
61
+ (state) => state.contentType.value
62
+ );
63
+ const dispatch = (0, hooks_1.useTypedDispatch)();
64
+ // Lot's of possible content-types:
65
+ // - application/json
66
+ // - application/xml
67
+ // - text/plain
68
+ // - text/css
69
+ // - text/html
70
+ // - text/javascript
71
+ // - application/javascript
72
+ // - multipart/form-data
73
+ // - application/x-www-form-urlencoded
74
+ // - image/svg+xml;charset=US-ASCII
75
+ // Show editor:
76
+ // - application/json
77
+ // - application/xml
78
+ // - */*
79
+ // Show form:
80
+ // - multipart/form-data
81
+ // - application/x-www-form-urlencoded
82
+ const schema = requestBodyMetadata?.content?.[contentType]?.schema;
83
+ const example = requestBodyMetadata?.content?.[contentType]?.example;
84
+ const examples = requestBodyMetadata?.content?.[contentType]?.examples;
85
+ if (schema?.format === "binary") {
86
+ return react_1.default.createElement(
87
+ FormItem_1.default,
88
+ null,
89
+ react_1.default.createElement(FormFileUpload_1.default, {
90
+ placeholder:
91
+ schema.description ||
92
+ (0, Translate_1.translate)({
93
+ id: translationIds_1.OPENAPI_REQUEST.BODY_TITLE,
94
+ message: "Body",
95
+ }),
96
+ onChange: (file) => {
97
+ if (file === undefined) {
98
+ dispatch((0, slice_1.clearRawBody)());
99
+ return;
100
+ }
101
+ dispatch(
102
+ (0, slice_1.setFileRawBody)({
103
+ src: `/path/to/${file.name}`,
104
+ content: file,
105
+ })
106
+ );
107
+ },
108
+ })
109
+ );
110
+ }
111
+ if (
112
+ (contentType === "multipart/form-data" ||
113
+ contentType === "application/x-www-form-urlencoded") &&
114
+ schema?.type === "object"
115
+ ) {
116
+ return react_1.default.createElement(
117
+ FormItem_1.default,
118
+ { className: "openapi-explorer__form-item-body-container" },
119
+ react_1.default.createElement(
120
+ "div",
121
+ null,
122
+ Object.entries(schema.properties ?? {}).map(([key, val]) => {
123
+ if (val.format === "binary") {
124
+ return react_1.default.createElement(
125
+ FormItem_1.default,
126
+ {
127
+ key: key,
128
+ label: key,
129
+ required:
130
+ Array.isArray(schema.required) &&
131
+ schema.required.includes(key),
132
+ },
133
+ react_1.default.createElement(FormFileUpload_1.default, {
134
+ placeholder: val.description || key,
135
+ onChange: (file) => {
136
+ if (file === undefined) {
137
+ dispatch((0, slice_1.clearFormBodyKey)(key));
138
+ return;
139
+ }
140
+ dispatch(
141
+ (0, slice_1.setFileFormBody)({
142
+ key: key,
143
+ value: {
144
+ src: `/path/to/${file.name}`,
145
+ content: file,
146
+ },
147
+ })
148
+ );
149
+ },
150
+ })
151
+ );
152
+ }
153
+ if (val.enum) {
154
+ return react_1.default.createElement(
155
+ FormItem_1.default,
156
+ {
157
+ key: key,
158
+ label: key,
159
+ required:
160
+ Array.isArray(schema.required) &&
161
+ schema.required.includes(key),
162
+ },
163
+ react_1.default.createElement(FormSelect_1.default, {
164
+ options: ["---", ...val.enum],
165
+ onChange: (e) => {
166
+ const val = e.target.value;
167
+ if (val === "---") {
168
+ dispatch((0, slice_1.clearFormBodyKey)(key));
169
+ } else {
170
+ dispatch(
171
+ (0, slice_1.setStringFormBody)({
172
+ key: key,
173
+ value: val,
174
+ })
175
+ );
176
+ }
177
+ },
178
+ })
179
+ );
180
+ }
181
+ // TODO: support all the other types.
182
+ return react_1.default.createElement(
183
+ FormItem_1.default,
184
+ {
185
+ key: key,
186
+ label: key,
187
+ required:
188
+ Array.isArray(schema.required) && schema.required.includes(key),
189
+ },
190
+ react_1.default.createElement(FormTextInput_1.default, {
191
+ paramName: key,
192
+ isRequired:
193
+ Array.isArray(schema.required) && schema.required.includes(key),
194
+ placeholder: val.description || key,
195
+ onChange: (e) => {
196
+ dispatch(
197
+ (0, slice_1.setStringFormBody)({
198
+ key: key,
199
+ value: e.target.value,
200
+ })
201
+ );
202
+ },
203
+ })
204
+ );
205
+ })
206
+ )
207
+ );
208
+ }
209
+ let language = "plaintext";
210
+ let defaultBody = ""; //"body content";
211
+ let exampleBody;
212
+ let examplesBodies = [];
213
+ if (
214
+ contentType.includes("application/json") ||
215
+ contentType.endsWith("+json")
216
+ ) {
217
+ if (jsonRequestBodyExample) {
218
+ defaultBody = JSON.stringify(jsonRequestBodyExample, null, 2);
219
+ }
220
+ if (example) {
221
+ exampleBody = JSON.stringify(example, null, 2);
222
+ }
223
+ if (examples) {
224
+ for (const [key, example] of Object.entries(examples)) {
225
+ let body = example.value;
226
+ try {
227
+ // If the value is already valid JSON we shouldn't double encode the value
228
+ JSON.parse(example.value);
229
+ } catch (e) {
230
+ body = JSON.stringify(example.value, null, 2);
231
+ }
232
+ examplesBodies.push({
233
+ label: key,
234
+ body,
235
+ summary: example.summary,
236
+ });
237
+ }
238
+ }
239
+ language = "json";
240
+ }
241
+ if (contentType === "application/xml" || contentType.endsWith("+xml")) {
242
+ if (jsonRequestBodyExample) {
243
+ try {
244
+ defaultBody = (0, xml_formatter_1.default)(
245
+ (0, json2xml_1.default)(jsonRequestBodyExample, ""),
246
+ {
247
+ indentation: " ",
248
+ lineSeparator: "\n",
249
+ collapseContent: true,
250
+ }
251
+ );
252
+ } catch {
253
+ defaultBody = (0, json2xml_1.default)(jsonRequestBodyExample);
254
+ }
255
+ }
256
+ if (example) {
257
+ try {
258
+ exampleBody = (0, xml_formatter_1.default)(
259
+ (0, json2xml_1.default)(example, ""),
260
+ {
261
+ indentation: " ",
262
+ lineSeparator: "\n",
263
+ collapseContent: true,
264
+ }
265
+ );
266
+ } catch {
267
+ exampleBody = (0, json2xml_1.default)(example);
268
+ }
269
+ }
270
+ if (examples) {
271
+ for (const [key, example] of Object.entries(examples)) {
272
+ let formattedXmlBody;
273
+ try {
274
+ formattedXmlBody = (0, xml_formatter_1.default)(example.value, {
275
+ indentation: " ",
276
+ lineSeparator: "\n",
277
+ collapseContent: true,
278
+ });
279
+ } catch {
280
+ formattedXmlBody = example.value;
281
+ }
282
+ examplesBodies.push({
283
+ label: key,
284
+ body: formattedXmlBody,
285
+ summary: example.summary,
286
+ });
287
+ }
288
+ }
289
+ language = "xml";
290
+ }
291
+ if (exampleBody) {
292
+ return react_1.default.createElement(
293
+ FormItem_1.default,
294
+ null,
295
+ react_1.default.createElement(
296
+ SchemaTabs_1.default,
297
+ { className: "openapi-tabs__schema", lazy: true },
298
+ react_1.default.createElement(
299
+ TabItem_1.default,
300
+ {
301
+ label: (0, Translate_1.translate)({
302
+ id: translationIds_1.OPENAPI_BODY.EXAMPLE_FROM_SCHEMA,
303
+ message: "Example (from schema)",
304
+ }),
305
+ value: "Example (from schema)",
306
+ default: true,
307
+ },
308
+ react_1.default.createElement(
309
+ LiveEditor_1.default,
310
+ { action: dispatch, language: language, required: required },
311
+ defaultBody
312
+ )
313
+ ),
314
+ react_1.default.createElement(
315
+ TabItem_1.default,
316
+ { label: "Example", value: "example" },
317
+ example.summary &&
318
+ react_1.default.createElement(
319
+ Markdown_1.default,
320
+ null,
321
+ example.summary
322
+ ),
323
+ exampleBody &&
324
+ react_1.default.createElement(
325
+ LiveEditor_1.default,
326
+ { action: dispatch, language: language, required: required },
327
+ exampleBody
328
+ )
329
+ )
330
+ )
331
+ );
332
+ }
333
+ if (examplesBodies && examplesBodies.length > 0) {
334
+ return react_1.default.createElement(
335
+ FormItem_1.default,
336
+ { className: "openapi-explorer__form-item-body-container" },
337
+ react_1.default.createElement(
338
+ SchemaTabs_1.default,
339
+ { className: "openapi-tabs__schema", lazy: true },
340
+ react_1.default.createElement(
341
+ TabItem_1.default,
342
+ {
343
+ label: (0, Translate_1.translate)({
344
+ id: translationIds_1.OPENAPI_BODY.EXAMPLE_FROM_SCHEMA,
345
+ message: "Example (from schema)",
346
+ }),
347
+ value: "Example (from schema)",
348
+ default: true,
349
+ },
350
+ react_1.default.createElement(
351
+ LiveEditor_1.default,
352
+ { action: dispatch, language: language, required: required },
353
+ defaultBody
354
+ )
355
+ ),
356
+ examplesBodies.map((example) => {
357
+ return (
358
+ // @ts-ignore
359
+ react_1.default.createElement(
360
+ TabItem_1.default,
361
+ {
362
+ label: example.label,
363
+ value: example.label,
364
+ key: example.label,
365
+ },
366
+ example.summary &&
367
+ react_1.default.createElement(
368
+ Markdown_1.default,
369
+ null,
370
+ example.summary
371
+ ),
372
+ example.body &&
373
+ react_1.default.createElement(
374
+ LiveEditor_1.default,
375
+ { action: dispatch, language: language },
376
+ example.body
377
+ )
378
+ )
379
+ );
380
+ })
381
+ )
382
+ );
383
+ }
384
+ return react_1.default.createElement(
385
+ FormItem_1.default,
386
+ null,
387
+ react_1.default.createElement(
388
+ LiveEditor_1.default,
389
+ { action: dispatch, language: language, required: required },
390
+ defaultBody
391
+ )
392
+ );
393
+ }
394
+ exports.default = BodyWrap;
@@ -0,0 +1,43 @@
1
+ /* ============================================================================
2
+ * Copyright (c) Palo Alto Networks
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ * ========================================================================== */
7
+
8
+ export default function json2xml(o, tab) {
9
+ var toXml = function (v, name, ind) {
10
+ var xml = "";
11
+ if (v instanceof Array) {
12
+ for (var i = 0, n = v.length; i < n; i++)
13
+ xml += ind + toXml(v[i], name, ind + "\t") + "\n";
14
+ } else if (typeof v == "object") {
15
+ var hasChild = false;
16
+ xml += ind + "<" + name;
17
+ for (var m in v) {
18
+ if (m.charAt(0) === "@")
19
+ xml += " " + m.substr(1) + '="' + v[m].toString() + '"';
20
+ else hasChild = true;
21
+ }
22
+ xml += hasChild ? ">" : "/>";
23
+ if (hasChild) {
24
+ for (var m2 in v) {
25
+ if (m2 === "#text") xml += v[m2];
26
+ else if (m2 === "#cdata") xml += "<![CDATA[" + v[m2] + "]]>";
27
+ else if (m2.charAt(0) !== "@") xml += toXml(v[m2], m2, ind + "\t");
28
+ }
29
+ xml +=
30
+ (xml.charAt(xml.length - 1) === "\n" ? ind : "") +
31
+ "</" +
32
+ name +
33
+ ">";
34
+ }
35
+ } else {
36
+ xml += ind + "<" + name + ">" + v.toString() + "</" + name + ">";
37
+ }
38
+ return xml;
39
+ },
40
+ xml = "";
41
+ for (var m3 in o) xml += toXml(o[m3], m3, "");
42
+ return tab ? xml.replace(/\t/g, tab) : xml.replace(/\t|\n/g, "");
43
+ }
@@ -0,0 +1,82 @@
1
+ import { PayloadAction } from "@reduxjs/toolkit";
2
+ export interface FileContent {
3
+ type: "file";
4
+ value: {
5
+ src: string;
6
+ content: Blob;
7
+ };
8
+ }
9
+ export interface StringContent {
10
+ type: "string";
11
+ value?: string;
12
+ }
13
+ export type Content = FileContent | StringContent | undefined;
14
+ export interface FormBody {
15
+ type: "form";
16
+ content: {
17
+ [key: string]: Content;
18
+ };
19
+ }
20
+ export interface RawBody {
21
+ type: "raw";
22
+ content: Content;
23
+ }
24
+ export interface EmptyBody {
25
+ type: "empty";
26
+ }
27
+ export type Body = EmptyBody | FormBody | RawBody;
28
+ export type State = Body;
29
+ export declare const slice: import("@reduxjs/toolkit").Slice<FormBody | RawBody | EmptyBody, {
30
+ clearRawBody: (_state: import("immer").WritableDraft<FormBody> | import("immer").WritableDraft<RawBody> | import("immer").WritableDraft<EmptyBody>) => {
31
+ type: "empty";
32
+ };
33
+ setStringRawBody: (_state: import("immer").WritableDraft<FormBody> | import("immer").WritableDraft<RawBody> | import("immer").WritableDraft<EmptyBody>, action: PayloadAction<string>) => {
34
+ type: "raw";
35
+ content: {
36
+ type: "string";
37
+ value: string;
38
+ };
39
+ };
40
+ setFileRawBody: (_state: import("immer").WritableDraft<FormBody> | import("immer").WritableDraft<RawBody> | import("immer").WritableDraft<EmptyBody>, action: PayloadAction<FileContent["value"]>) => {
41
+ type: "raw";
42
+ content: {
43
+ type: "file";
44
+ value: {
45
+ src: string;
46
+ content: Blob;
47
+ };
48
+ };
49
+ };
50
+ clearFormBodyKey: (state: import("immer").WritableDraft<FormBody> | import("immer").WritableDraft<RawBody> | import("immer").WritableDraft<EmptyBody>, action: PayloadAction<string>) => void;
51
+ setStringFormBody: (state: import("immer").WritableDraft<FormBody> | import("immer").WritableDraft<RawBody> | import("immer").WritableDraft<EmptyBody>, action: PayloadAction<{
52
+ key: string;
53
+ value: string;
54
+ }>) => import("immer").WritableDraft<FormBody>;
55
+ setFileFormBody: (state: import("immer").WritableDraft<FormBody> | import("immer").WritableDraft<RawBody> | import("immer").WritableDraft<EmptyBody>, action: PayloadAction<{
56
+ key: string;
57
+ value: FileContent["value"];
58
+ }>) => import("immer").WritableDraft<FormBody> | {
59
+ type: "form";
60
+ content: {
61
+ [x: string]: {
62
+ type: "file";
63
+ value: {
64
+ src: string;
65
+ content: Blob;
66
+ };
67
+ };
68
+ };
69
+ };
70
+ }, "body", "body", import("@reduxjs/toolkit").SliceSelectors<FormBody | RawBody | EmptyBody>>;
71
+ export declare const clearRawBody: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"body/clearRawBody">, setStringRawBody: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "body/setStringRawBody">, setFileRawBody: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
72
+ src: string;
73
+ content: Blob;
74
+ }, "body/setFileRawBody">, clearFormBodyKey: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "body/clearFormBodyKey">, setStringFormBody: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
75
+ key: string;
76
+ value: string;
77
+ }, "body/setStringFormBody">, setFileFormBody: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
78
+ key: string;
79
+ value: FileContent["value"];
80
+ }, "body/setFileFormBody">;
81
+ declare const _default: import("redux").Reducer<FormBody | RawBody | EmptyBody>;
82
+ export default _default;
@@ -0,0 +1,97 @@
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 _a;
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.setFileFormBody =
11
+ exports.setStringFormBody =
12
+ exports.clearFormBodyKey =
13
+ exports.setFileRawBody =
14
+ exports.setStringRawBody =
15
+ exports.clearRawBody =
16
+ exports.slice =
17
+ void 0;
18
+ const toolkit_1 = require("@reduxjs/toolkit");
19
+ const initialState = {};
20
+ exports.slice = (0, toolkit_1.createSlice)({
21
+ name: "body",
22
+ initialState,
23
+ reducers: {
24
+ clearRawBody: (_state) => {
25
+ return {
26
+ type: "empty",
27
+ };
28
+ },
29
+ setStringRawBody: (_state, action) => {
30
+ return {
31
+ type: "raw",
32
+ content: {
33
+ type: "string",
34
+ value: action.payload,
35
+ },
36
+ };
37
+ },
38
+ setFileRawBody: (_state, action) => {
39
+ return {
40
+ type: "raw",
41
+ content: {
42
+ type: "file",
43
+ value: action.payload,
44
+ },
45
+ };
46
+ },
47
+ clearFormBodyKey: (state, action) => {
48
+ if (state?.type === "form") {
49
+ delete state.content[action.payload];
50
+ }
51
+ },
52
+ setStringFormBody: (state, action) => {
53
+ if (state?.type !== "form") {
54
+ return {
55
+ type: "form",
56
+ content: {
57
+ [action.payload.key]: {
58
+ type: "string",
59
+ value: action.payload.value,
60
+ },
61
+ },
62
+ };
63
+ }
64
+ state.content[action.payload.key] = {
65
+ type: "string",
66
+ value: action.payload.value,
67
+ };
68
+ return state;
69
+ },
70
+ setFileFormBody: (state, action) => {
71
+ if (state?.type !== "form") {
72
+ return {
73
+ type: "form",
74
+ content: {
75
+ [action.payload.key]: {
76
+ type: "file",
77
+ value: action.payload.value,
78
+ },
79
+ },
80
+ };
81
+ }
82
+ state.content[action.payload.key] = {
83
+ type: "file",
84
+ value: action.payload.value,
85
+ };
86
+ return state;
87
+ },
88
+ },
89
+ });
90
+ ((_a = exports.slice.actions),
91
+ (exports.clearRawBody = _a.clearRawBody),
92
+ (exports.setStringRawBody = _a.setStringRawBody),
93
+ (exports.setFileRawBody = _a.setFileRawBody),
94
+ (exports.clearFormBodyKey = _a.clearFormBodyKey),
95
+ (exports.setStringFormBody = _a.setStringFormBody),
96
+ (exports.setFileFormBody = _a.setFileFormBody));
97
+ exports.default = exports.slice.reducer;
@@ -0,0 +1,21 @@
1
+ export type CodeSampleLanguage = "C" | "C#" | "C++" | "CoffeeScript" | "CSS" | "Dart" | "DM" | "Elixir" | "Go" | "Groovy" | "HTML" | "Java" | "JavaScript" | "Kotlin" | "Objective-C" | "OCaml" | "Perl" | "PHP" | "PowerShell" | "Python" | "R" | "Ruby" | "Rust" | "Scala" | "Shell" | "Swift" | "TypeScript";
2
+ export interface Language {
3
+ highlight: string;
4
+ language: string;
5
+ codeSampleLanguage: CodeSampleLanguage;
6
+ logoClass: string;
7
+ variant: string;
8
+ variants: string[];
9
+ options?: {
10
+ [key: string]: boolean;
11
+ };
12
+ sample?: string;
13
+ samples?: string[];
14
+ samplesSources?: string[];
15
+ samplesLabels?: string[];
16
+ }
17
+ export interface CodeSample {
18
+ source: string;
19
+ lang: CodeSampleLanguage;
20
+ label?: string;
21
+ }
@@ -0,0 +1,8 @@
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 });
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import * as sdk from "postman-collection";
3
+ import { CodeSample, Language } from "./code-snippets-types";
4
+ export declare const languageSet: Language[];
5
+ export interface Props {
6
+ postman: sdk.Request;
7
+ codeSamples: CodeSample[];
8
+ maskCredentials?: boolean;
9
+ }
10
+ declare function CodeSnippets({ postman, codeSamples, maskCredentials: propMaskCredentials, }: Props): React.JSX.Element | null;
11
+ export default CodeSnippets;