@mintlify/msft-sdk 1.1.61 → 1.1.63

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 (234) hide show
  1. package/dist/api-playground/ApiPlayground/Response/DownloadFileButton.js +6 -5
  2. package/dist/api-playground/ApiPlayground/Response/ResponseBody/CodeResponseContent.js +13 -12
  3. package/dist/api-playground/ApiPlayground/Response/ResponsePlaceholder.js +8 -7
  4. package/dist/api-playground/ApiPlayground/Response/ResponseTable.js +3 -2
  5. package/dist/api-playground/ApiPlayground/Response/ResponseTopbar.js +9 -8
  6. package/dist/api-playground/ApiPlayground/Response/index.js +4 -3
  7. package/dist/api-playground/ApiPlayground/components/AdditionalPropertyButton.js +42 -21
  8. package/dist/api-playground/ApiPlayground/components/ParamFieldWrapper.js +13 -9
  9. package/dist/api-playground/ApiPlayground/components/PlaygroundModalWrapper.js +6 -5
  10. package/dist/api-playground/ApiPlayground/components/SendPill.js +3 -2
  11. package/dist/api-playground/ApiPlayground/components/TypeDropdown.js +6 -5
  12. package/dist/api-playground/EndpointFields/ParamFields/ExampleDescription.js +3 -2
  13. package/dist/api-playground/EndpointFields/components/Description.js +6 -5
  14. package/dist/api-playground/EndpointFields/components/OptionDropdown.js +9 -8
  15. package/dist/api-playground/EndpointFields/components/SectionHeading.js +8 -7
  16. package/dist/api-playground-2/ApiExamples.js +19 -20
  17. package/dist/api-playground-2/ApiFields.js +20 -247
  18. package/dist/api-playground-2/EndpointHeader.js +59 -47
  19. package/dist/api-playground-2/OperationPage.js +70 -66
  20. package/dist/api-playground-2/Playground.js +67 -83
  21. package/dist/api-playground-2/SchemaPage.js +22 -9
  22. package/dist/api-playground-2/components/EndpointFields/Body.js +40 -0
  23. package/dist/api-playground-2/components/EndpointFields/Parameters.js +90 -0
  24. package/dist/api-playground-2/components/EndpointFields/Response.js +146 -0
  25. package/dist/api-playground-2/components/EndpointFields/Security.js +88 -0
  26. package/dist/api-playground-2/components/EndpointFields/fields/ArrayParamField.js +93 -0
  27. package/dist/api-playground-2/components/EndpointFields/fields/Enum.js +29 -11
  28. package/dist/api-playground-2/components/EndpointFields/fields/ObjectParamField.js +145 -0
  29. package/dist/api-playground-2/components/EndpointFields/fields/PrimitiveParamField.js +60 -48
  30. package/dist/api-playground-2/components/EndpointFields/fields/SchemaField.js +230 -0
  31. package/dist/api-playground-2/components/Example/GeneratedRequestExample.js +93 -89
  32. package/dist/api-playground-2/components/Example/GeneratedResponseExample.js +18 -17
  33. package/dist/api-playground-2/components/Example/RequestExample.js +92 -93
  34. package/dist/api-playground-2/components/Example/ResponseExample.js +19 -15
  35. package/dist/api-playground-2/components/Request/ParameterSection.js +20 -18
  36. package/dist/api-playground-2/components/Request/SecuritySection.js +53 -43
  37. package/dist/api-playground-2/components/Request/inputs/ArrayInput.js +89 -40
  38. package/dist/api-playground-2/components/Request/inputs/DifferentiatedInput.js +12 -12
  39. package/dist/api-playground-2/components/Request/inputs/FileInput.js +16 -15
  40. package/dist/api-playground-2/components/Request/inputs/InputContainer.js +76 -57
  41. package/dist/api-playground-2/components/Request/inputs/NumberInput.js +10 -9
  42. package/dist/api-playground-2/components/Request/inputs/ObjectInput.js +98 -80
  43. package/dist/api-playground-2/components/Request/inputs/OneOfInput.js +55 -47
  44. package/dist/api-playground-2/components/Request/inputs/SelectInput.js +18 -17
  45. package/dist/api-playground-2/components/Request/inputs/StringInput.js +19 -18
  46. package/dist/api-playground-2/components/Request/inputs/TextInput.js +12 -11
  47. package/dist/api-playground-2/components/SendPillWrapper.js +35 -0
  48. package/dist/api-playground-2/contexts/ApiPlaygroundContext.js +3 -5
  49. package/dist/api-playground-2/generators/createCookies.js +23 -0
  50. package/dist/api-playground-2/generators/createHeaders.js +53 -36
  51. package/dist/api-playground-2/generators/createQueryString.js +30 -0
  52. package/dist/api-playground-2/generators/generateAuthPlaceholder.js +14 -0
  53. package/dist/api-playground-2/generators/generateInteractiveCodeSample.js +27 -25
  54. package/dist/api-playground-2/generators/generateRequest.js +47 -51
  55. package/dist/api-playground-2/generators/generateResponseExampleMap.js +15 -11
  56. package/dist/api-playground-2/generators/generateSnippet.js +1 -1
  57. package/dist/api-playground-2/generators/generateSnippetMap.js +13 -11
  58. package/dist/api-playground-2/hooks/useCopyPathWithInputs.js +11 -11
  59. package/dist/api-playground-2/hooks/useInitializeInputs.js +185 -88
  60. package/dist/api-playground-2/hooks/usePlaygroundInputsStore.js +70 -25
  61. package/dist/api-playground-2/hooks/useSelectedBaseUrl.js +13 -0
  62. package/dist/api-playground-2/hooks/useSelectedExample.js +10 -0
  63. package/dist/api-playground-2/hooks/useSelectedRequestBodyContentType.js +12 -0
  64. package/dist/api-playground-2/hooks/useSelectedResponseContentType.js +12 -0
  65. package/dist/api-playground-2/hooks/useSelectedSecurityOption.js +31 -0
  66. package/dist/api-playground-2/hooks/useSendPlaygroundRequest.js +114 -101
  67. package/dist/api-playground-2/schemaGraph/addApiReferenceDataFromMdxAndDocsConfig.js +23 -32
  68. package/dist/api-playground-2/schemaGraph/addTypeLabelsToSchema.js +50 -0
  69. package/dist/api-playground-2/schemaGraph/addUniqueKeysToSchema.js +40 -24
  70. package/dist/api-playground-2/schemaGraph/getExampleBodyInputs.js +94 -0
  71. package/dist/api-playground-2/schemaGraph/getSchemaGraphOperationData.js +56 -50
  72. package/dist/api-playground-2/schemaGraph/processExamples.js +117 -52
  73. package/dist/api-playground-2/schemaGraph/processSchema.js +10 -0
  74. package/dist/api-playground-2/schemaGraph/processSecurityOptions.js +58 -28
  75. package/dist/api-playground-2/schemaGraph/reduceCompositions.js +220 -181
  76. package/dist/api-playground-2/schemaGraph/resolveOperationWithDependencies.js +128 -89
  77. package/dist/api-playground-2/schemaGraph/resolveSchemaWithDependencies.js +15 -16
  78. package/dist/api-playground-2/schemaGraph/sortSchemaByRequired.js +14 -12
  79. package/dist/api-playground-2/schemaGraph/utils.js +185 -147
  80. package/dist/common/guards.js +11 -19
  81. package/dist/components/Api/Expandable.js +10 -9
  82. package/dist/components/Api/Param.js +11 -13
  83. package/dist/components/Api/dropdown-menu.js +10 -9
  84. package/dist/components/content-components/code-group.js +4 -4
  85. package/dist/contexts/EndpointLocationContext.js +3 -3
  86. package/dist/hooks/useApiParamFieldOption.js +10 -0
  87. package/dist/hooks/useEndpoint.js +3 -3
  88. package/dist/hooks/useKeyboardShortcut.js +13 -13
  89. package/dist/hooks/useSendPlaygroundRequest.js +14 -146
  90. package/dist/httpsnippet/src/helpers/code-builder.js +27 -0
  91. package/dist/httpsnippet/src/helpers/escape.js +11 -0
  92. package/dist/httpsnippet/src/helpers/headers.js +13 -0
  93. package/dist/httpsnippet/src/helpers/reducer.js +7 -0
  94. package/dist/httpsnippet/src/helpers/shell.js +5 -0
  95. package/dist/httpsnippet/src/helpers/url-format.js +35 -0
  96. package/dist/httpsnippet/src/helpers/url-parse.js +76 -0
  97. package/dist/httpsnippet/src/index.js +157 -0
  98. package/dist/httpsnippet/src/targets/c/libcurl/client.js +22 -0
  99. package/dist/httpsnippet/src/targets/c/target.js +15 -0
  100. package/dist/httpsnippet/src/targets/clojure/clj_http/client.js +120 -0
  101. package/dist/httpsnippet/src/targets/clojure/target.js +14 -0
  102. package/dist/httpsnippet/src/targets/csharp/httpclient/client.js +76 -0
  103. package/dist/httpsnippet/src/targets/csharp/restsharp/client.js +63 -0
  104. package/dist/httpsnippet/src/targets/csharp/target.js +17 -0
  105. package/dist/httpsnippet/src/targets/go/native/client.js +24 -0
  106. package/dist/httpsnippet/src/targets/go/target.js +15 -0
  107. package/dist/httpsnippet/src/targets/http/http1.1/client.js +34 -0
  108. package/dist/httpsnippet/src/targets/http/target.js +14 -0
  109. package/dist/httpsnippet/src/targets/index.js +43 -0
  110. package/dist/httpsnippet/src/targets/java/asynchttp/client.js +23 -0
  111. package/dist/httpsnippet/src/targets/java/nethttp/client.js +28 -0
  112. package/dist/httpsnippet/src/targets/java/okhttp/client.js +23 -0
  113. package/dist/httpsnippet/src/targets/java/target.js +20 -0
  114. package/dist/httpsnippet/src/targets/java/unirest/client.js +23 -0
  115. package/dist/httpsnippet/src/targets/javascript/axios/client.js +50 -0
  116. package/dist/httpsnippet/src/targets/javascript/fetch/client.js +61 -0
  117. package/dist/httpsnippet/src/targets/javascript/jquery/client.js +51 -0
  118. package/dist/httpsnippet/src/targets/javascript/target.js +20 -0
  119. package/dist/httpsnippet/src/targets/javascript/xhr/client.js +49 -0
  120. package/dist/httpsnippet/src/targets/json/native/client.js +39 -0
  121. package/dist/httpsnippet/src/targets/json/target.js +14 -0
  122. package/dist/httpsnippet/src/targets/kotlin/okhttp/client.js +23 -0
  123. package/dist/httpsnippet/src/targets/kotlin/target.js +14 -0
  124. package/dist/httpsnippet/src/targets/node/axios/client.js +40 -0
  125. package/dist/httpsnippet/src/targets/node/fetch/client.js +68 -0
  126. package/dist/httpsnippet/src/targets/node/native/client.js +45 -0
  127. package/dist/httpsnippet/src/targets/node/target.js +19 -0
  128. package/dist/httpsnippet/src/targets/objc/helpers.js +27 -0
  129. package/dist/httpsnippet/src/targets/objc/nsurlsession/client.js +63 -0
  130. package/dist/httpsnippet/src/targets/objc/target.js +14 -0
  131. package/dist/httpsnippet/src/targets/ocaml/cohttp/client.js +32 -0
  132. package/dist/httpsnippet/src/targets/ocaml/target.js +14 -0
  133. package/dist/httpsnippet/src/targets/php/curl/client.js +85 -0
  134. package/dist/httpsnippet/src/targets/php/guzzle/client.js +57 -0
  135. package/dist/httpsnippet/src/targets/php/helpers.js +65 -0
  136. package/dist/httpsnippet/src/targets/php/http1/client.js +28 -0
  137. package/dist/httpsnippet/src/targets/php/http2/client.js +55 -0
  138. package/dist/httpsnippet/src/targets/php/target.js +21 -0
  139. package/dist/httpsnippet/src/targets/powershell/common.js +19 -0
  140. package/dist/httpsnippet/src/targets/powershell/restmethod/client.js +14 -0
  141. package/dist/httpsnippet/src/targets/powershell/target.js +16 -0
  142. package/dist/httpsnippet/src/targets/powershell/webrequest/client.js +14 -0
  143. package/dist/httpsnippet/src/targets/python/helpers.js +33 -0
  144. package/dist/httpsnippet/src/targets/python/requests/client.js +74 -0
  145. package/dist/httpsnippet/src/targets/python/target.js +15 -0
  146. package/dist/httpsnippet/src/targets/r/httr/client.js +46 -0
  147. package/dist/httpsnippet/src/targets/r/target.js +14 -0
  148. package/dist/httpsnippet/src/targets/ruby/native/client.js +37 -0
  149. package/dist/httpsnippet/src/targets/ruby/target.js +14 -0
  150. package/dist/httpsnippet/src/targets/shell/curl/client.js +92 -0
  151. package/dist/httpsnippet/src/targets/shell/httpie/client.js +56 -0
  152. package/dist/httpsnippet/src/targets/shell/target.js +19 -0
  153. package/dist/httpsnippet/src/targets/shell/wget/client.js +30 -0
  154. package/dist/httpsnippet/src/targets/swift/helpers.js +38 -0
  155. package/dist/httpsnippet/src/targets/swift/target.js +14 -0
  156. package/dist/httpsnippet/src/targets/swift/urlsession/client.js +59 -0
  157. package/dist/index.d.ts +65 -58
  158. package/dist/index.js +109 -111
  159. package/dist/openapi/generateTypeStringFromSchema.js +2 -31
  160. package/dist/styles.css +1 -1
  161. package/package.json +17 -4
  162. package/dist/api-playground/ApiPlayground/Request/BodySection.js +0 -64
  163. package/dist/api-playground/ApiPlayground/Request/ParameterSection.js +0 -32
  164. package/dist/api-playground/ApiPlayground/Request/PlaygroundModal.js +0 -201
  165. package/dist/api-playground/ApiPlayground/Request/SecuritySection.js +0 -146
  166. package/dist/api-playground/ApiPlayground/Request/ServerSection.js +0 -30
  167. package/dist/api-playground/ApiPlayground/Request/index.js +0 -43
  168. package/dist/api-playground/ApiPlayground/Request/inputs/ArrayInput.js +0 -93
  169. package/dist/api-playground/ApiPlayground/Request/inputs/DifferentiatedInput.js +0 -90
  170. package/dist/api-playground/ApiPlayground/Request/inputs/FileInput.js +0 -62
  171. package/dist/api-playground/ApiPlayground/Request/inputs/NullInput.js +0 -33
  172. package/dist/api-playground/ApiPlayground/Request/inputs/NumberInput.js +0 -61
  173. package/dist/api-playground/ApiPlayground/Request/inputs/ObjectChildren.js +0 -109
  174. package/dist/api-playground/ApiPlayground/Request/inputs/ObjectInput.js +0 -87
  175. package/dist/api-playground/ApiPlayground/Request/inputs/RecursiveInput.js +0 -61
  176. package/dist/api-playground/ApiPlayground/Request/inputs/SelectInput.js +0 -54
  177. package/dist/api-playground/ApiPlayground/Request/inputs/StringInput.js +0 -67
  178. package/dist/api-playground/ApiPlayground/Request/inputs/TextInput.js +0 -44
  179. package/dist/api-playground/ApiPlayground/components/EndpointsMenu.js +0 -42
  180. package/dist/api-playground/ApiPlayground/components/EndpointsMenuLink.js +0 -43
  181. package/dist/api-playground/ApiPlayground/components/EndpointsMenuSearch.js +0 -38
  182. package/dist/api-playground/ApiPlayground/components/InputContainer.js +0 -128
  183. package/dist/api-playground/ApiPlayground/components/InputSectionContainer.js +0 -59
  184. package/dist/api-playground/ApiPlayground/components/PathHeader.js +0 -162
  185. package/dist/api-playground/ApiPlayground/components/TrashButton.js +0 -26
  186. package/dist/api-playground/ApiPlayground/index.js +0 -67
  187. package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/Enum.js +0 -19
  188. package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/NumberMetadata.js +0 -18
  189. package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/StringMetadata.js +0 -28
  190. package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/index.js +0 -5
  191. package/dist/api-playground/EndpointFields/ParamFields/RecursiveParamField.js +0 -13
  192. package/dist/api-playground/EndpointFields/index.js +0 -7
  193. package/dist/api-playground-2/components/EndpointFields/EndpointSecurity.js +0 -87
  194. package/dist/api-playground-2/components/EndpointFields/fields/SimpleArrayParamField.js +0 -89
  195. package/dist/api-playground-2/components/EndpointFields/fields/SimpleObjectParamField.js +0 -121
  196. package/dist/api-playground-2/components/EndpointFields/fields/SimplePrimitiveParamField.js +0 -74
  197. package/dist/api-playground-2/components/EndpointFields/fields/SimpleSchemaField.js +0 -252
  198. package/dist/common/potentiallyParseOpenApiString.js +0 -24
  199. package/dist/common/replaceSlashIndex.js +0 -6
  200. package/dist/common/slugToTitle.js +0 -10
  201. package/dist/constants/prism-languages.js +0 -19
  202. package/dist/contexts/ApiPlaygroundInputsContext.js +0 -17
  203. package/dist/contexts/MDXContentContext.js +0 -17
  204. package/dist/hooks/useApiPlaygroundInputs.js +0 -6
  205. package/dist/hooks/useApiPlaygroundPrefillExamples.js +0 -39
  206. package/dist/hooks/useBaseUrlOptions.js +0 -18
  207. package/dist/hooks/useComponentSchemas.js +0 -9
  208. package/dist/hooks/useGenerateNextAdditionalProperties.js +0 -11
  209. package/dist/hooks/useGenerateNextItems.js +0 -11
  210. package/dist/hooks/useGenerateNextProperties.js +0 -11
  211. package/dist/hooks/useMDXContent.js +0 -6
  212. package/dist/hooks/useMDXContentController/useApiPlaygroundInputs.js +0 -9
  213. package/dist/hooks/useMDXContentController/useMDXContentCallbacks/useSetApiBaseIndexCallback.js +0 -15
  214. package/dist/hooks/useMDXContentController/useMDXContentCallbacks/useSetApiPlaygroundInputsCallback.js +0 -15
  215. package/dist/hooks/usePlaygroundSchemaOptions.js +0 -42
  216. package/dist/hooks/usePrefilledInputs/index.js +0 -65
  217. package/dist/hooks/usePrefilledInputs/storedServerVariables.js +0 -29
  218. package/dist/hooks/useSecurityOption.js +0 -10
  219. package/dist/hooks/useSetDefaultValue.js +0 -63
  220. package/dist/openapi/filterEnums.js +0 -20
  221. package/dist/openapi/generateNextAdditionalProperties.js +0 -7
  222. package/dist/openapi/generateNextItems.js +0 -7
  223. package/dist/openapi/generateNextProperties.js +0 -23
  224. package/dist/openapi/generateOptionLabels.js +0 -20
  225. package/dist/openapi/generateSimpleLabels.js +0 -4
  226. package/dist/openapi/getAuthFilteredSchemaArray.js +0 -18
  227. package/dist/paths/isEqualIgnoringLeadingSlash.js +0 -21
  228. package/dist/paths/optionallyRemoveLeadingSlash.js +0 -6
  229. package/dist/paths/optionallyRemoveTrailingSlash.js +0 -6
  230. package/dist/utils/api-playground/defaults.js +0 -15
  231. package/dist/utils/api-playground/paramFieldDefaults.js +0 -10
  232. package/dist/utils/api-reference/getFilteredSecurityOptions.js +0 -4
  233. package/dist/utils/api-reference/getNextPropertiesByType.js +0 -5
  234. package/dist/utils/flattenObject.js +0 -10
@@ -0,0 +1,93 @@
1
+ import { jsx as i, jsxs as t, Fragment as d } from "react/jsx-runtime";
2
+ import { isArrayObject as k, isSchemaObject as q } from "../../../schemaGraph/utils.js";
3
+ import { ParamFieldWrapper as x } from "../../../../api-playground/ApiPlayground/components/ParamFieldWrapper.js";
4
+ import { ExampleDescription as F } from "../../../../api-playground/EndpointFields/ParamFields/ExampleDescription.js";
5
+ import { Description as M } from "../../../../api-playground/EndpointFields/components/Description.js";
6
+ import { ParamHead as N } from "../../../../components/Api/Param.js";
7
+ import { SchemaField as P } from "./SchemaField.js";
8
+ import { cn as c } from "../../../../utils/cn.js";
9
+ const B = ({
10
+ displayFlattened: r = !1,
11
+ fieldType: e,
12
+ schema: n,
13
+ name: l,
14
+ location: a,
15
+ parentName: m,
16
+ typeOptions: o,
17
+ selectedIndex: p,
18
+ onSelectTypeOption: s,
19
+ paramId: u,
20
+ style: f,
21
+ explode: h,
22
+ required: v,
23
+ schemas: j,
24
+ omitPadding: g
25
+ }) => {
26
+ if (!k(n)) return null;
27
+ const A = (o == null ? void 0 : o[p ?? 0]) ?? "unknown", D = n.items, b = !0, y = q(n.items) && n.items.type === "object";
28
+ return /* @__PURE__ */ i(x, { paramId: u, className: "mint:array-param-field", children: /* @__PURE__ */ t("div", { className: c(!r && !g && "mint:py-6"), children: [
29
+ /* @__PURE__ */ i(
30
+ N,
31
+ {
32
+ id: u,
33
+ name: l,
34
+ location: a,
35
+ required: v ?? !1,
36
+ deprecated: n.deprecated,
37
+ typeLabel: A,
38
+ fieldType: e,
39
+ typeOptions: o,
40
+ selectedTypeOptionIndex: p,
41
+ onSelectTypeOption: s,
42
+ parentName: m,
43
+ style: f,
44
+ explode: h
45
+ }
46
+ ),
47
+ /* @__PURE__ */ t("div", { className: c({ "mint:mt-4": !g && n.description }), children: [
48
+ l && n.description && /* @__PURE__ */ i(M, { markdown: n.description }),
49
+ /* @__PURE__ */ i(w, { schema: n, description: n.description }),
50
+ /* @__PURE__ */ i(
51
+ P,
52
+ {
53
+ omitPadding: !0,
54
+ schema: D,
55
+ displayFlattened: r,
56
+ fieldType: e,
57
+ location: a,
58
+ parentName: m,
59
+ style: f,
60
+ explode: h,
61
+ onSelectTypeOption: s,
62
+ schemas: j,
63
+ hideExampleDescription: b,
64
+ hideDescription: y
65
+ }
66
+ ),
67
+ /* @__PURE__ */ i(F, { schema: n })
68
+ ] })
69
+ ] }) });
70
+ }, w = ({
71
+ schema: r,
72
+ description: e
73
+ }) => /* @__PURE__ */ i(d, { children: (r.minItems !== void 0 || r.maxItems !== void 0) && /* @__PURE__ */ i("div", { className: c("mint:prose mint:prose-sm mint:prose-gray mint:dark:prose-invert", e && "mint:mt-6"), children: /* @__PURE__ */ i(E, { minItems: r.minItems, maxItems: r.maxItems }) }) }), E = ({ minItems: r, maxItems: e }) => r === e && r !== void 0 ? /* @__PURE__ */ t(d, { children: [
74
+ "Required array length: ",
75
+ /* @__PURE__ */ i("code", { children: r }),
76
+ " element",
77
+ r > 1 ? "s" : ""
78
+ ] }) : r && e ? /* @__PURE__ */ t(d, { children: [
79
+ "Required array length: ",
80
+ /* @__PURE__ */ i("code", { children: `${r} - ${e}` }),
81
+ " element",
82
+ e > 1 ? "s" : ""
83
+ ] }) : r ? /* @__PURE__ */ t(d, { children: [
84
+ "Minimum length: ",
85
+ /* @__PURE__ */ i("code", { children: r })
86
+ ] }) : e ? /* @__PURE__ */ t(d, { children: [
87
+ "Maximum length: ",
88
+ /* @__PURE__ */ i("code", { children: e })
89
+ ] }) : "";
90
+ export {
91
+ w as ArrayMetadata,
92
+ B as ArrayParamField
93
+ };
@@ -1,15 +1,33 @@
1
- import { jsxs as t, jsx as l } from "react/jsx-runtime";
2
- const r = ({ schema: s }) => {
3
- const n = s.enum;
4
- return !n || n.length === 0 ? null : /* @__PURE__ */ t("div", { className: "mint:whitespace-pre-wrap mint:prose-sm mint:mt-6", children: [
5
- "Available options:",
6
- n.map((e, i) => /* @__PURE__ */ t("div", { className: "mint:inline-block", children: [
7
- /* @__PURE__ */ l("code", { children: e }),
8
- i !== n.length - 1 && ",",
1
+ import { jsxs as n, jsx as t } from "react/jsx-runtime";
2
+ import { useSelectedLocale as m } from "../../../../utils/locales/index.js";
3
+ const a = ({ schema: i }) => {
4
+ const l = m(), e = i.type === "boolean" ? ["true", "false"] : i.enum;
5
+ return !e || e.length === 0 ? null : /* @__PURE__ */ n("div", { className: "mint:whitespace-pre-wrap mint:prose-sm mint:mt-6", children: [
6
+ l.availableOptions,
7
+ ":",
8
+ " ",
9
+ e.map((r, s) => /* @__PURE__ */ n("div", { className: "mint:inline-block", children: [
10
+ /* @__PURE__ */ t("code", { children: r }),
11
+ s !== e.length - 1 && ",",
9
12
  " "
10
- ] }, `${e}-${i}`))
13
+ ] }, `${r}-${s}`))
11
14
  ] });
12
- };
15
+ }, d = ({
16
+ enumTable: i
17
+ }) => /* @__PURE__ */ n("div", { className: "mint:whitespace-pre-wrap mint:prose mint:prose-sm mint:mt-6", children: [
18
+ "Available options:",
19
+ /* @__PURE__ */ n("table", { className: "mint:w-min mint:max-w-full mint:text-sm not-prose", children: [
20
+ /* @__PURE__ */ n("tr", { children: [
21
+ /* @__PURE__ */ t("th", { className: "mint:text-left", children: "Title" }),
22
+ /* @__PURE__ */ t("th", { children: "Const" })
23
+ ] }),
24
+ i.map(({ title: l, const: e }) => /* @__PURE__ */ n("tr", { children: [
25
+ /* @__PURE__ */ t("td", { children: l }),
26
+ /* @__PURE__ */ t("td", { children: /* @__PURE__ */ t("code", { children: e }) })
27
+ ] }, l))
28
+ ] })
29
+ ] });
13
30
  export {
14
- r as EnumOptions
31
+ d as EnumConstTable,
32
+ a as EnumOptions
15
33
  };
@@ -0,0 +1,145 @@
1
+ import { jsx as e, jsxs as u, Fragment as S } from "react/jsx-runtime";
2
+ import { generateSimpleSchemaLabel as J, isSchemaObject as K, getDeepObjectParentName as Q, getRecursiveParentName as A } from "../../../schemaGraph/utils.js";
3
+ import { ParamFieldWrapper as V } from "../../../../api-playground/ApiPlayground/components/ParamFieldWrapper.js";
4
+ import { ExampleDescription as X } from "../../../../api-playground/EndpointFields/ParamFields/ExampleDescription.js";
5
+ import { Description as R } from "../../../../api-playground/EndpointFields/components/Description.js";
6
+ import { OneOfSelection as Y } from "../../../../api-playground/EndpointFields/components/OneOfDropdown.js";
7
+ import { Expandable as Z } from "../../../../components/Api/Expandable.js";
8
+ import { ParamHead as _ } from "../../../../components/Api/Param.js";
9
+ import { useEndpointLocation as $ } from "../../../../contexts/EndpointLocationContext.js";
10
+ import { useApiParamFieldOption as T } from "../../../../hooks/useApiParamFieldOption.js";
11
+ import { SchemaField as B } from "./SchemaField.js";
12
+ import { cn as a } from "../../../../utils/cn.js";
13
+ function I(r) {
14
+ return r.type !== "object" ? { properties: void 0, additionalProperties: void 0 } : {
15
+ properties: r.properties,
16
+ additionalProperties: r.additionalProperties
17
+ };
18
+ }
19
+ const be = ({
20
+ fieldType: r,
21
+ schema: i,
22
+ name: t,
23
+ location: f,
24
+ parentName: m,
25
+ typeOptions: y,
26
+ selectedIndex: O,
27
+ onSelectTypeOption: p,
28
+ paramId: s,
29
+ style: c,
30
+ explode: l,
31
+ required: C,
32
+ displayFlattened: v = !1,
33
+ schemas: h,
34
+ oneOfOptions: k,
35
+ lazy: H,
36
+ omitPadding: x = !1,
37
+ hideDescription: N,
38
+ hideExampleDescription: g
39
+ }) => {
40
+ const { properties: b, additionalProperties: o } = I(i), M = T(), { anchor: P } = $(), U = !!(s && (P != null && P.includes(s))), W = M === "all" || U || v, q = !!b && Object.keys(b).length > 0 || !!o && Object.keys(o).length > 0, w = J(i), d = !!v, n = !!k, j = !!i.description, E = !v, D = j && d !== n, z = j && !D;
41
+ return /* @__PURE__ */ e(
42
+ V,
43
+ {
44
+ noBorder: g,
45
+ paramId: s,
46
+ className: "mint:object-param-field",
47
+ children: /* @__PURE__ */ u("div", { className: a(!d && !x && "mint:py-6"), children: [
48
+ /* @__PURE__ */ e(
49
+ _,
50
+ {
51
+ id: s,
52
+ name: t,
53
+ location: f,
54
+ required: C ?? !1,
55
+ deprecated: i.deprecated,
56
+ typeLabel: w,
57
+ fieldType: r,
58
+ typeOptions: y ?? [w],
59
+ selectedTypeOptionIndex: O,
60
+ onSelectTypeOption: p,
61
+ parentName: m,
62
+ style: c,
63
+ explode: l
64
+ }
65
+ ),
66
+ /* @__PURE__ */ u("div", { className: a({ "mint:mt-4": !x && (j || q) }), children: [
67
+ D && !N && i.description && /* @__PURE__ */ e(R, { markdown: i.description }),
68
+ /* @__PURE__ */ u(
69
+ "div",
70
+ {
71
+ className: a(
72
+ n && "mint:mt-4",
73
+ n && !d && "mint:rounded-xl mint:border mint:border-gray-100 mint:px-4 mint:pb-4 mint:pt-2 mint:dark:border-white/10"
74
+ ),
75
+ children: [
76
+ n && /* @__PURE__ */ e(
77
+ Y,
78
+ {
79
+ selectedIndex: O,
80
+ options: k,
81
+ onSelectOption: p
82
+ }
83
+ ),
84
+ z && !N && i.description && /* @__PURE__ */ e("div", { className: a(n && d && "mint:pt-6 mint:pb-4"), children: /* @__PURE__ */ e(R, { markdown: i.description }) }),
85
+ q && /* @__PURE__ */ e("div", { className: a(n && !d && "mint:-mt-4"), children: /* @__PURE__ */ e(
86
+ ee,
87
+ {
88
+ expandable: E,
89
+ defaultOpen: W,
90
+ lazy: H,
91
+ uniqueParamId: s,
92
+ children: /* @__PURE__ */ u(S, { children: [
93
+ b && Object.entries(b).map(([F, L]) => {
94
+ const G = c === "deepObject" && l ? Q(t ?? void 0, m) : A(t ?? void 0, m);
95
+ return /* @__PURE__ */ e(
96
+ B,
97
+ {
98
+ schema: L,
99
+ name: F,
100
+ required: L.isRequired,
101
+ fieldType: r,
102
+ location: f,
103
+ parentName: G,
104
+ style: c,
105
+ explode: l,
106
+ onSelectTypeOption: p,
107
+ schemas: h
108
+ },
109
+ F
110
+ );
111
+ }),
112
+ typeof o == "object" && K(o) && /* @__PURE__ */ e(
113
+ B,
114
+ {
115
+ schema: o,
116
+ name: "{key}",
117
+ required: o.isRequired,
118
+ fieldType: r,
119
+ location: f,
120
+ parentName: A(t ?? void 0, m),
121
+ style: c,
122
+ explode: l,
123
+ onSelectTypeOption: p,
124
+ schemas: h
125
+ },
126
+ "{key}"
127
+ )
128
+ ] })
129
+ }
130
+ ) }),
131
+ E && !g && /* @__PURE__ */ e(X, { schema: i })
132
+ ]
133
+ }
134
+ )
135
+ ] })
136
+ ] })
137
+ }
138
+ );
139
+ };
140
+ function ee({ expandable: r, children: i, ...t }) {
141
+ return r ? /* @__PURE__ */ e(Z, { ...t, children: i }) : /* @__PURE__ */ e(S, { children: i });
142
+ }
143
+ export {
144
+ be as ObjectParamField
145
+ };
@@ -1,56 +1,68 @@
1
1
  import { jsx as i, jsxs as p } from "react/jsx-runtime";
2
- import { isEnum as d, isStringSchema as b, isNumberSchema as v } from "../../../schemaGraph/utils.js";
3
- import { ParamFieldWrapper as x } from "../../../../api-playground/ApiPlayground/components/ParamFieldWrapper.js";
4
- import { ExampleDescription as P } from "../../../../api-playground/EndpointFields/ParamFields/ExampleDescription.js";
5
- import { Description as S } from "../../../../api-playground/EndpointFields/components/Description.js";
2
+ import { isEnum as l, isStringSchema as j, isNumberSchema as k } from "../../../schemaGraph/utils.js";
3
+ import { ParamFieldWrapper as q } from "../../../../api-playground/ApiPlayground/components/ParamFieldWrapper.js";
4
+ import { ExampleDescription as w } from "../../../../api-playground/EndpointFields/ParamFields/ExampleDescription.js";
5
+ import { Description as x } from "../../../../api-playground/EndpointFields/components/Description.js";
6
6
  import { ParamHead as E } from "../../../../components/Api/Param.js";
7
- import { EnumOptions as g } from "./Enum.js";
8
- import { NumberMetadata as j } from "./NumberMetadata.js";
9
- import { StringMetadata as q } from "./StringMetadata.js";
10
- import { cn as y } from "../../../../utils/cn.js";
11
- const V = ({
12
- fieldType: n,
7
+ import { EnumConstTable as F, EnumOptions as M } from "./Enum.js";
8
+ import { NumberMetadata as g } from "./NumberMetadata.js";
9
+ import { StringMetadata as B } from "./StringMetadata.js";
10
+ import { cn as e } from "../../../../utils/cn.js";
11
+ const J = ({
12
+ fieldType: u,
13
13
  schema: r,
14
- name: a,
15
- location: l,
14
+ name: c,
15
+ location: s,
16
16
  typeOptions: m,
17
- selectedIndex: e,
18
- onSelectTypeOption: f,
19
- parentName: u,
20
- paramId: o,
21
- style: s,
22
- explode: c
17
+ selectedIndex: n,
18
+ onSelectTypeOption: N,
19
+ parentName: v,
20
+ paramId: a,
21
+ style: S,
22
+ explode: P,
23
+ enumTable: t,
24
+ omitPadding: f,
25
+ hideExampleDescription: d
23
26
  }) => {
24
- const N = m[e ?? 0], t = r.description;
25
- return /* @__PURE__ */ i(x, { paramId: o, className: "mint:primitive-param-field", children: /* @__PURE__ */ p("div", { className: "mint:py-2", children: [
26
- /* @__PURE__ */ i(
27
- E,
28
- {
29
- id: o,
30
- name: a,
31
- typeLabel: N,
32
- location: l,
33
- fieldType: n,
34
- required: r.isRequired,
35
- deprecated: r.deprecated,
36
- defaultValue: r.default,
37
- typeOptions: m,
38
- selectedTypeOptionIndex: e,
39
- onSelectTypeOption: f,
40
- parentName: u,
41
- style: s,
42
- explode: c
43
- }
44
- ),
45
- /* @__PURE__ */ p("div", { className: y({ "mint:mt-4 mint:mb-4": t || d(r) }), children: [
46
- t && /* @__PURE__ */ i(S, { markdown: t }),
47
- d(r) && /* @__PURE__ */ i(g, { schema: r }),
48
- b(r) && /* @__PURE__ */ i(q, { schema: r, description: t }),
49
- v(r) && /* @__PURE__ */ i(j, { schema: r }),
50
- /* @__PURE__ */ i(P, { schema: r })
51
- ] })
52
- ] }) });
27
+ const b = (m == null ? void 0 : m[n ?? 0]) ?? "unknown", o = r.description;
28
+ return /* @__PURE__ */ i(
29
+ q,
30
+ {
31
+ noBorder: d,
32
+ paramId: a,
33
+ className: "mint:primitive-param-field",
34
+ children: /* @__PURE__ */ p("div", { className: e(!f && "mint:py-6"), children: [
35
+ /* @__PURE__ */ i(
36
+ E,
37
+ {
38
+ id: a,
39
+ name: c,
40
+ typeLabel: b,
41
+ location: s,
42
+ fieldType: u,
43
+ required: r.isRequired,
44
+ deprecated: r.deprecated,
45
+ defaultValue: r.default,
46
+ typeOptions: m,
47
+ selectedTypeOptionIndex: n,
48
+ onSelectTypeOption: N,
49
+ parentName: v,
50
+ style: S,
51
+ explode: P
52
+ }
53
+ ),
54
+ /* @__PURE__ */ p("div", { className: e({ "mint:mt-4": !f && (o || l(r)) }), children: [
55
+ o && /* @__PURE__ */ i(x, { className: e(d && "mint:py-4"), markdown: o }),
56
+ t && /* @__PURE__ */ i(F, { enumTable: t }),
57
+ !t && l(r) && /* @__PURE__ */ i(M, { schema: r }),
58
+ j(r) && /* @__PURE__ */ i(B, { schema: r, description: o }),
59
+ k(r) && /* @__PURE__ */ i(g, { schema: r }),
60
+ !d && /* @__PURE__ */ i(w, { schema: r })
61
+ ] })
62
+ ] })
63
+ }
64
+ );
53
65
  };
54
66
  export {
55
- V as PrimitiveParamField
67
+ J as PrimitiveParamField
56
68
  };
@@ -0,0 +1,230 @@
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import { useState as U } from "react";
3
+ import { CIRCULAR_REF_KEY as K } from "../../../constants/index.js";
4
+ import { getParamIdFromSchema as w } from "../../../schemaGraph/addUniqueKeysToSchema.js";
5
+ import { isCircularRef as Y, isSchemaObject as g, isEnum as E, filterSchemasWithConsts as B, generateSchemaOptionLabels as C, isObjectArray as F } from "../../../schemaGraph/utils.js";
6
+ import { ArrayParamField as D } from "./ArrayParamField.js";
7
+ import { ObjectParamField as L } from "./ObjectParamField.js";
8
+ import { PrimitiveParamField as G } from "./PrimitiveParamField.js";
9
+ const M = ({
10
+ schema: t,
11
+ omitPadding: f,
12
+ name: n,
13
+ displayFlattened: e = !1,
14
+ typeOptions: c,
15
+ fieldType: o,
16
+ location: s,
17
+ parentName: i,
18
+ style: S,
19
+ explode: p,
20
+ required: O,
21
+ onSelectTypeOption: R,
22
+ selectedIndex: j,
23
+ schemas: b,
24
+ enumTable: _,
25
+ hideExampleDescription: W,
26
+ hideDescription: k
27
+ }) => {
28
+ const y = w(t, o, n, i);
29
+ if (Y(t)) {
30
+ const u = t[K], I = b == null ? void 0 : b[u];
31
+ return I ? /* @__PURE__ */ l(
32
+ L,
33
+ {
34
+ lazy: !0,
35
+ omitPadding: f,
36
+ schema: { ...I, description: t.description },
37
+ typeOptions: c,
38
+ fieldType: o,
39
+ name: n,
40
+ location: s,
41
+ parentName: i,
42
+ style: S,
43
+ explode: p,
44
+ required: O,
45
+ schemas: b,
46
+ paramId: y
47
+ }
48
+ ) : null;
49
+ }
50
+ if (t.oneOf && Array.isArray(t.oneOf) && t.oneOf.length > 0) {
51
+ let u = t.oneOf.filter((r) => g(r));
52
+ if (u.length === 0) return null;
53
+ const I = u.some((r) => E(r) && "const" in r);
54
+ I && (u = B(u));
55
+ const h = C(u), m = u.filter((r) => r.type !== "null"), z = u.some((r) => r.type === "null");
56
+ let v;
57
+ if (I && (v = u.filter((r) => E(r) && "const" in r).map((r) => ({
58
+ title: r.title ?? "Unknown",
59
+ const: r.const ?? ""
60
+ }))), m.length === 1 && m[0]) {
61
+ const r = z && t.typeLabel ? [t.typeLabel] : h;
62
+ return /* @__PURE__ */ l(
63
+ M,
64
+ {
65
+ schema: m[0],
66
+ omitPadding: f,
67
+ displayFlattened: e,
68
+ typeOptions: r,
69
+ fieldType: o,
70
+ name: n,
71
+ location: s,
72
+ parentName: i,
73
+ style: S,
74
+ explode: p,
75
+ required: O,
76
+ schemas: b
77
+ }
78
+ );
79
+ }
80
+ if (m.every((r) => r.type === "object" || F(r)))
81
+ return /* @__PURE__ */ l(
82
+ J,
83
+ {
84
+ omitPadding: f,
85
+ schema: t,
86
+ schemas: m,
87
+ displayFlattened: e,
88
+ typeOptions: ["object"],
89
+ fieldType: o,
90
+ name: n,
91
+ location: s,
92
+ style: S,
93
+ explode: p,
94
+ parentName: i,
95
+ required: O,
96
+ paramId: y
97
+ }
98
+ );
99
+ {
100
+ const r = m[j ?? 0];
101
+ return r ? /* @__PURE__ */ l(
102
+ H,
103
+ {
104
+ omitPadding: f,
105
+ schemas: m,
106
+ schema: r,
107
+ enumTable: v,
108
+ displayFlattened: e,
109
+ typeOptions: h,
110
+ fieldType: o,
111
+ name: n,
112
+ location: s,
113
+ style: S,
114
+ explode: p,
115
+ required: O,
116
+ selectedIndex: j,
117
+ parentName: i,
118
+ onSelectTypeOption: R
119
+ }
120
+ ) : null;
121
+ }
122
+ }
123
+ const A = C([t]);
124
+ if (t.type !== "array" && t.type !== "object")
125
+ return /* @__PURE__ */ l(
126
+ G,
127
+ {
128
+ omitPadding: f,
129
+ fieldType: o,
130
+ enumTable: _,
131
+ schema: t,
132
+ typeOptions: c ?? A,
133
+ name: n,
134
+ location: s,
135
+ parentName: i,
136
+ selectedIndex: j,
137
+ onSelectTypeOption: R,
138
+ style: S,
139
+ explode: p,
140
+ required: O,
141
+ paramId: y,
142
+ hideExampleDescription: W
143
+ }
144
+ );
145
+ if (t.type === "object")
146
+ return /* @__PURE__ */ l(
147
+ L,
148
+ {
149
+ omitPadding: f,
150
+ displayFlattened: e,
151
+ fieldType: o,
152
+ schema: t,
153
+ typeOptions: c ?? A,
154
+ name: n,
155
+ location: s,
156
+ parentName: i,
157
+ selectedIndex: j,
158
+ onSelectTypeOption: R,
159
+ style: S,
160
+ explode: p,
161
+ required: O,
162
+ schemas: b,
163
+ paramId: y,
164
+ hideDescription: k,
165
+ hideExampleDescription: W
166
+ }
167
+ );
168
+ if (t.type === "array")
169
+ return /* @__PURE__ */ l(
170
+ D,
171
+ {
172
+ omitPadding: f,
173
+ displayFlattened: e,
174
+ fieldType: o,
175
+ schema: t,
176
+ typeOptions: c ?? A,
177
+ name: n,
178
+ location: s,
179
+ parentName: i,
180
+ selectedIndex: j,
181
+ onSelectTypeOption: R,
182
+ style: S,
183
+ explode: p,
184
+ required: O,
185
+ schemas: b,
186
+ paramId: y
187
+ }
188
+ );
189
+ };
190
+ function H({
191
+ schemas: t,
192
+ ...f
193
+ }) {
194
+ const [n, e] = U(0), c = t[n];
195
+ return c ? /* @__PURE__ */ l(
196
+ M,
197
+ {
198
+ ...f,
199
+ selectedIndex: n,
200
+ onSelectTypeOption: e,
201
+ schema: c
202
+ }
203
+ ) : null;
204
+ }
205
+ function J({
206
+ schemas: t,
207
+ paramId: f,
208
+ ...n
209
+ }) {
210
+ const [e, c] = U(0);
211
+ let o = t[e];
212
+ if (F(o) && (o = o.items), !o) return null;
213
+ const s = C(t), i = f ?? w(o, n.fieldType, n.name, n.parentName);
214
+ return /* @__PURE__ */ l(
215
+ L,
216
+ {
217
+ ...n,
218
+ oneOfOptions: s,
219
+ schema: o,
220
+ selectedIndex: e,
221
+ onSelectTypeOption: c,
222
+ paramId: i
223
+ }
224
+ );
225
+ }
226
+ export {
227
+ H as MultipleSchemasWithDropdown,
228
+ J as MultipleSchemasWithTabs,
229
+ M as SchemaField
230
+ };