@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.
- package/dist/api-playground/ApiPlayground/Response/DownloadFileButton.js +6 -5
- package/dist/api-playground/ApiPlayground/Response/ResponseBody/CodeResponseContent.js +13 -12
- package/dist/api-playground/ApiPlayground/Response/ResponsePlaceholder.js +8 -7
- package/dist/api-playground/ApiPlayground/Response/ResponseTable.js +3 -2
- package/dist/api-playground/ApiPlayground/Response/ResponseTopbar.js +9 -8
- package/dist/api-playground/ApiPlayground/Response/index.js +4 -3
- package/dist/api-playground/ApiPlayground/components/AdditionalPropertyButton.js +42 -21
- package/dist/api-playground/ApiPlayground/components/ParamFieldWrapper.js +13 -9
- package/dist/api-playground/ApiPlayground/components/PlaygroundModalWrapper.js +6 -5
- package/dist/api-playground/ApiPlayground/components/SendPill.js +3 -2
- package/dist/api-playground/ApiPlayground/components/TypeDropdown.js +6 -5
- package/dist/api-playground/EndpointFields/ParamFields/ExampleDescription.js +3 -2
- package/dist/api-playground/EndpointFields/components/Description.js +6 -5
- package/dist/api-playground/EndpointFields/components/OptionDropdown.js +9 -8
- package/dist/api-playground/EndpointFields/components/SectionHeading.js +8 -7
- package/dist/api-playground-2/ApiExamples.js +19 -20
- package/dist/api-playground-2/ApiFields.js +20 -247
- package/dist/api-playground-2/EndpointHeader.js +59 -47
- package/dist/api-playground-2/OperationPage.js +70 -66
- package/dist/api-playground-2/Playground.js +67 -83
- package/dist/api-playground-2/SchemaPage.js +22 -9
- package/dist/api-playground-2/components/EndpointFields/Body.js +40 -0
- package/dist/api-playground-2/components/EndpointFields/Parameters.js +90 -0
- package/dist/api-playground-2/components/EndpointFields/Response.js +146 -0
- package/dist/api-playground-2/components/EndpointFields/Security.js +88 -0
- package/dist/api-playground-2/components/EndpointFields/fields/ArrayParamField.js +93 -0
- package/dist/api-playground-2/components/EndpointFields/fields/Enum.js +29 -11
- package/dist/api-playground-2/components/EndpointFields/fields/ObjectParamField.js +145 -0
- package/dist/api-playground-2/components/EndpointFields/fields/PrimitiveParamField.js +60 -48
- package/dist/api-playground-2/components/EndpointFields/fields/SchemaField.js +230 -0
- package/dist/api-playground-2/components/Example/GeneratedRequestExample.js +93 -89
- package/dist/api-playground-2/components/Example/GeneratedResponseExample.js +18 -17
- package/dist/api-playground-2/components/Example/RequestExample.js +92 -93
- package/dist/api-playground-2/components/Example/ResponseExample.js +19 -15
- package/dist/api-playground-2/components/Request/ParameterSection.js +20 -18
- package/dist/api-playground-2/components/Request/SecuritySection.js +53 -43
- package/dist/api-playground-2/components/Request/inputs/ArrayInput.js +89 -40
- package/dist/api-playground-2/components/Request/inputs/DifferentiatedInput.js +12 -12
- package/dist/api-playground-2/components/Request/inputs/FileInput.js +16 -15
- package/dist/api-playground-2/components/Request/inputs/InputContainer.js +76 -57
- package/dist/api-playground-2/components/Request/inputs/NumberInput.js +10 -9
- package/dist/api-playground-2/components/Request/inputs/ObjectInput.js +98 -80
- package/dist/api-playground-2/components/Request/inputs/OneOfInput.js +55 -47
- package/dist/api-playground-2/components/Request/inputs/SelectInput.js +18 -17
- package/dist/api-playground-2/components/Request/inputs/StringInput.js +19 -18
- package/dist/api-playground-2/components/Request/inputs/TextInput.js +12 -11
- package/dist/api-playground-2/components/SendPillWrapper.js +35 -0
- package/dist/api-playground-2/contexts/ApiPlaygroundContext.js +3 -5
- package/dist/api-playground-2/generators/createCookies.js +23 -0
- package/dist/api-playground-2/generators/createHeaders.js +53 -36
- package/dist/api-playground-2/generators/createQueryString.js +30 -0
- package/dist/api-playground-2/generators/generateAuthPlaceholder.js +14 -0
- package/dist/api-playground-2/generators/generateInteractiveCodeSample.js +27 -25
- package/dist/api-playground-2/generators/generateRequest.js +47 -51
- package/dist/api-playground-2/generators/generateResponseExampleMap.js +15 -11
- package/dist/api-playground-2/generators/generateSnippetMap.js +13 -11
- package/dist/api-playground-2/hooks/useCopyPathWithInputs.js +11 -11
- package/dist/api-playground-2/hooks/useInitializeInputs.js +185 -88
- package/dist/api-playground-2/hooks/usePlaygroundInputsStore.js +70 -25
- package/dist/api-playground-2/hooks/useSelectedBaseUrl.js +13 -0
- package/dist/api-playground-2/hooks/useSelectedExample.js +10 -0
- package/dist/api-playground-2/hooks/useSelectedRequestBodyContentType.js +12 -0
- package/dist/api-playground-2/hooks/useSelectedResponseContentType.js +12 -0
- package/dist/api-playground-2/hooks/useSelectedSecurityOption.js +31 -0
- package/dist/api-playground-2/hooks/useSendPlaygroundRequest.js +114 -101
- package/dist/api-playground-2/schemaGraph/addApiReferenceDataFromMdxAndDocsConfig.js +23 -32
- package/dist/api-playground-2/schemaGraph/addTypeLabelsToSchema.js +50 -0
- package/dist/api-playground-2/schemaGraph/addUniqueKeysToSchema.js +40 -24
- package/dist/api-playground-2/schemaGraph/getExampleBodyInputs.js +94 -0
- package/dist/api-playground-2/schemaGraph/getSchemaGraphOperationData.js +56 -50
- package/dist/api-playground-2/schemaGraph/processExamples.js +117 -52
- package/dist/api-playground-2/schemaGraph/processSchema.js +10 -0
- package/dist/api-playground-2/schemaGraph/processSecurityOptions.js +58 -28
- package/dist/api-playground-2/schemaGraph/reduceCompositions.js +220 -181
- package/dist/api-playground-2/schemaGraph/resolveOperationWithDependencies.js +128 -89
- package/dist/api-playground-2/schemaGraph/resolveSchemaWithDependencies.js +15 -16
- package/dist/api-playground-2/schemaGraph/sortSchemaByRequired.js +14 -12
- package/dist/api-playground-2/schemaGraph/utils.js +185 -147
- package/dist/common/guards.js +11 -19
- package/dist/components/Api/Expandable.js +10 -9
- package/dist/components/Api/Param.js +11 -13
- package/dist/components/Api/dropdown-menu.js +10 -9
- package/dist/components/content-components/code-group.js +4 -4
- package/dist/contexts/EndpointLocationContext.js +3 -3
- package/dist/hooks/useApiParamFieldOption.js +10 -0
- package/dist/hooks/useEndpoint.js +3 -3
- package/dist/hooks/useKeyboardShortcut.js +13 -13
- package/dist/hooks/useSendPlaygroundRequest.js +14 -146
- package/dist/index.d.ts +65 -58
- package/dist/index.js +109 -111
- package/dist/openapi/generateTypeStringFromSchema.js +2 -31
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/api-playground/ApiPlayground/Request/BodySection.js +0 -64
- package/dist/api-playground/ApiPlayground/Request/ParameterSection.js +0 -32
- package/dist/api-playground/ApiPlayground/Request/PlaygroundModal.js +0 -201
- package/dist/api-playground/ApiPlayground/Request/SecuritySection.js +0 -146
- package/dist/api-playground/ApiPlayground/Request/ServerSection.js +0 -30
- package/dist/api-playground/ApiPlayground/Request/index.js +0 -43
- package/dist/api-playground/ApiPlayground/Request/inputs/ArrayInput.js +0 -93
- package/dist/api-playground/ApiPlayground/Request/inputs/DifferentiatedInput.js +0 -90
- package/dist/api-playground/ApiPlayground/Request/inputs/FileInput.js +0 -62
- package/dist/api-playground/ApiPlayground/Request/inputs/NullInput.js +0 -33
- package/dist/api-playground/ApiPlayground/Request/inputs/NumberInput.js +0 -61
- package/dist/api-playground/ApiPlayground/Request/inputs/ObjectChildren.js +0 -109
- package/dist/api-playground/ApiPlayground/Request/inputs/ObjectInput.js +0 -87
- package/dist/api-playground/ApiPlayground/Request/inputs/RecursiveInput.js +0 -61
- package/dist/api-playground/ApiPlayground/Request/inputs/SelectInput.js +0 -54
- package/dist/api-playground/ApiPlayground/Request/inputs/StringInput.js +0 -67
- package/dist/api-playground/ApiPlayground/Request/inputs/TextInput.js +0 -44
- package/dist/api-playground/ApiPlayground/components/EndpointsMenu.js +0 -42
- package/dist/api-playground/ApiPlayground/components/EndpointsMenuLink.js +0 -43
- package/dist/api-playground/ApiPlayground/components/EndpointsMenuSearch.js +0 -38
- package/dist/api-playground/ApiPlayground/components/InputContainer.js +0 -128
- package/dist/api-playground/ApiPlayground/components/InputSectionContainer.js +0 -59
- package/dist/api-playground/ApiPlayground/components/PathHeader.js +0 -162
- package/dist/api-playground/ApiPlayground/components/TrashButton.js +0 -26
- package/dist/api-playground/ApiPlayground/index.js +0 -67
- package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/Enum.js +0 -19
- package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/NumberMetadata.js +0 -18
- package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/StringMetadata.js +0 -28
- package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/index.js +0 -5
- package/dist/api-playground/EndpointFields/ParamFields/RecursiveParamField.js +0 -13
- package/dist/api-playground/EndpointFields/index.js +0 -7
- package/dist/api-playground-2/components/EndpointFields/EndpointSecurity.js +0 -87
- package/dist/api-playground-2/components/EndpointFields/fields/SimpleArrayParamField.js +0 -89
- package/dist/api-playground-2/components/EndpointFields/fields/SimpleObjectParamField.js +0 -121
- package/dist/api-playground-2/components/EndpointFields/fields/SimplePrimitiveParamField.js +0 -74
- package/dist/api-playground-2/components/EndpointFields/fields/SimpleSchemaField.js +0 -252
- package/dist/common/potentiallyParseOpenApiString.js +0 -24
- package/dist/common/replaceSlashIndex.js +0 -6
- package/dist/common/slugToTitle.js +0 -10
- package/dist/constants/prism-languages.js +0 -19
- package/dist/contexts/ApiPlaygroundInputsContext.js +0 -17
- package/dist/contexts/MDXContentContext.js +0 -17
- package/dist/hooks/useApiPlaygroundInputs.js +0 -6
- package/dist/hooks/useApiPlaygroundPrefillExamples.js +0 -39
- package/dist/hooks/useBaseUrlOptions.js +0 -18
- package/dist/hooks/useComponentSchemas.js +0 -9
- package/dist/hooks/useGenerateNextAdditionalProperties.js +0 -11
- package/dist/hooks/useGenerateNextItems.js +0 -11
- package/dist/hooks/useGenerateNextProperties.js +0 -11
- package/dist/hooks/useMDXContent.js +0 -6
- package/dist/hooks/useMDXContentController/useApiPlaygroundInputs.js +0 -9
- package/dist/hooks/useMDXContentController/useMDXContentCallbacks/useSetApiBaseIndexCallback.js +0 -15
- package/dist/hooks/useMDXContentController/useMDXContentCallbacks/useSetApiPlaygroundInputsCallback.js +0 -15
- package/dist/hooks/usePlaygroundSchemaOptions.js +0 -42
- package/dist/hooks/usePrefilledInputs/index.js +0 -65
- package/dist/hooks/usePrefilledInputs/storedServerVariables.js +0 -29
- package/dist/hooks/useSecurityOption.js +0 -10
- package/dist/hooks/useSetDefaultValue.js +0 -63
- package/dist/openapi/filterEnums.js +0 -20
- package/dist/openapi/generateNextAdditionalProperties.js +0 -7
- package/dist/openapi/generateNextItems.js +0 -7
- package/dist/openapi/generateNextProperties.js +0 -23
- package/dist/openapi/generateOptionLabels.js +0 -20
- package/dist/openapi/generateSimpleLabels.js +0 -4
- package/dist/openapi/getAuthFilteredSchemaArray.js +0 -18
- package/dist/paths/isEqualIgnoringLeadingSlash.js +0 -21
- package/dist/paths/optionallyRemoveLeadingSlash.js +0 -6
- package/dist/paths/optionallyRemoveTrailingSlash.js +0 -6
- package/dist/utils/api-playground/defaults.js +0 -15
- package/dist/utils/api-playground/paramFieldDefaults.js +0 -10
- package/dist/utils/api-reference/getFilteredSecurityOptions.js +0 -4
- package/dist/utils/api-reference/getNextPropertiesByType.js +0 -5
- package/dist/utils/flattenObject.js +0 -10
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { jsx as i, jsxs as t, Fragment as d } from "react/jsx-runtime";
|
|
2
|
+
import { isArrayObject as k, isSchemaObject as q } from "../../../schemaGraph/utils.js";
|
|
3
|
+
import { ParamFieldWrapper as x } from "../../../../api-playground/ApiPlayground/components/ParamFieldWrapper.js";
|
|
4
|
+
import { ExampleDescription as F } from "../../../../api-playground/EndpointFields/ParamFields/ExampleDescription.js";
|
|
5
|
+
import { Description as M } from "../../../../api-playground/EndpointFields/components/Description.js";
|
|
6
|
+
import { ParamHead as N } from "../../../../components/Api/Param.js";
|
|
7
|
+
import { SchemaField as P } from "./SchemaField.js";
|
|
8
|
+
import { cn as c } from "../../../../utils/cn.js";
|
|
9
|
+
const B = ({
|
|
10
|
+
displayFlattened: r = !1,
|
|
11
|
+
fieldType: e,
|
|
12
|
+
schema: n,
|
|
13
|
+
name: l,
|
|
14
|
+
location: a,
|
|
15
|
+
parentName: m,
|
|
16
|
+
typeOptions: o,
|
|
17
|
+
selectedIndex: p,
|
|
18
|
+
onSelectTypeOption: s,
|
|
19
|
+
paramId: u,
|
|
20
|
+
style: f,
|
|
21
|
+
explode: h,
|
|
22
|
+
required: v,
|
|
23
|
+
schemas: j,
|
|
24
|
+
omitPadding: g
|
|
25
|
+
}) => {
|
|
26
|
+
if (!k(n)) return null;
|
|
27
|
+
const A = (o == null ? void 0 : o[p ?? 0]) ?? "unknown", D = n.items, b = !0, y = q(n.items) && n.items.type === "object";
|
|
28
|
+
return /* @__PURE__ */ i(x, { paramId: u, className: "mint:array-param-field", children: /* @__PURE__ */ t("div", { className: c(!r && !g && "mint:py-6"), children: [
|
|
29
|
+
/* @__PURE__ */ i(
|
|
30
|
+
N,
|
|
31
|
+
{
|
|
32
|
+
id: u,
|
|
33
|
+
name: l,
|
|
34
|
+
location: a,
|
|
35
|
+
required: v ?? !1,
|
|
36
|
+
deprecated: n.deprecated,
|
|
37
|
+
typeLabel: A,
|
|
38
|
+
fieldType: e,
|
|
39
|
+
typeOptions: o,
|
|
40
|
+
selectedTypeOptionIndex: p,
|
|
41
|
+
onSelectTypeOption: s,
|
|
42
|
+
parentName: m,
|
|
43
|
+
style: f,
|
|
44
|
+
explode: h
|
|
45
|
+
}
|
|
46
|
+
),
|
|
47
|
+
/* @__PURE__ */ t("div", { className: c({ "mint:mt-4": !g && n.description }), children: [
|
|
48
|
+
l && n.description && /* @__PURE__ */ i(M, { markdown: n.description }),
|
|
49
|
+
/* @__PURE__ */ i(w, { schema: n, description: n.description }),
|
|
50
|
+
/* @__PURE__ */ i(
|
|
51
|
+
P,
|
|
52
|
+
{
|
|
53
|
+
omitPadding: !0,
|
|
54
|
+
schema: D,
|
|
55
|
+
displayFlattened: r,
|
|
56
|
+
fieldType: e,
|
|
57
|
+
location: a,
|
|
58
|
+
parentName: m,
|
|
59
|
+
style: f,
|
|
60
|
+
explode: h,
|
|
61
|
+
onSelectTypeOption: s,
|
|
62
|
+
schemas: j,
|
|
63
|
+
hideExampleDescription: b,
|
|
64
|
+
hideDescription: y
|
|
65
|
+
}
|
|
66
|
+
),
|
|
67
|
+
/* @__PURE__ */ i(F, { schema: n })
|
|
68
|
+
] })
|
|
69
|
+
] }) });
|
|
70
|
+
}, w = ({
|
|
71
|
+
schema: r,
|
|
72
|
+
description: e
|
|
73
|
+
}) => /* @__PURE__ */ i(d, { children: (r.minItems !== void 0 || r.maxItems !== void 0) && /* @__PURE__ */ i("div", { className: c("mint:prose mint:prose-sm mint:prose-gray mint:dark:prose-invert", e && "mint:mt-6"), children: /* @__PURE__ */ i(E, { minItems: r.minItems, maxItems: r.maxItems }) }) }), E = ({ minItems: r, maxItems: e }) => r === e && r !== void 0 ? /* @__PURE__ */ t(d, { children: [
|
|
74
|
+
"Required array length: ",
|
|
75
|
+
/* @__PURE__ */ i("code", { children: r }),
|
|
76
|
+
" element",
|
|
77
|
+
r > 1 ? "s" : ""
|
|
78
|
+
] }) : r && e ? /* @__PURE__ */ t(d, { children: [
|
|
79
|
+
"Required array length: ",
|
|
80
|
+
/* @__PURE__ */ i("code", { children: `${r} - ${e}` }),
|
|
81
|
+
" element",
|
|
82
|
+
e > 1 ? "s" : ""
|
|
83
|
+
] }) : r ? /* @__PURE__ */ t(d, { children: [
|
|
84
|
+
"Minimum length: ",
|
|
85
|
+
/* @__PURE__ */ i("code", { children: r })
|
|
86
|
+
] }) : e ? /* @__PURE__ */ t(d, { children: [
|
|
87
|
+
"Maximum length: ",
|
|
88
|
+
/* @__PURE__ */ i("code", { children: e })
|
|
89
|
+
] }) : "";
|
|
90
|
+
export {
|
|
91
|
+
w as ArrayMetadata,
|
|
92
|
+
B as ArrayParamField
|
|
93
|
+
};
|
|
@@ -1,15 +1,33 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { jsxs as n, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useSelectedLocale as m } from "../../../../utils/locales/index.js";
|
|
3
|
+
const a = ({ schema: i }) => {
|
|
4
|
+
const l = m(), e = i.type === "boolean" ? ["true", "false"] : i.enum;
|
|
5
|
+
return !e || e.length === 0 ? null : /* @__PURE__ */ n("div", { className: "mint:whitespace-pre-wrap mint:prose-sm mint:mt-6", children: [
|
|
6
|
+
l.availableOptions,
|
|
7
|
+
":",
|
|
8
|
+
" ",
|
|
9
|
+
e.map((r, s) => /* @__PURE__ */ n("div", { className: "mint:inline-block", children: [
|
|
10
|
+
/* @__PURE__ */ t("code", { children: r }),
|
|
11
|
+
s !== e.length - 1 && ",",
|
|
9
12
|
" "
|
|
10
|
-
] }, `${
|
|
13
|
+
] }, `${r}-${s}`))
|
|
11
14
|
] });
|
|
12
|
-
}
|
|
15
|
+
}, d = ({
|
|
16
|
+
enumTable: i
|
|
17
|
+
}) => /* @__PURE__ */ n("div", { className: "mint:whitespace-pre-wrap mint:prose mint:prose-sm mint:mt-6", children: [
|
|
18
|
+
"Available options:",
|
|
19
|
+
/* @__PURE__ */ n("table", { className: "mint:w-min mint:max-w-full mint:text-sm not-prose", children: [
|
|
20
|
+
/* @__PURE__ */ n("tr", { children: [
|
|
21
|
+
/* @__PURE__ */ t("th", { className: "mint:text-left", children: "Title" }),
|
|
22
|
+
/* @__PURE__ */ t("th", { children: "Const" })
|
|
23
|
+
] }),
|
|
24
|
+
i.map(({ title: l, const: e }) => /* @__PURE__ */ n("tr", { children: [
|
|
25
|
+
/* @__PURE__ */ t("td", { children: l }),
|
|
26
|
+
/* @__PURE__ */ t("td", { children: /* @__PURE__ */ t("code", { children: e }) })
|
|
27
|
+
] }, l))
|
|
28
|
+
] })
|
|
29
|
+
] });
|
|
13
30
|
export {
|
|
14
|
-
|
|
31
|
+
d as EnumConstTable,
|
|
32
|
+
a as EnumOptions
|
|
15
33
|
};
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { jsx as e, jsxs as u, Fragment as S } from "react/jsx-runtime";
|
|
2
|
+
import { generateSimpleSchemaLabel as J, isSchemaObject as K, getDeepObjectParentName as Q, getRecursiveParentName as A } from "../../../schemaGraph/utils.js";
|
|
3
|
+
import { ParamFieldWrapper as V } from "../../../../api-playground/ApiPlayground/components/ParamFieldWrapper.js";
|
|
4
|
+
import { ExampleDescription as X } from "../../../../api-playground/EndpointFields/ParamFields/ExampleDescription.js";
|
|
5
|
+
import { Description as R } from "../../../../api-playground/EndpointFields/components/Description.js";
|
|
6
|
+
import { OneOfSelection as Y } from "../../../../api-playground/EndpointFields/components/OneOfDropdown.js";
|
|
7
|
+
import { Expandable as Z } from "../../../../components/Api/Expandable.js";
|
|
8
|
+
import { ParamHead as _ } from "../../../../components/Api/Param.js";
|
|
9
|
+
import { useEndpointLocation as $ } from "../../../../contexts/EndpointLocationContext.js";
|
|
10
|
+
import { useApiParamFieldOption as T } from "../../../../hooks/useApiParamFieldOption.js";
|
|
11
|
+
import { SchemaField as B } from "./SchemaField.js";
|
|
12
|
+
import { cn as a } from "../../../../utils/cn.js";
|
|
13
|
+
function I(r) {
|
|
14
|
+
return r.type !== "object" ? { properties: void 0, additionalProperties: void 0 } : {
|
|
15
|
+
properties: r.properties,
|
|
16
|
+
additionalProperties: r.additionalProperties
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
const be = ({
|
|
20
|
+
fieldType: r,
|
|
21
|
+
schema: i,
|
|
22
|
+
name: t,
|
|
23
|
+
location: f,
|
|
24
|
+
parentName: m,
|
|
25
|
+
typeOptions: y,
|
|
26
|
+
selectedIndex: O,
|
|
27
|
+
onSelectTypeOption: p,
|
|
28
|
+
paramId: s,
|
|
29
|
+
style: c,
|
|
30
|
+
explode: l,
|
|
31
|
+
required: C,
|
|
32
|
+
displayFlattened: v = !1,
|
|
33
|
+
schemas: h,
|
|
34
|
+
oneOfOptions: k,
|
|
35
|
+
lazy: H,
|
|
36
|
+
omitPadding: x = !1,
|
|
37
|
+
hideDescription: N,
|
|
38
|
+
hideExampleDescription: g
|
|
39
|
+
}) => {
|
|
40
|
+
const { properties: b, additionalProperties: o } = I(i), M = T(), { anchor: P } = $(), U = !!(s && (P != null && P.includes(s))), W = M === "all" || U || v, q = !!b && Object.keys(b).length > 0 || !!o && Object.keys(o).length > 0, w = J(i), d = !!v, n = !!k, j = !!i.description, E = !v, D = j && d !== n, z = j && !D;
|
|
41
|
+
return /* @__PURE__ */ e(
|
|
42
|
+
V,
|
|
43
|
+
{
|
|
44
|
+
noBorder: g,
|
|
45
|
+
paramId: s,
|
|
46
|
+
className: "mint:object-param-field",
|
|
47
|
+
children: /* @__PURE__ */ u("div", { className: a(!d && !x && "mint:py-6"), children: [
|
|
48
|
+
/* @__PURE__ */ e(
|
|
49
|
+
_,
|
|
50
|
+
{
|
|
51
|
+
id: s,
|
|
52
|
+
name: t,
|
|
53
|
+
location: f,
|
|
54
|
+
required: C ?? !1,
|
|
55
|
+
deprecated: i.deprecated,
|
|
56
|
+
typeLabel: w,
|
|
57
|
+
fieldType: r,
|
|
58
|
+
typeOptions: y ?? [w],
|
|
59
|
+
selectedTypeOptionIndex: O,
|
|
60
|
+
onSelectTypeOption: p,
|
|
61
|
+
parentName: m,
|
|
62
|
+
style: c,
|
|
63
|
+
explode: l
|
|
64
|
+
}
|
|
65
|
+
),
|
|
66
|
+
/* @__PURE__ */ u("div", { className: a({ "mint:mt-4": !x && (j || q) }), children: [
|
|
67
|
+
D && !N && i.description && /* @__PURE__ */ e(R, { markdown: i.description }),
|
|
68
|
+
/* @__PURE__ */ u(
|
|
69
|
+
"div",
|
|
70
|
+
{
|
|
71
|
+
className: a(
|
|
72
|
+
n && "mint:mt-4",
|
|
73
|
+
n && !d && "mint:rounded-xl mint:border mint:border-gray-100 mint:px-4 mint:pb-4 mint:pt-2 mint:dark:border-white/10"
|
|
74
|
+
),
|
|
75
|
+
children: [
|
|
76
|
+
n && /* @__PURE__ */ e(
|
|
77
|
+
Y,
|
|
78
|
+
{
|
|
79
|
+
selectedIndex: O,
|
|
80
|
+
options: k,
|
|
81
|
+
onSelectOption: p
|
|
82
|
+
}
|
|
83
|
+
),
|
|
84
|
+
z && !N && i.description && /* @__PURE__ */ e("div", { className: a(n && d && "mint:pt-6 mint:pb-4"), children: /* @__PURE__ */ e(R, { markdown: i.description }) }),
|
|
85
|
+
q && /* @__PURE__ */ e("div", { className: a(n && !d && "mint:-mt-4"), children: /* @__PURE__ */ e(
|
|
86
|
+
ee,
|
|
87
|
+
{
|
|
88
|
+
expandable: E,
|
|
89
|
+
defaultOpen: W,
|
|
90
|
+
lazy: H,
|
|
91
|
+
uniqueParamId: s,
|
|
92
|
+
children: /* @__PURE__ */ u(S, { children: [
|
|
93
|
+
b && Object.entries(b).map(([F, L]) => {
|
|
94
|
+
const G = c === "deepObject" && l ? Q(t ?? void 0, m) : A(t ?? void 0, m);
|
|
95
|
+
return /* @__PURE__ */ e(
|
|
96
|
+
B,
|
|
97
|
+
{
|
|
98
|
+
schema: L,
|
|
99
|
+
name: F,
|
|
100
|
+
required: L.isRequired,
|
|
101
|
+
fieldType: r,
|
|
102
|
+
location: f,
|
|
103
|
+
parentName: G,
|
|
104
|
+
style: c,
|
|
105
|
+
explode: l,
|
|
106
|
+
onSelectTypeOption: p,
|
|
107
|
+
schemas: h
|
|
108
|
+
},
|
|
109
|
+
F
|
|
110
|
+
);
|
|
111
|
+
}),
|
|
112
|
+
typeof o == "object" && K(o) && /* @__PURE__ */ e(
|
|
113
|
+
B,
|
|
114
|
+
{
|
|
115
|
+
schema: o,
|
|
116
|
+
name: "{key}",
|
|
117
|
+
required: o.isRequired,
|
|
118
|
+
fieldType: r,
|
|
119
|
+
location: f,
|
|
120
|
+
parentName: A(t ?? void 0, m),
|
|
121
|
+
style: c,
|
|
122
|
+
explode: l,
|
|
123
|
+
onSelectTypeOption: p,
|
|
124
|
+
schemas: h
|
|
125
|
+
},
|
|
126
|
+
"{key}"
|
|
127
|
+
)
|
|
128
|
+
] })
|
|
129
|
+
}
|
|
130
|
+
) }),
|
|
131
|
+
E && !g && /* @__PURE__ */ e(X, { schema: i })
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
)
|
|
135
|
+
] })
|
|
136
|
+
] })
|
|
137
|
+
}
|
|
138
|
+
);
|
|
139
|
+
};
|
|
140
|
+
function ee({ expandable: r, children: i, ...t }) {
|
|
141
|
+
return r ? /* @__PURE__ */ e(Z, { ...t, children: i }) : /* @__PURE__ */ e(S, { children: i });
|
|
142
|
+
}
|
|
143
|
+
export {
|
|
144
|
+
be as ObjectParamField
|
|
145
|
+
};
|
|
@@ -1,56 +1,68 @@
|
|
|
1
1
|
import { jsx as i, jsxs as p } from "react/jsx-runtime";
|
|
2
|
-
import { isEnum as
|
|
3
|
-
import { ParamFieldWrapper as
|
|
4
|
-
import { ExampleDescription as
|
|
5
|
-
import { Description as
|
|
2
|
+
import { isEnum as l, isStringSchema as j, isNumberSchema as k } from "../../../schemaGraph/utils.js";
|
|
3
|
+
import { ParamFieldWrapper as q } from "../../../../api-playground/ApiPlayground/components/ParamFieldWrapper.js";
|
|
4
|
+
import { ExampleDescription as w } from "../../../../api-playground/EndpointFields/ParamFields/ExampleDescription.js";
|
|
5
|
+
import { Description as x } from "../../../../api-playground/EndpointFields/components/Description.js";
|
|
6
6
|
import { ParamHead as E } from "../../../../components/Api/Param.js";
|
|
7
|
-
import { EnumOptions as
|
|
8
|
-
import { NumberMetadata as
|
|
9
|
-
import { StringMetadata as
|
|
10
|
-
import { cn as
|
|
11
|
-
const
|
|
12
|
-
fieldType:
|
|
7
|
+
import { EnumConstTable as F, EnumOptions as M } from "./Enum.js";
|
|
8
|
+
import { NumberMetadata as g } from "./NumberMetadata.js";
|
|
9
|
+
import { StringMetadata as B } from "./StringMetadata.js";
|
|
10
|
+
import { cn as e } from "../../../../utils/cn.js";
|
|
11
|
+
const J = ({
|
|
12
|
+
fieldType: u,
|
|
13
13
|
schema: r,
|
|
14
|
-
name:
|
|
15
|
-
location:
|
|
14
|
+
name: c,
|
|
15
|
+
location: s,
|
|
16
16
|
typeOptions: m,
|
|
17
|
-
selectedIndex:
|
|
18
|
-
onSelectTypeOption:
|
|
19
|
-
parentName:
|
|
20
|
-
paramId:
|
|
21
|
-
style:
|
|
22
|
-
explode:
|
|
17
|
+
selectedIndex: n,
|
|
18
|
+
onSelectTypeOption: N,
|
|
19
|
+
parentName: v,
|
|
20
|
+
paramId: a,
|
|
21
|
+
style: S,
|
|
22
|
+
explode: P,
|
|
23
|
+
enumTable: t,
|
|
24
|
+
omitPadding: f,
|
|
25
|
+
hideExampleDescription: d
|
|
23
26
|
}) => {
|
|
24
|
-
const
|
|
25
|
-
return /* @__PURE__ */ i(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
27
|
+
const b = (m == null ? void 0 : m[n ?? 0]) ?? "unknown", o = r.description;
|
|
28
|
+
return /* @__PURE__ */ i(
|
|
29
|
+
q,
|
|
30
|
+
{
|
|
31
|
+
noBorder: d,
|
|
32
|
+
paramId: a,
|
|
33
|
+
className: "mint:primitive-param-field",
|
|
34
|
+
children: /* @__PURE__ */ p("div", { className: e(!f && "mint:py-6"), children: [
|
|
35
|
+
/* @__PURE__ */ i(
|
|
36
|
+
E,
|
|
37
|
+
{
|
|
38
|
+
id: a,
|
|
39
|
+
name: c,
|
|
40
|
+
typeLabel: b,
|
|
41
|
+
location: s,
|
|
42
|
+
fieldType: u,
|
|
43
|
+
required: r.isRequired,
|
|
44
|
+
deprecated: r.deprecated,
|
|
45
|
+
defaultValue: r.default,
|
|
46
|
+
typeOptions: m,
|
|
47
|
+
selectedTypeOptionIndex: n,
|
|
48
|
+
onSelectTypeOption: N,
|
|
49
|
+
parentName: v,
|
|
50
|
+
style: S,
|
|
51
|
+
explode: P
|
|
52
|
+
}
|
|
53
|
+
),
|
|
54
|
+
/* @__PURE__ */ p("div", { className: e({ "mint:mt-4": !f && (o || l(r)) }), children: [
|
|
55
|
+
o && /* @__PURE__ */ i(x, { className: e(d && "mint:py-4"), markdown: o }),
|
|
56
|
+
t && /* @__PURE__ */ i(F, { enumTable: t }),
|
|
57
|
+
!t && l(r) && /* @__PURE__ */ i(M, { schema: r }),
|
|
58
|
+
j(r) && /* @__PURE__ */ i(B, { schema: r, description: o }),
|
|
59
|
+
k(r) && /* @__PURE__ */ i(g, { schema: r }),
|
|
60
|
+
!d && /* @__PURE__ */ i(w, { schema: r })
|
|
61
|
+
] })
|
|
62
|
+
] })
|
|
63
|
+
}
|
|
64
|
+
);
|
|
53
65
|
};
|
|
54
66
|
export {
|
|
55
|
-
|
|
67
|
+
J as PrimitiveParamField
|
|
56
68
|
};
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { useState as U } from "react";
|
|
3
|
+
import { CIRCULAR_REF_KEY as K } from "../../../constants/index.js";
|
|
4
|
+
import { getParamIdFromSchema as w } from "../../../schemaGraph/addUniqueKeysToSchema.js";
|
|
5
|
+
import { isCircularRef as Y, isSchemaObject as g, isEnum as E, filterSchemasWithConsts as B, generateSchemaOptionLabels as C, isObjectArray as F } from "../../../schemaGraph/utils.js";
|
|
6
|
+
import { ArrayParamField as D } from "./ArrayParamField.js";
|
|
7
|
+
import { ObjectParamField as L } from "./ObjectParamField.js";
|
|
8
|
+
import { PrimitiveParamField as G } from "./PrimitiveParamField.js";
|
|
9
|
+
const M = ({
|
|
10
|
+
schema: t,
|
|
11
|
+
omitPadding: f,
|
|
12
|
+
name: n,
|
|
13
|
+
displayFlattened: e = !1,
|
|
14
|
+
typeOptions: c,
|
|
15
|
+
fieldType: o,
|
|
16
|
+
location: s,
|
|
17
|
+
parentName: i,
|
|
18
|
+
style: S,
|
|
19
|
+
explode: p,
|
|
20
|
+
required: O,
|
|
21
|
+
onSelectTypeOption: R,
|
|
22
|
+
selectedIndex: j,
|
|
23
|
+
schemas: b,
|
|
24
|
+
enumTable: _,
|
|
25
|
+
hideExampleDescription: W,
|
|
26
|
+
hideDescription: k
|
|
27
|
+
}) => {
|
|
28
|
+
const y = w(t, o, n, i);
|
|
29
|
+
if (Y(t)) {
|
|
30
|
+
const u = t[K], I = b == null ? void 0 : b[u];
|
|
31
|
+
return I ? /* @__PURE__ */ l(
|
|
32
|
+
L,
|
|
33
|
+
{
|
|
34
|
+
lazy: !0,
|
|
35
|
+
omitPadding: f,
|
|
36
|
+
schema: { ...I, description: t.description },
|
|
37
|
+
typeOptions: c,
|
|
38
|
+
fieldType: o,
|
|
39
|
+
name: n,
|
|
40
|
+
location: s,
|
|
41
|
+
parentName: i,
|
|
42
|
+
style: S,
|
|
43
|
+
explode: p,
|
|
44
|
+
required: O,
|
|
45
|
+
schemas: b,
|
|
46
|
+
paramId: y
|
|
47
|
+
}
|
|
48
|
+
) : null;
|
|
49
|
+
}
|
|
50
|
+
if (t.oneOf && Array.isArray(t.oneOf) && t.oneOf.length > 0) {
|
|
51
|
+
let u = t.oneOf.filter((r) => g(r));
|
|
52
|
+
if (u.length === 0) return null;
|
|
53
|
+
const I = u.some((r) => E(r) && "const" in r);
|
|
54
|
+
I && (u = B(u));
|
|
55
|
+
const h = C(u), m = u.filter((r) => r.type !== "null"), z = u.some((r) => r.type === "null");
|
|
56
|
+
let v;
|
|
57
|
+
if (I && (v = u.filter((r) => E(r) && "const" in r).map((r) => ({
|
|
58
|
+
title: r.title ?? "Unknown",
|
|
59
|
+
const: r.const ?? ""
|
|
60
|
+
}))), m.length === 1 && m[0]) {
|
|
61
|
+
const r = z && t.typeLabel ? [t.typeLabel] : h;
|
|
62
|
+
return /* @__PURE__ */ l(
|
|
63
|
+
M,
|
|
64
|
+
{
|
|
65
|
+
schema: m[0],
|
|
66
|
+
omitPadding: f,
|
|
67
|
+
displayFlattened: e,
|
|
68
|
+
typeOptions: r,
|
|
69
|
+
fieldType: o,
|
|
70
|
+
name: n,
|
|
71
|
+
location: s,
|
|
72
|
+
parentName: i,
|
|
73
|
+
style: S,
|
|
74
|
+
explode: p,
|
|
75
|
+
required: O,
|
|
76
|
+
schemas: b
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
if (m.every((r) => r.type === "object" || F(r)))
|
|
81
|
+
return /* @__PURE__ */ l(
|
|
82
|
+
J,
|
|
83
|
+
{
|
|
84
|
+
omitPadding: f,
|
|
85
|
+
schema: t,
|
|
86
|
+
schemas: m,
|
|
87
|
+
displayFlattened: e,
|
|
88
|
+
typeOptions: ["object"],
|
|
89
|
+
fieldType: o,
|
|
90
|
+
name: n,
|
|
91
|
+
location: s,
|
|
92
|
+
style: S,
|
|
93
|
+
explode: p,
|
|
94
|
+
parentName: i,
|
|
95
|
+
required: O,
|
|
96
|
+
paramId: y
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
{
|
|
100
|
+
const r = m[j ?? 0];
|
|
101
|
+
return r ? /* @__PURE__ */ l(
|
|
102
|
+
H,
|
|
103
|
+
{
|
|
104
|
+
omitPadding: f,
|
|
105
|
+
schemas: m,
|
|
106
|
+
schema: r,
|
|
107
|
+
enumTable: v,
|
|
108
|
+
displayFlattened: e,
|
|
109
|
+
typeOptions: h,
|
|
110
|
+
fieldType: o,
|
|
111
|
+
name: n,
|
|
112
|
+
location: s,
|
|
113
|
+
style: S,
|
|
114
|
+
explode: p,
|
|
115
|
+
required: O,
|
|
116
|
+
selectedIndex: j,
|
|
117
|
+
parentName: i,
|
|
118
|
+
onSelectTypeOption: R
|
|
119
|
+
}
|
|
120
|
+
) : null;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
const A = C([t]);
|
|
124
|
+
if (t.type !== "array" && t.type !== "object")
|
|
125
|
+
return /* @__PURE__ */ l(
|
|
126
|
+
G,
|
|
127
|
+
{
|
|
128
|
+
omitPadding: f,
|
|
129
|
+
fieldType: o,
|
|
130
|
+
enumTable: _,
|
|
131
|
+
schema: t,
|
|
132
|
+
typeOptions: c ?? A,
|
|
133
|
+
name: n,
|
|
134
|
+
location: s,
|
|
135
|
+
parentName: i,
|
|
136
|
+
selectedIndex: j,
|
|
137
|
+
onSelectTypeOption: R,
|
|
138
|
+
style: S,
|
|
139
|
+
explode: p,
|
|
140
|
+
required: O,
|
|
141
|
+
paramId: y,
|
|
142
|
+
hideExampleDescription: W
|
|
143
|
+
}
|
|
144
|
+
);
|
|
145
|
+
if (t.type === "object")
|
|
146
|
+
return /* @__PURE__ */ l(
|
|
147
|
+
L,
|
|
148
|
+
{
|
|
149
|
+
omitPadding: f,
|
|
150
|
+
displayFlattened: e,
|
|
151
|
+
fieldType: o,
|
|
152
|
+
schema: t,
|
|
153
|
+
typeOptions: c ?? A,
|
|
154
|
+
name: n,
|
|
155
|
+
location: s,
|
|
156
|
+
parentName: i,
|
|
157
|
+
selectedIndex: j,
|
|
158
|
+
onSelectTypeOption: R,
|
|
159
|
+
style: S,
|
|
160
|
+
explode: p,
|
|
161
|
+
required: O,
|
|
162
|
+
schemas: b,
|
|
163
|
+
paramId: y,
|
|
164
|
+
hideDescription: k,
|
|
165
|
+
hideExampleDescription: W
|
|
166
|
+
}
|
|
167
|
+
);
|
|
168
|
+
if (t.type === "array")
|
|
169
|
+
return /* @__PURE__ */ l(
|
|
170
|
+
D,
|
|
171
|
+
{
|
|
172
|
+
omitPadding: f,
|
|
173
|
+
displayFlattened: e,
|
|
174
|
+
fieldType: o,
|
|
175
|
+
schema: t,
|
|
176
|
+
typeOptions: c ?? A,
|
|
177
|
+
name: n,
|
|
178
|
+
location: s,
|
|
179
|
+
parentName: i,
|
|
180
|
+
selectedIndex: j,
|
|
181
|
+
onSelectTypeOption: R,
|
|
182
|
+
style: S,
|
|
183
|
+
explode: p,
|
|
184
|
+
required: O,
|
|
185
|
+
schemas: b,
|
|
186
|
+
paramId: y
|
|
187
|
+
}
|
|
188
|
+
);
|
|
189
|
+
};
|
|
190
|
+
function H({
|
|
191
|
+
schemas: t,
|
|
192
|
+
...f
|
|
193
|
+
}) {
|
|
194
|
+
const [n, e] = U(0), c = t[n];
|
|
195
|
+
return c ? /* @__PURE__ */ l(
|
|
196
|
+
M,
|
|
197
|
+
{
|
|
198
|
+
...f,
|
|
199
|
+
selectedIndex: n,
|
|
200
|
+
onSelectTypeOption: e,
|
|
201
|
+
schema: c
|
|
202
|
+
}
|
|
203
|
+
) : null;
|
|
204
|
+
}
|
|
205
|
+
function J({
|
|
206
|
+
schemas: t,
|
|
207
|
+
paramId: f,
|
|
208
|
+
...n
|
|
209
|
+
}) {
|
|
210
|
+
const [e, c] = U(0);
|
|
211
|
+
let o = t[e];
|
|
212
|
+
if (F(o) && (o = o.items), !o) return null;
|
|
213
|
+
const s = C(t), i = f ?? w(o, n.fieldType, n.name, n.parentName);
|
|
214
|
+
return /* @__PURE__ */ l(
|
|
215
|
+
L,
|
|
216
|
+
{
|
|
217
|
+
...n,
|
|
218
|
+
oneOfOptions: s,
|
|
219
|
+
schema: o,
|
|
220
|
+
selectedIndex: e,
|
|
221
|
+
onSelectTypeOption: c,
|
|
222
|
+
paramId: i
|
|
223
|
+
}
|
|
224
|
+
);
|
|
225
|
+
}
|
|
226
|
+
export {
|
|
227
|
+
H as MultipleSchemasWithDropdown,
|
|
228
|
+
J as MultipleSchemasWithTabs,
|
|
229
|
+
M as SchemaField
|
|
230
|
+
};
|