@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
@@ -1,103 +1,121 @@
1
- import { jsx as r, Fragment as K, jsxs as T } from "react/jsx-runtime";
2
- import { useState as g } from "react";
3
- import { v4 as q } from "uuid";
4
- import { isSchemaObject as u, getUniqueInputKey as b, convertAnySchemaToOneOfs as w } from "../../../schemaGraph/utils.js";
5
- import { AdditionalPropertyButton as B } from "../../../../api-playground/ApiPlayground/components/AdditionalPropertyButton.js";
6
- import { DifferentiatedInput as f } from "./DifferentiatedInput.js";
7
- const G = ({
8
- schema: t,
9
- depth: s,
1
+ import { jsx as p, Fragment as w, jsxs as N } from "react/jsx-runtime";
2
+ import { useState as V } from "react";
3
+ import { v4 as W } from "uuid";
4
+ import { usePlaygroundInputsStore as F } from "../../../hooks/usePlaygroundInputsStore.js";
5
+ import { getUniqueInputKey as U } from "../../../schemaGraph/addUniqueKeysToSchema.js";
6
+ import { isSchemaObject as b, escapeDots as j, convertAnySchemaToOneOfs as z } from "../../../schemaGraph/utils.js";
7
+ import { AdditionalPropertyButton as C } from "../../../../api-playground/ApiPlayground/components/AdditionalPropertyButton.js";
8
+ import { DifferentiatedInput as A } from "./DifferentiatedInput.js";
9
+ const Y = ({
10
+ schema: n,
11
+ depth: d,
10
12
  parentNames: m,
11
- style: a,
12
- explode: d,
13
- inputKeyPrefix: e,
14
- name: l
13
+ style: K,
14
+ explode: O,
15
+ inputKeyPrefix: o,
16
+ name: c,
17
+ arrayIndices: i
15
18
  }) => {
16
- const O = [];
17
- Object.entries(t.properties ?? {}).forEach(([o, n]) => {
18
- if (u(n)) {
19
- const i = l ? [l] : void 0;
20
- O.push(
21
- /* @__PURE__ */ r(
22
- f,
19
+ const $ = F((t) => t.deleteInput), S = [];
20
+ Object.entries(n.properties ?? {}).forEach(([t, e]) => {
21
+ if (b(e)) {
22
+ const l = c ? [...m ?? [], c] : void 0;
23
+ S.push(
24
+ /* @__PURE__ */ p(
25
+ A,
23
26
  {
24
- name: o,
25
- schema: n,
26
- depth: (s ?? 0) + 1,
27
- parentNames: i,
28
- style: a,
29
- explode: d,
30
- inputKeyPrefix: e
27
+ name: t,
28
+ schema: e,
29
+ depth: (d ?? 0) + 1,
30
+ parentNames: l,
31
+ style: K,
32
+ explode: O,
33
+ arrayIndices: i,
34
+ inputKeyPrefix: o
31
35
  },
32
- o
36
+ t
33
37
  )
34
38
  );
35
39
  }
36
40
  });
37
- const h = t.additionalProperties !== void 0 && t.additionalProperties !== !1, j = q(), [p, v] = g([]), c = [];
38
- p.forEach((o) => {
39
- var n;
40
- if (u(t.additionalProperties)) {
41
- const i = b(e, t, void 0, o);
42
- c.push(
43
- /* @__PURE__ */ r(
44
- f,
41
+ const v = n.additionalProperties !== !1, T = W(), [q, y] = V([]), P = [];
42
+ q.forEach((t) => {
43
+ var l;
44
+ const e = c ? [...m ?? [], c] : m;
45
+ if (b(n.additionalProperties)) {
46
+ const f = n.uniqueKey ?? "", h = f ? `${f}.${j(t)}` : j(t), r = { ...n.additionalProperties, uniqueKey: h }, s = U(o, r, i), u = () => {
47
+ $(s), y((a) => a.filter((I) => I !== t));
48
+ };
49
+ P.push(
50
+ /* @__PURE__ */ p(
51
+ A,
45
52
  {
46
- name: o,
47
- schema: { ...t.additionalProperties, uniqueKey: i },
48
- depth: (s ?? 0) + 1,
49
- parentNames: m,
50
- style: a,
51
- explode: d,
52
- inputKeyPrefix: e
53
+ name: t,
54
+ schema: r,
55
+ depth: (d ?? 0) + 1,
56
+ parentNames: e,
57
+ style: K,
58
+ explode: O,
59
+ arrayIndices: i,
60
+ inputKeyPrefix: o,
61
+ clearValue: u
53
62
  },
54
- o
63
+ t
55
64
  )
56
65
  );
57
66
  } else {
58
- const i = b(e, t, void 0, o), y = {
59
- oneOf: (n = w().oneOf) == null ? void 0 : n.map((S) => ({
60
- ...S,
61
- uniqueKey: i
62
- }))
67
+ const f = n.uniqueKey ?? "", h = z(), r = `${f}.${j(t)}.oneOf`, s = {
68
+ oneOf: (l = h.oneOf) == null ? void 0 : l.map((u, a) => ({
69
+ ...u,
70
+ uniqueKey: `${r}.${a}`
71
+ })),
72
+ uniqueKey: r
63
73
  };
64
- u(y) && c.push(
65
- /* @__PURE__ */ r(
66
- f,
67
- {
68
- name: o,
69
- schema: y,
70
- depth: (s ?? 0) + 1,
71
- parentNames: m,
72
- style: a,
73
- explode: d,
74
- inputKeyPrefix: e
75
- },
76
- o
77
- )
78
- );
74
+ if (b(s)) {
75
+ const u = () => {
76
+ const a = U(o, s, i);
77
+ $(a), y((I) => I.filter((E) => E !== t));
78
+ };
79
+ P.push(
80
+ /* @__PURE__ */ p(
81
+ A,
82
+ {
83
+ name: t,
84
+ schema: s,
85
+ depth: (d ?? 0) + 1,
86
+ parentNames: e,
87
+ style: K,
88
+ explode: O,
89
+ arrayIndices: i,
90
+ inputKeyPrefix: o,
91
+ clearValue: u
92
+ },
93
+ t
94
+ )
95
+ );
96
+ }
79
97
  }
80
98
  });
81
- const P = [...O, ...c];
82
- if (s === 0)
83
- return /* @__PURE__ */ r(K, { children: P });
84
- const A = (o) => {
85
- const n = [...p, o];
86
- v(n);
87
- }, I = [...Object.keys(t.properties ?? {}), ...p];
88
- return /* @__PURE__ */ T(K, { children: [
89
- P,
90
- h ? /* @__PURE__ */ r(
91
- B,
99
+ const g = [...S, ...P];
100
+ if (d === 0)
101
+ return /* @__PURE__ */ p(w, { children: g });
102
+ const B = (t) => {
103
+ const e = [...q, t];
104
+ y(e);
105
+ }, D = [...Object.keys(n.properties ?? {}), ...q];
106
+ return /* @__PURE__ */ N(w, { children: [
107
+ g,
108
+ v ? /* @__PURE__ */ p(
109
+ C,
92
110
  {
93
- existingKeys: I,
94
- onAddKey: A,
95
- dataTestId: ("name" in t && t.name ? t.name : "") + "-additional-property-button"
111
+ existingKeys: D,
112
+ onAddKey: B,
113
+ dataTestId: ("name" in n && n.name ? n.name : "") + "-additional-property-button"
96
114
  },
97
- "add-property-button" + j
115
+ "add-property-button" + T
98
116
  ) : null
99
117
  ] });
100
118
  };
101
119
  export {
102
- G as ObjectInput
120
+ Y as ObjectInput
103
121
  };
@@ -1,76 +1,84 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
- import { useState as g } from "react";
3
- import { generateSimpleSchemaLabel as T, generateSchemaOptionLabels as w } from "../../EndpointFields/fields/SimpleSchemaField.js";
4
- import { usePlaygroundInputsStore as D } from "../../../hooks/usePlaygroundInputsStore.js";
5
- import { isSchemaObject as L } from "../../../schemaGraph/utils.js";
6
- import { TypeDropdown as j } from "../../TypeDropdown.js";
7
- import { DifferentiatedInput as b } from "./DifferentiatedInput.js";
8
- import { Tabs as k } from "../../../../components/content-components/tabs/tabs.js";
9
- import { Tab as q } from "../../../../components/content-components/tabs/tab.js";
10
- const G = ({
11
- name: m,
2
+ import { useState as L } from "react";
3
+ import { usePlaygroundInputsStore as h } from "../../../hooks/usePlaygroundInputsStore.js";
4
+ import { getUniqueInputKey as k } from "../../../schemaGraph/addUniqueKeysToSchema.js";
5
+ import { isSchemaObject as A, generateSimpleSchemaLabel as q, isObjectArray as v, generateSchemaOptionLabels as x } from "../../../schemaGraph/utils.js";
6
+ import { TypeDropdown as C } from "../../TypeDropdown.js";
7
+ import { DifferentiatedInput as O } from "./DifferentiatedInput.js";
8
+ import { Tabs as W } from "../../../../components/content-components/tabs/tabs.js";
9
+ import { Tab as U } from "../../../../components/content-components/tabs/tab.js";
10
+ const R = ({
11
+ name: p,
12
12
  schema: r,
13
- clearValue: l,
14
- parentNames: c,
15
- style: p,
16
- explode: a,
17
- inputKeyPrefix: s
13
+ clearValue: a,
14
+ parentNames: d,
15
+ style: f,
16
+ explode: u,
17
+ inputKeyPrefix: s,
18
+ arrayIndices: c,
19
+ isArrayChild: I,
20
+ isBody: y
18
21
  }) => {
19
- const [i, S] = g(0), n = "oneOf" in r && r.oneOf ? r.oneOf.filter(L) : [], y = n.some((e) => e.type === "null"), O = n.map((e) => ({
20
- label: T(e, y),
22
+ const [i, T] = L(0), n = "oneOf" in r && r.oneOf ? r.oneOf.filter(A) : [], g = n.map((e) => ({
23
+ label: q(e),
21
24
  schema: e
22
- })), t = n[i], { setInput: f } = D(), d = `${s}.${r.uniqueKey}`, u = (e) => {
23
- t && "type" in t && t.type === "null" ? f(d, null) : f(d, void 0), S(e);
25
+ })), l = n[i], b = h((e) => e.setInput), j = h((e) => e.deleteInput), m = k(s, r, c), S = (e) => {
26
+ j(m);
27
+ const t = n[e];
28
+ t && "type" in t && t.type === "null" ? b(m, null) : b(m, void 0), T(e);
24
29
  };
25
- if (!t) return null;
26
- if (n.every((e) => e.type === "object")) {
27
- const e = w(n);
30
+ if (!l) return null;
31
+ const w = n.every((e) => e.type === "object" || v(e));
32
+ if (!I && w && y) {
33
+ const e = x(n);
28
34
  return /* @__PURE__ */ o(
29
- k,
35
+ W,
30
36
  {
31
- defaultTab: i,
32
- onChange: u,
37
+ defaultTabIndex: i,
38
+ onClickTab: S,
33
39
  className: "mint:border-gray-100! mint:mb-4! mint:dark:border-white/10!",
34
- children: e.map((h) => /* @__PURE__ */ o(q, { title: h, children: /* @__PURE__ */ o(
35
- b,
40
+ children: e.map((t) => /* @__PURE__ */ o(U, { title: t, children: /* @__PURE__ */ o(
41
+ O,
36
42
  {
37
43
  skipContainer: !0,
38
- name: m,
39
- schema: t,
40
- clearValue: l,
41
- parentNames: c,
42
- style: p,
43
- explode: a,
44
+ arrayIndices: c,
45
+ name: p,
46
+ schema: l,
47
+ clearValue: a,
48
+ parentNames: d,
49
+ style: f,
50
+ explode: u,
44
51
  inputKeyPrefix: s
45
52
  }
46
- ) }, h))
53
+ ) }, t))
47
54
  }
48
55
  );
49
56
  }
50
- const I = O.filter(
57
+ const D = g.filter(
51
58
  ({ schema: e }) => e.type !== "null"
52
59
  );
53
60
  return /* @__PURE__ */ o(
54
- b,
61
+ O,
55
62
  {
56
- name: m,
57
- schema: t,
63
+ name: p,
64
+ schema: l,
58
65
  typeDropdown: /* @__PURE__ */ o(
59
- j,
66
+ C,
60
67
  {
61
- options: I,
68
+ options: D,
62
69
  selectedIndex: i,
63
- onSelectOption: u
70
+ onSelectOption: S
64
71
  }
65
72
  ),
66
- clearValue: l,
67
- parentNames: c,
68
- style: p,
69
- explode: a,
70
- inputKeyPrefix: s
73
+ clearValue: a,
74
+ parentNames: d,
75
+ style: f,
76
+ explode: u,
77
+ inputKeyPrefix: s,
78
+ arrayIndices: c
71
79
  }
72
80
  );
73
81
  };
74
82
  export {
75
- G as OneOfInput
83
+ R as OneOfInput
76
84
  };
@@ -1,51 +1,52 @@
1
1
  import { jsxs as c, jsx as o } from "react/jsx-runtime";
2
- import { isBoolean as S, isString as b, isNumber as v, isInteger as y } from "../../../../common/guards.js";
3
- import { ChevronDownIcon as I } from "lucide-react";
4
- import { usePlaygroundInputsStore as w } from "../../../hooks/usePlaygroundInputsStore.js";
5
- import { getSchemaPlaceholder as N, getUniqueInputKey as k } from "../../../schemaGraph/utils.js";
6
- import { useSelectedLocale as P } from "../../../../utils/locales/index.js";
7
- import { cn as j } from "../../../../utils/cn.js";
2
+ import { isBoolean as x, isString as S, isNumber as b, isInteger as v } from "../../../../common/guards.js";
3
+ import { ChevronDownIcon as y } from "lucide-react";
4
+ import { usePlaygroundInput as I } from "../../../hooks/usePlaygroundInputsStore.js";
5
+ import { getUniqueInputKey as w } from "../../../schemaGraph/addUniqueKeysToSchema.js";
6
+ import { getSchemaPlaceholder as N } from "../../../schemaGraph/utils.js";
7
+ import { useSelectedLocale as k } from "../../../../utils/locales/index.js";
8
+ import { cn as P } from "../../../../utils/cn.js";
8
9
  const U = ({
9
10
  name: a,
10
11
  schema: n,
11
12
  inputKeyPrefix: u,
12
13
  enumType: m,
13
- arrayIndex: p
14
+ arrayIndices: p
14
15
  }) => {
15
- const g = P(), { getInput: d, setInput: s } = w(), l = N(n), f = n.type === "boolean" ? [!0, !1] : n.enum ?? [], r = k(u, n, p), h = d(r), i = ((t, e) => {
16
+ const g = k(), l = N(n), d = n.type === "boolean" ? [!0, !1] : n.enum ?? [], r = w(u, n, p), { value: f, setInput: s } = I(r), i = ((t, e) => {
16
17
  switch (t) {
17
18
  case "integer":
18
- return y(e) ? e : void 0;
19
- case "number":
20
19
  return v(e) ? e : void 0;
21
- case "string":
20
+ case "number":
22
21
  return b(e) ? e : void 0;
23
- case "boolean":
22
+ case "string":
24
23
  return S(e) ? e : void 0;
24
+ case "boolean":
25
+ return x(e) ? e : void 0;
25
26
  default:
26
27
  return;
27
28
  }
28
- })(m, h), x = (t) => {
29
+ })(m, f), h = (t) => {
29
30
  m === "boolean" ? s(r, t.target.value === "true") : s(r, t.target.value);
30
31
  };
31
32
  return /* @__PURE__ */ c("div", { className: "mint:relative", children: [
32
33
  /* @__PURE__ */ c(
33
34
  "select",
34
35
  {
35
- className: j(
36
+ className: P(
36
37
  "mint:relative mint:text-playground-input mint:w-full mint:text-left mint:flex-1 mint:outline-0 mint:cursor-pointer mint:bg-transparent",
37
38
  i !== void 0 ? "mint:text-gray-900! mint:dark:text-gray-100!" : "mint:text-gray-400! mint:dark:text-white/30!"
38
39
  ),
39
40
  value: (i == null ? void 0 : i.toString()) ?? "",
40
41
  "aria-label": l ?? g["aria.selectOption"].replace("{name}", a || "option"),
41
- onChange: x,
42
+ onChange: h,
42
43
  children: [
43
44
  /* @__PURE__ */ o("option", { value: "", disabled: !0, children: l ?? `select ${a || "option"}` }),
44
- f.map((t) => /* @__PURE__ */ o("option", { value: t.toString(), children: t.toString() }, t.toString()))
45
+ d.map((t) => /* @__PURE__ */ o("option", { value: t.toString(), children: t.toString() }, t.toString()))
45
46
  ]
46
47
  }
47
48
  ),
48
- /* @__PURE__ */ o(I, { className: "mint:absolute mint:right-2 mint:top-1/2 mint:-translate-y-1/2 mint:h-4 mint:w-4 mint:text-gray-400 mint:dark:text-white/30 mint:pointer-events-none" })
49
+ /* @__PURE__ */ o(y, { className: "mint:absolute mint:right-2 mint:top-1/2 mint:-translate-y-1/2 mint:h-4 mint:w-4 mint:text-gray-400 mint:dark:text-white/30 mint:pointer-events-none" })
49
50
  ] });
50
51
  };
51
52
  export {
@@ -1,34 +1,35 @@
1
- import { jsxs as y, jsx as c } from "react/jsx-runtime";
2
- import { isString as I } from "../../../../common/guards.js";
3
- import { usePlaygroundInputsStore as b } from "../../../hooks/usePlaygroundInputsStore.js";
4
- import { getSchemaPlaceholder as P, getUniqueInputKey as S } from "../../../schemaGraph/utils.js";
5
- import { useSelectedLocale as j } from "../../../../utils/locales/index.js";
6
- import { Ids as k } from "../../../types/index.js";
7
- const A = ({ name: t, schema: i, inputKeyPrefix: p, arrayIndex: d }) => {
8
- const g = j(), { getInput: f, setInput: l } = b(), s = P(i), { prefix: e, placeholder: a } = w(i.format), r = S(p, i, d), m = f(r), n = I(m) ? m : void 0, x = e && (n != null && n.startsWith(e)) ? n.substring(e.length) : n, h = (o) => {
1
+ import { jsxs as v, jsx as c } from "react/jsx-runtime";
2
+ import { isString as y } from "../../../../common/guards.js";
3
+ import { usePlaygroundInput as I } from "../../../hooks/usePlaygroundInputsStore.js";
4
+ import { getUniqueInputKey as b } from "../../../schemaGraph/addUniqueKeysToSchema.js";
5
+ import { getSchemaPlaceholder as P } from "../../../schemaGraph/utils.js";
6
+ import { useSelectedLocale as S } from "../../../../utils/locales/index.js";
7
+ import { Ids as j } from "../../../types/index.js";
8
+ const A = ({ name: t, schema: i, inputKeyPrefix: p, arrayIndices: d }) => {
9
+ const f = S(), l = P(i), { prefix: e, placeholder: a } = k(i.format), r = b(p, i, d), { value: s, setInput: m } = I(r), n = y(s) ? s : void 0, g = e && (n != null && n.startsWith(e)) ? n.substring(e.length) : n, x = (o) => {
9
10
  const u = `${e ?? ""}${o}`;
10
- u ? l(r, u) : l(r, void 0);
11
- }, v = (o) => {
12
- h(o.target.value);
11
+ u ? m(r, u) : m(r, void 0);
12
+ }, h = (o) => {
13
+ x(o.target.value);
13
14
  };
14
- return /* @__PURE__ */ y("div", { className: "mint:relative mint:flex mint:flex-1 mint:items-center", children: [
15
+ return /* @__PURE__ */ v("div", { className: "mint:relative mint:flex mint:flex-1 mint:items-center", children: [
15
16
  /* @__PURE__ */ c("div", { className: "mint:absolute mint:left-2.5 mint:top-0 mint:bottom-0 mint:flex mint:items-center mint:justify-center mint:text-sm mint:text-gray-800 mint:dark:text-gray-100", children: e }),
16
17
  /* @__PURE__ */ c(
17
18
  "input",
18
19
  {
19
- id: k.APIPlaygroundInput,
20
+ id: j.APIPlaygroundInput,
20
21
  className: "mint:flex-1 mint:min-w-0 mint:bg-transparent mint:outline-0 mint:text-playground-input",
21
22
  style: { paddingLeft: e ? e.length * 0.52 + "rem" : void 0 },
22
- placeholder: s ?? a ?? `enter ${t ?? "value"}`,
23
- "aria-label": s ?? a ?? g["aria.enterValue"].replace("{name}", t ?? "value"),
23
+ placeholder: l ?? a ?? `enter ${t ?? "value"}`,
24
+ "aria-label": l ?? a ?? f["aria.enterValue"].replace("{name}", t ?? "value"),
24
25
  type: "text",
25
- value: x ?? "",
26
- onChange: v,
26
+ value: g ?? "",
27
+ onChange: h,
27
28
  spellCheck: !1
28
29
  }
29
30
  )
30
31
  ] });
31
- }, w = (t) => {
32
+ }, k = (t) => {
32
33
  switch (t == null ? void 0 : t.toLowerCase()) {
33
34
  case "bearer":
34
35
  return {
@@ -1,20 +1,21 @@
1
- import { jsx as f } from "react/jsx-runtime";
2
- import { isString as g } from "../../../../common/guards.js";
3
- import { usePlaygroundInputsStore as x } from "../../../hooks/usePlaygroundInputsStore.js";
4
- import { getUniqueInputKey as d, getSchemaPlaceholder as h } from "../../../schemaGraph/utils.js";
5
- import { useSelectedLocale as v } from "../../../../utils/locales/index.js";
6
- const b = ({ name: e, schema: t, inputKeyPrefix: r, arrayIndex: l }) => {
7
- const i = v(), { getInput: m, setInput: u } = x(), n = d(r, t, l), o = m(n), s = g(o) ? o : void 0, p = (c) => {
8
- u(n, c.target.value);
9
- }, a = h(t);
10
- return /* @__PURE__ */ f(
1
+ import { jsx as c } from "react/jsx-runtime";
2
+ import { isString as f } from "../../../../common/guards.js";
3
+ import { usePlaygroundInput as g } from "../../../hooks/usePlaygroundInputsStore.js";
4
+ import { getUniqueInputKey as x } from "../../../schemaGraph/addUniqueKeysToSchema.js";
5
+ import { getSchemaPlaceholder as d } from "../../../schemaGraph/utils.js";
6
+ import { useSelectedLocale as h } from "../../../../utils/locales/index.js";
7
+ const b = ({ name: e, schema: t, inputKeyPrefix: r, arrayIndices: l }) => {
8
+ const i = h(), o = x(r, t, l), { value: n, setInput: m } = g(o), u = f(n) ? n : void 0, p = (s) => {
9
+ m(o, s.target.value);
10
+ }, a = d(t);
11
+ return /* @__PURE__ */ c(
11
12
  "textarea",
12
13
  {
13
14
  className: "mint:-mx-3.5 mint:px-3.5 mint:flex-1 mint:min-h-[2.5rem] mint:min-w-0 mint:bg-transparent mint:outline-0 mint:text-playground-input mint:resize-y",
14
15
  rows: 2,
15
16
  placeholder: a ?? `Enter ${e ?? "value"}`,
16
17
  "aria-label": a ?? i["aria.enterValue"].replace("{name}", e ?? "value"),
17
- value: s,
18
+ value: u,
18
19
  onChange: p,
19
20
  spellCheck: !1,
20
21
  autoCapitalize: "off",
@@ -0,0 +1,35 @@
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import { useState as u } from "react";
3
+ import { SendPill as S } from "../../api-playground/ApiPlayground/components/SendPill.js";
4
+ import { useSendPlaygroundRequest as f } from "../hooks/useSendPlaygroundRequest.js";
5
+ import { getRequestBodyContentType as c } from "../schemaGraph/utils.js";
6
+ const C = ({
7
+ apiReferenceData: e,
8
+ baseUrl: t,
9
+ selectedRequestBodyContentTypeIndex: o,
10
+ setResult: n,
11
+ label: r,
12
+ method: s,
13
+ className: i
14
+ }) => {
15
+ const [m, p] = u(!1), d = f({
16
+ apiReferenceData: e,
17
+ baseUrl: t,
18
+ contentType: c(e, o),
19
+ setResult: n,
20
+ setIsSending: p
21
+ });
22
+ return /* @__PURE__ */ l(
23
+ S,
24
+ {
25
+ label: r,
26
+ method: s,
27
+ isSending: m,
28
+ onClick: d,
29
+ className: i
30
+ }
31
+ );
32
+ };
33
+ export {
34
+ C as SendPillWrapper
35
+ };
@@ -1,10 +1,8 @@
1
1
  import { createContext as e } from "react";
2
- const t = e({
2
+ const o = e({
3
3
  isSending: !1,
4
- selectedBaseUrlIndex: 0,
5
- isPlaygroundExpanded: !1,
6
- selectedExampleIndex: 0
4
+ isPlaygroundExpanded: !1
7
5
  });
8
6
  export {
9
- t as ApiPlaygroundContext
7
+ o as ApiPlaygroundContext
10
8
  };
@@ -0,0 +1,23 @@
1
+ const r = ({
2
+ securityOption: a,
3
+ inputs: n
4
+ }) => {
5
+ if (!a) return [];
6
+ const i = [];
7
+ return a.schemes.forEach(({ scheme: e, name: c }) => {
8
+ if ("in" in e && e.in === "cookie") {
9
+ const o = "name" in e ? e.name : c;
10
+ n.cookie[o] && typeof n.cookie[o] == "string" ? i.push({
11
+ name: o,
12
+ // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
13
+ value: n.cookie[o]
14
+ }) : i.push({
15
+ name: o,
16
+ value: ""
17
+ });
18
+ }
19
+ }), i;
20
+ };
21
+ export {
22
+ r as createCookies
23
+ };