@mintlify/msft-sdk 1.1.62 → 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 (166) 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/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/content-components/code-group.js +4 -4
  84. package/dist/contexts/EndpointLocationContext.js +3 -3
  85. package/dist/hooks/useApiParamFieldOption.js +10 -0
  86. package/dist/hooks/useEndpoint.js +3 -3
  87. package/dist/hooks/useKeyboardShortcut.js +13 -13
  88. package/dist/hooks/useSendPlaygroundRequest.js +14 -146
  89. package/dist/index.d.ts +65 -58
  90. package/dist/index.js +109 -111
  91. package/dist/openapi/generateTypeStringFromSchema.js +2 -31
  92. package/dist/styles.css +1 -1
  93. package/package.json +1 -1
  94. package/dist/api-playground/ApiPlayground/Request/BodySection.js +0 -64
  95. package/dist/api-playground/ApiPlayground/Request/ParameterSection.js +0 -32
  96. package/dist/api-playground/ApiPlayground/Request/PlaygroundModal.js +0 -201
  97. package/dist/api-playground/ApiPlayground/Request/SecuritySection.js +0 -146
  98. package/dist/api-playground/ApiPlayground/Request/ServerSection.js +0 -30
  99. package/dist/api-playground/ApiPlayground/Request/index.js +0 -43
  100. package/dist/api-playground/ApiPlayground/Request/inputs/ArrayInput.js +0 -93
  101. package/dist/api-playground/ApiPlayground/Request/inputs/DifferentiatedInput.js +0 -90
  102. package/dist/api-playground/ApiPlayground/Request/inputs/FileInput.js +0 -62
  103. package/dist/api-playground/ApiPlayground/Request/inputs/NullInput.js +0 -33
  104. package/dist/api-playground/ApiPlayground/Request/inputs/NumberInput.js +0 -61
  105. package/dist/api-playground/ApiPlayground/Request/inputs/ObjectChildren.js +0 -109
  106. package/dist/api-playground/ApiPlayground/Request/inputs/ObjectInput.js +0 -87
  107. package/dist/api-playground/ApiPlayground/Request/inputs/RecursiveInput.js +0 -61
  108. package/dist/api-playground/ApiPlayground/Request/inputs/SelectInput.js +0 -54
  109. package/dist/api-playground/ApiPlayground/Request/inputs/StringInput.js +0 -67
  110. package/dist/api-playground/ApiPlayground/Request/inputs/TextInput.js +0 -44
  111. package/dist/api-playground/ApiPlayground/components/EndpointsMenu.js +0 -42
  112. package/dist/api-playground/ApiPlayground/components/EndpointsMenuLink.js +0 -43
  113. package/dist/api-playground/ApiPlayground/components/EndpointsMenuSearch.js +0 -38
  114. package/dist/api-playground/ApiPlayground/components/InputContainer.js +0 -128
  115. package/dist/api-playground/ApiPlayground/components/InputSectionContainer.js +0 -59
  116. package/dist/api-playground/ApiPlayground/components/PathHeader.js +0 -162
  117. package/dist/api-playground/ApiPlayground/components/TrashButton.js +0 -26
  118. package/dist/api-playground/ApiPlayground/index.js +0 -67
  119. package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/Enum.js +0 -19
  120. package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/NumberMetadata.js +0 -18
  121. package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/StringMetadata.js +0 -28
  122. package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/index.js +0 -5
  123. package/dist/api-playground/EndpointFields/ParamFields/RecursiveParamField.js +0 -13
  124. package/dist/api-playground/EndpointFields/index.js +0 -7
  125. package/dist/api-playground-2/components/EndpointFields/EndpointSecurity.js +0 -87
  126. package/dist/api-playground-2/components/EndpointFields/fields/SimpleArrayParamField.js +0 -89
  127. package/dist/api-playground-2/components/EndpointFields/fields/SimpleObjectParamField.js +0 -121
  128. package/dist/api-playground-2/components/EndpointFields/fields/SimplePrimitiveParamField.js +0 -74
  129. package/dist/api-playground-2/components/EndpointFields/fields/SimpleSchemaField.js +0 -252
  130. package/dist/common/potentiallyParseOpenApiString.js +0 -24
  131. package/dist/common/replaceSlashIndex.js +0 -6
  132. package/dist/common/slugToTitle.js +0 -10
  133. package/dist/constants/prism-languages.js +0 -19
  134. package/dist/contexts/ApiPlaygroundInputsContext.js +0 -17
  135. package/dist/contexts/MDXContentContext.js +0 -17
  136. package/dist/hooks/useApiPlaygroundInputs.js +0 -6
  137. package/dist/hooks/useApiPlaygroundPrefillExamples.js +0 -39
  138. package/dist/hooks/useBaseUrlOptions.js +0 -18
  139. package/dist/hooks/useComponentSchemas.js +0 -9
  140. package/dist/hooks/useGenerateNextAdditionalProperties.js +0 -11
  141. package/dist/hooks/useGenerateNextItems.js +0 -11
  142. package/dist/hooks/useGenerateNextProperties.js +0 -11
  143. package/dist/hooks/useMDXContent.js +0 -6
  144. package/dist/hooks/useMDXContentController/useApiPlaygroundInputs.js +0 -9
  145. package/dist/hooks/useMDXContentController/useMDXContentCallbacks/useSetApiBaseIndexCallback.js +0 -15
  146. package/dist/hooks/useMDXContentController/useMDXContentCallbacks/useSetApiPlaygroundInputsCallback.js +0 -15
  147. package/dist/hooks/usePlaygroundSchemaOptions.js +0 -42
  148. package/dist/hooks/usePrefilledInputs/index.js +0 -65
  149. package/dist/hooks/usePrefilledInputs/storedServerVariables.js +0 -29
  150. package/dist/hooks/useSecurityOption.js +0 -10
  151. package/dist/hooks/useSetDefaultValue.js +0 -63
  152. package/dist/openapi/filterEnums.js +0 -20
  153. package/dist/openapi/generateNextAdditionalProperties.js +0 -7
  154. package/dist/openapi/generateNextItems.js +0 -7
  155. package/dist/openapi/generateNextProperties.js +0 -23
  156. package/dist/openapi/generateOptionLabels.js +0 -20
  157. package/dist/openapi/generateSimpleLabels.js +0 -4
  158. package/dist/openapi/getAuthFilteredSchemaArray.js +0 -18
  159. package/dist/paths/isEqualIgnoringLeadingSlash.js +0 -21
  160. package/dist/paths/optionallyRemoveLeadingSlash.js +0 -6
  161. package/dist/paths/optionallyRemoveTrailingSlash.js +0 -6
  162. package/dist/utils/api-playground/defaults.js +0 -15
  163. package/dist/utils/api-playground/paramFieldDefaults.js +0 -10
  164. package/dist/utils/api-reference/getFilteredSecurityOptions.js +0 -4
  165. package/dist/utils/api-reference/getNextPropertiesByType.js +0 -5
  166. package/dist/utils/flattenObject.js +0 -10
@@ -1,252 +1,25 @@
1
- import { jsx as t, jsxs as S, Fragment as V } from "react/jsx-runtime";
2
- import { useContext as T, useMemo as f, useState as P, useCallback as U } from "react";
3
- import { EndpointSecurity as ne } from "./components/EndpointFields/EndpointSecurity.js";
4
- import { SimpleSchemaField as x, generateSchemaOptionLabels as se } from "./components/EndpointFields/fields/SimpleSchemaField.js";
5
- import { isSchemaObject as g } from "./schemaGraph/utils.js";
6
- import { Classes as A } from "./types/index.js";
7
- import { TypeDropdown as J } from "../api-playground/ApiPlayground/components/TypeDropdown.js";
8
- import { SectionHeading as R } from "../api-playground/EndpointFields/components/SectionHeading.js";
9
- import { InfoPill as oe } from "../components/Api/Param.js";
10
- import { ApiReferenceContext2 as v } from "../contexts/ConfigContext.js";
11
- import { EndpointLocationProvider as K } from "../contexts/EndpointLocationContext.js";
12
- import { cn as b } from "../utils/cn.js";
13
- import { Tabs as W } from "../components/content-components/tabs/tabs.js";
14
- import { Tab as X } from "../components/content-components/tabs/tab.js";
15
- const re = " | null";
16
- function ke({ pageMetadata: s }) {
17
- return /* @__PURE__ */ t("div", { className: b("mint:mb-14"), children: s.openapi && /* @__PURE__ */ t(ie, {}) });
18
- }
19
- const ie = () => {
20
- const { apiReferenceData2: s } = T(v);
21
- if (!s.operation)
1
+ import { jsx as t, jsxs as m, Fragment as p } from "react/jsx-runtime";
2
+ import { memo as c, useContext as f } from "react";
3
+ import { Security as l } from "./components/EndpointFields/Security.js";
4
+ import { Parameters as u } from "./components/EndpointFields/Parameters.js";
5
+ import { Body as h } from "./components/EndpointFields/Body.js";
6
+ import { Response as y } from "./components/EndpointFields/Response.js";
7
+ import { ApiReferenceContext2 as R } from "../contexts/ConfigContext.js";
8
+ import { EndpointLocationProvider as o } from "../contexts/EndpointLocationContext.js";
9
+ const A = c(function({ pageMetadata: r }) {
10
+ return /* @__PURE__ */ t("div", { className: "mint:mb-14", children: r.openapi && /* @__PURE__ */ t(x, {}) });
11
+ }), x = () => {
12
+ const { apiReferenceData2: e } = f(R);
13
+ if (!e.operation)
22
14
  return null;
23
- const { dependencies: n } = s, l = (n == null ? void 0 : n.security) && Object.keys(n.security).length > 0, o = (n == null ? void 0 : n.parameters) && Object.keys(n.parameters).length > 0, c = n == null ? void 0 : n.requestBody, i = (n == null ? void 0 : n.responses) && Object.keys(n.responses).length > 0;
24
- return /* @__PURE__ */ S(V, { children: [
25
- l && /* @__PURE__ */ t(ne, { apiReferenceData: s }),
26
- o && /* @__PURE__ */ t(ce, {}),
27
- c && /* @__PURE__ */ t(K, { location: "request", children: /* @__PURE__ */ t(ae, {}) }),
28
- i && /* @__PURE__ */ t(K, { location: "response", children: /* @__PURE__ */ t(le, {}) })
29
- ] });
30
- }, ce = () => {
31
- var o;
32
- const { apiReferenceData2: s } = T(v), n = f(() => {
33
- var c;
34
- return ((c = s.dependencies) == null ? void 0 : c.parameters) ?? {};
35
- }, [(o = s.dependencies) == null ? void 0 : o.parameters]), l = f(() => {
36
- const c = {
37
- header: {},
38
- path: {},
39
- query: {},
40
- cookie: {}
41
- };
42
- return Object.entries(n).forEach(([i, r]) => {
43
- const m = r.in;
44
- m in c && c[m] && (c[m][r.name] = r);
45
- }), c;
46
- }, [n]);
47
- return /* @__PURE__ */ S(V, { children: [
48
- /* @__PURE__ */ t(I, { title: "Headers", parameters: l.header ?? {} }),
49
- /* @__PURE__ */ t(I, { title: "Path Parameters", parameters: l.path ?? {} }),
50
- /* @__PURE__ */ t(I, { title: "Query Parameters", parameters: l.query ?? {} }),
51
- /* @__PURE__ */ t(I, { title: "Cookies", parameters: l.cookie ?? {} })
52
- ] });
53
- }, I = ({
54
- parameters: s,
55
- title: n
56
- }) => {
57
- const { apiReferenceData2: l } = T(v);
58
- if (Object.keys(s).length === 0)
59
- return null;
60
- const o = Object.entries(s).map(([c, i]) => {
61
- var r;
62
- return !i.schema || !g(i.schema) ? null : /* @__PURE__ */ t(
63
- x,
64
- {
65
- schema: i.schema,
66
- displayFlattened: !0,
67
- fieldType: "parameter",
68
- name: i.name,
69
- style: i.style,
70
- explode: i.explode,
71
- required: i.required,
72
- schemas: (r = l.dependencies) == null ? void 0 : r.schemas
73
- },
74
- i.name
75
- );
76
- });
77
- return /* @__PURE__ */ S("div", { className: b(A.APISection), children: [
78
- /* @__PURE__ */ t(R, { title: n }),
79
- o
80
- ] });
81
- }, ae = () => {
82
- var O, j;
83
- const [s, n] = P(0), { apiReferenceData2: l } = T(v), o = (O = l.dependencies) == null ? void 0 : O.requestBody, c = o == null ? void 0 : o.description, i = Object.keys((o == null ? void 0 : o.content) ?? {}), r = Object.fromEntries(
84
- i.map((p) => {
85
- var h;
86
- return [p, (h = o == null ? void 0 : o.content[p]) == null ? void 0 : h.schema];
87
- }).filter((p) => p[1] !== void 0)
88
- ), m = Object.values(r)[s];
89
- return m === void 0 ? null : /* @__PURE__ */ S("div", { className: b(A.APISection), children: [
90
- i.length > 1 ? /* @__PURE__ */ t(
91
- R,
92
- {
93
- title: "Body",
94
- options: i,
95
- selectedIndex: s,
96
- onSelectOption: n,
97
- subtitle: c
98
- }
99
- ) : /* @__PURE__ */ t(R, { title: "Body", rightElement: i[0], subtitle: c }),
100
- Object.keys(r).length > 1 ? /* @__PURE__ */ t("div", { className: "mint:mt-4 mint:rounded-xl mint:border mint:border-gray-100 mint:px-4 mint:pt-2 mint:dark:border-white/10", children: /* @__PURE__ */ t(
101
- W,
102
- {
103
- className: "mint:-mt-1! mint:border-gray-100! mint:mb-0! mint:dark:border-white/10!",
104
- children: Object.values(r).map((p, h) => {
105
- var k;
106
- return /* @__PURE__ */ t(X, { title: Object.keys(r)[h] ?? "", children: /* @__PURE__ */ t(
107
- x,
108
- {
109
- schema: p,
110
- fieldType: "body",
111
- displayFlattened: !0,
112
- schemas: (k = l.dependencies) == null ? void 0 : k.schemas
113
- }
114
- ) }, h);
115
- })
116
- },
117
- s
118
- ) }) : /* @__PURE__ */ t(
119
- x,
120
- {
121
- schema: m,
122
- fieldType: "body",
123
- displayFlattened: !0,
124
- schemas: (j = l.dependencies) == null ? void 0 : j.schemas
125
- }
126
- )
127
- ] });
128
- }, le = () => {
129
- var B, $, _, L;
130
- const { apiReferenceData2: s } = T(v), [n, l] = P(0), [o, c] = P(0), i = f(() => {
131
- var e;
132
- return ((e = s.dependencies) == null ? void 0 : e.responses) ?? {};
133
- }, [(B = s.dependencies) == null ? void 0 : B.responses]), r = f(() => {
134
- var a;
135
- const e = (a = s.operation) == null ? void 0 : a.responses;
136
- return e ? Object.entries(e).map(([u, E]) => {
137
- const y = i[E];
138
- return [u, (y == null ? void 0 : y.content) ?? {}];
139
- }) : [];
140
- }, [i, ($ = s.operation) == null ? void 0 : $.responses]), m = f(() => {
141
- const e = r[n];
142
- return !e || !e[1] ? [] : Object.entries(e[1]);
143
- }, [r, n]), O = U(
144
- (e) => {
145
- l(e);
146
- const a = r[e];
147
- a && a[1] && o >= Object.entries(a[1]).length && c(0);
148
- },
149
- [r, o]
150
- ), j = U((e) => {
151
- c(e);
152
- }, []), {
153
- contentType: p,
154
- schema: h,
155
- description: k
156
- } = f(() => {
157
- var G, Q;
158
- const e = m[o];
159
- if (!e)
160
- return { contentType: void 0, schema: void 0, description: void 0 };
161
- const [a, u] = e, E = u.schema, y = r[n], M = y ? String(y[0]) : void 0, z = M ? (Q = (G = s.operation) == null ? void 0 : G.responses) == null ? void 0 : Q[M] : void 0, N = z ? i[z] : void 0, H = N == null ? void 0 : N.description;
162
- return a === "_mintlify/placeholder" ? {
163
- schema: E,
164
- contentType: "",
165
- description: H
166
- } : {
167
- schema: E,
168
- contentType: a,
169
- description: H
170
- };
171
- }, [
172
- m,
173
- o,
174
- r,
175
- n,
176
- i,
177
- (_ = s.operation) == null ? void 0 : _.responses
178
- ]);
179
- if (!h) return null;
180
- let d = [h];
181
- const C = se(d);
182
- d.some((e) => g(e) && e.type === "null") && (d = d.filter(
183
- (e) => !g(e) || e.type !== "null"
184
- ));
185
- const Y = r.map(([e, a]) => ({
186
- label: String(e),
187
- schema: a
188
- })), Z = m.filter(([e]) => e !== "_mintlify/placeholder").map(([e, a]) => ({
189
- label: String(e),
190
- schema: a
191
- })), w = r[0] ? `${r[0][0]}` : "", F = p === "" ? "" : `${p}`, ee = `${w}${w && F ? " - " : ""}${F}`, q = r.length > 1, D = m.length > 1, te = q || D;
192
- return /* @__PURE__ */ S("div", { className: b(A.APISection), children: [
193
- /* @__PURE__ */ t(
194
- R,
195
- {
196
- title: "Response",
197
- subtitle: k,
198
- rightElement: te ? /* @__PURE__ */ S("div", { className: "mint:flex mint:items-center mint:gap-x-3 mint:font-mono mint:text-xs", children: [
199
- /* @__PURE__ */ t(
200
- J,
201
- {
202
- onSelectOption: O,
203
- options: Y,
204
- selectedIndex: n,
205
- className: b(
206
- "mint:bg-transparent mint:dark:bg-transparent",
207
- q && "mint:hover:text-zinc-950 mint:dark:hover:text-white mint:transition-all"
208
- )
209
- }
210
- ),
211
- /* @__PURE__ */ t(
212
- J,
213
- {
214
- onSelectOption: j,
215
- options: Z,
216
- selectedIndex: o,
217
- className: b(
218
- "mint:bg-transparent mint:dark:bg-transparent",
219
- D && "mint:hover:text-zinc-950 mint:dark:hover:text-white mint:transition-all"
220
- )
221
- }
222
- )
223
- ] }) : ee,
224
- children: C[0] && C[0].includes(re) && /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(oe, { className: "mint:max-w-fit mint:text-xs mint:font-medium mint:font-mono mint:break-words", children: C[0] }) })
225
- }
226
- ),
227
- d.length > 1 ? /* @__PURE__ */ t(W, { children: d.map((e, a) => {
228
- var u;
229
- return /* @__PURE__ */ t(X, { title: C[a] ?? "", children: g(e) && /* @__PURE__ */ t(
230
- x,
231
- {
232
- schema: e,
233
- fieldType: "response",
234
- displayFlattened: !0,
235
- schemas: (u = s.dependencies) == null ? void 0 : u.schemas
236
- }
237
- ) }, a);
238
- }) }) : d[0] && g(d[0]) && /* @__PURE__ */ t(
239
- x,
240
- {
241
- schema: d[0],
242
- fieldType: "response",
243
- displayFlattened: !0,
244
- schemas: (L = s.dependencies) == null ? void 0 : L.schemas
245
- }
246
- )
15
+ const { dependencies: r } = e, s = (r == null ? void 0 : r.processedSecurityOptions) && r.processedSecurityOptions.length > 0, a = (r == null ? void 0 : r.parameters) && Object.keys(r.parameters).length > 0, i = r == null ? void 0 : r.requestBody, n = (r == null ? void 0 : r.responses) && Object.keys(r.responses).length > 0;
16
+ return /* @__PURE__ */ m(p, { children: [
17
+ s && /* @__PURE__ */ t(l, { apiReferenceData: e }),
18
+ a && /* @__PURE__ */ t(u, { apiReferenceData: e }),
19
+ i && /* @__PURE__ */ t(o, { location: "request", children: /* @__PURE__ */ t(h, { apiReferenceData: e }) }),
20
+ n && /* @__PURE__ */ t(o, { location: "response", children: /* @__PURE__ */ t(y, { apiReferenceData: e }) })
247
21
  ] });
248
22
  };
249
23
  export {
250
- ke as ApiFields,
251
- re as orNullTypeString
24
+ A as ApiFields
252
25
  };
@@ -1,51 +1,63 @@
1
1
  import { jsxs as n, jsx as t } from "react/jsx-runtime";
2
- import { BasePathSelector as p } from "../api-playground/ApiPlayground/components/BasePathSelector.js";
3
- import { PrettyPath as d } from "../api-playground/ApiPlayground/components/PrettyPath.js";
4
- import { MethodPill as f } from "../components/Api/MethodPill.js";
5
- import { cn as x } from "../utils/cn.js";
6
- const g = ({
7
- onCopy: e,
8
- baseUrlOptions: r,
2
+ import { useState as u } from "react";
3
+ import { BasePathSelector as x } from "../api-playground/ApiPlayground/components/BasePathSelector.js";
4
+ import { PrettyPath as h } from "../api-playground/ApiPlayground/components/PrettyPath.js";
5
+ import { MethodPill as y } from "../components/Api/MethodPill.js";
6
+ import { cn as v } from "../utils/cn.js";
7
+ import { copyToClipboard as C } from "../utils/copyToClipboard.js";
8
+ import { useCopyPathWithInputs as P } from "./hooks/useCopyPathWithInputs.js";
9
+ const W = ({
10
+ baseUrl: r,
11
+ baseUrlOptions: s,
9
12
  selectedBaseUrlIndex: m,
10
- setSelectedBaseUrlIndex: o,
11
- isCopiedActive: l,
12
- display: h,
13
- path: a,
14
- method: i,
15
- onBaseUrlChange: s,
16
- isInPlaygroundModal: c
17
- }) => /* @__PURE__ */ n(
18
- "div",
19
- {
20
- className: x(
21
- "mint:relative mint:flex-1 mint:flex mint:gap-2 mint:min-w-0 mint:items-center mint:p-1.5 mint:pr-0 mint:cursor-pointer mint:overflow-hidden mint:rounded-xl"
22
- ),
23
- onClick: e,
24
- children: [
25
- /* @__PURE__ */ t(f, { method: i, isActive: !1 }),
26
- /* @__PURE__ */ n("div", { className: "mint:flex mint:items-center mint:space-x-2 mint:overflow-x-auto mint:flex-1 mint:no-scrollbar", children: [
27
- /* @__PURE__ */ t(
28
- p,
29
- {
30
- baseUrlOptions: r,
31
- selectedBaseUrlIndex: m,
32
- setSelectedBaseUrlIndex: o,
33
- onBaseUrlChange: s
34
- }
35
- ),
36
- /* @__PURE__ */ t(
37
- d,
38
- {
39
- path: a,
40
- method: i,
41
- isCopiedActive: l,
42
- hasGrayBackground: c
43
- }
44
- )
45
- ] })
46
- ]
47
- }
48
- );
13
+ setSelectedBaseUrlIndex: a,
14
+ display: w,
15
+ path: i,
16
+ method: o,
17
+ onBaseUrlChange: c,
18
+ isInPlaygroundModal: p
19
+ }) => {
20
+ const [l, e] = u(!1), f = P({
21
+ path: i,
22
+ baseUrl: r
23
+ }), d = async () => {
24
+ await C(f) === "success" && (e(!0), setTimeout(() => {
25
+ e(!1);
26
+ }, 2e3));
27
+ };
28
+ return /* @__PURE__ */ n(
29
+ "div",
30
+ {
31
+ className: v(
32
+ "mint:relative mint:flex-1 mint:flex mint:gap-2 mint:min-w-0 mint:items-center mint:p-1.5 mint:pr-0 mint:cursor-pointer mint:overflow-hidden mint:rounded-xl"
33
+ ),
34
+ onClick: d,
35
+ children: [
36
+ /* @__PURE__ */ t(y, { method: o, isActive: !1 }),
37
+ /* @__PURE__ */ n("div", { className: "mint:flex mint:items-center mint:space-x-2 mint:overflow-x-auto mint:flex-1 mint:no-scrollbar", children: [
38
+ /* @__PURE__ */ t(
39
+ x,
40
+ {
41
+ baseUrlOptions: s,
42
+ selectedBaseUrlIndex: m,
43
+ setSelectedBaseUrlIndex: a,
44
+ onBaseUrlChange: c
45
+ }
46
+ ),
47
+ /* @__PURE__ */ t(
48
+ h,
49
+ {
50
+ path: i,
51
+ method: o,
52
+ isCopiedActive: l,
53
+ hasGrayBackground: p
54
+ }
55
+ )
56
+ ] })
57
+ ]
58
+ }
59
+ );
60
+ };
49
61
  export {
50
- g as EndpointHeader
62
+ W as EndpointHeader
51
63
  };
@@ -1,94 +1,98 @@
1
- import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
- import { useContext as U, useState as s, useEffect as v } from "react";
3
- import { SendPill as I } from "../api-playground/ApiPlayground/components/SendPill.js";
1
+ import { jsxs as t, jsx as e } from "react/jsx-runtime";
2
+ import { useContext as w, useState as P, useEffect as b } from "react";
3
+ import { useSelectedBaseUrl as v } from "./hooks/useSelectedBaseUrl.js";
4
+ import { SendPill as U } from "../api-playground/ApiPlayground/components/SendPill.js";
4
5
  import { PageContext as E } from "../contexts/ConfigContext.js";
5
- import { useApiPlaygroundDisplay as S } from "../hooks/useApiPlaygroundDisplay.js";
6
- import { copyToClipboard as A } from "../utils/copyToClipboard.js";
7
- import { ApiExamples as N } from "./ApiExamples.js";
8
- import { ApiFields as k } from "./ApiFields.js";
9
- import { EndpointHeader as B } from "./EndpointHeader.js";
10
- import { Playground as j } from "./Playground.js";
11
- import { ApiPlaygroundContext as L } from "./contexts/ApiPlaygroundContext.js";
12
- import { joinWithSingleSlash as R } from "./hooks/useSendPlaygroundRequest.js";
13
- const V = ({
14
- apiReferenceData: h,
15
- operation: x,
6
+ import { useApiPlaygroundDisplay as I } from "../hooks/useApiPlaygroundDisplay.js";
7
+ import { ApiExamples as C } from "./ApiExamples.js";
8
+ import { ApiFields as S } from "./ApiFields.js";
9
+ import { EndpointHeader as N } from "./EndpointHeader.js";
10
+ import { Playground as A } from "./Playground.js";
11
+ import { ApiPlaygroundContext as k } from "./contexts/ApiPlaygroundContext.js";
12
+ import { Classes as B } from "./types/index.js";
13
+ import { cn as L } from "../utils/cn.js";
14
+ const J = ({
15
+ apiReferenceData: c,
16
+ operation: f,
16
17
  // eslint-disable-next-line unused-imports/no-unused-vars
17
- children: T
18
+ children: u
18
19
  }) => {
19
- const { path: l, method: d, baseUrl: w, baseUrlOptions: r } = x, { pageMetadata: P } = U(E), m = S(), [o, c] = s(0), [p, u] = s(!1), [b, f] = s(!1), g = m === "simple", y = r[o] ?? w ?? "";
20
- v(() => {
20
+ const { path: g, method: a, baseUrlOptions: o } = f, { pageMetadata: x } = w(E), d = I(), [l, m] = P(!1), s = d === "simple", { selectedBaseUrlIndex: h, setSelectedBaseUrlIndex: y, baseUrl: p } = v();
21
+ b(() => {
21
22
  if (typeof window > "u") return;
22
23
  new URLSearchParams(window.location.search).has("playground") && requestAnimationFrame(() => {
23
- u(!0);
24
+ m(!0);
24
25
  });
25
26
  }, []);
26
- const C = async () => {
27
- const n = R(y, l);
28
- await A(n) === "success" && (f(!0), setTimeout(() => {
29
- f(!1);
30
- }, 2e3));
31
- }, a = (n) => {
32
- if (u(n), !(typeof window > "u"))
33
- if (n) {
34
- const t = new URL(window.location.href);
35
- t.searchParams.set("playground", "open"), window.history.replaceState({}, "", t);
27
+ const r = (i) => {
28
+ if (m(i), !(typeof window > "u"))
29
+ if (i) {
30
+ const n = new URL(window.location.href);
31
+ n.searchParams.set("playground", "open"), window.history.replaceState({}, "", n);
36
32
  } else {
37
- const t = new URL(window.location.href);
38
- t.searchParams.delete("playground"), window.history.replaceState({}, "", t);
33
+ const n = new URL(window.location.href);
34
+ n.searchParams.delete("playground"), window.history.replaceState({}, "", n);
39
35
  }
40
36
  };
41
- return /* @__PURE__ */ i(
42
- L.Provider,
37
+ return /* @__PURE__ */ t(
38
+ k.Provider,
43
39
  {
44
40
  value: {
45
- setSelectedBaseUrlIndex: c,
46
- selectedBaseUrlIndex: o,
47
- baseUrlOptions: r,
48
- isPlaygroundExpanded: p,
49
- setIsPlaygroundExpanded: a
41
+ isPlaygroundExpanded: l,
42
+ setIsPlaygroundExpanded: r
50
43
  },
51
44
  children: [
52
- /* @__PURE__ */ i("div", { className: "mint:flex mint:flex-col mint:gap-8", children: [
53
- /* @__PURE__ */ i("div", { className: "mint:flex mint:w-full mint:flex-col mint:space-y-4", children: [
54
- /* @__PURE__ */ i("div", { className: "mint:flex mint:items-center mint:gap-3 mint:border mint:border-gray-200 mint:dark:border-[#2d2d2d] mint:rounded-2xl mint:p-1.5", children: [
55
- /* @__PURE__ */ e("div", { className: "mint:flex mint:items-center mint:gap-0 mint:flex-1 mint:bg-white mint:dark:bg-[#1a1a1a] mint:border mint:border-gray-200 mint:dark:border-[#2d2d2d] mint:rounded-2xl", children: /* @__PURE__ */ e(
56
- B,
45
+ /* @__PURE__ */ t("div", { className: "mint:flex mint:flex-col mint:gap-8", id: "api-playground-2-operation-page", children: [
46
+ /* @__PURE__ */ t("div", { className: "mint:flex mint:w-full mint:flex-col mint:space-y-4", children: [
47
+ /* @__PURE__ */ e("div", { className: "mint:flex mint:items-center mint:gap-3 mint:border mint:border-gray-200 mint:dark:border-[#2d2d2d] mint:rounded-2xl mint:p-1.5", children: /* @__PURE__ */ t("div", { className: "mint:flex mint:items-center mint:gap-0 mint:flex-1 mint:bg-white mint:dark:bg-[#1a1a1a] mint:border mint:border-gray-200 mint:dark:border-[#2d2d2d] mint:rounded-2xl", children: [
48
+ /* @__PURE__ */ e(
49
+ N,
57
50
  {
58
- onCopy: C,
59
- baseUrlOptions: r,
60
- selectedBaseUrlIndex: o,
61
- setSelectedBaseUrlIndex: c,
62
- isCopiedActive: b,
63
- display: m,
64
- path: l,
65
- method: d,
51
+ baseUrl: p,
52
+ baseUrlOptions: o,
53
+ selectedBaseUrlIndex: h,
54
+ setSelectedBaseUrlIndex: y,
55
+ display: d,
56
+ path: g,
57
+ method: a,
66
58
  onBaseUrlChange: () => {
67
59
  },
68
60
  isInPlaygroundModal: !1
69
61
  }
70
- ) }),
71
- g ? null : /* @__PURE__ */ e(
72
- I,
62
+ ),
63
+ s ? null : /* @__PURE__ */ e(
64
+ U,
73
65
  {
74
66
  label: "Try it",
75
- method: d,
76
- onClick: () => a(!0)
67
+ method: a,
68
+ onClick: () => r(!0)
77
69
  }
78
70
  )
79
- ] }),
80
- /* @__PURE__ */ e("div", { className: "mint:mt-8 mint:lg:mt-0 mint:flex mint:flex-col mint:gap-6 mint:xl:!hidden mint:max-h-[30rem]", children: /* @__PURE__ */ e(N, { noInputs: !0 }) })
71
+ ] }) }),
72
+ /* @__PURE__ */ e("div", { className: "mint:mt-8 mint:lg:mt-0 mint:flex mint:flex-col mint:gap-6 mint:xl:hidden mint:max-h-[30rem]", children: /* @__PURE__ */ e(C, { noInputs: !0 }) })
81
73
  ] }),
82
- /* @__PURE__ */ e(k, { pageMetadata: P })
74
+ /* @__PURE__ */ t(
75
+ "div",
76
+ {
77
+ className: L(
78
+ B.Content,
79
+ "relative"
80
+ ),
81
+ children: [
82
+ u,
83
+ /* @__PURE__ */ e(S, { pageMetadata: x })
84
+ ]
85
+ }
86
+ )
83
87
  ] }),
84
- !g && /* @__PURE__ */ e(
85
- j,
88
+ !s && /* @__PURE__ */ e(
89
+ A,
86
90
  {
87
- isPlaygroundExpanded: p,
88
- setIsPlaygroundExpanded: a,
89
- baseUrl: y,
90
- baseUrlOptions: r,
91
- apiReferenceData: h
91
+ isPlaygroundExpanded: l,
92
+ setIsPlaygroundExpanded: r,
93
+ baseUrl: p,
94
+ baseUrlOptions: o,
95
+ apiReferenceData: c
92
96
  }
93
97
  )
94
98
  ]
@@ -96,5 +100,5 @@ const V = ({
96
100
  );
97
101
  };
98
102
  export {
99
- V as OperationPage
103
+ J as OperationPage
100
104
  };