@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,18 +0,0 @@
1
- import { useContext as l, useMemo as x } from "react";
2
- import { DocsConfigContext as a } from "../contexts/ConfigContext.js";
3
- import { useEndpoint as c } from "./useEndpoint.js";
4
- const O = () => {
5
- var o, m;
6
- const r = c(), { docsConfig: e } = l(a);
7
- return x(() => {
8
- var n, p, u;
9
- const t = (n = r == null ? void 0 : r.servers) == null ? void 0 : n.map(({ url: i }) => i);
10
- if (t && t.length > 0)
11
- return t;
12
- const s = (u = (p = e == null ? void 0 : e.api) == null ? void 0 : p.mdx) == null ? void 0 : u.server;
13
- return typeof s == "string" ? [s] : s;
14
- }, [r == null ? void 0 : r.servers, (m = (o = e == null ? void 0 : e.api) == null ? void 0 : o.mdx) == null ? void 0 : m.server]);
15
- };
16
- export {
17
- O as useBaseUrlOptions
18
- };
@@ -1,9 +0,0 @@
1
- import { useContext as o } from "react";
2
- import { ApiReferenceContext as t } from "../contexts/ConfigContext.js";
3
- const m = () => {
4
- const { apiReferenceData: e } = o(t);
5
- return e.componentSchemas;
6
- };
7
- export {
8
- m as useComponentSchemas
9
- };
@@ -1,11 +0,0 @@
1
- import { useMemo as r } from "react";
2
- import { useEndpointLocation as n } from "../contexts/EndpointLocationContext.js";
3
- import { generateNextAdditionalProperties as i } from "../openapi/generateNextAdditionalProperties.js";
4
- import { useComponentSchemas as m } from "./useComponentSchemas.js";
5
- function u(o) {
6
- const e = m(), { location: t } = n();
7
- return r(() => i(o, e, t), [o, e, t]);
8
- }
9
- export {
10
- u as useGenerateNextAdditionalProperties
11
- };
@@ -1,11 +0,0 @@
1
- import { useMemo as n } from "react";
2
- import { useEndpointLocation as r } from "../contexts/EndpointLocationContext.js";
3
- import { generateNextItems as m } from "../openapi/generateNextItems.js";
4
- import { useComponentSchemas as s } from "./useComponentSchemas.js";
5
- function a(o) {
6
- const e = s(), { location: t } = r();
7
- return n(() => m(o, e, t), [o, e, t]);
8
- }
9
- export {
10
- a as useGenerateNextItems
11
- };
@@ -1,11 +0,0 @@
1
- import { useMemo as r } from "react";
2
- import { useEndpointLocation as n } from "../contexts/EndpointLocationContext.js";
3
- import { generateNextProperties as m } from "../openapi/generateNextProperties.js";
4
- import { useComponentSchemas as i } from "./useComponentSchemas.js";
5
- function a(o) {
6
- const e = i(), { location: t } = n();
7
- return r(() => m(o, e, t), [o, e, t]);
8
- }
9
- export {
10
- a as useGenerateNextProperties
11
- };
@@ -1,6 +0,0 @@
1
- import { useContext as t } from "react";
2
- import { MDXContentContext as o } from "../contexts/MDXContentContext.js";
3
- const r = () => t(o);
4
- export {
5
- r as useMDXContent
6
- };
@@ -1,9 +0,0 @@
1
- import { useMemo as r } from "react";
2
- import { useApiPlaygroundInputs as t } from "../useApiPlaygroundInputs.js";
3
- const s = () => {
4
- const [o] = t();
5
- return r(() => o, [o]);
6
- };
7
- export {
8
- s as useApiPlaygroundInputs
9
- };
@@ -1,15 +0,0 @@
1
- import { useCallback as a } from "react";
2
- import { useMDXContent as o } from "../../useMDXContent.js";
3
- const n = () => {
4
- const [, e] = o();
5
- return a(
6
- (t) => e({
7
- type: "set_api_base_index",
8
- payload: t
9
- }),
10
- [e]
11
- );
12
- };
13
- export {
14
- n as useSetApiBaseIndexCallback
15
- };
@@ -1,15 +0,0 @@
1
- import { useCallback as a } from "react";
2
- import { useApiPlaygroundInputs as o } from "../../useApiPlaygroundInputs.js";
3
- const u = () => {
4
- const [, p] = o();
5
- return a(
6
- (t) => p({
7
- type: "set_api_playground_inputs",
8
- payload: t
9
- }),
10
- [p]
11
- );
12
- };
13
- export {
14
- u as useSetApiPlaygroundInputsCallback
15
- };
@@ -1,42 +0,0 @@
1
- import { useMemo as c } from "react";
2
- import { generateOptionLabels as u } from "../openapi/generateOptionLabels.js";
3
- import { useComponentSchemas as m } from "./useComponentSchemas.js";
4
- const g = (t) => {
5
- const n = m();
6
- return c(() => t ? f(t, n, void 0) : [], [t, n]);
7
- }, f = (t, n, s) => {
8
- const i = t.some((e) => e.type === "null"), l = t.every((e) => e.type === "object"), a = u(
9
- t,
10
- n,
11
- l,
12
- i,
13
- s
14
- );
15
- let o;
16
- const r = [], p = [];
17
- for (const e of t)
18
- e.type === "any" ? o = o ?? e : r.push(e);
19
- for (const e of a)
20
- e === "any" ? p.push(null) : p.push(e);
21
- if (o !== void 0) {
22
- const e = {
23
- description: o.description,
24
- required: o.required
25
- };
26
- r.push(
27
- { ...e, type: "string" },
28
- { ...e, type: "number" },
29
- { ...e, type: "boolean" },
30
- { ...e, type: "object", properties: {} },
31
- { ...e, type: "array", items: [{ type: "any" }] },
32
- { ...e, type: "null" }
33
- );
34
- }
35
- return r.map((e, y) => ({
36
- schema: e,
37
- label: p[y] ?? e.type
38
- }));
39
- };
40
- export {
41
- g as usePlaygroundSchemaOptions
42
- };
@@ -1,65 +0,0 @@
1
- import { useState as S, useEffect as h } from "react";
2
- import { loadServerVariableStore as n, storeServerVariables as f } from "./storedServerVariables.js";
3
- function k({
4
- inputs: e,
5
- setInputs: a,
6
- baseUrl: r,
7
- securityOption: t,
8
- userInfoInputs: o
9
- }) {
10
- const [v, s] = S();
11
- h(() => {
12
- s(n());
13
- }, []), h(() => {
14
- const c = d(t, void 0, o), m = i(r, v, o);
15
- a({
16
- ...c,
17
- server: m,
18
- path: e.path,
19
- body: e.body
20
- });
21
- }, [v, o]), h(() => {
22
- const c = d(t, void 0, o);
23
- a({ ...e, ...c });
24
- }, [t]), h(() => {
25
- const c = i(r, v, o);
26
- a({ ...e, server: c });
27
- }, [r]), h(() => {
28
- r && f(r, e.server, o);
29
- }, [e.server]);
30
- }
31
- const d = (e, a, r) => {
32
- const t = {
33
- query: {},
34
- header: {},
35
- cookie: {}
36
- };
37
- if (!e)
38
- return t;
39
- for (const o of ["query", "header", "cookie"])
40
- Object.entries(e.parameters[o]).forEach(([v, s]) => {
41
- var c;
42
- t[o][v] = l((c = r == null ? void 0 : r[o]) == null ? void 0 : c[v]);
43
- });
44
- return t;
45
- }, l = (e, a) => e, i = (e, a, r) => {
46
- const t = r == null ? void 0 : r.server, o = a && e ? a[e] : void 0;
47
- return { ...t, ...o };
48
- }, q = (e, a) => {
49
- const r = {
50
- query: {},
51
- header: {},
52
- cookie: {}
53
- };
54
- if (!e)
55
- return r;
56
- for (const t of ["query", "header", "cookie"])
57
- Object.entries(e.parameters[t]).forEach(([o, v]) => {
58
- });
59
- return r;
60
- };
61
- export {
62
- d as parseAuthInputs,
63
- q as parseAuthInputsFromUserInfo,
64
- k as usePrefilledInputs
65
- };
@@ -1,29 +0,0 @@
1
- const l = "mintlify-server-variables", S = (e) => typeof e != "object" || e == null ? !1 : Object.values(e).every(
2
- (t) => typeof t == "object" && t !== null && Object.values(t).every((a) => typeof a == "string")
3
- ), b = () => {
4
- const e = localStorage.getItem(l);
5
- if (e)
6
- try {
7
- const r = JSON.parse(e);
8
- if (S(r))
9
- return r;
10
- } catch (r) {
11
- console.log(`unable to parse stored server variables: ${r}`);
12
- }
13
- return {};
14
- }, g = (e, r, t) => {
15
- const a = Object.fromEntries(
16
- Object.entries(r).filter(([c, i]) => {
17
- var o;
18
- return i && ((o = t == null ? void 0 : t.server) == null ? void 0 : o[c]) !== i;
19
- })
20
- ), s = {
21
- ...b(),
22
- [e]: a
23
- }, n = JSON.stringify(s);
24
- localStorage.setItem(l, n);
25
- };
26
- export {
27
- b as loadServerVariableStore,
28
- g as storeServerVariables
29
- };
@@ -1,10 +0,0 @@
1
- import { useState as c } from "react";
2
- function u(e) {
3
- const [t, o] = c(0);
4
- return e.filter(
5
- (n) => Object.values(n.parameters).some((s) => Object.keys(s).length > 0)
6
- )[t];
7
- }
8
- export {
9
- u as useSecurityOption
10
- };
@@ -1,63 +0,0 @@
1
- import { isNull as y, isInteger as i, isNumber as u, isString as e, isArray as l, isObject as b, isBoolean as a } from "../common/guards.js";
2
- import { useRef as j, useEffect as p } from "react";
3
- const O = (f, t, r, n) => {
4
- const o = j(!1);
5
- p(() => {
6
- if (!n && !o.current) {
7
- switch (f.default === void 0 && f["x-default"] !== void 0 && (f.default = f["x-default"]), f.type) {
8
- case "string": {
9
- e(f.default) && !e(t) && r(f.default);
10
- break;
11
- }
12
- case "number": {
13
- u(f.default) && !u(t) && r(f.default);
14
- break;
15
- }
16
- case "boolean": {
17
- a(f.default) && !a(t) && r(f.default);
18
- break;
19
- }
20
- case "object": {
21
- if (f.default && b(f.default) && !b(t)) {
22
- const d = {};
23
- for (const [k, g] of Object.entries(f.default))
24
- d[k] = g;
25
- r(d);
26
- }
27
- break;
28
- }
29
- case "integer": {
30
- i(f.default) && !i(t) && r(f.default);
31
- break;
32
- }
33
- case "array": {
34
- if (f.default !== void 0 && !l(t)) {
35
- const d = l(f.default) ? f.default : [f.default];
36
- r([...d]);
37
- }
38
- break;
39
- }
40
- case "enum<string>": {
41
- e(f.default) && !e(t) && r(f.default);
42
- break;
43
- }
44
- case "enum<number>": {
45
- u(f.default) && !u(t) && r(f.default);
46
- break;
47
- }
48
- case "enum<integer>": {
49
- i(f.default) && !i(t) && r(f.default);
50
- break;
51
- }
52
- case "null": {
53
- y(f.default) && t !== null && r(f.default);
54
- break;
55
- }
56
- }
57
- o.current = !0;
58
- }
59
- }, [f, t, r, n]);
60
- };
61
- export {
62
- O as useSetDefaultValue
63
- };
@@ -1,20 +0,0 @@
1
- const f = ({
2
- schema: e,
3
- userGroups: n
4
- }) => {
5
- let t = e.enum;
6
- return e["x-mint-enum"] && (e.type === "enum<string>" ? t = r(e, n) : t = c(e, n)), t;
7
- }, r = (e, n) => {
8
- const t = e.enum, l = [];
9
- return Object.entries(e["x-mint-enum"] ?? {}).forEach(([i, m]) => {
10
- Array.isArray(m) && m.some((u) => n == null ? void 0 : n.includes(u)) || l.push(i);
11
- }), t.filter((i) => !l.includes(i));
12
- }, c = (e, n) => {
13
- const t = e.enum, l = [];
14
- return Object.entries(e["x-mint-enum"] ?? {}).forEach(([i, m]) => {
15
- Array.isArray(m) && m.some((u) => n == null ? void 0 : n.includes(u)) || l.push(Number(i));
16
- }), t.filter((i) => !l.includes(i));
17
- };
18
- export {
19
- f as getXFilteredEnumValues
20
- };
@@ -1,7 +0,0 @@
1
- import { generateNextIncrementalSchema as i } from "@mintlify/validation";
2
- function n(r, e, t) {
3
- return typeof r.additionalProperties != "object" || Array.isArray(r.additionalProperties) ? r.additionalProperties : i(r.additionalProperties, e, void 0, t);
4
- }
5
- export {
6
- n as generateNextAdditionalProperties
7
- };
@@ -1,7 +0,0 @@
1
- import { generateNextIncrementalSchema as i } from "@mintlify/validation";
2
- function m(e, r, t) {
3
- return Array.isArray(e.items) ? e.items : i(e.items, r, void 0, t);
4
- }
5
- export {
6
- m as generateNextItems
7
- };
@@ -1,23 +0,0 @@
1
- import { generateNextIncrementalSchema as f } from "@mintlify/validation";
2
- function p(i, u, o) {
3
- const c = Object.entries(i.properties).sort(([e], [r]) => {
4
- var n, s;
5
- const t = ((n = i.requiredProperties) == null ? void 0 : n.includes(e)) ?? !1, d = ((s = i.requiredProperties) == null ? void 0 : s.includes(r)) ?? !1;
6
- return t === d ? 0 : t ? -1 : 1;
7
- }).map(([e, r]) => {
8
- var t;
9
- return Array.isArray(r) ? [e, r] : [
10
- e,
11
- f(
12
- r,
13
- u,
14
- (t = i.requiredProperties) == null ? void 0 : t.includes(e),
15
- o
16
- )
17
- ];
18
- });
19
- return Object.fromEntries(c);
20
- }
21
- export {
22
- p as generateNextProperties
23
- };
@@ -1,20 +0,0 @@
1
- import { generateSimpleLabels as u } from "./generateSimpleLabels.js";
2
- import { generateTypeStringFromSchema as a } from "./generateTypeStringFromSchema.js";
3
- const T = (e, n, f, i, o, y) => {
4
- if (e.length <= 1)
5
- return [a(e[0], n, i, o)];
6
- if (f)
7
- return u(e);
8
- const t = e.map(
9
- (r) => a(r, n, i, o, 0)
10
- );
11
- return new Set(t).size === t.length ? t : t.map(
12
- (r, p) => {
13
- var g;
14
- return r === "any" ? r : (((g = e[p]) == null ? void 0 : g.title) ?? `Option ${p + 1}`) + " · " + r;
15
- }
16
- );
17
- };
18
- export {
19
- T as generateOptionLabels
20
- };
@@ -1,4 +0,0 @@
1
- const a = (e) => e.map(({ title: p }, t) => p ?? `Option ${t + 1}`);
2
- export {
3
- a as generateSimpleLabels
4
- };
@@ -1,18 +0,0 @@
1
- const o = (t) => Array.isArray(t) && t.length > 0, A = ({
2
- schemaArray: t,
3
- userGroups: n
4
- }) => {
5
- const r = t.filter((l) => {
6
- const i = a(l);
7
- return i.length === 0 || i.some((e) => n == null ? void 0 : n.includes(e));
8
- });
9
- return o(r) ? r : null;
10
- }, a = (t) => {
11
- const n = [];
12
- return "x-mint" in t && t["x-mint"] && typeof t["x-mint"] == "object" && "groups" in t["x-mint"] && Array.isArray(t["x-mint"].groups) && n.push(...t["x-mint"].groups), n;
13
- };
14
- export {
15
- A as getAuthFilteredSchemaArray,
16
- a as getXMintAllowlist,
17
- o as isDataSchemaArrayOrIncrementalDataSchemaArray
18
- };
@@ -1,21 +0,0 @@
1
- import { replaceSlashIndex as s } from "../common/replaceSlashIndex.js";
2
- import { optionallyRemoveLeadingSlash as i } from "./optionallyRemoveLeadingSlash.js";
3
- import { optionallyRemoveTrailingSlash as r } from "./optionallyRemoveTrailingSlash.js";
4
- function o(n) {
5
- if (n === "") return "index";
6
- if (n === "index") return n;
7
- if (n.endsWith("/index")) {
8
- const e = s(n);
9
- return e === "" ? "index" : e;
10
- }
11
- return n;
12
- }
13
- function m(n, e) {
14
- if (n == null || e == null || typeof n != "string" || typeof e != "string")
15
- return !1;
16
- const l = r(i(n)), t = r(i(e));
17
- return o(l) === o(t);
18
- }
19
- export {
20
- m as isEqualIgnoringLeadingSlash
21
- };
@@ -1,6 +0,0 @@
1
- function r(n) {
2
- return !n || n.startsWith("/") ? n.substring(1) : n;
3
- }
4
- export {
5
- r as optionallyRemoveLeadingSlash
6
- };
@@ -1,6 +0,0 @@
1
- function i(e) {
2
- return !e || e.endsWith("/") ? e.slice(0, -1) : e;
3
- }
4
- export {
5
- i as optionallyRemoveTrailingSlash
6
- };
@@ -1,15 +0,0 @@
1
- const s = (e) => {
2
- const t = e.default;
3
- if (t !== void 0) return t;
4
- }, n = (e) => {
5
- const t = {};
6
- for (const [r, a] of Object.entries(e)) {
7
- const c = a.schema[0], o = s(c);
8
- o !== void 0 && (t[r] = o);
9
- }
10
- return t;
11
- };
12
- export {
13
- s as getDefaultFromSchema,
14
- n as getDefaultsFromParameterGroup
15
- };
@@ -1,10 +0,0 @@
1
- const e = {
2
- query: {},
3
- path: {},
4
- header: {},
5
- body: {},
6
- cookie: {}
7
- };
8
- export {
9
- e as paramFieldDefaults
10
- };
@@ -1,4 +0,0 @@
1
- const r = (t) => t.request.security.filter((e) => Object.keys(e.parameters.cookie).length > 0 || Object.keys(e.parameters.header).length > 0 || Object.keys(e.parameters.query).length > 0);
2
- export {
3
- r as getFilteredSecurityOptions
4
- };
@@ -1,5 +0,0 @@
1
- import { flattenObject as r } from "../flattenObject.js";
2
- const p = (t) => t.type === "object" ? r(t.properties) : t.type === "array" ? r(t.items) : [];
3
- export {
4
- p as getNextPropertiesByType
5
- };
@@ -1,10 +0,0 @@
1
- function y(o, c = "", e = {}) {
2
- for (const n in o) {
3
- const f = c ? `${c}.${n}` : n, t = o[n];
4
- typeof t == "object" ? y(t, f, e) : e[f] = t;
5
- }
6
- return e;
7
- }
8
- export {
9
- y as flattenObject
10
- };