@mintlify/msft-sdk 1.1.62 → 1.1.64

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 (169) 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 +7 -6
  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 -67
  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/generateSnippetMap.js +13 -11
  57. package/dist/api-playground-2/hooks/useCopyPathWithInputs.js +11 -11
  58. package/dist/api-playground-2/hooks/useInitializeInputs.js +185 -88
  59. package/dist/api-playground-2/hooks/usePlaygroundInputsStore.js +70 -25
  60. package/dist/api-playground-2/hooks/useSelectedBaseUrl.js +13 -0
  61. package/dist/api-playground-2/hooks/useSelectedExample.js +10 -0
  62. package/dist/api-playground-2/hooks/useSelectedRequestBodyContentType.js +12 -0
  63. package/dist/api-playground-2/hooks/useSelectedResponseContentType.js +12 -0
  64. package/dist/api-playground-2/hooks/useSelectedSecurityOption.js +31 -0
  65. package/dist/api-playground-2/hooks/useSendPlaygroundRequest.js +114 -101
  66. package/dist/api-playground-2/schemaGraph/addApiReferenceDataFromMdxAndDocsConfig.js +23 -32
  67. package/dist/api-playground-2/schemaGraph/addTypeLabelsToSchema.js +50 -0
  68. package/dist/api-playground-2/schemaGraph/addUniqueKeysToSchema.js +40 -24
  69. package/dist/api-playground-2/schemaGraph/getExampleBodyInputs.js +94 -0
  70. package/dist/api-playground-2/schemaGraph/getSchemaGraphOperationData.js +56 -50
  71. package/dist/api-playground-2/schemaGraph/processExamples.js +117 -52
  72. package/dist/api-playground-2/schemaGraph/processSchema.js +10 -0
  73. package/dist/api-playground-2/schemaGraph/processSecurityOptions.js +58 -28
  74. package/dist/api-playground-2/schemaGraph/reduceCompositions.js +220 -181
  75. package/dist/api-playground-2/schemaGraph/resolveOperationWithDependencies.js +128 -89
  76. package/dist/api-playground-2/schemaGraph/resolveSchemaWithDependencies.js +15 -16
  77. package/dist/api-playground-2/schemaGraph/sortSchemaByRequired.js +14 -12
  78. package/dist/api-playground-2/schemaGraph/utils.js +185 -147
  79. package/dist/common/guards.js +11 -19
  80. package/dist/components/Api/Expandable.js +10 -9
  81. package/dist/components/Api/Param.js +11 -13
  82. package/dist/components/Api/dropdown-menu.js +10 -9
  83. package/dist/components/apiPage.js +125 -0
  84. package/dist/components/content-components/code-group.js +4 -4
  85. package/dist/components/docsPage.js +54 -56
  86. package/dist/contexts/EndpointLocationContext.js +3 -3
  87. package/dist/hooks/useApiParamFieldOption.js +10 -0
  88. package/dist/hooks/useEndpoint.js +3 -3
  89. package/dist/hooks/useKeyboardShortcut.js +13 -13
  90. package/dist/hooks/useSendPlaygroundRequest.js +14 -146
  91. package/dist/index.d.ts +80 -60
  92. package/dist/index.js +99 -101
  93. package/dist/openapi/generateTypeStringFromSchema.js +2 -31
  94. package/dist/plugins/sanitize/rehype-pre-to-mdx-fence.js +13 -13
  95. package/dist/styles.css +1 -1
  96. package/package.json +1 -1
  97. package/dist/api-playground/ApiPlayground/Request/BodySection.js +0 -64
  98. package/dist/api-playground/ApiPlayground/Request/ParameterSection.js +0 -32
  99. package/dist/api-playground/ApiPlayground/Request/PlaygroundModal.js +0 -201
  100. package/dist/api-playground/ApiPlayground/Request/SecuritySection.js +0 -146
  101. package/dist/api-playground/ApiPlayground/Request/ServerSection.js +0 -30
  102. package/dist/api-playground/ApiPlayground/Request/index.js +0 -43
  103. package/dist/api-playground/ApiPlayground/Request/inputs/ArrayInput.js +0 -93
  104. package/dist/api-playground/ApiPlayground/Request/inputs/DifferentiatedInput.js +0 -90
  105. package/dist/api-playground/ApiPlayground/Request/inputs/FileInput.js +0 -62
  106. package/dist/api-playground/ApiPlayground/Request/inputs/NullInput.js +0 -33
  107. package/dist/api-playground/ApiPlayground/Request/inputs/NumberInput.js +0 -61
  108. package/dist/api-playground/ApiPlayground/Request/inputs/ObjectChildren.js +0 -109
  109. package/dist/api-playground/ApiPlayground/Request/inputs/ObjectInput.js +0 -87
  110. package/dist/api-playground/ApiPlayground/Request/inputs/RecursiveInput.js +0 -61
  111. package/dist/api-playground/ApiPlayground/Request/inputs/SelectInput.js +0 -54
  112. package/dist/api-playground/ApiPlayground/Request/inputs/StringInput.js +0 -67
  113. package/dist/api-playground/ApiPlayground/Request/inputs/TextInput.js +0 -44
  114. package/dist/api-playground/ApiPlayground/components/EndpointsMenu.js +0 -42
  115. package/dist/api-playground/ApiPlayground/components/EndpointsMenuLink.js +0 -43
  116. package/dist/api-playground/ApiPlayground/components/EndpointsMenuSearch.js +0 -38
  117. package/dist/api-playground/ApiPlayground/components/InputContainer.js +0 -128
  118. package/dist/api-playground/ApiPlayground/components/InputSectionContainer.js +0 -59
  119. package/dist/api-playground/ApiPlayground/components/PathHeader.js +0 -162
  120. package/dist/api-playground/ApiPlayground/components/TrashButton.js +0 -26
  121. package/dist/api-playground/ApiPlayground/index.js +0 -67
  122. package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/Enum.js +0 -19
  123. package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/NumberMetadata.js +0 -18
  124. package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/StringMetadata.js +0 -28
  125. package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/index.js +0 -5
  126. package/dist/api-playground/EndpointFields/ParamFields/RecursiveParamField.js +0 -13
  127. package/dist/api-playground/EndpointFields/index.js +0 -7
  128. package/dist/api-playground-2/components/EndpointFields/EndpointSecurity.js +0 -87
  129. package/dist/api-playground-2/components/EndpointFields/fields/SimpleArrayParamField.js +0 -89
  130. package/dist/api-playground-2/components/EndpointFields/fields/SimpleObjectParamField.js +0 -121
  131. package/dist/api-playground-2/components/EndpointFields/fields/SimplePrimitiveParamField.js +0 -74
  132. package/dist/api-playground-2/components/EndpointFields/fields/SimpleSchemaField.js +0 -252
  133. package/dist/common/potentiallyParseOpenApiString.js +0 -24
  134. package/dist/common/replaceSlashIndex.js +0 -6
  135. package/dist/common/slugToTitle.js +0 -10
  136. package/dist/constants/prism-languages.js +0 -19
  137. package/dist/contexts/ApiPlaygroundInputsContext.js +0 -17
  138. package/dist/contexts/MDXContentContext.js +0 -17
  139. package/dist/hooks/useApiPlaygroundInputs.js +0 -6
  140. package/dist/hooks/useApiPlaygroundPrefillExamples.js +0 -39
  141. package/dist/hooks/useBaseUrlOptions.js +0 -18
  142. package/dist/hooks/useComponentSchemas.js +0 -9
  143. package/dist/hooks/useGenerateNextAdditionalProperties.js +0 -11
  144. package/dist/hooks/useGenerateNextItems.js +0 -11
  145. package/dist/hooks/useGenerateNextProperties.js +0 -11
  146. package/dist/hooks/useMDXContent.js +0 -6
  147. package/dist/hooks/useMDXContentController/useApiPlaygroundInputs.js +0 -9
  148. package/dist/hooks/useMDXContentController/useMDXContentCallbacks/useSetApiBaseIndexCallback.js +0 -15
  149. package/dist/hooks/useMDXContentController/useMDXContentCallbacks/useSetApiPlaygroundInputsCallback.js +0 -15
  150. package/dist/hooks/usePlaygroundSchemaOptions.js +0 -42
  151. package/dist/hooks/usePrefilledInputs/index.js +0 -65
  152. package/dist/hooks/usePrefilledInputs/storedServerVariables.js +0 -29
  153. package/dist/hooks/useSecurityOption.js +0 -10
  154. package/dist/hooks/useSetDefaultValue.js +0 -63
  155. package/dist/openapi/filterEnums.js +0 -20
  156. package/dist/openapi/generateNextAdditionalProperties.js +0 -7
  157. package/dist/openapi/generateNextItems.js +0 -7
  158. package/dist/openapi/generateNextProperties.js +0 -23
  159. package/dist/openapi/generateOptionLabels.js +0 -20
  160. package/dist/openapi/generateSimpleLabels.js +0 -4
  161. package/dist/openapi/getAuthFilteredSchemaArray.js +0 -18
  162. package/dist/paths/isEqualIgnoringLeadingSlash.js +0 -21
  163. package/dist/paths/optionallyRemoveLeadingSlash.js +0 -6
  164. package/dist/paths/optionallyRemoveTrailingSlash.js +0 -6
  165. package/dist/utils/api-playground/defaults.js +0 -15
  166. package/dist/utils/api-playground/paramFieldDefaults.js +0 -10
  167. package/dist/utils/api-reference/getFilteredSecurityOptions.js +0 -4
  168. package/dist/utils/api-reference/getNextPropertiesByType.js +0 -5
  169. package/dist/utils/flattenObject.js +0 -10
@@ -1,127 +1,111 @@
1
- import { jsxs as n, jsx as t } from "react/jsx-runtime";
2
- import { useContext as q, useState as o } from "react";
3
- import { Response as u } from "../api-playground/ApiPlayground/Response/index.js";
4
- import { ModalHeader as w } from "../api-playground/ApiPlayground/components/ModalHeader.js";
5
- import { PlaygroundModalWrapper as P } from "../api-playground/ApiPlayground/components/PlaygroundModalWrapper.js";
6
- import { SendPill as A } from "../api-playground/ApiPlayground/components/SendPill.js";
7
- import { useKeyboardShortcut as M } from "../hooks/useKeyboardShortcut.js";
8
- import { copyToClipboard as j } from "../utils/copyToClipboard.js";
9
- import { ApiExamples as E } from "./ApiExamples.js";
10
- import { EndpointHeader as U } from "./EndpointHeader.js";
11
- import { BodySection as W } from "./components/Request/BodySection.js";
12
- import { ParameterSection as H } from "./components/Request/ParameterSection.js";
13
- import { SecuritySection as K } from "./components/Request/SecuritySection.js";
14
- import { ServerSection as O } from "./components/Request/ServerSection.js";
15
- import { ApiPlaygroundContext as z } from "./contexts/ApiPlaygroundContext.js";
16
- import { useCopyPathWithInputs as F } from "./hooks/useCopyPathWithInputs.js";
17
- import { useInitializeInputs as G } from "./hooks/useInitializeInputs.js";
18
- import { useSendPlaygroundRequest as J } from "./hooks/useSendPlaygroundRequest.js";
19
- import { getRequestBodyContentType as L } from "./schemaGraph/utils.js";
20
- import { cn as Q } from "../utils/cn.js";
21
- const xt = ({
22
- isPlaygroundExpanded: l,
1
+ import { jsxs as i, jsx as t } from "react/jsx-runtime";
2
+ import { useState as S } from "react";
3
+ import { useSelectedBaseUrl as v } from "./hooks/useSelectedBaseUrl.js";
4
+ import { useSelectedExample as I } from "./hooks/useSelectedExample.js";
5
+ import { Response as c } from "../api-playground/ApiPlayground/Response/index.js";
6
+ import { ModalHeader as N } from "../api-playground/ApiPlayground/components/ModalHeader.js";
7
+ import { PlaygroundModalWrapper as b } from "../api-playground/ApiPlayground/components/PlaygroundModalWrapper.js";
8
+ import { useKeyboardShortcut as B } from "../hooks/useKeyboardShortcut.js";
9
+ import { ApiExamples as C } from "./ApiExamples.js";
10
+ import { EndpointHeader as k } from "./EndpointHeader.js";
11
+ import { BodySection as w } from "./components/Request/BodySection.js";
12
+ import { ParameterSection as T } from "./components/Request/ParameterSection.js";
13
+ import { SecuritySection as q } from "./components/Request/SecuritySection.js";
14
+ import { ServerSection as M } from "./components/Request/ServerSection.js";
15
+ import { SendPillWrapper as j } from "./components/SendPillWrapper.js";
16
+ import { useInitializeInputs as E } from "./hooks/useInitializeInputs.js";
17
+ import { useSelectedRequestBodyContentType as P } from "./hooks/useSelectedRequestBodyContentType.js";
18
+ import { cn as U } from "../utils/cn.js";
19
+ const D = ({
20
+ isPlaygroundExpanded: o,
23
21
  setIsPlaygroundExpanded: r,
24
- baseUrl: d,
25
- baseUrlOptions: y,
22
+ baseUrl: s,
23
+ baseUrlOptions: a,
26
24
  apiReferenceData: e
27
25
  }) => {
28
- var a;
29
- const { selectedExampleIndex: g, selectedBaseUrlIndex: s, setSelectedBaseUrlIndex: x } = q(z), [V, X] = o(0), [f, c] = o(!1), [m, h] = o(0), [i, S] = o(), [I, C] = o(!1);
30
- G({
26
+ const { selectedBaseUrlIndex: m, setSelectedBaseUrlIndex: p } = v(), { selectedRequestBodyContentTypeIndex: l, setSelectedRequestBodyContentTypeIndex: u } = P(), [n, g] = S(), { selectedExampleIndex: y } = I();
27
+ if (E({
31
28
  apiReferenceData: e,
32
- selectedBaseUrlIndex: s,
33
- selectedExampleIndex: g ?? 0,
34
- selectedRequestBodyContentTypeIndex: m
35
- });
36
- const v = J({
37
- apiReferenceData: e,
38
- baseUrl: d,
39
- contentType: L(e, m),
40
- setResult: S,
41
- setIsSending: C
42
- }), N = F({
43
- path: ((a = e.operation) == null ? void 0 : a.path) ?? "",
44
- baseUrl: d
45
- }), b = async () => {
46
- await j(N) === "success" && (c(!0), setTimeout(() => {
47
- c(!1);
48
- }, 2e3));
49
- };
50
- if (M({
29
+ selectedBaseUrlIndex: m,
30
+ selectedExampleIndex: y,
31
+ selectedRequestBodyContentTypeIndex: l,
32
+ locallyStoredCredentials: void 0,
33
+ serverInputs: void 0
34
+ }), B({
51
35
  key: "Escape",
52
- callback: l ? () => r(!1) : void 0,
36
+ callback: o ? () => r(!1) : void 0,
53
37
  isSingleKey: !0
54
38
  }), !e.operation) return null;
55
- const { path: B, method: p, title: T, description: k } = e.operation;
56
- return /* @__PURE__ */ n(
57
- P,
39
+ const { path: f, method: d, title: x, description: h } = e.operation;
40
+ return /* @__PURE__ */ i(
41
+ b,
58
42
  {
59
- isPlaygroundExpanded: l,
43
+ isPlaygroundExpanded: o,
60
44
  setIsPlaygroundExpanded: r,
61
45
  children: [
62
- /* @__PURE__ */ n("div", { className: "mint:flex mint:items-center mint:justify-between mint:gap-x-2 mint:rounded-xl mint:p-1.5 mint:pr-0", children: [
46
+ /* @__PURE__ */ i("div", { className: "mint:flex mint:items-center mint:justify-between mint:gap-x-2 mint:rounded-xl mint:p-1.5 mint:pr-0", children: [
63
47
  /* @__PURE__ */ t("div", { className: "mint:flex-1 mint:bg-gray-100 dark:bg-white/5 mint:border-gray-200 mint:rounded-xl ", children: /* @__PURE__ */ t(
64
- U,
48
+ k,
65
49
  {
66
- onCopy: b,
67
- baseUrlOptions: y,
68
- selectedBaseUrlIndex: s,
69
- setSelectedBaseUrlIndex: x ?? (() => {
70
- }),
71
- isCopiedActive: f,
50
+ baseUrl: s,
51
+ baseUrlOptions: a,
52
+ selectedBaseUrlIndex: m,
53
+ setSelectedBaseUrlIndex: p,
72
54
  display: "interactive",
73
- path: B,
74
- method: p,
55
+ path: f,
56
+ method: d,
75
57
  onBaseUrlChange: () => {
76
58
  },
77
59
  isInPlaygroundModal: !0
78
60
  }
79
61
  ) }),
80
62
  /* @__PURE__ */ t(
81
- A,
63
+ j,
82
64
  {
65
+ apiReferenceData: e,
66
+ baseUrl: s,
67
+ selectedRequestBodyContentTypeIndex: l,
68
+ setResult: g,
83
69
  label: "Send",
84
- method: p,
85
- isSending: I,
86
- onClick: v,
70
+ method: d,
87
71
  className: "mint:w-20"
88
72
  }
89
73
  )
90
74
  ] }),
91
- /* @__PURE__ */ n("div", { className: "mint:grid mint:grid-cols-1 mint:lg:grid-cols-5 mint:gap-x-8 mint:gap-y-6 mint:mt-5 mint:relative", children: [
92
- /* @__PURE__ */ n("div", { className: "mint:col-span-1 mint:lg:col-span-3", children: [
93
- /* @__PURE__ */ t(w, { title: T, description: k }),
94
- i && /* @__PURE__ */ t(u, { result: i, className: "mint:mt-6 mint:block mint:lg:hidden" }),
95
- /* @__PURE__ */ n("div", { className: "mint:space-y-2 mint:mt-6", children: [
75
+ /* @__PURE__ */ i("div", { className: "mint:grid mint:grid-cols-1 mint:lg:grid-cols-5 mint:gap-x-8 mint:gap-y-6 mint:mt-5 mint:relative", children: [
76
+ /* @__PURE__ */ i("div", { className: "mint:col-span-1 mint:lg:col-span-3", children: [
77
+ /* @__PURE__ */ t(N, { title: x, description: h }),
78
+ n && /* @__PURE__ */ t(c, { result: n, className: "mint:mt-6 mint:block mint:lg:hidden" }),
79
+ /* @__PURE__ */ i("div", { className: "mint:space-y-2 mint:mt-6", children: [
96
80
  /* @__PURE__ */ t(
97
- O,
81
+ M,
98
82
  {
99
83
  apiReferenceData: e,
100
- selectedBaseUrlIndex: s
84
+ selectedBaseUrlIndex: m
101
85
  }
102
86
  ),
103
- /* @__PURE__ */ t(K, { apiReferenceData: e }),
104
- /* @__PURE__ */ t(H, { apiReferenceData: e }),
87
+ /* @__PURE__ */ t(q, { apiReferenceData: e }),
88
+ /* @__PURE__ */ t(T, { apiReferenceData: e }),
105
89
  /* @__PURE__ */ t(
106
- W,
90
+ w,
107
91
  {
108
92
  apiReferenceData: e,
109
- selectedContentTypeIndex: m,
110
- setSelectedContentTypeIndex: h
93
+ selectedContentTypeIndex: l,
94
+ setSelectedContentTypeIndex: u
111
95
  }
112
96
  )
113
97
  ] })
114
98
  ] }),
115
- /* @__PURE__ */ n(
99
+ /* @__PURE__ */ i(
116
100
  "div",
117
101
  {
118
- className: Q(
102
+ className: U(
119
103
  "mint:p-px mint:col-span-1 mint:lg:col-span-2 mint:lg:space-y-6 mint:lg:flex mint:lg:sticky mint:lg:top-0 mint:lg:self-start mint:lg:h-[calc(100vh-5.5rem)]",
120
- i && "mint:lg:flex-col mint:overflow-y-auto mint:lg:-top-12 mint:lg:h-screen"
104
+ n && "mint:lg:flex-col mint:overflow-y-auto mint:lg:-top-12 mint:lg:h-screen"
121
105
  ),
122
106
  children: [
123
- i && /* @__PURE__ */ t(u, { result: i, className: "mint:hidden mint:lg:block mint:min-h-fit" }),
124
- /* @__PURE__ */ t(E, { isModal: !0, "data-testid": "api-playground-request-example", className: "mint:xl:w-full" })
107
+ n && /* @__PURE__ */ t(c, { result: n, className: "mint:hidden mint:lg:block mint:min-h-fit" }),
108
+ /* @__PURE__ */ t(C, { isModal: !0, "data-testid": "api-playground-request-example", className: "mint:xl:w-full" })
125
109
  ]
126
110
  }
127
111
  )
@@ -131,5 +115,5 @@ const xt = ({
131
115
  );
132
116
  };
133
117
  export {
134
- xt as Playground
118
+ D as Playground
135
119
  };
@@ -1,13 +1,26 @@
1
- import { jsx as m } from "react/jsx-runtime";
2
- import { SimpleSchemaField as a } from "./components/EndpointFields/fields/SimpleSchemaField.js";
3
- const c = ({
4
- apiReferenceData: t,
5
- // eslint-disable-next-line unused-imports/no-unused-vars
6
- children: i
1
+ import { jsx as a, jsxs as i } from "react/jsx-runtime";
2
+ import { SchemaField as r } from "./components/EndpointFields/fields/SchemaField.js";
3
+ import { Classes as s } from "./types/index.js";
4
+ import { cn as l } from "../utils/cn.js";
5
+ const d = ({
6
+ apiReferenceData: m,
7
+ children: t
7
8
  }) => {
8
- const e = t.schemaData;
9
- return e ? /* @__PURE__ */ m("div", { className: "mint:flex mint:flex-col mint:gap-8", children: /* @__PURE__ */ m(a, { schema: e, fieldType: "schema", displayFlattened: !0 }) }) : null;
9
+ const e = m.schemaData;
10
+ return e ? /* @__PURE__ */ a("div", { className: "mint:flex mint:flex-col mint:gap-8", id: "api-playground-2-schema-page", children: /* @__PURE__ */ i(
11
+ "div",
12
+ {
13
+ className: l(
14
+ s.Content,
15
+ "relative"
16
+ ),
17
+ children: [
18
+ t,
19
+ /* @__PURE__ */ a(r, { schema: e, fieldType: "schema", displayFlattened: !0 })
20
+ ]
21
+ }
22
+ ) }) : null;
10
23
  };
11
24
  export {
12
- c as SchemaPage
25
+ d as SchemaPage
13
26
  };
@@ -0,0 +1,40 @@
1
+ import { jsxs as y, jsx as s } from "react/jsx-runtime";
2
+ import { Classes as f } from "../../types/index.js";
3
+ import { SectionHeading as p } from "../../../api-playground/EndpointFields/components/SectionHeading.js";
4
+ import { SchemaField as B } from "./fields/SchemaField.js";
5
+ import { useSelectedRequestBodyContentType as S } from "../../hooks/useSelectedRequestBodyContentType.js";
6
+ import { cn as x } from "../../../utils/cn.js";
7
+ const O = ({ apiReferenceData: o }) => {
8
+ var r, m;
9
+ const { selectedRequestBodyContentTypeIndex: c, setSelectedRequestBodyContentTypeIndex: a } = S(), e = (r = o.dependencies) == null ? void 0 : r.requestBody, i = e == null ? void 0 : e.description, t = Object.keys((e == null ? void 0 : e.content) ?? {}), u = Object.fromEntries(
10
+ t.map((n) => {
11
+ var l;
12
+ return [n, (l = e == null ? void 0 : e.content[n]) == null ? void 0 : l.schema];
13
+ }).filter((n) => n[1] !== void 0)
14
+ ), h = (m = o.dependencies) == null ? void 0 : m.schemas, d = Object.values(u)[c];
15
+ return d === void 0 ? null : /* @__PURE__ */ y("div", { className: x(f.APISection), children: [
16
+ t.length > 1 ? /* @__PURE__ */ s(
17
+ p,
18
+ {
19
+ title: "Body",
20
+ options: t,
21
+ selectedIndex: c,
22
+ onSelectOption: a,
23
+ subtitle: i
24
+ }
25
+ ) : /* @__PURE__ */ s(p, { title: "Body", rightElement: t[0], subtitle: i }),
26
+ /* @__PURE__ */ s(
27
+ B,
28
+ {
29
+ schema: d,
30
+ fieldType: "body",
31
+ displayFlattened: !0,
32
+ omitPadding: !0,
33
+ schemas: h
34
+ }
35
+ )
36
+ ] });
37
+ };
38
+ export {
39
+ O as Body
40
+ };
@@ -0,0 +1,90 @@
1
+ import { jsxs as h, Fragment as p, jsx as n } from "react/jsx-runtime";
2
+ import { useMemo as l } from "react";
3
+ import { Classes as u } from "../../types/index.js";
4
+ import { isSchemaObject as f } from "../../schemaGraph/utils.js";
5
+ import { SectionHeading as y } from "../../../api-playground/EndpointFields/components/SectionHeading.js";
6
+ import { SchemaField as j } from "./fields/SchemaField.js";
7
+ import { cn as P } from "../../../utils/cn.js";
8
+ const E = ({ apiReferenceData: t }) => {
9
+ var m, e;
10
+ const i = l(() => {
11
+ var r;
12
+ return ((r = t.dependencies) == null ? void 0 : r.parameters) ?? {};
13
+ }, [(m = t.dependencies) == null ? void 0 : m.parameters]), s = (e = t.dependencies) == null ? void 0 : e.schemas, o = l(() => {
14
+ const r = {
15
+ header: {},
16
+ path: {},
17
+ query: {},
18
+ cookie: {}
19
+ };
20
+ return Object.entries(i).forEach(([x, a]) => {
21
+ const d = a.in;
22
+ d in r && r[d] && (r[d][a.name] = a);
23
+ }), r;
24
+ }, [i]);
25
+ return /* @__PURE__ */ h(p, { children: [
26
+ /* @__PURE__ */ n(
27
+ c,
28
+ {
29
+ title: "Headers",
30
+ parameters: o.header ?? {},
31
+ schemas: s
32
+ }
33
+ ),
34
+ /* @__PURE__ */ n(
35
+ c,
36
+ {
37
+ title: "Path Parameters",
38
+ parameters: o.path ?? {},
39
+ schemas: s
40
+ }
41
+ ),
42
+ /* @__PURE__ */ n(
43
+ c,
44
+ {
45
+ title: "Query Parameters",
46
+ parameters: o.query ?? {},
47
+ schemas: s
48
+ }
49
+ ),
50
+ /* @__PURE__ */ n(
51
+ c,
52
+ {
53
+ title: "Cookies",
54
+ parameters: o.cookie ?? {},
55
+ schemas: s
56
+ }
57
+ )
58
+ ] });
59
+ }, c = ({
60
+ parameters: t,
61
+ title: i,
62
+ schemas: s
63
+ }) => {
64
+ if (Object.keys(t).length === 0)
65
+ return null;
66
+ const o = Object.entries(t).map(([m, e]) => {
67
+ if (!e.schema || !f(e.schema)) return null;
68
+ const r = e.description ?? e.schema.description;
69
+ return /* @__PURE__ */ n(
70
+ j,
71
+ {
72
+ schema: { ...e.schema, description: r },
73
+ fieldType: "parameter",
74
+ name: e.name,
75
+ style: e.style,
76
+ explode: e.explode,
77
+ required: e.required,
78
+ schemas: s
79
+ },
80
+ e.name
81
+ );
82
+ });
83
+ return /* @__PURE__ */ h("div", { className: P(u.APISection), children: [
84
+ /* @__PURE__ */ n(y, { title: i }),
85
+ o
86
+ ] });
87
+ };
88
+ export {
89
+ E as Parameters
90
+ };
@@ -0,0 +1,146 @@
1
+ import { jsxs as _, jsx as i } from "react/jsx-runtime";
2
+ import { useState as V, useRef as W, useMemo as y, useEffect as X, useCallback as H } from "react";
3
+ import { SchemaField as L } from "./fields/SchemaField.js";
4
+ import { isSchemaObject as f, generateSchemaOptionLabels as Y } from "../../schemaGraph/utils.js";
5
+ import { Classes as Z } from "../../types/index.js";
6
+ import { SectionHeading as D } from "../../../api-playground/EndpointFields/components/SectionHeading.js";
7
+ import { useSelectedResponseContentType as tt } from "../../hooks/useSelectedResponseContentType.js";
8
+ import { TypeDropdown as U } from "../../../api-playground/ApiPlayground/components/TypeDropdown.js";
9
+ import { orNullTypeString as et } from "../../../openapi/generateTypeStringFromSchema.js";
10
+ import { InfoPill as nt } from "../../../components/Api/Param.js";
11
+ import { cn as T } from "../../../utils/cn.js";
12
+ import { Tabs as st } from "../../../components/content-components/tabs/tabs.js";
13
+ import { Tab as ot } from "../../../components/content-components/tabs/tab.js";
14
+ const Tt = ({ apiReferenceData: s }) => {
15
+ var j, k, A, N;
16
+ const [r, l] = V(0), { selectedResponseContentTypeIndex: p, setSelectedResponseContentTypeIndex: m } = tt(), x = W(s.operation), d = y(() => {
17
+ var t;
18
+ return ((t = s.dependencies) == null ? void 0 : t.responses) ?? {};
19
+ }, [(j = s.dependencies) == null ? void 0 : j.responses]), b = (k = s.dependencies) == null ? void 0 : k.schemas, n = y(() => {
20
+ var e;
21
+ const t = (e = s.operation) == null ? void 0 : e.responses;
22
+ return t ? Object.entries(t).map(([g, u]) => {
23
+ const c = d[u];
24
+ return [g, (c == null ? void 0 : c.content) ?? {}];
25
+ }) : [];
26
+ }, [d, (A = s.operation) == null ? void 0 : A.responses]);
27
+ X(() => {
28
+ x.current !== s.operation ? (x.current = s.operation, l(0)) : r >= n.length && n.length > 0 && l(0);
29
+ }, [s.operation, n.length, r]);
30
+ const a = y(() => {
31
+ const t = n[r];
32
+ return !t || !t[1] ? [] : Object.entries(t[1]);
33
+ }, [n, r]), q = H(
34
+ (t) => {
35
+ l(t);
36
+ const e = n[t];
37
+ e && e[1] && p >= Object.entries(e[1]).length && m(0);
38
+ },
39
+ [
40
+ n,
41
+ p,
42
+ l,
43
+ m
44
+ ]
45
+ ), B = H(
46
+ (t) => {
47
+ m(t);
48
+ },
49
+ [m]
50
+ ), {
51
+ contentType: C,
52
+ schema: v,
53
+ description: G
54
+ } = y(() => {
55
+ var P, z;
56
+ const t = a[p];
57
+ if (!t)
58
+ return { contentType: void 0, schema: void 0, description: void 0 };
59
+ const [e, g] = t, u = g.schema, c = n[r], $ = c ? String(c[0]) : void 0, F = $ ? (z = (P = s.operation) == null ? void 0 : P.responses) == null ? void 0 : z[$] : void 0, S = F ? d[F] : void 0, M = S == null ? void 0 : S.description;
60
+ return e === "_mintlify/placeholder" ? {
61
+ schema: u,
62
+ contentType: "",
63
+ description: M
64
+ } : {
65
+ schema: u,
66
+ contentType: e,
67
+ description: M
68
+ };
69
+ }, [
70
+ a,
71
+ p,
72
+ n,
73
+ r,
74
+ d,
75
+ (N = s.operation) == null ? void 0 : N.responses
76
+ ]);
77
+ if (!v) return null;
78
+ let o = [v];
79
+ o.some((t) => f(t) && t.type === "null") && (o = o.filter(
80
+ (t) => !f(t) || t.type !== "null"
81
+ ));
82
+ const h = Y(o), J = n.map(([t, e]) => ({
83
+ label: String(t),
84
+ schema: e
85
+ })), K = a.filter(([t]) => t !== "_mintlify/placeholder").map(([t, e]) => ({
86
+ label: String(t),
87
+ schema: e
88
+ })), O = n[0] ? `${n[0][0]}` : "", w = C === "" ? "" : `${C}`, Q = `${O}${O && w ? " - " : ""}${w}`, E = n.length > 1, I = a.length > 1, R = E || I;
89
+ return /* @__PURE__ */ _("div", { className: T(Z.APISection), children: [
90
+ /* @__PURE__ */ i(
91
+ D,
92
+ {
93
+ title: "Response",
94
+ subtitle: G,
95
+ rightElement: R ? /* @__PURE__ */ _("div", { className: "mint:flex mint:items-center mint:gap-x-3 mint:font-mono mint:text-xs", children: [
96
+ /* @__PURE__ */ i(
97
+ U,
98
+ {
99
+ onSelectOption: q,
100
+ options: J,
101
+ selectedIndex: r,
102
+ className: T(
103
+ "mint:bg-transparent mint:dark:bg-transparent",
104
+ E && "mint:hover:text-zinc-950 mint:dark:hover:text-white mint:transition-all"
105
+ )
106
+ }
107
+ ),
108
+ /* @__PURE__ */ i(
109
+ U,
110
+ {
111
+ onSelectOption: B,
112
+ options: K,
113
+ selectedIndex: p,
114
+ className: T(
115
+ "mint:bg-transparent mint:dark:bg-transparent",
116
+ I && "mint:hover:text-zinc-950 mint:dark:hover:text-white mint:transition-all"
117
+ )
118
+ }
119
+ )
120
+ ] }) : Q,
121
+ children: h[0] && h[0].includes(et) && /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(nt, { className: "mint:max-w-fit mint:text-xs mint:font-medium mint:font-mono mint:break-words", children: h[0] }) })
122
+ }
123
+ ),
124
+ o.length > 1 ? /* @__PURE__ */ i(st, { children: o.map((t, e) => /* @__PURE__ */ i(ot, { title: h[e] ?? "", children: f(t) && /* @__PURE__ */ i(
125
+ L,
126
+ {
127
+ schema: t,
128
+ fieldType: "response",
129
+ displayFlattened: !0,
130
+ schemas: b
131
+ }
132
+ ) }, e)) }) : o[0] && f(o[0]) && /* @__PURE__ */ i(
133
+ L,
134
+ {
135
+ schema: o[0],
136
+ fieldType: "response",
137
+ displayFlattened: !0,
138
+ omitPadding: !0,
139
+ schemas: b
140
+ }
141
+ )
142
+ ] });
143
+ };
144
+ export {
145
+ Tt as Response
146
+ };
@@ -0,0 +1,88 @@
1
+ import { jsx as o, jsxs as y } from "react/jsx-runtime";
2
+ import { useSelectedSecurityOption as S } from "../../hooks/useSelectedSecurityOption.js";
3
+ import { SectionHeading as O } from "../../../api-playground/EndpointFields/components/SectionHeading.js";
4
+ import { Classes as h } from "../../types/index.js";
5
+ import { cn as g } from "../../../utils/cn.js";
6
+ import { PrimitiveParamField as r } from "./fields/PrimitiveParamField.js";
7
+ const P = ({ apiReferenceData: d }) => {
8
+ var a;
9
+ const { selectedSecurityOptionIndex: s, setSelectedSecurityOptionIndex: u } = S(), p = (a = d.dependencies) == null ? void 0 : a.processedSecurityOptions;
10
+ if (!p) return null;
11
+ const l = p[s];
12
+ if (!l) return null;
13
+ const e = [];
14
+ if (l.schemes.forEach(({ scheme: t, schema: i, name: n }) => {
15
+ if (t.type === "apiKey" && "name" in t && "in" in t)
16
+ e.push(
17
+ /* @__PURE__ */ o(
18
+ r,
19
+ {
20
+ fieldType: "authorization",
21
+ schema: i,
22
+ typeOptions: ["string"],
23
+ name: n,
24
+ location: t.in
25
+ },
26
+ `${t.in}:${t.name}`
27
+ )
28
+ );
29
+ else if (t.type === "http" && "scheme" in t)
30
+ if (t.scheme === "basic") {
31
+ const f = { ...i, type: "string" };
32
+ e.push(
33
+ /* @__PURE__ */ o(
34
+ r,
35
+ {
36
+ fieldType: "authorization",
37
+ schema: f,
38
+ typeOptions: ["string"],
39
+ name: n,
40
+ location: "header"
41
+ },
42
+ `header:${i.title}`
43
+ )
44
+ );
45
+ } else t.scheme === "bearer" && e.push(
46
+ /* @__PURE__ */ o(
47
+ r,
48
+ {
49
+ fieldType: "authorization",
50
+ schema: i,
51
+ typeOptions: ["string"],
52
+ name: n,
53
+ location: "header"
54
+ },
55
+ `header:${i.title}`
56
+ )
57
+ );
58
+ else t.type === "oauth2" && e.push(
59
+ /* @__PURE__ */ o(
60
+ r,
61
+ {
62
+ fieldType: "authorization",
63
+ schema: i,
64
+ typeOptions: ["string"],
65
+ name: n,
66
+ location: "header"
67
+ },
68
+ `header:${i.title}`
69
+ )
70
+ );
71
+ }), e.length === 0) return null;
72
+ const c = p.map((t) => t.title);
73
+ return /* @__PURE__ */ y("div", { className: g(h.APISection), children: [
74
+ /* @__PURE__ */ o(
75
+ O,
76
+ {
77
+ title: "Authorizations",
78
+ options: c,
79
+ selectedIndex: s,
80
+ onSelectOption: u
81
+ }
82
+ ),
83
+ e
84
+ ] });
85
+ };
86
+ export {
87
+ P as Security
88
+ };