@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,33 +0,0 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import { InputContainer as a } from "../../components/InputContainer.js";
3
- const u = ({
4
- name: n,
5
- schema: e,
6
- typeDropdown: i,
7
- clearValue: r,
8
- parentNames: l,
9
- arrayIndex: o
10
- }) => /* @__PURE__ */ t(
11
- a,
12
- {
13
- name: n,
14
- typeDropdown: i,
15
- schema: e,
16
- onClear: r,
17
- parentNames: l,
18
- arrayIndex: o,
19
- children: /* @__PURE__ */ t(
20
- "input",
21
- {
22
- className: "mint:flex-1 mint:min-w-0 mint:outline-0 mint:bg-transparent mint:text-playground-input",
23
- type: "text",
24
- placeholder: "--",
25
- contentEditable: "false",
26
- disabled: !0
27
- }
28
- )
29
- }
30
- );
31
- export {
32
- u as NullInput
33
- };
@@ -1,61 +0,0 @@
1
- import { jsx as l } from "react/jsx-runtime";
2
- import { useCallback as g } from "react";
3
- import { useSelectedLocale as s } from "../../../../utils/locales/index.js";
4
- import { InputContainer as c } from "../../components/InputContainer.js";
5
- import { Ids as y } from "../../../../api-playground-2/types/index.js";
6
- const C = ({
7
- name: n,
8
- typeDropdown: o,
9
- schema: r,
10
- value: i,
11
- setValue: t,
12
- clearValue: p,
13
- arrayIndex: u,
14
- ...m
15
- }) => {
16
- const d = s(), f = g(
17
- (e) => {
18
- if (e.target.value.length === 0) {
19
- t(void 0);
20
- return;
21
- }
22
- if (r.type === "integer") {
23
- const a = parseInt(e.target.value);
24
- if (isNaN(a))
25
- return;
26
- t(a);
27
- } else
28
- t(parseFloat(e.target.value));
29
- },
30
- [t, r.type]
31
- );
32
- return /* @__PURE__ */ l(
33
- c,
34
- {
35
- name: n,
36
- typeDropdown: o,
37
- schema: r,
38
- onClear: p,
39
- parentNames: m.parentNames,
40
- arrayIndex: u,
41
- children: /* @__PURE__ */ l(
42
- "input",
43
- {
44
- id: y.APIPlaygroundInput,
45
- className: "mint:flex-1 mint:min-w-0 mint:bg-transparent mint:outline-0 mint:text-playground-input",
46
- placeholder: r.placeholder ?? `enter ${n ?? "value"}`,
47
- "aria-label": r.placeholder ?? d["aria.enterValue"].replace("{name}", n ?? "value"),
48
- onKeyDown: (e) => {
49
- (e.key === "e" || e.key === "." && r.type === "integer") && e.preventDefault();
50
- },
51
- type: "number",
52
- value: i ?? "",
53
- onChange: f
54
- }
55
- )
56
- }
57
- );
58
- };
59
- export {
60
- C as NumberInput
61
- };
@@ -1,109 +0,0 @@
1
- import { jsx as R } from "react/jsx-runtime";
2
- import { getNextPropertiesByType as g } from "../../../../utils/api-reference/getNextPropertiesByType.js";
3
- import { RecursiveInput as V } from "./RecursiveInput.js";
4
- const B = ({
5
- properties: p,
6
- additionalProperties: i,
7
- value: e,
8
- setValue: o,
9
- name: s,
10
- parentNames: f,
11
- defaultExpanded: d,
12
- depth: t,
13
- refId: m,
14
- refs: x,
15
- style: A,
16
- explode: S
17
- }) => {
18
- const u = new Set(x);
19
- m && u.add(m);
20
- const h = [], w = F(p, i, e);
21
- return u.size > 0 ? w.map((j) => {
22
- const {
23
- key: n,
24
- schema: l,
25
- value: a,
26
- isAdditionalProperty: b
27
- } = j, I = (r) => {
28
- const N = { ...e };
29
- N[n] = r, o(N);
30
- }, O = a === void 0 && !b ? void 0 : () => {
31
- const r = { ...e };
32
- delete r[n], o(r);
33
- }, P = s ? [...f ?? [], s] : void 0, c = l[0], y = g(c), C = Object.values(y).some(
34
- (r) => typeof r == "string" && u.has(r)
35
- );
36
- h.push(
37
- /* @__PURE__ */ R(
38
- V,
39
- {
40
- name: n,
41
- schemaArray: l,
42
- value: a,
43
- setValue: I,
44
- clearValue: O,
45
- depth: t + 1,
46
- parentNames: P,
47
- defaultExpanded: C ? !1 : d,
48
- renderedRefs: new Set(u),
49
- style: A,
50
- explode: S
51
- },
52
- n
53
- )
54
- );
55
- }) : w.map((j) => {
56
- const {
57
- key: n,
58
- schema: l,
59
- value: a,
60
- isAdditionalProperty: b
61
- } = j, I = (c) => {
62
- const y = { ...e };
63
- y[n] = c, o(y);
64
- }, O = a === void 0 && !b ? void 0 : () => {
65
- const c = { ...e };
66
- delete c[n], o(c);
67
- }, P = s ? [...f ?? [], s] : void 0;
68
- h.push(
69
- /* @__PURE__ */ R(
70
- V,
71
- {
72
- name: n,
73
- schemaArray: l,
74
- value: a,
75
- setValue: I,
76
- clearValue: O,
77
- depth: t + 1,
78
- parentNames: P,
79
- defaultExpanded: d,
80
- style: A,
81
- explode: S,
82
- renderedRefs: /* @__PURE__ */ new Set()
83
- },
84
- n
85
- )
86
- );
87
- }), h;
88
- }, F = (p, i, e) => {
89
- const o = Object.entries(p).map(([t, m]) => ({
90
- key: t,
91
- schema: m,
92
- value: e == null ? void 0 : e[t],
93
- isAdditionalProperty: !1
94
- }));
95
- if (i === !1)
96
- return o;
97
- const s = typeof i == "object" ? i : [{ type: "any" }], d = Object.keys(e ?? {}).filter(
98
- (t) => !Object.keys(p).includes(t)
99
- ).map((t) => ({
100
- key: t,
101
- schema: s,
102
- value: e == null ? void 0 : e[t],
103
- isAdditionalProperty: !0
104
- }));
105
- return [...o, ...d];
106
- };
107
- export {
108
- B as calculateObjectInputChildren
109
- };
@@ -1,87 +0,0 @@
1
- import { jsxs as w, jsx as B } from "react/jsx-runtime";
2
- import { useState as C, useMemo as S } from "react";
3
- import { generateUniqueString as b } from "../../../../utils/uuid.js";
4
- import { useGenerateNextAdditionalProperties as k } from "../../../../hooks/useGenerateNextAdditionalProperties.js";
5
- import { useGenerateNextProperties as x } from "../../../../hooks/useGenerateNextProperties.js";
6
- import { AdditionalPropertyButton as G } from "../../components/AdditionalPropertyButton.js";
7
- import { InputContainer as q } from "../../components/InputContainer.js";
8
- import { calculateObjectInputChildren as M } from "./ObjectChildren.js";
9
- const Q = ({
10
- name: o,
11
- schema: t,
12
- typeDropdown: l,
13
- setValue: i,
14
- clearValue: m,
15
- value: r,
16
- depth: n,
17
- parentNames: e,
18
- arrayIndex: I,
19
- defaultExpanded: s,
20
- style: p,
21
- explode: d,
22
- renderedRefs: c
23
- }) => {
24
- const [K, O] = C(b()), a = t.additionalProperties !== !1, A = [...Object.keys(r ?? {}), ...Object.keys(t.properties)], f = x(t), u = k(t), j = t.refIdentifier, y = S(
25
- () => M({
26
- properties: f,
27
- additionalProperties: u,
28
- value: r,
29
- setValue: i,
30
- name: o,
31
- parentNames: e,
32
- defaultExpanded: s,
33
- depth: n,
34
- refId: j,
35
- refs: new Set(c),
36
- style: p,
37
- explode: d
38
- }),
39
- [
40
- u,
41
- s,
42
- n,
43
- o,
44
- e,
45
- f,
46
- j,
47
- c,
48
- i,
49
- r,
50
- p,
51
- d
52
- ]
53
- );
54
- return n === 0 ? y : /* @__PURE__ */ w(
55
- q,
56
- {
57
- name: o,
58
- typeDropdown: l,
59
- schema: t,
60
- onClear: m,
61
- isObject: !0,
62
- parentNames: e,
63
- arrayIndex: I,
64
- defaultExpanded: s,
65
- style: p,
66
- explode: d,
67
- children: [
68
- y,
69
- a ? /* @__PURE__ */ B(
70
- G,
71
- {
72
- onAddKey: (g) => {
73
- const P = { ...r };
74
- P[g] = void 0, i(P), O(b());
75
- },
76
- existingKeys: A,
77
- dataTestId: o + "-additional-property-button"
78
- },
79
- K
80
- ) : null
81
- ]
82
- }
83
- );
84
- };
85
- export {
86
- Q as ObjectInput
87
- };
@@ -1,61 +0,0 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import { useState as O, useCallback as P } from "react";
3
- import { useApiPlaygroundPrefillExamples as g } from "../../../../hooks/useApiPlaygroundPrefillExamples.js";
4
- import { usePlaygroundSchemaOptions as T } from "../../../../hooks/usePlaygroundSchemaOptions.js";
5
- import j from "../../../../components/Api/ErrorBoundary.js";
6
- import { TypeDropdown as k } from "../../components/TypeDropdown.js";
7
- import { DifferentiatedInput as A } from "./DifferentiatedInput.js";
8
- const F = ({
9
- name: p,
10
- value: i,
11
- schemaArray: m,
12
- setValue: e,
13
- clearValue: a,
14
- isBody: d,
15
- depth: f = 0,
16
- parentNames: u,
17
- arrayIndex: h,
18
- defaultExpanded: S,
19
- style: y,
20
- explode: x,
21
- renderedRefs: I = /* @__PURE__ */ new Set()
22
- }) => {
23
- var l;
24
- const [n, b] = O(0), o = T(m), r = (l = o[n]) == null ? void 0 : l.schema, { prefillExamplesEnabled: D } = g(), E = D, v = P(
25
- (s) => {
26
- var c;
27
- ((c = o[s]) == null ? void 0 : c.schema.type) === "null" ? e(null) : e(void 0), b(s);
28
- },
29
- [o, e]
30
- ), w = /* @__PURE__ */ t(
31
- k,
32
- {
33
- options: o,
34
- selectedIndex: n,
35
- onSelectOption: v
36
- }
37
- );
38
- return r === void 0 ? null : /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(
39
- A,
40
- {
41
- name: p,
42
- schema: r,
43
- typeDropdown: w,
44
- value: i,
45
- setValue: e,
46
- clearValue: a,
47
- isBody: d,
48
- depth: f,
49
- parentNames: u,
50
- arrayIndex: h,
51
- defaultExpanded: S,
52
- style: y,
53
- explode: x,
54
- renderedRefs: I,
55
- prefillDisabled: E
56
- }
57
- ) });
58
- };
59
- export {
60
- F as RecursiveInput
61
- };
@@ -1,54 +0,0 @@
1
- import { jsx as i, jsxs as l } from "react/jsx-runtime";
2
- import { ChevronDownFilled as u } from "@fluentui/react-icons";
3
- import { useSelectedLocale as g } from "../../../../utils/locales/index.js";
4
- import { getXFilteredEnumValues as x } from "../../../../openapi/filterEnums.js";
5
- import "@mintlify/validation";
6
- import { cn as f } from "../../../../utils/cn.js";
7
- import { InputContainer as h } from "../../components/InputContainer.js";
8
- const N = ({
9
- name: r,
10
- schema: t,
11
- typeDropdown: a,
12
- value: n,
13
- setValue: o,
14
- clearValue: m,
15
- parentNames: p,
16
- arrayIndex: s
17
- }) => {
18
- const d = g(), c = t.type === "boolean" ? [!0, !1] : x({ schema: t, userGroups: void 0 });
19
- return /* @__PURE__ */ i(
20
- h,
21
- {
22
- name: r,
23
- typeDropdown: a,
24
- schema: t,
25
- onClear: m,
26
- parentNames: p,
27
- arrayIndex: s,
28
- children: /* @__PURE__ */ l("div", { className: "mint:relative", children: [
29
- /* @__PURE__ */ l(
30
- "select",
31
- {
32
- className: f(
33
- "mint:relative mint:text-playground-input mint:w-full mint:text-left mint:flex-1 mint:outline-0 mint:cursor-pointer mint:bg-transparent",
34
- n !== void 0 ? "mint:text-gray-900! mint:dark:text-gray-100!" : "mint:text-gray-400! mint:dark:text-white/30!"
35
- ),
36
- value: (n == null ? void 0 : n.toString()) ?? "",
37
- "aria-label": t.placeholder ?? d["aria.selectOption"].replace("{name}", r || "option"),
38
- onChange: (e) => {
39
- t.type === "boolean" ? o(e.target.value === "true") : o(e.target.value);
40
- },
41
- children: [
42
- /* @__PURE__ */ i("option", { value: "", disabled: !0, children: t.placeholder ?? `select ${r || "option"}` }),
43
- c.map((e) => /* @__PURE__ */ i("option", { value: e.toString(), children: e.toString() }, e.toString()))
44
- ]
45
- }
46
- ),
47
- /* @__PURE__ */ i(u, { 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" })
48
- ] })
49
- }
50
- );
51
- };
52
- export {
53
- N as SelectInput
54
- };
@@ -1,67 +0,0 @@
1
- import { jsx as o, jsxs as b } from "react/jsx-runtime";
2
- import { useCallback as y } from "react";
3
- import { useSelectedLocale as C } from "../../../../utils/locales/index.js";
4
- import { InputContainer as I } from "../../components/InputContainer.js";
5
- import { Ids as k } from "../../../../api-playground-2/types/index.js";
6
- const A = ({
7
- name: e,
8
- schema: i,
9
- typeDropdown: s,
10
- value: n,
11
- setValue: r,
12
- clearValue: c,
13
- parentNames: d,
14
- arrayIndex: p,
15
- style: u,
16
- explode: f
17
- }) => {
18
- const x = C(), { prefix: t, placeholder: a } = j(i.format), g = t && (n != null && n.startsWith(t)) ? n.substring(t.length) : n, h = y(
19
- (l) => {
20
- const m = `${t ?? ""}${l}`;
21
- r(m || void 0);
22
- },
23
- [r, t]
24
- );
25
- return /* @__PURE__ */ o(
26
- I,
27
- {
28
- name: e,
29
- typeDropdown: s,
30
- schema: i,
31
- onClear: c,
32
- parentNames: d,
33
- arrayIndex: p,
34
- style: u,
35
- explode: f,
36
- children: /* @__PURE__ */ b("div", { className: "mint:relative mint:flex mint:flex-1 mint:items-center", children: [
37
- /* @__PURE__ */ o("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: t }),
38
- /* @__PURE__ */ o(
39
- "input",
40
- {
41
- id: k.APIPlaygroundInput,
42
- className: "mint:flex-1 mint:min-w-0 mint:bg-transparent mint:outline-0 mint:text-playground-input",
43
- style: { paddingLeft: t ? t.length * 0.52 + "rem" : void 0 },
44
- placeholder: i.placeholder ?? a ?? `enter ${e ?? "value"}`,
45
- "aria-label": i.placeholder ?? a ?? x["aria.enterValue"].replace("{name}", e ?? "value"),
46
- type: "text",
47
- value: g ?? "",
48
- onChange: (l) => h(l.target.value),
49
- spellCheck: !1
50
- }
51
- )
52
- ] })
53
- }
54
- );
55
- }, j = (e) => {
56
- switch (e == null ? void 0 : e.toLowerCase()) {
57
- case "bearer":
58
- return {
59
- prefix: "Bearer ",
60
- placeholder: "enter bearer token"
61
- };
62
- }
63
- return {};
64
- };
65
- export {
66
- A as StringInput
67
- };
@@ -1,44 +0,0 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { useSelectedLocale as c } from "../../../../utils/locales/index.js";
3
- import { InputContainer as f } from "../../components/InputContainer.js";
4
- const d = ({
5
- name: e,
6
- schema: t,
7
- typeDropdown: a,
8
- value: l,
9
- setValue: n,
10
- clearValue: o,
11
- parentNames: i,
12
- arrayIndex: m
13
- }) => {
14
- const p = c();
15
- return /* @__PURE__ */ r(
16
- f,
17
- {
18
- name: e,
19
- typeDropdown: a,
20
- schema: t,
21
- onClear: o,
22
- parentNames: i,
23
- arrayIndex: m,
24
- children: /* @__PURE__ */ r(
25
- "textarea",
26
- {
27
- 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",
28
- rows: 2,
29
- placeholder: t.placeholder ?? `Enter ${e ?? "value"}`,
30
- "aria-label": t.placeholder ?? p["aria.enterValue"].replace("{name}", e ?? "value"),
31
- value: l,
32
- onChange: (u) => n(u.target.value),
33
- spellCheck: !1,
34
- autoCapitalize: "off",
35
- autoComplete: "off",
36
- autoCorrect: "off"
37
- }
38
- )
39
- }
40
- );
41
- };
42
- export {
43
- d as TextInput
44
- };
@@ -1,42 +0,0 @@
1
- import { jsxs as l, jsx as i } from "react/jsx-runtime";
2
- import { potentiallyParseOpenApiString as M } from "../../../common/potentiallyParseOpenApiString.js";
3
- import { slugToTitle as f } from "../../../common/slugToTitle.js";
4
- import { ChevronDownFilled as k } from "@fluentui/react-icons";
5
- import { useState as P, useMemo as h } from "react";
6
- import { MethodPill as A } from "../../../components/Api/MethodPill.js";
7
- import { DropdownMenu as y, DropdownMenuTrigger as D, DropdownMenuContent as N } from "../../../components/Api/dropdown-menu.js";
8
- import { useMDXContent as S } from "../../../hooks/useMDXContent.js";
9
- import { EndpointsMenuLink as C } from "./EndpointsMenuLink.js";
10
- import { EndpointsMenuSearch as T } from "./EndpointsMenuSearch.js";
11
- const g = (r) => r.reduce((t, e) => "pages" in e ? [...t, ...g(e.pages)] : "openapi" in e || "api" in e || "asyncapi" in e ? [...t, e] : t, []), E = (r) => r.map((t) => {
12
- {
13
- const e = t.openapi || t.api;
14
- if (e == null)
15
- return;
16
- const n = M(e);
17
- return n == null ? void 0 : {
18
- method: n.method,
19
- title: t.title || f(t.href),
20
- href: t.href,
21
- type: "openapi",
22
- playground: t.playground
23
- };
24
- }
25
- }).filter((t) => t != null), G = ({ endpoint: r, channel: t, operation: e, pathname: n }) => {
26
- var u;
27
- const [{ pageMetadata: a }] = S(), s = a.title || f(n), [m, x] = P(""), p = g(((u = a.navigation) == null ? void 0 : u.groupsOrPages) ?? []), d = h(() => E(p), [p]), v = e ? e.title || s : r ? r.title || s : (t == null ? void 0 : t.title) || s, c = e ? e.method : r ? r.method : "websocket", w = c === "websocket", b = h(() => m ? d.filter((o) => o.title.toLowerCase().includes(m.toLowerCase())) : d, [m, d]);
28
- return /* @__PURE__ */ l(y, { children: [
29
- /* @__PURE__ */ i(D, { className: "mint:hidden mint:lg:block", children: /* @__PURE__ */ l("div", { className: "mint:flex mint:items-center mint:gap-x-2 mint:border-standard mint:rounded-xl mint:p-1.5 mint:pr-3 mint:min-w-80 mint:hover:bg-gray-50 mint:dark:hover:bg-white/5", children: [
30
- /* @__PURE__ */ i(A, { method: c, shortMethod: w, isActive: !0 }),
31
- /* @__PURE__ */ i("div", { className: "mint:flex-1 mint:text-left mint:text-sm mint:font-medium mint:text-gray-900 mint:dark:text-white mint:truncate", children: v }),
32
- /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(k, { className: "mint:w-4 mint:h-4 mint:text-gray-500 mint:dark:text-gray-400" }) })
33
- ] }) }),
34
- /* @__PURE__ */ i(N, { className: "mint:hidden mint:lg:block mint:w-80 mint:border mint:border-gray-100 mint:dark:border-white/10 mint:rounded-xl mint:px-2 mint:pb-2 mint:pt-0", children: /* @__PURE__ */ l("div", { className: "mint:flex mint:flex-col", children: [
35
- /* @__PURE__ */ i(T, { search: m, setSearch: x }),
36
- b.map((o) => /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(C, { page: o, pathname: n }) }, `search-${o.title}-${o.href}`))
37
- ] }) })
38
- ] });
39
- };
40
- export {
41
- G as EndpointsMenu
42
- };
@@ -1,43 +0,0 @@
1
- import { jsx as n, jsxs as l } from "react/jsx-runtime";
2
- import { MethodPill as a } from "../../../components/Api/MethodPill.js";
3
- import { isEqualIgnoringLeadingSlash as c } from "../../../paths/isEqualIgnoringLeadingSlash.js";
4
- import { cn as u } from "../../../utils/cn.js";
5
- const w = ({ page: t, pathname: o }) => {
6
- const i = c(t.href, o), m = t.type === "openapi", d = t.playground === "none" || t.playground === "simple" || t.method === "webhook", s = (h) => {
7
- h.preventDefault();
8
- const e = d ? t.href : `${t.href}?playground=open`;
9
- if (typeof window < "u" && window.next) {
10
- const r = window.next.router;
11
- if (r) {
12
- r.push(e);
13
- return;
14
- }
15
- }
16
- window.location.href = e;
17
- };
18
- return /* @__PURE__ */ n("a", { href: t.href, title: t.title, children: /* @__PURE__ */ l(
19
- "div",
20
- {
21
- onClick: s,
22
- className: u(
23
- "mint:flex mint:items-center mint:gap-x-2 mint:hover:bg-gray-50 mint:dark:hover:bg-white/5 mint:rounded-xl mint:p-1.5 mint:group mint:cursor-pointer",
24
- i ? "mint:bg-gray-50 mint:dark:bg-white/5 mint:text-[#643FB2] mint:dark:text-[#C9AAF9] mint:font-medium" : "mint:text-gray-700 mint:hover:text-gray-900 mint:dark:text-gray-400 mint:dark:hover:text-gray-300"
25
- ),
26
- children: [
27
- /* @__PURE__ */ n(
28
- a,
29
- {
30
- method: t.method,
31
- shortMethod: m,
32
- className: "mint:font-medium mint:px-1 mint:py-px mint:text-xs mint:rounded-md",
33
- isActive: i
34
- }
35
- ),
36
- /* @__PURE__ */ n("div", { className: "mint:text-sm mint:truncate", children: t.title })
37
- ]
38
- }
39
- ) });
40
- };
41
- export {
42
- w as EndpointsMenuLink
43
- };
@@ -1,38 +0,0 @@
1
- import { jsx as n, jsxs as r } from "react/jsx-runtime";
2
- import a from "lodash/debounce";
3
- import { SearchIcon as o } from "lucide-react";
4
- import { cn as d } from "../../../utils/cn.js";
5
- const g = ({
6
- search: e,
7
- setSearch: i
8
- }) => {
9
- const m = a(async (t) => {
10
- i(t);
11
- }, 20);
12
- return /* @__PURE__ */ n(
13
- "div",
14
- {
15
- className: d(
16
- "mint:h-[52px] mint:sticky mint:z-[2] mint:-mb-1 mint:-mx-2 mint:pb-0 mint:p-2 mint:left-0 mint:top-0"
17
- ),
18
- children: /* @__PURE__ */ r("div", { className: "mint:p-1.5 mint:border mint:border-gray-200/70 mint:dark:border-white/10 mint:rounded-[0.6rem] mint:bg-white mint:dark:bg-gray-950 mint:border-solid mint:flex mint:items-center mint:gap-x-2 mint:mb-2", children: [
19
- /* @__PURE__ */ n(o, { size: 16, className: "mint:min-w-4 mint:flex-none mint:text-gray-400 mint:dark:text-gray-600" }),
20
- /* @__PURE__ */ n(
21
- "input",
22
- {
23
- type: "text",
24
- value: e,
25
- onChange: (t) => m(t.target.value),
26
- autoFocus: !0,
27
- placeholder: "Search for endpoint...",
28
- "aria-label": "Search for an endpoint",
29
- className: "mint:w-full mint:text-sm mint:text-gray-900 mint:dark:text-gray-100 mint:placeholder-gray-400 mint:dark:placeholder-gray-600 mint:font-light mint:focus:outline-0 mint:dark:bg-gray-950"
30
- }
31
- )
32
- ] })
33
- }
34
- );
35
- };
36
- export {
37
- g as EndpointsMenuSearch
38
- };