fumadocs-openapi 10.2.2 → 10.2.3

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 (278) hide show
  1. package/dist/generate-file.d.ts +53 -49
  2. package/dist/generate-file.d.ts.map +1 -1
  3. package/dist/generate-file.js +88 -102
  4. package/dist/generate-file.js.map +1 -0
  5. package/dist/index.d.ts +6 -6
  6. package/dist/index.js +3 -1
  7. package/dist/playground/client.d.ts +88 -72
  8. package/dist/playground/client.d.ts.map +1 -1
  9. package/dist/playground/client.js +446 -296
  10. package/dist/playground/client.js.map +1 -0
  11. package/dist/playground/components/inputs.js +395 -172
  12. package/dist/playground/components/inputs.js.map +1 -0
  13. package/dist/playground/components/oauth-dialog.js +270 -174
  14. package/dist/playground/components/oauth-dialog.js.map +1 -0
  15. package/dist/playground/components/server-select.js +115 -55
  16. package/dist/playground/components/server-select.js.map +1 -0
  17. package/dist/playground/fetcher.d.ts +10 -18
  18. package/dist/playground/fetcher.d.ts.map +1 -1
  19. package/dist/playground/fetcher.js +67 -75
  20. package/dist/playground/fetcher.js.map +1 -0
  21. package/dist/playground/get-default-values.js +23 -26
  22. package/dist/playground/get-default-values.js.map +1 -0
  23. package/dist/playground/index.d.ts +23 -13
  24. package/dist/playground/index.d.ts.map +1 -1
  25. package/dist/playground/index.js +87 -91
  26. package/dist/playground/index.js.map +1 -0
  27. package/dist/playground/lazy.js +9 -2
  28. package/dist/playground/lazy.js.map +1 -0
  29. package/dist/playground/schema.d.ts +18 -55
  30. package/dist/playground/schema.d.ts.map +1 -1
  31. package/dist/playground/schema.js +117 -106
  32. package/dist/playground/schema.js.map +1 -0
  33. package/dist/playground/status-info.js +49 -37
  34. package/dist/playground/status-info.js.map +1 -0
  35. package/dist/requests/generators/csharp.js +40 -50
  36. package/dist/requests/generators/csharp.js.map +1 -0
  37. package/dist/requests/generators/curl.js +28 -27
  38. package/dist/requests/generators/curl.js.map +1 -0
  39. package/dist/requests/generators/go.js +39 -35
  40. package/dist/requests/generators/go.js.map +1 -0
  41. package/dist/requests/generators/index.js +49 -43
  42. package/dist/requests/generators/index.js.map +1 -0
  43. package/dist/requests/generators/java.js +56 -67
  44. package/dist/requests/generators/java.js.map +1 -0
  45. package/dist/requests/generators/javascript.js +38 -45
  46. package/dist/requests/generators/javascript.js.map +1 -0
  47. package/dist/requests/generators/python.js +33 -37
  48. package/dist/requests/generators/python.js.map +1 -0
  49. package/dist/requests/media/adapter.d.ts +38 -84
  50. package/dist/requests/media/adapter.d.ts.map +1 -1
  51. package/dist/requests/media/adapter.js +122 -169
  52. package/dist/requests/media/adapter.js.map +1 -0
  53. package/dist/requests/media/encode.d.ts +12 -7
  54. package/dist/requests/media/encode.d.ts.map +1 -1
  55. package/dist/requests/media/encode.js +129 -109
  56. package/dist/requests/media/encode.js.map +1 -0
  57. package/dist/requests/media/resolve-adapter.js +28 -28
  58. package/dist/requests/media/resolve-adapter.js.map +1 -0
  59. package/dist/requests/string-utils.js +28 -35
  60. package/dist/requests/string-utils.js.map +1 -0
  61. package/dist/requests/to-python-object.js +16 -28
  62. package/dist/requests/to-python-object.js.map +1 -0
  63. package/dist/requests/types.d.ts +25 -21
  64. package/dist/requests/types.d.ts.map +1 -1
  65. package/dist/scalar/client.js +57 -20
  66. package/dist/scalar/client.js.map +1 -0
  67. package/dist/scalar/index.d.ts +8 -2
  68. package/dist/scalar/index.d.ts.map +1 -1
  69. package/dist/scalar/index.js +29 -19
  70. package/dist/scalar/index.js.map +1 -0
  71. package/dist/server/create.d.ts +29 -25
  72. package/dist/server/create.d.ts.map +1 -1
  73. package/dist/server/create.js +42 -39
  74. package/dist/server/create.js.map +1 -0
  75. package/dist/server/index.d.ts +3 -3
  76. package/dist/server/index.js +4 -2
  77. package/dist/server/proxy.d.ts +28 -28
  78. package/dist/server/proxy.d.ts.map +1 -1
  79. package/dist/server/proxy.js +58 -75
  80. package/dist/server/proxy.js.map +1 -0
  81. package/dist/server/source-api.d.ts +32 -29
  82. package/dist/server/source-api.d.ts.map +1 -1
  83. package/dist/server/source-api.js +82 -75
  84. package/dist/server/source-api.js.map +1 -0
  85. package/dist/types.d.ts +41 -36
  86. package/dist/types.d.ts.map +1 -1
  87. package/dist/ui/api-page.d.ts +140 -136
  88. package/dist/ui/api-page.d.ts.map +1 -1
  89. package/dist/ui/api-page.js +134 -118
  90. package/dist/ui/api-page.js.map +1 -0
  91. package/dist/ui/client/index.d.ts +30 -26
  92. package/dist/ui/client/index.d.ts.map +1 -1
  93. package/dist/ui/client/index.js +8 -2
  94. package/dist/ui/client/index.js.map +1 -0
  95. package/dist/ui/client/storage-key.js +16 -10
  96. package/dist/ui/client/storage-key.js.map +1 -0
  97. package/dist/ui/components/accordion.js +40 -14
  98. package/dist/ui/components/accordion.js.map +1 -0
  99. package/dist/ui/components/dialog.js +51 -15
  100. package/dist/ui/components/dialog.js.map +1 -0
  101. package/dist/ui/components/input.js +18 -8
  102. package/dist/ui/components/input.js.map +1 -0
  103. package/dist/ui/components/method-label.js +38 -33
  104. package/dist/ui/components/method-label.js.map +1 -0
  105. package/dist/ui/components/select.js +66 -15
  106. package/dist/ui/components/select.js.map +1 -0
  107. package/dist/ui/contexts/api.js +96 -85
  108. package/dist/ui/contexts/api.js.map +1 -0
  109. package/dist/ui/contexts/api.lazy.js +9 -2
  110. package/dist/ui/contexts/api.lazy.js.map +1 -0
  111. package/dist/ui/index.d.ts +2 -2
  112. package/dist/ui/index.js +3 -1
  113. package/dist/ui/operation/client.js +65 -27
  114. package/dist/ui/operation/client.js.map +1 -0
  115. package/dist/ui/operation/index.js +403 -186
  116. package/dist/ui/operation/index.js.map +1 -0
  117. package/dist/ui/operation/request-tabs.d.ts +15 -16
  118. package/dist/ui/operation/request-tabs.d.ts.map +1 -1
  119. package/dist/ui/operation/request-tabs.js +151 -131
  120. package/dist/ui/operation/request-tabs.js.map +1 -0
  121. package/dist/ui/operation/response-tabs.d.ts +27 -28
  122. package/dist/ui/operation/response-tabs.d.ts.map +1 -1
  123. package/dist/ui/operation/response-tabs.js +73 -56
  124. package/dist/ui/operation/response-tabs.js.map +1 -0
  125. package/dist/ui/operation/usage-tabs/client.js +117 -88
  126. package/dist/ui/operation/usage-tabs/client.js.map +1 -0
  127. package/dist/ui/operation/usage-tabs/index.d.ts +22 -21
  128. package/dist/ui/operation/usage-tabs/index.d.ts.map +1 -1
  129. package/dist/ui/operation/usage-tabs/index.js +63 -48
  130. package/dist/ui/operation/usage-tabs/index.js.map +1 -0
  131. package/dist/ui/operation/usage-tabs/lazy.js +11 -4
  132. package/dist/ui/operation/usage-tabs/lazy.js.map +1 -0
  133. package/dist/ui/schema/client.d.ts +11 -7
  134. package/dist/ui/schema/client.d.ts.map +1 -1
  135. package/dist/ui/schema/client.js +213 -127
  136. package/dist/ui/schema/client.js.map +1 -0
  137. package/dist/ui/schema/index.d.ts +51 -50
  138. package/dist/ui/schema/index.d.ts.map +1 -1
  139. package/dist/ui/schema/index.js +225 -248
  140. package/dist/ui/schema/index.js.map +1 -0
  141. package/dist/ui/schema/lazy.js +9 -2
  142. package/dist/ui/schema/lazy.js.map +1 -0
  143. package/dist/utils/cn.js +3 -1
  144. package/dist/utils/deep-equal.js +18 -26
  145. package/dist/utils/deep-equal.js.map +1 -0
  146. package/dist/utils/get-typescript-schema.js +21 -19
  147. package/dist/utils/get-typescript-schema.js.map +1 -0
  148. package/dist/utils/id-to-title.js +13 -16
  149. package/dist/utils/id-to-title.js.map +1 -0
  150. package/dist/utils/lazy.js +13 -11
  151. package/dist/utils/lazy.js.map +1 -0
  152. package/dist/utils/merge-schema.js +130 -174
  153. package/dist/utils/merge-schema.js.map +1 -0
  154. package/dist/utils/pages/builder.d.ts +80 -76
  155. package/dist/utils/pages/builder.d.ts.map +1 -1
  156. package/dist/utils/pages/builder.js +101 -118
  157. package/dist/utils/pages/builder.js.map +1 -0
  158. package/dist/utils/pages/preset-auto.d.ts +58 -55
  159. package/dist/utils/pages/preset-auto.d.ts.map +1 -1
  160. package/dist/utils/pages/preset-auto.js +124 -137
  161. package/dist/utils/pages/preset-auto.js.map +1 -0
  162. package/dist/utils/pages/to-body.js +21 -18
  163. package/dist/utils/pages/to-body.js.map +1 -0
  164. package/dist/utils/pages/to-static-data.js +48 -40
  165. package/dist/utils/pages/to-static-data.js.map +1 -0
  166. package/dist/utils/pages/to-text.d.ts +43 -41
  167. package/dist/utils/pages/to-text.d.ts.map +1 -1
  168. package/dist/utils/pages/to-text.js +93 -126
  169. package/dist/utils/pages/to-text.js.map +1 -0
  170. package/dist/utils/process-document.d.ts +18 -19
  171. package/dist/utils/process-document.d.ts.map +1 -1
  172. package/dist/utils/process-document.js +43 -54
  173. package/dist/utils/process-document.js.map +1 -0
  174. package/dist/utils/remove-undefined.js +18 -18
  175. package/dist/utils/remove-undefined.js.map +1 -0
  176. package/dist/utils/schema-to-string.js +46 -64
  177. package/dist/utils/schema-to-string.js.map +1 -0
  178. package/dist/utils/schema.d.ts +11 -27
  179. package/dist/utils/schema.d.ts.map +1 -1
  180. package/dist/utils/schema.js +43 -44
  181. package/dist/utils/schema.js.map +1 -0
  182. package/dist/utils/url.js +35 -56
  183. package/dist/utils/url.js.map +1 -0
  184. package/dist/utils/use-query.js +39 -33
  185. package/dist/utils/use-query.js.map +1 -0
  186. package/package.json +33 -32
  187. package/dist/index.d.ts.map +0 -1
  188. package/dist/playground/components/inputs.d.ts +0 -25
  189. package/dist/playground/components/inputs.d.ts.map +0 -1
  190. package/dist/playground/components/oauth-dialog.d.ts +0 -13
  191. package/dist/playground/components/oauth-dialog.d.ts.map +0 -1
  192. package/dist/playground/components/server-select.d.ts +0 -3
  193. package/dist/playground/components/server-select.d.ts.map +0 -1
  194. package/dist/playground/get-default-values.d.ts +0 -3
  195. package/dist/playground/get-default-values.d.ts.map +0 -1
  196. package/dist/playground/lazy.d.ts +0 -2
  197. package/dist/playground/lazy.d.ts.map +0 -1
  198. package/dist/playground/status-info.d.ts +0 -8
  199. package/dist/playground/status-info.d.ts.map +0 -1
  200. package/dist/requests/generators/csharp.d.ts +0 -3
  201. package/dist/requests/generators/csharp.d.ts.map +0 -1
  202. package/dist/requests/generators/curl.d.ts +0 -3
  203. package/dist/requests/generators/curl.d.ts.map +0 -1
  204. package/dist/requests/generators/go.d.ts +0 -3
  205. package/dist/requests/generators/go.d.ts.map +0 -1
  206. package/dist/requests/generators/index.d.ts +0 -3
  207. package/dist/requests/generators/index.d.ts.map +0 -1
  208. package/dist/requests/generators/java.d.ts +0 -3
  209. package/dist/requests/generators/java.d.ts.map +0 -1
  210. package/dist/requests/generators/javascript.d.ts +0 -3
  211. package/dist/requests/generators/javascript.d.ts.map +0 -1
  212. package/dist/requests/generators/python.d.ts +0 -3
  213. package/dist/requests/generators/python.d.ts.map +0 -1
  214. package/dist/requests/media/resolve-adapter.d.ts +0 -19
  215. package/dist/requests/media/resolve-adapter.d.ts.map +0 -1
  216. package/dist/requests/string-utils.d.ts +0 -7
  217. package/dist/requests/string-utils.d.ts.map +0 -1
  218. package/dist/requests/to-python-object.d.ts +0 -2
  219. package/dist/requests/to-python-object.d.ts.map +0 -1
  220. package/dist/requests/types.js +0 -1
  221. package/dist/scalar/client.d.ts +0 -7
  222. package/dist/scalar/client.d.ts.map +0 -1
  223. package/dist/server/index.d.ts.map +0 -1
  224. package/dist/types.js +0 -1
  225. package/dist/ui/client/storage-key.d.ts +0 -9
  226. package/dist/ui/client/storage-key.d.ts.map +0 -1
  227. package/dist/ui/components/accordion.d.ts +0 -8
  228. package/dist/ui/components/accordion.d.ts.map +0 -1
  229. package/dist/ui/components/dialog.d.ts +0 -20
  230. package/dist/ui/components/dialog.d.ts.map +0 -1
  231. package/dist/ui/components/input.d.ts +0 -6
  232. package/dist/ui/components/input.d.ts.map +0 -1
  233. package/dist/ui/components/method-label.d.ts +0 -10
  234. package/dist/ui/components/method-label.d.ts.map +0 -1
  235. package/dist/ui/components/select.d.ts +0 -14
  236. package/dist/ui/components/select.d.ts.map +0 -1
  237. package/dist/ui/contexts/api.d.ts +0 -33
  238. package/dist/ui/contexts/api.d.ts.map +0 -1
  239. package/dist/ui/contexts/api.lazy.d.ts +0 -2
  240. package/dist/ui/contexts/api.lazy.d.ts.map +0 -1
  241. package/dist/ui/icons.d.ts +0 -49
  242. package/dist/ui/icons.d.ts.map +0 -1
  243. package/dist/ui/icons.js +0 -281
  244. package/dist/ui/index.d.ts.map +0 -1
  245. package/dist/ui/operation/client.d.ts +0 -19
  246. package/dist/ui/operation/client.d.ts.map +0 -1
  247. package/dist/ui/operation/index.d.ts +0 -12
  248. package/dist/ui/operation/index.d.ts.map +0 -1
  249. package/dist/ui/operation/usage-tabs/client.d.ts +0 -23
  250. package/dist/ui/operation/usage-tabs/client.d.ts.map +0 -1
  251. package/dist/ui/operation/usage-tabs/lazy.d.ts +0 -4
  252. package/dist/ui/operation/usage-tabs/lazy.d.ts.map +0 -1
  253. package/dist/ui/schema/lazy.d.ts +0 -2
  254. package/dist/ui/schema/lazy.d.ts.map +0 -1
  255. package/dist/utils/cn.d.ts +0 -2
  256. package/dist/utils/cn.d.ts.map +0 -1
  257. package/dist/utils/deep-equal.d.ts +0 -2
  258. package/dist/utils/deep-equal.d.ts.map +0 -1
  259. package/dist/utils/get-typescript-schema.d.ts +0 -4
  260. package/dist/utils/get-typescript-schema.d.ts.map +0 -1
  261. package/dist/utils/id-to-title.d.ts +0 -2
  262. package/dist/utils/id-to-title.d.ts.map +0 -1
  263. package/dist/utils/lazy.d.ts +0 -5
  264. package/dist/utils/lazy.d.ts.map +0 -1
  265. package/dist/utils/merge-schema.d.ts +0 -7
  266. package/dist/utils/merge-schema.d.ts.map +0 -1
  267. package/dist/utils/pages/to-body.d.ts +0 -4
  268. package/dist/utils/pages/to-body.d.ts.map +0 -1
  269. package/dist/utils/pages/to-static-data.d.ts +0 -10
  270. package/dist/utils/pages/to-static-data.d.ts.map +0 -1
  271. package/dist/utils/remove-undefined.d.ts +0 -2
  272. package/dist/utils/remove-undefined.d.ts.map +0 -1
  273. package/dist/utils/schema-to-string.d.ts +0 -8
  274. package/dist/utils/schema-to-string.d.ts.map +0 -1
  275. package/dist/utils/url.d.ts +0 -11
  276. package/dist/utils/url.d.ts.map +0 -1
  277. package/dist/utils/use-query.d.ts +0 -8
  278. package/dist/utils/use-query.d.ts.map +0 -1
@@ -1,194 +1,411 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { Fragment } from 'react';
3
- import { createMethod, methodKeys, } from '../../utils/schema.js';
4
- import { idToTitle } from '../../utils/id-to-title.js';
5
- import { Schema } from '../schema/index.js';
6
- import { UsageTabs } from '../../ui/operation/usage-tabs/index.js';
7
- import { MethodLabel } from '../../ui/components/method-label.js';
8
- import { getTypescriptSchema } from '../../utils/get-typescript-schema.js';
9
- import { CopyResponseTypeScript, SelectTab, SelectTabs, SelectTabTrigger, } from './client.js';
10
- import { AccordionContent, AccordionHeader, AccordionItem, Accordions, AccordionTrigger, } from '../../ui/components/accordion.js';
11
- import { isMediaTypeSupported } from '../../requests/media/adapter.js';
12
- import { cn } from '../../utils/cn.js';
13
- import { APIPlayground } from '../../playground/index.js';
14
- import { getExampleRequests, RequestTabs } from './request-tabs.js';
15
- import { UsageTabsProviderLazy } from './usage-tabs/lazy.js';
1
+ import { idToTitle } from "../../utils/id-to-title.js";
2
+ import { createMethod, methodKeys } from "../../utils/schema.js";
3
+ import { isMediaTypeSupported } from "../../requests/media/resolve-adapter.js";
4
+ import "../../requests/media/adapter.js";
5
+ import { cn } from "../../utils/cn.js";
6
+ import { MethodLabel } from "../components/method-label.js";
7
+ import { APIPlayground } from "../../playground/index.js";
8
+ import { Schema } from "../schema/index.js";
9
+ import { UsageTabsProviderLazy } from "./usage-tabs/lazy.js";
10
+ import { AccordionContent, AccordionHeader, AccordionItem, AccordionTrigger, Accordions } from "../components/accordion.js";
11
+ import { UsageTabs } from "./usage-tabs/index.js";
12
+ import { getTypescriptSchema } from "../../utils/get-typescript-schema.js";
13
+ import { CopyResponseTypeScript, SelectTab, SelectTabTrigger, SelectTabs } from "./client.js";
14
+ import { RequestTabs, getExampleRequests } from "./request-tabs.js";
15
+ import { Fragment } from "react";
16
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
17
+
18
+ //#region src/ui/operation/index.tsx
16
19
  const ParamTypes = {
17
- path: 'Path Parameters',
18
- query: 'Query Parameters',
19
- header: 'Header Parameters',
20
- cookie: 'Cookie Parameters',
20
+ path: "Path Parameters",
21
+ query: "Query Parameters",
22
+ header: "Header Parameters",
23
+ cookie: "Cookie Parameters"
21
24
  };
22
- export async function Operation({ type = 'operation', path, method, ctx, showTitle, showDescription, headingLevel = 2, }) {
23
- const { schema: { dereferenced }, } = ctx;
24
- const body = method.requestBody;
25
- let headNode = null;
26
- const descriptionNode = showDescription &&
27
- method.description &&
28
- ctx.renderMarkdown(method.description);
29
- let bodyNode = null;
30
- let authNode = null;
31
- let responseNode = null;
32
- let callbacksNode = null;
33
- if (showTitle) {
34
- const title = method.summary ||
35
- (method.operationId ? idToTitle(method.operationId) : path);
36
- headNode = ctx.renderHeading(headingLevel, title);
37
- headingLevel++;
38
- }
39
- const contentTypes = body ? Object.entries(body.content) : null;
40
- if (body && contentTypes && contentTypes.length > 0) {
41
- const items = contentTypes.map(([key]) => ({
42
- label: _jsx("code", { className: "text-xs", children: key }),
43
- value: key,
44
- }));
45
- bodyNode = (_jsxs(SelectTabs, { defaultValue: items[0].value, children: [_jsxs("div", { className: "flex gap-2 items-center justify-between mt-10", children: [ctx.renderHeading(headingLevel, 'Request Body', {
46
- className: 'my-0!',
47
- }), contentTypes.length > 1 ? (_jsx(SelectTabTrigger, { items: items, className: "font-medium" })) : (_jsx("p", { className: "text-fd-muted-foreground not-prose", children: items[0].label }))] }), body.description && ctx.renderMarkdown(body.description), contentTypes.map(([type, content]) => {
48
- if (!isMediaTypeSupported(type, ctx.mediaAdapters)) {
49
- throw new Error(`Media type ${type} is not supported (in ${path})`);
50
- }
51
- return (_jsx(SelectTab, { value: type, children: _jsx(Schema, { client: {
52
- name: 'body',
53
- as: 'body',
54
- required: body.required,
55
- }, root: (content.schema ?? {}), readOnly: method.method === 'GET', writeOnly: method.method !== 'GET', ctx: ctx }) }, type));
56
- })] }));
57
- }
58
- if (method.responses && ctx.showResponseSchema !== false) {
59
- const statuses = Object.keys(method.responses);
60
- responseNode = (_jsxs(_Fragment, { children: [ctx.renderHeading(headingLevel, 'Response Body'), _jsx(Accordions, { type: "multiple", children: statuses.map((status) => (_jsx(ResponseAccordion, { status: status, operation: method, ctx: ctx }, status))) })] }));
61
- }
62
- const parameterNode = Object.entries(ParamTypes).map(([type, title]) => {
63
- const params = method.parameters?.filter((param) => param.in === type);
64
- if (!params || params.length === 0)
65
- return;
66
- return (_jsxs(Fragment, { children: [ctx.renderHeading(headingLevel, title), _jsx("div", { className: "flex flex-col", children: params.map((param) => (_jsx(Schema, { client: {
67
- name: param.name,
68
- required: param.required,
69
- }, root: {
70
- ...param.schema,
71
- description: param.description ?? param.schema?.description,
72
- deprecated: (param.deprecated ?? false) ||
73
- (param.schema?.deprecated ?? false),
74
- }, readOnly: method.method === 'GET', writeOnly: method.method !== 'GET', ctx: ctx }, param.name))) })] }, type));
75
- });
76
- const securities = (method.security ?? dereferenced.security ?? []).filter((v) => Object.keys(v).length > 0);
77
- if (type === 'operation' && securities.length > 0) {
78
- const securitySchemes = dereferenced.components?.securitySchemes;
79
- const items = securities.map((security, i) => {
80
- return {
81
- value: String(i),
82
- label: (_jsx("div", { className: "flex flex-col text-xs min-w-0", children: Object.entries(security).map(([key, scopes]) => (_jsxs("code", { className: "truncate", children: [_jsx("span", { className: "font-medium", children: key }), ' ', scopes.length > 0 && (_jsx("span", { className: "text-fd-muted-foreground", children: scopes.join(', ') }))] }, key))) })),
83
- };
84
- });
85
- authNode = (_jsxs(SelectTabs, { defaultValue: items[0].value, children: [_jsxs("div", { className: "flex items-start justify-between gap-2 mt-10", children: [ctx.renderHeading(headingLevel, 'Authorization', {
86
- className: 'my-0!',
87
- }), items.length > 1 ? (_jsx(SelectTabTrigger, { items: items })) : (_jsx("div", { className: "not-prose", children: items[0].label }))] }), securities.map((security, i) => (_jsx(SelectTab, { value: items[i].value, children: Object.entries(security).map(([key, scopes]) => {
88
- const scheme = securitySchemes?.[key];
89
- if (!scheme)
90
- return;
91
- return (_jsx(AuthScheme, { scheme: scheme, scopes: scopes, ctx: ctx }, key));
92
- }) }, i)))] }));
93
- }
94
- const callbacks = method.callbacks ? Object.entries(method.callbacks) : null;
95
- if (callbacks && callbacks.length > 0) {
96
- const items = callbacks.map(([key]) => ({
97
- label: _jsx("code", { className: "text-xs", children: key }),
98
- value: key,
99
- }));
100
- callbacksNode = (_jsxs(SelectTabs, { defaultValue: items[0].value, children: [_jsxs("div", { className: "flex justify-between gap-2 items-end mt-10", children: [ctx.renderHeading(headingLevel, 'Callbacks', {
101
- className: 'my-0!',
102
- }), callbacks.length > 1 ? (_jsx(SelectTabTrigger, { items: items, className: "font-medium" })) : (_jsx("p", { className: "text-fd-muted-foreground not-prose", children: items[0].label }))] }), callbacks.map(([name, callback]) => (_jsx(SelectTab, { value: name, children: _jsx(WebhookCallback, { callback: callback, ctx: ctx, headingLevel: headingLevel }) }, name)))] }));
103
- }
104
- let { renderOperationLayout, renderWebhookLayout } = ctx.content ?? {};
105
- if (type === 'operation') {
106
- renderOperationLayout ?? (renderOperationLayout = (slots) => {
107
- return (_jsxs("div", { className: "flex flex-col gap-x-6 gap-y-4 @4xl:flex-row @4xl:items-start", children: [_jsxs("div", { className: "min-w-0 flex-1", children: [slots.header, slots.apiPlayground, slots.description, slots.authSchemes, slots.paremeters, slots.body, slots.responses, slots.callbacks] }), _jsx("div", { className: "@4xl:sticky @4xl:top-[calc(var(--fd-docs-row-1,2rem)+1rem)] @4xl:w-[400px]", children: slots.apiExample })] }));
108
- });
109
- const playgroundEnabled = ctx.playground?.enabled ?? true;
110
- const content = await renderOperationLayout({
111
- header: headNode,
112
- description: descriptionNode,
113
- authSchemes: authNode,
114
- body: bodyNode,
115
- callbacks: callbacksNode,
116
- paremeters: parameterNode,
117
- responses: responseNode,
118
- apiPlayground: playgroundEnabled ? (_jsx(APIPlayground, { path: path, method: method, ctx: ctx })) : (_jsxs("div", { className: "flex flex-row items-center gap-2.5 p-3 rounded-xl border bg-fd-card text-fd-card-foreground not-prose", children: [_jsx(MethodLabel, { className: "text-xs", children: method.method }), _jsx("code", { className: "flex-1 overflow-auto text-nowrap text-[0.8125rem] text-fd-muted-foreground", children: path })] })),
119
- apiExample: _jsx(UsageTabs, { method: method, ctx: ctx }),
120
- }, ctx, method);
121
- return (_jsx(UsageTabsProviderLazy, { defaultExampleId: method['x-exclusiveCodeSample'] ?? method['x-selectedCodeSample'], route: path, examples: getExampleRequests(path, method, ctx), children: content }));
122
- }
123
- else {
124
- renderWebhookLayout ?? (renderWebhookLayout = (slots) => (_jsxs("div", { className: "flex flex-col-reverse gap-x-6 gap-y-4 @4xl:flex-row @4xl:items-start", children: [_jsxs("div", { className: "min-w-0 flex-1", children: [slots.header, slots.description, slots.authSchemes, slots.paremeters, slots.body, slots.responses, slots.callbacks] }), _jsx("div", { className: "@4xl:sticky @4xl:top-[calc(var(--fd-docs-row-1,2rem)+1rem)] @4xl:w-[400px]", children: slots.requests })] })));
125
- return renderWebhookLayout({
126
- header: headNode,
127
- description: descriptionNode,
128
- authSchemes: authNode,
129
- body: bodyNode,
130
- callbacks: callbacksNode,
131
- paremeters: parameterNode,
132
- responses: responseNode,
133
- requests: _jsx(RequestTabs, { path: path, operation: method, ctx: ctx }),
134
- });
135
- }
25
+ async function Operation({ type = "operation", path, method, ctx, showTitle, showDescription, headingLevel = 2 }) {
26
+ const { schema: { dereferenced } } = ctx;
27
+ const body = method.requestBody;
28
+ let headNode = null;
29
+ const descriptionNode = showDescription && method.description && ctx.renderMarkdown(method.description);
30
+ let bodyNode = null;
31
+ let authNode = null;
32
+ let responseNode = null;
33
+ let callbacksNode = null;
34
+ if (showTitle) {
35
+ const title = method.summary || (method.operationId ? idToTitle(method.operationId) : path);
36
+ headNode = ctx.renderHeading(headingLevel, title);
37
+ headingLevel++;
38
+ }
39
+ const contentTypes = body ? Object.entries(body.content) : null;
40
+ if (body && contentTypes && contentTypes.length > 0) {
41
+ const items = contentTypes.map(([key]) => ({
42
+ label: /* @__PURE__ */ jsx("code", {
43
+ className: "text-xs",
44
+ children: key
45
+ }),
46
+ value: key
47
+ }));
48
+ bodyNode = /* @__PURE__ */ jsxs(SelectTabs, {
49
+ defaultValue: items[0].value,
50
+ children: [
51
+ /* @__PURE__ */ jsxs("div", {
52
+ className: "flex gap-2 items-center justify-between mt-10",
53
+ children: [ctx.renderHeading(headingLevel, "Request Body", { className: "my-0!" }), contentTypes.length > 1 ? /* @__PURE__ */ jsx(SelectTabTrigger, {
54
+ items,
55
+ className: "font-medium"
56
+ }) : /* @__PURE__ */ jsx("p", {
57
+ className: "text-fd-muted-foreground not-prose",
58
+ children: items[0].label
59
+ })]
60
+ }),
61
+ body.description && ctx.renderMarkdown(body.description),
62
+ contentTypes.map(([type$1, content]) => {
63
+ if (!isMediaTypeSupported(type$1, ctx.mediaAdapters)) throw new Error(`Media type ${type$1} is not supported (in ${path})`);
64
+ return /* @__PURE__ */ jsx(SelectTab, {
65
+ value: type$1,
66
+ children: /* @__PURE__ */ jsx(Schema, {
67
+ client: {
68
+ name: "body",
69
+ as: "body",
70
+ required: body.required
71
+ },
72
+ root: content.schema ?? {},
73
+ readOnly: method.method === "GET",
74
+ writeOnly: method.method !== "GET",
75
+ ctx
76
+ })
77
+ }, type$1);
78
+ })
79
+ ]
80
+ });
81
+ }
82
+ if (method.responses && ctx.showResponseSchema !== false) {
83
+ const statuses = Object.keys(method.responses);
84
+ responseNode = /* @__PURE__ */ jsxs(Fragment$1, { children: [ctx.renderHeading(headingLevel, "Response Body"), /* @__PURE__ */ jsx(Accordions, {
85
+ type: "multiple",
86
+ children: statuses.map((status) => /* @__PURE__ */ jsx(ResponseAccordion, {
87
+ status,
88
+ operation: method,
89
+ ctx
90
+ }, status))
91
+ })] });
92
+ }
93
+ const parameterNode = Object.entries(ParamTypes).map(([type$1, title]) => {
94
+ const params = method.parameters?.filter((param) => param.in === type$1);
95
+ if (!params || params.length === 0) return;
96
+ return /* @__PURE__ */ jsxs(Fragment, { children: [ctx.renderHeading(headingLevel, title), /* @__PURE__ */ jsx("div", {
97
+ className: "flex flex-col",
98
+ children: params.map((param) => /* @__PURE__ */ jsx(Schema, {
99
+ client: {
100
+ name: param.name,
101
+ required: param.required
102
+ },
103
+ root: {
104
+ ...param.schema,
105
+ description: param.description ?? param.schema?.description,
106
+ deprecated: (param.deprecated ?? false) || (param.schema?.deprecated ?? false)
107
+ },
108
+ readOnly: method.method === "GET",
109
+ writeOnly: method.method !== "GET",
110
+ ctx
111
+ }, param.name))
112
+ })] }, type$1);
113
+ });
114
+ const securities = (method.security ?? dereferenced.security ?? []).filter((v) => Object.keys(v).length > 0);
115
+ if (type === "operation" && securities.length > 0) {
116
+ const securitySchemes = dereferenced.components?.securitySchemes;
117
+ const items = securities.map((security, i) => {
118
+ return {
119
+ value: String(i),
120
+ label: /* @__PURE__ */ jsx("div", {
121
+ className: "flex flex-col text-xs min-w-0",
122
+ children: Object.entries(security).map(([key, scopes]) => /* @__PURE__ */ jsxs("code", {
123
+ className: "truncate",
124
+ children: [
125
+ /* @__PURE__ */ jsx("span", {
126
+ className: "font-medium",
127
+ children: key
128
+ }),
129
+ " ",
130
+ scopes.length > 0 && /* @__PURE__ */ jsx("span", {
131
+ className: "text-fd-muted-foreground",
132
+ children: scopes.join(", ")
133
+ })
134
+ ]
135
+ }, key))
136
+ })
137
+ };
138
+ });
139
+ authNode = /* @__PURE__ */ jsxs(SelectTabs, {
140
+ defaultValue: items[0].value,
141
+ children: [/* @__PURE__ */ jsxs("div", {
142
+ className: "flex items-start justify-between gap-2 mt-10",
143
+ children: [ctx.renderHeading(headingLevel, "Authorization", { className: "my-0!" }), items.length > 1 ? /* @__PURE__ */ jsx(SelectTabTrigger, { items }) : /* @__PURE__ */ jsx("div", {
144
+ className: "not-prose",
145
+ children: items[0].label
146
+ })]
147
+ }), securities.map((security, i) => /* @__PURE__ */ jsx(SelectTab, {
148
+ value: items[i].value,
149
+ children: Object.entries(security).map(([key, scopes]) => {
150
+ const scheme = securitySchemes?.[key];
151
+ if (!scheme) return;
152
+ return /* @__PURE__ */ jsx(AuthScheme, {
153
+ scheme,
154
+ scopes,
155
+ ctx
156
+ }, key);
157
+ })
158
+ }, i))]
159
+ });
160
+ }
161
+ const callbacks = method.callbacks ? Object.entries(method.callbacks) : null;
162
+ if (callbacks && callbacks.length > 0) {
163
+ const items = callbacks.map(([key]) => ({
164
+ label: /* @__PURE__ */ jsx("code", {
165
+ className: "text-xs",
166
+ children: key
167
+ }),
168
+ value: key
169
+ }));
170
+ callbacksNode = /* @__PURE__ */ jsxs(SelectTabs, {
171
+ defaultValue: items[0].value,
172
+ children: [/* @__PURE__ */ jsxs("div", {
173
+ className: "flex justify-between gap-2 items-end mt-10",
174
+ children: [ctx.renderHeading(headingLevel, "Callbacks", { className: "my-0!" }), callbacks.length > 1 ? /* @__PURE__ */ jsx(SelectTabTrigger, {
175
+ items,
176
+ className: "font-medium"
177
+ }) : /* @__PURE__ */ jsx("p", {
178
+ className: "text-fd-muted-foreground not-prose",
179
+ children: items[0].label
180
+ })]
181
+ }), callbacks.map(([name, callback]) => /* @__PURE__ */ jsx(SelectTab, {
182
+ value: name,
183
+ children: /* @__PURE__ */ jsx(WebhookCallback, {
184
+ callback,
185
+ ctx,
186
+ headingLevel
187
+ })
188
+ }, name))]
189
+ });
190
+ }
191
+ let { renderOperationLayout, renderWebhookLayout } = ctx.content ?? {};
192
+ if (type === "operation") {
193
+ renderOperationLayout ??= (slots) => {
194
+ return /* @__PURE__ */ jsxs("div", {
195
+ className: "flex flex-col gap-x-6 gap-y-4 @4xl:flex-row @4xl:items-start",
196
+ children: [/* @__PURE__ */ jsxs("div", {
197
+ className: "min-w-0 flex-1",
198
+ children: [
199
+ slots.header,
200
+ slots.apiPlayground,
201
+ slots.description,
202
+ slots.authSchemes,
203
+ slots.paremeters,
204
+ slots.body,
205
+ slots.responses,
206
+ slots.callbacks
207
+ ]
208
+ }), /* @__PURE__ */ jsx("div", {
209
+ className: "@4xl:sticky @4xl:top-[calc(var(--fd-docs-row-1,2rem)+1rem)] @4xl:w-[400px]",
210
+ children: slots.apiExample
211
+ })]
212
+ });
213
+ };
214
+ const playgroundEnabled = ctx.playground?.enabled ?? true;
215
+ const content = await renderOperationLayout({
216
+ header: headNode,
217
+ description: descriptionNode,
218
+ authSchemes: authNode,
219
+ body: bodyNode,
220
+ callbacks: callbacksNode,
221
+ paremeters: parameterNode,
222
+ responses: responseNode,
223
+ apiPlayground: playgroundEnabled ? /* @__PURE__ */ jsx(APIPlayground, {
224
+ path,
225
+ method,
226
+ ctx
227
+ }) : /* @__PURE__ */ jsxs("div", {
228
+ className: "flex flex-row items-center gap-2.5 p-3 rounded-xl border bg-fd-card text-fd-card-foreground not-prose",
229
+ children: [/* @__PURE__ */ jsx(MethodLabel, {
230
+ className: "text-xs",
231
+ children: method.method
232
+ }), /* @__PURE__ */ jsx("code", {
233
+ className: "flex-1 overflow-auto text-nowrap text-[0.8125rem] text-fd-muted-foreground",
234
+ children: path
235
+ })]
236
+ }),
237
+ apiExample: /* @__PURE__ */ jsx(UsageTabs, {
238
+ method,
239
+ ctx
240
+ })
241
+ }, ctx, method);
242
+ return /* @__PURE__ */ jsx(UsageTabsProviderLazy, {
243
+ defaultExampleId: method["x-exclusiveCodeSample"] ?? method["x-selectedCodeSample"],
244
+ route: path,
245
+ examples: getExampleRequests(path, method, ctx),
246
+ children: content
247
+ });
248
+ } else {
249
+ renderWebhookLayout ??= (slots) => /* @__PURE__ */ jsxs("div", {
250
+ className: "flex flex-col-reverse gap-x-6 gap-y-4 @4xl:flex-row @4xl:items-start",
251
+ children: [/* @__PURE__ */ jsxs("div", {
252
+ className: "min-w-0 flex-1",
253
+ children: [
254
+ slots.header,
255
+ slots.description,
256
+ slots.authSchemes,
257
+ slots.paremeters,
258
+ slots.body,
259
+ slots.responses,
260
+ slots.callbacks
261
+ ]
262
+ }), /* @__PURE__ */ jsx("div", {
263
+ className: "@4xl:sticky @4xl:top-[calc(var(--fd-docs-row-1,2rem)+1rem)] @4xl:w-[400px]",
264
+ children: slots.requests
265
+ })]
266
+ });
267
+ return renderWebhookLayout({
268
+ header: headNode,
269
+ description: descriptionNode,
270
+ authSchemes: authNode,
271
+ body: bodyNode,
272
+ callbacks: callbacksNode,
273
+ paremeters: parameterNode,
274
+ responses: responseNode,
275
+ requests: /* @__PURE__ */ jsx(RequestTabs, {
276
+ path,
277
+ operation: method,
278
+ ctx
279
+ })
280
+ });
281
+ }
136
282
  }
137
- async function ResponseAccordion({ status, operation, ctx, }) {
138
- const response = operation.responses[status];
139
- const { generateTypeScriptSchema } = ctx;
140
- const contentTypes = response.content ? Object.entries(response.content) : [];
141
- let wrapper = (children) => children;
142
- let selectorNode = null;
143
- if (contentTypes.length > 0) {
144
- const items = contentTypes.map(([key]) => ({
145
- label: _jsx("code", { className: "text-xs", children: key }),
146
- value: key,
147
- }));
148
- selectorNode =
149
- items.length === 1 ? (_jsx("p", { className: "text-fd-muted-foreground not-prose", children: items[0].label })) : (_jsx(SelectTabTrigger, { items: items }));
150
- wrapper = (children) => (_jsx(SelectTabs, { defaultValue: items[0].value, children: children }));
151
- }
152
- return wrapper(_jsxs(AccordionItem, { value: status, children: [_jsxs(AccordionHeader, { children: [_jsx(AccordionTrigger, { className: "font-mono", children: status }), selectorNode] }), _jsxs(AccordionContent, { className: "ps-4.5", children: [response.description && (_jsx("div", { className: "prose-no-margin mb-2", children: ctx.renderMarkdown(response.description) })), contentTypes.map(async ([type, resType]) => {
153
- const schema = resType.schema;
154
- let ts;
155
- if (generateTypeScriptSchema) {
156
- ts = await generateTypeScriptSchema(operation, status);
157
- }
158
- else if (generateTypeScriptSchema === undefined && schema) {
159
- ts = await getTypescriptSchema(schema, ctx);
160
- }
161
- return (_jsxs(SelectTab, { value: type, className: "mb-2", children: [ts && _jsx(CopyResponseTypeScript, { code: ts }), schema && (_jsx("div", { className: "border px-3 py-2 rounded-lg", children: _jsx(Schema, { client: {
162
- name: 'response',
163
- as: 'body',
164
- }, root: schema, readOnly: true, ctx: ctx }) }))] }, type));
165
- })] })] }));
283
+ async function ResponseAccordion({ status, operation, ctx }) {
284
+ const response = operation.responses[status];
285
+ const { generateTypeScriptSchema } = ctx;
286
+ const contentTypes = response.content ? Object.entries(response.content) : [];
287
+ let wrapper = (children) => children;
288
+ let selectorNode = null;
289
+ if (contentTypes.length > 0) {
290
+ const items = contentTypes.map(([key]) => ({
291
+ label: /* @__PURE__ */ jsx("code", {
292
+ className: "text-xs",
293
+ children: key
294
+ }),
295
+ value: key
296
+ }));
297
+ selectorNode = items.length === 1 ? /* @__PURE__ */ jsx("p", {
298
+ className: "text-fd-muted-foreground not-prose",
299
+ children: items[0].label
300
+ }) : /* @__PURE__ */ jsx(SelectTabTrigger, { items });
301
+ wrapper = (children) => /* @__PURE__ */ jsx(SelectTabs, {
302
+ defaultValue: items[0].value,
303
+ children
304
+ });
305
+ }
306
+ return wrapper(/* @__PURE__ */ jsxs(AccordionItem, {
307
+ value: status,
308
+ children: [/* @__PURE__ */ jsxs(AccordionHeader, { children: [/* @__PURE__ */ jsx(AccordionTrigger, {
309
+ className: "font-mono",
310
+ children: status
311
+ }), selectorNode] }), /* @__PURE__ */ jsxs(AccordionContent, {
312
+ className: "ps-4.5",
313
+ children: [response.description && /* @__PURE__ */ jsx("div", {
314
+ className: "prose-no-margin mb-2",
315
+ children: ctx.renderMarkdown(response.description)
316
+ }), contentTypes.map(async ([type, resType]) => {
317
+ const schema = resType.schema;
318
+ let ts;
319
+ if (generateTypeScriptSchema) ts = await generateTypeScriptSchema(operation, status);
320
+ else if (generateTypeScriptSchema === void 0 && schema) ts = await getTypescriptSchema(schema, ctx);
321
+ return /* @__PURE__ */ jsxs(SelectTab, {
322
+ value: type,
323
+ className: "mb-2",
324
+ children: [ts && /* @__PURE__ */ jsx(CopyResponseTypeScript, { code: ts }), schema && /* @__PURE__ */ jsx("div", {
325
+ className: "border px-3 py-2 rounded-lg",
326
+ children: /* @__PURE__ */ jsx(Schema, {
327
+ client: {
328
+ name: "response",
329
+ as: "body"
330
+ },
331
+ root: schema,
332
+ readOnly: true,
333
+ ctx
334
+ })
335
+ })]
336
+ }, type);
337
+ })]
338
+ })]
339
+ }));
166
340
  }
167
- function WebhookCallback({ callback, ctx, headingLevel, }) {
168
- const pathItems = Object.entries(callback);
169
- return (_jsx(Accordions, { type: "single", collapsible: true, children: pathItems.map(([path, pathItem]) => {
170
- const pathNodes = methodKeys.map((method) => {
171
- const operation = pathItem[method];
172
- if (!operation)
173
- return null;
174
- return (_jsx("div", { className: "border p-3 my-2 @container prose-no-margin rounded-lg", children: _jsx(Operation, { type: "webhook", path: path, headingLevel: headingLevel + 1, method: createMethod(method, pathItem, operation), ctx: ctx }) }, method));
175
- });
176
- return (_jsxs(AccordionItem, { value: path, children: [_jsx(AccordionHeader, { children: _jsx(AccordionTrigger, { className: "font-mono", children: path }) }), _jsx(AccordionContent, { children: pathNodes })] }, path));
177
- }) }));
341
+ function WebhookCallback({ callback, ctx, headingLevel }) {
342
+ return /* @__PURE__ */ jsx(Accordions, {
343
+ type: "single",
344
+ collapsible: true,
345
+ children: Object.entries(callback).map(([path, pathItem]) => {
346
+ const pathNodes = methodKeys.map((method) => {
347
+ const operation = pathItem[method];
348
+ if (!operation) return null;
349
+ return /* @__PURE__ */ jsx("div", {
350
+ className: "border p-3 my-2 @container prose-no-margin rounded-lg",
351
+ children: /* @__PURE__ */ jsx(Operation, {
352
+ type: "webhook",
353
+ path,
354
+ headingLevel: headingLevel + 1,
355
+ method: createMethod(method, pathItem, operation),
356
+ ctx
357
+ })
358
+ }, method);
359
+ });
360
+ return /* @__PURE__ */ jsxs(AccordionItem, {
361
+ value: path,
362
+ children: [/* @__PURE__ */ jsx(AccordionHeader, { children: /* @__PURE__ */ jsx(AccordionTrigger, {
363
+ className: "font-mono",
364
+ children: path
365
+ }) }), /* @__PURE__ */ jsx(AccordionContent, { children: pathNodes })]
366
+ }, path);
367
+ })
368
+ });
178
369
  }
179
- function AuthScheme({ scheme: schema, scopes, ctx, }) {
180
- if (schema.type === 'http' || schema.type === 'oauth2') {
181
- return (_jsxs(AuthProperty, { name: "Authorization", type: schema.type === 'http' && schema.scheme === 'basic'
182
- ? `Basic <token>`
183
- : 'Bearer <token>', scopes: scopes, children: [schema.description && ctx.renderMarkdown(schema.description), _jsxs("p", { children: ["In: ", _jsx("code", { children: "header" })] })] }));
184
- }
185
- if (schema.type === 'apiKey') {
186
- return (_jsxs(AuthProperty, { name: schema.name, type: "<token>", scopes: scopes, children: [schema.description && ctx.renderMarkdown(schema.description), _jsxs("p", { children: ["In: ", _jsx("code", { children: schema.in })] })] }));
187
- }
188
- if (schema.type === 'openIdConnect') {
189
- return (_jsx(AuthProperty, { name: "OpenID Connect", type: "<token>", scopes: scopes, children: schema.description && ctx.renderMarkdown(schema.description) }));
190
- }
370
+ function AuthScheme({ scheme: schema, scopes, ctx }) {
371
+ if (schema.type === "http" || schema.type === "oauth2") return /* @__PURE__ */ jsxs(AuthProperty, {
372
+ name: "Authorization",
373
+ type: schema.type === "http" && schema.scheme === "basic" ? `Basic <token>` : "Bearer <token>",
374
+ scopes,
375
+ children: [schema.description && ctx.renderMarkdown(schema.description), /* @__PURE__ */ jsxs("p", { children: ["In: ", /* @__PURE__ */ jsx("code", { children: "header" })] })]
376
+ });
377
+ if (schema.type === "apiKey") return /* @__PURE__ */ jsxs(AuthProperty, {
378
+ name: schema.name,
379
+ type: "<token>",
380
+ scopes,
381
+ children: [schema.description && ctx.renderMarkdown(schema.description), /* @__PURE__ */ jsxs("p", { children: ["In: ", /* @__PURE__ */ jsx("code", { children: schema.in })] })]
382
+ });
383
+ if (schema.type === "openIdConnect") return /* @__PURE__ */ jsx(AuthProperty, {
384
+ name: "OpenID Connect",
385
+ type: "<token>",
386
+ scopes,
387
+ children: schema.description && ctx.renderMarkdown(schema.description)
388
+ });
191
389
  }
192
390
  function AuthProperty({ name, type, scopes = [], className, ...props }) {
193
- return (_jsxs("div", { className: cn('text-sm border-t my-4 first:border-t-0', className), children: [_jsxs("div", { className: "flex flex-wrap items-center gap-3 not-prose", children: [_jsx("span", { className: "font-medium font-mono text-fd-primary", children: name }), _jsx("span", { className: "text-sm font-mono text-fd-muted-foreground", children: type })] }), _jsxs("div", { className: "prose-no-margin pt-2.5 empty:hidden", children: [props.children, scopes.length > 0 && (_jsxs("p", { children: ["Scope: ", _jsx("code", { children: scopes.join(', ') })] }))] })] }));
391
+ return /* @__PURE__ */ jsxs("div", {
392
+ className: cn("text-sm border-t my-4 first:border-t-0", className),
393
+ children: [/* @__PURE__ */ jsxs("div", {
394
+ className: "flex flex-wrap items-center gap-3 not-prose",
395
+ children: [/* @__PURE__ */ jsx("span", {
396
+ className: "font-medium font-mono text-fd-primary",
397
+ children: name
398
+ }), /* @__PURE__ */ jsx("span", {
399
+ className: "text-sm font-mono text-fd-muted-foreground",
400
+ children: type
401
+ })]
402
+ }), /* @__PURE__ */ jsxs("div", {
403
+ className: "prose-no-margin pt-2.5 empty:hidden",
404
+ children: [props.children, scopes.length > 0 && /* @__PURE__ */ jsxs("p", { children: ["Scope: ", /* @__PURE__ */ jsx("code", { children: scopes.join(", ") })] })]
405
+ })]
406
+ });
194
407
  }
408
+
409
+ //#endregion
410
+ export { Operation };
411
+ //# sourceMappingURL=index.js.map