@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,47 +1,49 @@
1
1
  import "@mintlify/validation";
2
- import { apiPlaygroundInputKeys as c, initialApiPlaygroundInputs as O, CIRCULAR_REF_KEY as A, stringFileFormats as S, combinationKeys as g, MAX_SCHEMA_COMBINATION_SIZE as k } from "../constants/index.js";
3
- function j(e) {
2
+ import q from "@sindresorhus/slugify";
3
+ import { apiPlaygroundInputKeys as a, CIRCULAR_REF_KEY as A, stringFileFormats as h, combinationKeys as m, MAX_SCHEMA_COMBINATION_SIZE as $ } from "../constants/index.js";
4
+ import { getExampleBodyInputs as k } from "./getExampleBodyInputs.js";
5
+ function D(e) {
4
6
  return typeof e == "object" && e !== null && A in e && typeof e[A] == "string";
5
7
  }
6
- const B = () => ({ oneOf: [] }), T = () => ({ oneOf: [{}] }), m = (e) => typeof e == "object" && e !== null && !Array.isArray(e), x = (e) => a(e) && Array.isArray(e.oneOf), a = (e) => m(e) ? "type" in e || "properties" in e || "oneOf" in e || "anyOf" in e || "allOf" in e || "items" in e || "additionalProperties" in e || "enum" in e || "const" in e || "format" in e || "pattern" in e || "minimum" in e || "maximum" in e || "minLength" in e || "maxLength" in e || "minItems" in e || "maxItems" in e || "minProperties" in e || "maxProperties" in e || "required" in e || "nullable" in e || "description" in e : !1, K = (e) => a(e) && e.type === "array";
7
- function R(e) {
8
- const t = Array.isArray(e.oneOf) ? e.oneOf.length : 1, n = Array.isArray(e.anyOf) ? e.anyOf.length : 1, r = Array.isArray(e.allOf) ? e.allOf.length : 1, i = [t, n, r];
9
- return g.forEach((o) => {
10
- if (e[o]) {
11
- const u = e[o];
12
- i.push(Object.keys(u).length), g.forEach((f) => {
13
- if (u[f]) {
14
- const p = u[f];
15
- i.push(Object.keys(p).length), g.forEach((b) => {
16
- if (p[b]) {
17
- const P = p[b];
18
- i.push(Object.keys(P).length);
8
+ const K = () => ({ oneOf: [] }), z = () => ({ oneOf: [{}] }), b = (e) => typeof e == "object" && e !== null && !Array.isArray(e), N = (e) => c(e) && Array.isArray(e.oneOf), c = (e) => b(e) ? "type" in e || "properties" in e || "oneOf" in e || "anyOf" in e || "allOf" in e || "items" in e || "additionalProperties" in e || "enum" in e || "const" in e || "format" in e || "pattern" in e || "minimum" in e || "maximum" in e || "minLength" in e || "maxLength" in e || "minItems" in e || "maxItems" in e || "minProperties" in e || "maxProperties" in e || "required" in e || "nullable" in e || "description" in e : !1, E = (e) => c(e) && e.type === "array", F = (e) => E(e) && c(e.items) && e.items.type === "object";
9
+ function w(e) {
10
+ const t = Array.isArray(e.oneOf) ? e.oneOf.length : 1, n = Array.isArray(e.anyOf) ? e.anyOf.length : 1, i = Array.isArray(e.allOf) ? e.allOf.length : 1, r = [t, n, i];
11
+ return m.forEach((s) => {
12
+ if (e[s]) {
13
+ const f = e[s];
14
+ r.push(Object.keys(f).length), m.forEach((u) => {
15
+ if (f[u]) {
16
+ const p = f[u];
17
+ r.push(Object.keys(p).length), m.forEach((y) => {
18
+ if (p[y]) {
19
+ const g = p[y];
20
+ r.push(Object.keys(g).length);
19
21
  }
20
22
  });
21
23
  }
22
24
  });
23
25
  }
24
- }), i.reduce((o, u) => o * u, 1) > k;
26
+ }), r.reduce((s, f) => s * f, 1) > $;
25
27
  }
26
- const D = (e, t, n) => t[n] ?? e[n], v = (e, t, n, r) => e[n] !== void 0 && t[n] !== void 0 ? r(e[n], t[n]) : e[n] ?? t[n], L = (e) => e.oneOf && e.oneOf.length === 1 ? e.oneOf[0] : e, y = (e) => {
28
+ const M = (e, t, n) => t[n] ?? e[n], _ = (e, t, n, i) => e[n] !== void 0 && t[n] !== void 0 ? i(e[n], t[n]) : e[n] ?? t[n], V = (e) => e.oneOf && e.oneOf.length === 1 ? e.oneOf[0] : e, l = (e) => {
27
29
  let t = { ...e };
28
30
  if (t.properties && typeof t.properties == "object") {
29
31
  const n = {};
30
- for (const [r, i] of Object.entries(t.properties))
31
- a(i) ? n[r] = y(i) : n[r] = i;
32
+ for (const [i, r] of Object.entries(t.properties))
33
+ c(r) ? n[i] = l(r) : n[i] = r;
32
34
  t.properties = n;
33
35
  }
34
- if ("items" in t && t.items && typeof t.items == "object" && a(t.items) && (t.items = y(t.items)), t.additionalProperties && typeof t.additionalProperties == "object" && a(t.additionalProperties) && (t.additionalProperties = y(t.additionalProperties)), t.oneOf && Array.isArray(t.oneOf) && t.oneOf.length > 1) {
35
- const r = t.oneOf.map((i) => a(i) ? y(i) : i);
36
- t.oneOf = r;
36
+ if ("items" in t && t.items && typeof t.items == "object" && c(t.items) && (t.items = l(t.items)), t.additionalProperties && typeof t.additionalProperties == "object" && c(t.additionalProperties) && (t.additionalProperties = l(t.additionalProperties)), t.oneOf && Array.isArray(t.oneOf) && t.oneOf.length > 1) {
37
+ const i = t.oneOf.map((r) => c(r) ? l(r) : r);
38
+ t.oneOf = i;
37
39
  }
38
40
  if ("oneOf" in t && t.oneOf && Array.isArray(t.oneOf) && t.oneOf.length === 1) {
39
41
  const n = t.oneOf[0];
40
- if (a(n))
41
- return t = { ...t, ...n }, delete t.oneOf, y(t);
42
+ if (c(n))
43
+ return t = { ...t, ...n }, delete t.oneOf, l(t);
42
44
  }
43
45
  return t;
44
- }, N = (e) => {
46
+ }, U = (e) => {
45
47
  if (e.oneOf)
46
48
  return "oneOf";
47
49
  if (e.enum)
@@ -55,56 +57,59 @@ const D = (e, t, n) => t[n] ?? e[n], v = (e, t, n, r) => e[n] !== void 0 && t[n]
55
57
  default:
56
58
  return e.type;
57
59
  }
58
- return e.format && S.includes(e.format) ? "file" : e.type;
59
- }, $ = (e) => "enum" in e && e.enum !== void 0, F = (e) => "placeholder" in e && typeof e.placeholder == "string" ? e.placeholder : void 0, M = (e) => e.type === "string", _ = (e) => e.type === "number" || e.type === "integer", z = (e) => {
60
+ return e.format && h.includes(e.format) ? "file" : e.type;
61
+ }, X = (e) => "enum" in e && e.enum !== void 0, H = (e) => "placeholder" in e && typeof e.placeholder == "string" ? e.placeholder : void 0, W = (e) => e.type === "string", Y = (e) => e.type === "number" || e.type === "integer", Z = (e) => {
60
62
  var n;
61
63
  const t = {};
62
- return Object.entries(((n = e.operation) == null ? void 0 : n.responses) ?? {}).forEach(([r, i]) => {
63
- var o, u;
64
- const s = (u = (o = e.dependencies) == null ? void 0 : o.responses) == null ? void 0 : u[i];
65
- s && s.content && (t[r] = s.content);
64
+ return Object.entries(((n = e.operation) == null ? void 0 : n.responses) ?? {}).forEach(([i, r]) => {
65
+ var s, f;
66
+ const o = (f = (s = e.dependencies) == null ? void 0 : s.responses) == null ? void 0 : f[r];
67
+ o && o.content && (t[i] = o.content);
66
68
  }), t;
67
- }, w = (e) => {
68
- var o, u, f;
69
- const t = (u = (o = e.dependencies) == null ? void 0 : o.requestBody) == null ? void 0 : u.content;
69
+ }, G = (e) => {
70
+ var u, p;
71
+ const t = (p = (u = e.dependencies) == null ? void 0 : u.requestBody) == null ? void 0 : p.content;
70
72
  if (t === void 0)
71
- return [O];
72
- const r = Object.keys(t)[0];
73
- if (!r)
74
- return [O];
75
- const i = Object.values(((f = t[r]) == null ? void 0 : f.examples) ?? {}), s = [];
76
- for (const p of i)
77
- "value" in p && s.push({
78
- ...O,
79
- body: p.value
80
- });
81
- return s;
82
- }, U = (e) => {
73
+ return [];
74
+ const i = Object.keys(t)[0];
75
+ if (!i)
76
+ return [];
77
+ const r = t[i], o = r == null ? void 0 : r.schema;
78
+ if (!c(o))
79
+ return [];
80
+ const s = Object.values((r == null ? void 0 : r.examples) ?? {});
81
+ if (s.length === 0)
82
+ return [];
83
+ const f = [];
84
+ for (const y of s)
85
+ if ("value" in y) {
86
+ const g = k({
87
+ schema: o,
88
+ example: y.value
89
+ });
90
+ f.push(g);
91
+ }
92
+ return f;
93
+ }, J = (e) => {
83
94
  var n;
84
95
  const t = (n = e.dependencies) == null ? void 0 : n.parameters;
85
96
  if (t) {
86
- const r = Object.values(t), i = r.filter(
87
- (f) => !("in" in f) || f.in === "header"
88
- ), s = r.filter((f) => f.in === "cookie"), o = r.filter((f) => f.in === "path"), u = r.filter((f) => f.in === "query");
97
+ const i = Object.values(t), r = i.filter(
98
+ (u) => !("in" in u) || u.in === "header"
99
+ ), o = i.filter((u) => u.in === "cookie"), s = i.filter((u) => u.in === "path"), f = i.filter((u) => u.in === "query");
89
100
  return {
90
- header: i,
91
- path: o,
92
- query: u,
93
- cookie: s
101
+ header: r,
102
+ path: s,
103
+ query: f,
104
+ cookie: o
94
105
  };
95
106
  }
96
107
  return { header: [], path: [], query: [], cookie: [] };
97
- }, C = (e) => {
108
+ }, x = (e) => {
98
109
  let t;
99
110
  if (e)
100
111
  return typeof e == "object" && "default" in e && (t = e.default), typeof e == "object" && "x-default" in e && (t = e["x-default"]), t;
101
- }, V = (e, t, n, r) => {
102
- if (t.uniqueKey) {
103
- const i = n || r;
104
- return `${e ? e + "." : ""}${t.uniqueKey}${i ? "." + i : ""}`;
105
- } else
106
- return e;
107
- }, H = () => ({
112
+ }, Q = () => ({
108
113
  oneOf: [
109
114
  {
110
115
  type: "string"
@@ -136,24 +141,24 @@ const D = (e, t, n) => t[n] ?? e[n], v = (e, t, n, r) => e[n] !== void 0 && t[n]
136
141
  type: "null"
137
142
  }
138
143
  ]
139
- }), W = (e, t) => {
140
- var i, s;
141
- const n = (s = (i = e.dependencies) == null ? void 0 : i.requestBody) == null ? void 0 : s.content;
144
+ }), ee = (e, t) => {
145
+ var r, o;
146
+ const n = (o = (r = e.dependencies) == null ? void 0 : r.requestBody) == null ? void 0 : o.content;
142
147
  return n === void 0 ? void 0 : Object.keys(n)[t];
143
- }, X = (e) => e.replace(/\./g, "\\."), Y = (e) => {
148
+ }, C = (e) => e.replace(/\./g, "\\."), B = (e) => {
144
149
  switch (e) {
145
150
  case "header":
146
- return c.header;
151
+ return a.header;
147
152
  case "path":
148
- return c.path;
153
+ return a.path;
149
154
  case "query":
150
- return c.query;
155
+ return a.query;
151
156
  case "cookie":
152
- return c.cookie;
157
+ return a.cookie;
153
158
  default:
154
- return c.header;
159
+ return a.header;
155
160
  }
156
- }, Z = (e) => {
161
+ }, te = (e) => {
157
162
  const t = {
158
163
  server: {},
159
164
  header: {},
@@ -162,112 +167,145 @@ const D = (e, t, n) => t[n] ?? e[n], v = (e, t, n, r) => e[n] !== void 0 && t[n]
162
167
  cookie: {},
163
168
  body: void 0
164
169
  };
165
- return Object.entries(e).forEach(([n, r]) => {
166
- if (r == null)
170
+ return Object.entries(e).forEach(([n, i]) => {
171
+ if (i == null)
167
172
  return;
168
- const i = n.split(new RegExp("(?<!\\\\)\\.")).map((f) => f.replace(/\\\./g, "."));
169
- if (i.length < 2) {
170
- n === "body" && (t.body = r);
173
+ const r = n.split(new RegExp("(?<!\\\\)\\.")).map((u) => u.replace(/\\\./g, "."));
174
+ if (r.length < 2) {
175
+ n === "body" && (t.body = i);
171
176
  return;
172
177
  }
173
- const [s, ...o] = i, u = Object.values(c);
174
- !s || !u.includes(s) || (s !== c.body ? q(
175
- t[s],
176
- [...o],
177
- r
178
- ) : [...o].length === 0 ? t.body = r : ((t.body === void 0 || typeof t.body != "object") && (t.body = {}), q(t.body, o, r)));
179
- }), d(t);
180
- }, h = (e) => {
181
- if (!m(e))
178
+ const [o, ...s] = r, f = Object.values(a);
179
+ !o || !f.includes(o) || (o !== a.body ? S(
180
+ t[o],
181
+ [...s],
182
+ i
183
+ ) : [...s].length === 0 ? t.body = i : ((t.body === void 0 || typeof t.body != "object") && (t.body = {}), S(t.body, s, i)));
184
+ }), O(t);
185
+ }, I = (e) => {
186
+ if (!b(e))
182
187
  return !1;
183
188
  const t = Object.keys(e);
184
189
  return t.length === 0 ? !1 : t.every((n) => /^\d+$/.test(n));
185
- }, d = (e) => {
190
+ }, O = (e) => {
186
191
  if (e == null)
187
192
  return e;
188
193
  if (Array.isArray(e))
189
- return e.map(d);
190
- if (m(e)) {
191
- if (h(e))
192
- return Object.keys(e).sort((i, s) => Number(i) - Number(s)).map((i) => e[i]).map(d);
194
+ return e.map(O);
195
+ if (b(e)) {
196
+ if (I(e))
197
+ return Object.keys(e).sort((r, o) => Number(r) - Number(o)).map((r) => e[r]).map(O);
193
198
  const t = {};
194
- for (const [n, r] of Object.entries(e))
195
- t[n] = d(r);
199
+ for (const [n, i] of Object.entries(e))
200
+ t[n] = O(i);
196
201
  return t;
197
202
  }
198
203
  return e;
199
- }, q = (e, t, n) => {
200
- const r = [];
201
- for (let s = 0; s < t.length; s++) {
202
- const o = t[s];
203
- if (o === "oneOf") {
204
- s++;
204
+ }, S = (e, t, n) => {
205
+ const i = [];
206
+ for (let o = 0; o < t.length; o++) {
207
+ const s = t[o];
208
+ if (s === "oneOf") {
209
+ o++;
205
210
  continue;
206
211
  }
207
- o === "additionalProperties" || o === "items" || o && r.push(o);
212
+ s === "additionalProperties" || s === "items" || s && i.push(s);
208
213
  }
209
- let i = e;
210
- for (let s = 0; s < r.length; s++) {
211
- const o = r[s];
212
- s === r.length - 1 ? o && (i[o] = n) : (o && (!i[o] || typeof i[o] != "object") && (i[o] = {}), o && (i = i[o]));
214
+ let r = e;
215
+ for (let o = 0; o < i.length; o++) {
216
+ const s = i[o];
217
+ o === i.length - 1 ? s && (r[s] = n) : (s && (!r[s] || typeof r[s] != "object") && (r[s] = {}), s && (r = r[s]));
213
218
  }
214
- }, G = (e) => e.filter((n) => "enum" in n && n.enum && "const" in n ? n.enum.includes(n.const) : !0), l = (e) => {
219
+ }, ne = (e) => e.filter((n) => "enum" in n && n.enum && "const" in n ? n.enum.includes(n.const) : !0), d = (e) => {
215
220
  const t = {};
216
221
  if ("uniqueKey" in e && e.uniqueKey !== void 0) {
217
- const n = C(e);
222
+ const n = x(e);
218
223
  if (n !== void 0) {
219
- const r = `${c.body}.${e.uniqueKey}`;
220
- t[r] = n;
224
+ let i = `${a.body}.${e.uniqueKey}`;
225
+ i = i.replace(/\[INDEX\]/g, "0"), t[i] = n;
221
226
  }
222
227
  }
223
228
  if ("oneOf" in e && Array.isArray(e.oneOf) && e.oneOf.forEach((n) => {
224
- if (a(n)) {
225
- const r = l(n);
226
- Object.assign(t, r);
229
+ if (c(n)) {
230
+ const i = d(n);
231
+ Object.assign(t, i);
227
232
  }
228
233
  }), e.type === "object" && e.properties && Object.values(e.properties).forEach((n) => {
229
- if (a(n)) {
230
- const r = l(n);
231
- Object.assign(t, r);
234
+ if (c(n)) {
235
+ const i = d(n);
236
+ Object.assign(t, i);
232
237
  }
233
- }), e.additionalProperties && typeof e.additionalProperties == "object" && a(e.additionalProperties)) {
234
- const n = l(e.additionalProperties);
238
+ }), e.additionalProperties && typeof e.additionalProperties == "object" && c(e.additionalProperties)) {
239
+ const n = d(e.additionalProperties);
235
240
  Object.assign(t, n);
236
241
  }
237
- if (e.type === "array" && "items" in e && a(e.items)) {
238
- const n = l(e.items);
242
+ if (e.type === "array" && "items" in e && c(e.items)) {
243
+ const n = d(e.items);
239
244
  Object.assign(t, n);
240
245
  }
241
246
  return t;
242
- };
247
+ }, re = (e) => {
248
+ var r;
249
+ const t = "schemes" in e ? (r = e.schemes[0]) == null ? void 0 : r.scheme : e.scheme;
250
+ if (!t) return "header.Authorization";
251
+ const n = "in" in t ? t.in : "header", i = "name" in t ? t.name : T(t);
252
+ return `${B(n)}.${C(i)}`;
253
+ }, ie = (e) => e && "type" in e && e.type === "http" && e.scheme === "basic", T = (e) => e && "type" in e && e.type === "apiKey" ? e.name : "Authorization", oe = (e, t) => Buffer.from(`${e ?? ""}:${t ?? ""}`).toString("base64"), P = (e) => {
254
+ const t = e.typeLabel, n = "type" in e && typeof e.type == "string" ? e.type : void 0;
255
+ return t ?? n ?? "unknown";
256
+ }, se = (e) => {
257
+ if (e.length <= 1)
258
+ return e.map((r) => P(r));
259
+ const t = e.every((r) => r.type === "object"), n = e.map((r) => P(r));
260
+ return t ? e.map((r, o) => r.title ?? `Option ${o + 1}`) : new Set(n).size === n.length ? n : n.map(
261
+ (r, o) => {
262
+ var s;
263
+ return (((s = e[o]) == null ? void 0 : s.title) ?? `Option ${o + 1}`) + " · " + r;
264
+ }
265
+ );
266
+ }, ue = (e, t, n, i) => q(
267
+ `${e ? `${e}-` : ""}${n ? `${n}-` : ""}${t || ""}-`,
268
+ {
269
+ decamelize: !0
270
+ }
271
+ ), fe = (e, t) => e ? `${t ? `${t}` : ""}${e}.` : "", ce = (e, t) => e ? t ? `${t}${e}][` : `${e}[` : "";
243
272
  export {
244
- v as combine,
245
- H as convertAnySchemaToOneOfs,
246
- B as createEmptyReducedSchema,
247
- T as createUnknownReducedSchema,
248
- X as escapeDots,
249
- G as filterSchemasWithConsts,
250
- y as flattenSchemaOneOfs,
251
- L as flattenSingleOneOf,
252
- w as generatePrefillRequestData,
253
- l as getBodyDefaultsFromSchema,
254
- N as getDifferentiatedType,
255
- U as getParametersPerSection,
256
- W as getRequestBodyContentType,
257
- C as getSchemaDefault,
258
- F as getSchemaPlaceholder,
259
- V as getUniqueInputKey,
260
- K as isArrayObject,
261
- j as isCircularRef,
262
- $ as isEnum,
263
- _ as isNumberSchema,
264
- m as isPlainRecord,
265
- x as isReducedSchema,
266
- a as isSchemaObject,
267
- M as isStringSchema,
268
- Y as mapParamInToPlaygroundInputKey,
269
- z as mapResponseExamples,
270
- R as shouldTruncateForSize,
271
- D as takeLast,
272
- Z as unflattenInputs
273
+ ue as buildRecursiveParamFieldId,
274
+ _ as combine,
275
+ Q as convertAnySchemaToOneOfs,
276
+ K as createEmptyReducedSchema,
277
+ z as createUnknownReducedSchema,
278
+ oe as encodeBasicAuth,
279
+ C as escapeDots,
280
+ ne as filterSchemasWithConsts,
281
+ l as flattenSchemaOneOfs,
282
+ V as flattenSingleOneOf,
283
+ se as generateSchemaOptionLabels,
284
+ P as generateSimpleSchemaLabel,
285
+ d as getBodyDefaultsFromSchema,
286
+ ce as getDeepObjectParentName,
287
+ U as getDifferentiatedType,
288
+ J as getParametersPerSection,
289
+ G as getPrefillRequestExamples,
290
+ fe as getRecursiveParentName,
291
+ ee as getRequestBodyContentType,
292
+ x as getSchemaDefault,
293
+ H as getSchemaPlaceholder,
294
+ re as getSecurityOptionInputKeyPrefix,
295
+ T as getSecuritySchemeName,
296
+ E as isArrayObject,
297
+ ie as isBasicAuth,
298
+ D as isCircularRef,
299
+ X as isEnum,
300
+ Y as isNumberSchema,
301
+ F as isObjectArray,
302
+ b as isPlainRecord,
303
+ N as isReducedSchema,
304
+ c as isSchemaObject,
305
+ W as isStringSchema,
306
+ B as mapParamInToPlaygroundInputKey,
307
+ Z as mapResponseExamples,
308
+ w as shouldTruncateForSize,
309
+ M as takeLast,
310
+ te as unflattenInputs
273
311
  };
@@ -1,36 +1,28 @@
1
- function e(n) {
1
+ function t(n) {
2
2
  return typeof n == "string";
3
3
  }
4
- function t(n) {
5
- const r = Number(n);
6
- return typeof r == "number" && !isNaN(r);
4
+ function r(n) {
5
+ const e = Number(n);
6
+ return typeof e == "number" && !isNaN(e);
7
7
  }
8
8
  function i(n) {
9
- const r = Number(n);
10
- return typeof r == "number" && !isNaN(r) && r % 1 === 0;
9
+ const e = Number(n);
10
+ return typeof e == "number" && !isNaN(e) && e % 1 === 0;
11
11
  }
12
12
  function o(n) {
13
13
  return !!n && typeof n == "object" && !Array.isArray(n);
14
14
  }
15
15
  function u(n) {
16
- return !!n && typeof n == "object" && Array.isArray(n);
17
- }
18
- function f(n) {
19
16
  return typeof n == "boolean";
20
17
  }
21
- function s(n) {
22
- return n === null;
23
- }
24
- function c(n) {
18
+ function f(n) {
25
19
  return typeof window < "u" && n instanceof File;
26
20
  }
27
21
  export {
28
- u as isArray,
29
- f as isBoolean,
30
- c as isFile,
22
+ u as isBoolean,
23
+ f as isFile,
31
24
  i as isInteger,
32
- s as isNull,
33
- t as isNumber,
25
+ r as isNumber,
34
26
  o as isObject,
35
- e as isString
27
+ t as isString
36
28
  };
@@ -1,4 +1,4 @@
1
- import { jsxs as p, jsx as u } from "react/jsx-runtime";
1
+ import { jsxs as h, jsx as u } from "react/jsx-runtime";
2
2
  import { useContext as R, useState as E, useRef as T, useEffect as j } from "react";
3
3
  import { EndpointLocationContext as M } from "../../contexts/EndpointLocationContext.js";
4
4
  import { useSelectedLocale as _ } from "../../utils/locales/index.js";
@@ -6,10 +6,11 @@ import { useExpandableMemory as $ } from "../../hooks/useExpandableMemory.js";
6
6
  import { Classes as B } from "../../api-playground-2/types/index.js";
7
7
  import { ChevronRightFilled as D } from "@fluentui/react-icons";
8
8
  import "@mintlify/validation";
9
+ import "@sindresorhus/slugify";
9
10
  import { cn as o } from "../../utils/cn.js";
10
11
  import { scrollElementIntoView as F } from "../../utils/scrollElementIntoView.js";
11
12
  const a = "expandable-content";
12
- function Q({
13
+ function W({
13
14
  title: s,
14
15
  defaultOpen: l = !1,
15
16
  onChange: x,
@@ -22,7 +23,7 @@ function Q({
22
23
  l
23
24
  ), [y, f] = E(l), n = l || i ? w : y, [v, S] = E(
24
25
  n || !C
25
- ), h = T(null), N = (t) => {
26
+ ), p = T(null), N = (t) => {
26
27
  var b;
27
28
  let e = t.closest(`.${a}`);
28
29
  for (; e; ) {
@@ -35,7 +36,7 @@ function Q({
35
36
  F({
36
37
  shouldReturnEarly: !!(r != null && r.current),
37
38
  checkIfShouldScroll(e) {
38
- return !!h.current && h.current.contains(e);
39
+ return !!p.current && p.current.contains(e);
39
40
  },
40
41
  preScrollCallback(e) {
41
42
  i ? d(!0) : f(!0), N(e);
@@ -54,10 +55,10 @@ function Q({
54
55
  }, A = (t) => {
55
56
  i ? d(t) : f(t), L(t);
56
57
  };
57
- return /* @__PURE__ */ p(
58
+ return /* @__PURE__ */ h(
58
59
  "details",
59
60
  {
60
- ref: h,
61
+ ref: p,
61
62
  open: n,
62
63
  onToggle: (t) => {
63
64
  const e = t.currentTarget.open;
@@ -66,7 +67,7 @@ function Q({
66
67
  className: o(B.Expandable, "mint:mt-4 mint:mb-4 mint:border-standard mint:rounded-xl"),
67
68
  "data-testid": m + "-children",
68
69
  children: [
69
- /* @__PURE__ */ p(
70
+ /* @__PURE__ */ h(
70
71
  "summary",
71
72
  {
72
73
  className: o(
@@ -88,7 +89,7 @@ function Q({
88
89
  )
89
90
  }
90
91
  ),
91
- /* @__PURE__ */ u("div", { className: "mint:ml-3 mint:leading-tight mint:text-left", children: /* @__PURE__ */ p("p", { className: "mint:m-0", contentEditable: !1, children: [
92
+ /* @__PURE__ */ u("div", { className: "mint:ml-3 mint:leading-tight mint:text-left", children: /* @__PURE__ */ h("p", { className: "mint:m-0", contentEditable: !1, children: [
92
93
  n ? c.hide : c.show,
93
94
  " ",
94
95
  s || c.childAttributes
@@ -114,5 +115,5 @@ function Q({
114
115
  );
115
116
  }
116
117
  export {
117
- Q as Expandable
118
+ W as Expandable
118
119
  };
@@ -1,15 +1,13 @@
1
1
  import { jsx as t, jsxs as d, Fragment as y } from "react/jsx-runtime";
2
2
  import { useContext as H, useRef as q, useState as M, useCallback as O, useEffect as v } from "react";
3
- import { buildRecursiveParamFieldId as z } from "../../api-playground/EndpointFields/ParamFields/RecursiveParamField.js";
4
- import { OptionDropdown as A } from "../../api-playground/EndpointFields/components/OptionDropdown.js";
5
- import { EndpointLocationContext as D } from "../../contexts/EndpointLocationContext.js";
6
- import { useSelectedLocale as B } from "../../utils/locales/index.js";
7
- import { LinkMultipleRegular as J } from "@fluentui/react-icons";
8
- import "@mintlify/validation";
9
- import { cn as f } from "../../utils/cn.js";
3
+ import { OptionDropdown as z } from "../../api-playground/EndpointFields/components/OptionDropdown.js";
4
+ import { EndpointLocationContext as A } from "../../contexts/EndpointLocationContext.js";
5
+ import { useSelectedLocale as D } from "../../utils/locales/index.js";
6
+ import { LinkMultipleRegular as B } from "@fluentui/react-icons";
7
+ import { buildRecursiveParamFieldId as J } from "../../api-playground-2/schemaGraph/utils.js";
10
8
  import { copyToClipboard as $ } from "../../utils/copyToClipboard.js";
11
9
  import { scrollElementIntoView as G } from "../../utils/scrollElementIntoView.js";
12
- import "../../api-playground-2/types/index.js";
10
+ import { cn as f } from "../../utils/cn.js";
13
11
  function u({
14
12
  children: e,
15
13
  prefix: o,
@@ -50,7 +48,7 @@ function Q() {
50
48
  }
51
49
  );
52
50
  }
53
- function mt({
51
+ function et({
54
52
  name: e,
55
53
  typeLabel: o,
56
54
  location: c,
@@ -68,7 +66,7 @@ function mt({
68
66
  style: _,
69
67
  explode: E
70
68
  }) {
71
- const { hasScrolledToAnchorRef: a } = H(D), L = B(), x = q(null), [P, S] = M(!1), i = R ?? z(C, e, r), b = O(() => {
69
+ const { hasScrolledToAnchorRef: a } = H(A), L = D(), x = q(null), [P, S] = M(!1), i = R ?? J(C, e, r), b = O(() => {
72
70
  i && ($(window.location.href.split("#")[0] + "#" + i), window.location.hash = i);
73
71
  }, [i]);
74
72
  v(() => {
@@ -121,7 +119,7 @@ function mt({
121
119
  onClick: b,
122
120
  children: [
123
121
  "​",
124
- /* @__PURE__ */ t("div", { className: "mint:w-6 mint:h-6 mint:rounded-md mint:flex mint:items-center mint:justify-center mint:shadow-sm mint:text-gray-400 mint:dark:text-white/50 mint:dark:bg-background-dark mint:dark:brightness-[1.35] mint:dark:ring-1 mint:dark:hover:brightness-150 mint:bg-white mint:ring-1 mint:ring-gray-400/30 mint:dark:ring-gray-700/25 mint:hover:ring-gray-400/60 mint:dark:hover:ring-white/20 mint:group-focus/link:border-2 mint:group-focus/link:border-primary mint:dark:group-focus/link:border-primary-light", children: /* @__PURE__ */ t(J, {}) })
122
+ /* @__PURE__ */ t("div", { className: "mint:w-6 mint:h-6 mint:rounded-md mint:flex mint:items-center mint:justify-center mint:shadow-sm mint:text-gray-400 mint:dark:text-white/50 mint:dark:bg-background-dark mint:dark:brightness-[1.35] mint:dark:ring-1 mint:dark:hover:brightness-150 mint:bg-white mint:ring-1 mint:ring-gray-400/30 mint:dark:ring-gray-700/25 mint:hover:ring-gray-400/60 mint:dark:hover:ring-white/20 mint:group-focus/link:border-2 mint:group-focus/link:border-primary mint:dark:group-focus/link:border-primary-light", children: /* @__PURE__ */ t(B, {}) })
125
123
  ]
126
124
  }
127
125
  ) }),
@@ -154,7 +152,7 @@ function mt({
154
152
  "data-component-part": "field-meta",
155
153
  children: [
156
154
  s && s.length > 1 && h ? /* @__PURE__ */ t(
157
- A,
155
+ z,
158
156
  {
159
157
  options: s,
160
158
  selectedIndex: I,
@@ -185,6 +183,6 @@ function mt({
185
183
  export {
186
184
  Q as DeprecatedPill,
187
185
  u as InfoPill,
188
- mt as ParamHead,
186
+ et as ParamHead,
189
187
  K as RequiredPill
190
188
  };