@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.
- 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 +7 -6
- 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 -67
- 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/apiPage.js +125 -0
- package/dist/components/content-components/code-group.js +4 -4
- package/dist/components/docsPage.js +54 -56
- 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 +80 -60
- package/dist/index.js +99 -101
- package/dist/openapi/generateTypeStringFromSchema.js +2 -31
- package/dist/plugins/sanitize/rehype-pre-to-mdx-fence.js +13 -13
- 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
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import { jsxs as m, jsx as i, Fragment as s } from "react/jsx-runtime";
|
|
2
|
-
import { useState as C } from "react";
|
|
3
|
-
import { isEnum as $ } from "../../EndpointFields/ParamFields/PrimitiveParamField/index.js";
|
|
4
|
-
import { Description as g } from "../../EndpointFields/components/Description.js";
|
|
5
|
-
import { InfoPill as j, RequiredPill as B, DeprecatedPill as P } from "../../../components/Api/Param.js";
|
|
6
|
-
import T from "../../../components/Api/ErrorBoundary.js";
|
|
7
|
-
import { containsMarkdownTable as q } from "../../../utils/containsMarkdownTable.js";
|
|
8
|
-
import { cn as e } from "../../../utils/cn.js";
|
|
9
|
-
import { ArrayCount as E } from "./ArrayCount.js";
|
|
10
|
-
import { ObjectExpandButton as S } from "./ObjectExpandButton.js";
|
|
11
|
-
import { TrashButton as D } from "./TrashButton.js";
|
|
12
|
-
const U = ({
|
|
13
|
-
name: d,
|
|
14
|
-
children: y,
|
|
15
|
-
schema: t,
|
|
16
|
-
onClear: a,
|
|
17
|
-
isObject: r,
|
|
18
|
-
isArray: c,
|
|
19
|
-
parentNames: n,
|
|
20
|
-
arrayIndex: o,
|
|
21
|
-
typeDropdown: p,
|
|
22
|
-
defaultExpanded: f = !0,
|
|
23
|
-
style: u,
|
|
24
|
-
explode: v
|
|
25
|
-
}) => {
|
|
26
|
-
const [l, k] = C(f), b = t.type === "object" ? Object.keys(t.properties).length : 0, h = "format" in t && typeof t.format == "string" ? `${t.type}<${t.format}>` : t.type, x = $(t) && t.description && q(t.description);
|
|
27
|
-
return /* @__PURE__ */ m(T, { children: [
|
|
28
|
-
/* @__PURE__ */ m(
|
|
29
|
-
"div",
|
|
30
|
-
{
|
|
31
|
-
className: e(
|
|
32
|
-
"mint:flex mint:space-x-3 mint:items-start",
|
|
33
|
-
o != null && !r && "mint:flex mint:items-center"
|
|
34
|
-
),
|
|
35
|
-
children: [
|
|
36
|
-
o != null && /* @__PURE__ */ i(E, { className: e(r && "mint:mt-8"), children: o + 1 }),
|
|
37
|
-
/* @__PURE__ */ m(
|
|
38
|
-
"div",
|
|
39
|
-
{
|
|
40
|
-
className: e(
|
|
41
|
-
"mint:flex-1 mint:grid mint:lg:grid-cols-2 mint:gap-x-12 mint:gap-y-4 mint:py-5 mint:max-w-full",
|
|
42
|
-
c && "mint:flex mint:flex-col",
|
|
43
|
-
r && "mint:gap-y-0 mint:flex mint:flex-col mint:border mint:border-gray-50 mint:dark:border-white/5 mint:rounded-xl mint:px-4 mint:py-0 mint:my-5",
|
|
44
|
-
o !== void 0 && "mint:py-1 mint:my-2"
|
|
45
|
-
),
|
|
46
|
-
children: [
|
|
47
|
-
/* @__PURE__ */ m(
|
|
48
|
-
"div",
|
|
49
|
-
{
|
|
50
|
-
className: e(
|
|
51
|
-
"mint:space-y-2",
|
|
52
|
-
r && "mint:pt-8 mint:py-5 mint:border-b mint:border-gray-50 mint:dark:border-white/5",
|
|
53
|
-
!l && "mint:border-none",
|
|
54
|
-
o != null && !r && "mint:flex mint:items-center"
|
|
55
|
-
),
|
|
56
|
-
children: [
|
|
57
|
-
/* @__PURE__ */ m("div", { className: "mint:flex mint:items-center mint:justify-between mint:font-mono mint:font-bold", children: [
|
|
58
|
-
/* @__PURE__ */ m(
|
|
59
|
-
"div",
|
|
60
|
-
{
|
|
61
|
-
className: "mint:flex mint:flex-wrap mint:items-center mint:gap-2 mint:text-xs mint:truncate",
|
|
62
|
-
title: n ? `${n.join(".")}.${d}` : d,
|
|
63
|
-
children: [
|
|
64
|
-
/* @__PURE__ */ i("div", { className: e("mint:text-sm mint:truncate", d == null && "mint:hidden"), children: n && n.length > 0 && u === "deepObject" && v ? /* @__PURE__ */ m(s, { children: [
|
|
65
|
-
/* @__PURE__ */ i("span", { className: "mint:text-gray-500 mint:dark:text-gray-400", children: n.map((w, N) => /* @__PURE__ */ m(s, { children: [
|
|
66
|
-
w,
|
|
67
|
-
N === 0 ? "[" : "]["
|
|
68
|
-
] })) }),
|
|
69
|
-
/* @__PURE__ */ i("span", { className: "mint:font-semibold mint:text-gray-900 mint:dark:text-gray-100", children: d }),
|
|
70
|
-
/* @__PURE__ */ i("span", { className: "mint:text-gray-500 mint:dark:text-gray-400", children: "]" })
|
|
71
|
-
] }) : /* @__PURE__ */ m(s, { children: [
|
|
72
|
-
/* @__PURE__ */ i("span", { className: "mint:text-gray-500 mint:dark:text-gray-400", children: n ? `${n.join(".")}.` : "" }),
|
|
73
|
-
/* @__PURE__ */ i("span", { className: "mint:font-semibold mint:text-gray-900 mint:dark:text-gray-100", children: d })
|
|
74
|
-
] }) }),
|
|
75
|
-
p ?? /* @__PURE__ */ i(j, { children: h }),
|
|
76
|
-
t.required && /* @__PURE__ */ i(B, {}),
|
|
77
|
-
t.deprecated && /* @__PURE__ */ i(P, {})
|
|
78
|
-
]
|
|
79
|
-
}
|
|
80
|
-
),
|
|
81
|
-
r && /* @__PURE__ */ i(
|
|
82
|
-
S,
|
|
83
|
-
{
|
|
84
|
-
onClick: () => k(!l),
|
|
85
|
-
count: b,
|
|
86
|
-
labeled: f == !1
|
|
87
|
-
}
|
|
88
|
-
)
|
|
89
|
-
] }),
|
|
90
|
-
t.description && !x && /* @__PURE__ */ i(
|
|
91
|
-
g,
|
|
92
|
-
{
|
|
93
|
-
markdown: t.description,
|
|
94
|
-
className: "mint:text-gray-500 mint:dark:text-gray-400"
|
|
95
|
-
}
|
|
96
|
-
)
|
|
97
|
-
]
|
|
98
|
-
}
|
|
99
|
-
),
|
|
100
|
-
l && /* @__PURE__ */ i(
|
|
101
|
-
"div",
|
|
102
|
-
{
|
|
103
|
-
className: e(
|
|
104
|
-
"mint:grid mint:grid-cols-1 mint:w-full mint:items-start mint:divide-y mint:divide-gray-50 mint:dark:divide-white/5",
|
|
105
|
-
c && "mint:divide-y-0"
|
|
106
|
-
),
|
|
107
|
-
children: y
|
|
108
|
-
}
|
|
109
|
-
)
|
|
110
|
-
]
|
|
111
|
-
}
|
|
112
|
-
),
|
|
113
|
-
(o != null || n) && a && /* @__PURE__ */ i(
|
|
114
|
-
D,
|
|
115
|
-
{
|
|
116
|
-
className: e(r && "mint:mt-8", n && "mint:mt-7"),
|
|
117
|
-
onClick: () => a()
|
|
118
|
-
}
|
|
119
|
-
)
|
|
120
|
-
]
|
|
121
|
-
}
|
|
122
|
-
),
|
|
123
|
-
t.description && x && /* @__PURE__ */ i(g, { markdown: t.description, className: "mint:text-gray-500 mint:dark:text-gray-400" })
|
|
124
|
-
] });
|
|
125
|
-
};
|
|
126
|
-
export {
|
|
127
|
-
U as InputContainer
|
|
128
|
-
};
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { jsxs as i, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { useState as s } from "react";
|
|
3
|
-
import { ChevronRightFilled as c, CheckmarkCircleRegular as g, ErrorCircleRegular as x } from "@fluentui/react-icons";
|
|
4
|
-
import { cn as e } from "../../../utils/cn.js";
|
|
5
|
-
const k = ({
|
|
6
|
-
name: d,
|
|
7
|
-
validationState: m,
|
|
8
|
-
children: r,
|
|
9
|
-
rightElement: a
|
|
10
|
-
}) => {
|
|
11
|
-
const [n, o] = s(!0);
|
|
12
|
-
return /* @__PURE__ */ i("div", { children: [
|
|
13
|
-
/* @__PURE__ */ i(
|
|
14
|
-
"button",
|
|
15
|
-
{
|
|
16
|
-
"aria-label": "Expand Input Section",
|
|
17
|
-
onClick: () => o((l) => !l),
|
|
18
|
-
className: e(
|
|
19
|
-
"mint:flex mint:w-full mint:px-4 mint:py-2.5 mint:items-center mint:justify-between mint:border-standard mint:cursor-pointer mint:hover:bg-gray-50 mint:dark:hover:bg-white/5",
|
|
20
|
-
n ? "mint:border-b-0! mint:border-t mint:border-x mint:rounded-t-2xl" : "mint:rounded-2xl"
|
|
21
|
-
),
|
|
22
|
-
children: [
|
|
23
|
-
/* @__PURE__ */ i("div", { className: "mint:flex mint:items-center mint:gap-x-1.5", children: [
|
|
24
|
-
/* @__PURE__ */ t(
|
|
25
|
-
c,
|
|
26
|
-
{
|
|
27
|
-
className: e(
|
|
28
|
-
"mint:h-3 mint:w-3 mint:bg-gray-400 mint:dark:bg-gray-500 mint:transition-transform",
|
|
29
|
-
n && "mint:rotate-180"
|
|
30
|
-
)
|
|
31
|
-
}
|
|
32
|
-
),
|
|
33
|
-
/* @__PURE__ */ i("div", { className: "mint:flex-1 mint:flex mint:items-center mint:space-x-2", children: [
|
|
34
|
-
/* @__PURE__ */ t("div", { className: "mint:text-sm mint:font-medium mint:text-gray-800 mint:dark:text-gray-200 mint:leading-6", children: d }),
|
|
35
|
-
m ? m === "invalid" ? /* @__PURE__ */ t(b, {}) : /* @__PURE__ */ t(u, {}) : null
|
|
36
|
-
] })
|
|
37
|
-
] }),
|
|
38
|
-
a
|
|
39
|
-
]
|
|
40
|
-
}
|
|
41
|
-
),
|
|
42
|
-
/* @__PURE__ */ i(
|
|
43
|
-
"div",
|
|
44
|
-
{
|
|
45
|
-
className: e(
|
|
46
|
-
"mint:bg-background-light mint:dark:bg-background-dark mint:flex-1 mint:px-4 mint:rounded-b-xl mint:border-standard mint:border-t-0! mint:divide-y mint:divide-gray-100 mint:dark:divide-white/10",
|
|
47
|
-
n && r ? "" : "mint:hidden"
|
|
48
|
-
),
|
|
49
|
-
children: [
|
|
50
|
-
/* @__PURE__ */ t("div", {}),
|
|
51
|
-
r
|
|
52
|
-
]
|
|
53
|
-
}
|
|
54
|
-
)
|
|
55
|
-
] });
|
|
56
|
-
}, b = () => /* @__PURE__ */ t(g, { className: "mint:h-4 mint:w-4 mint:bg-[#2AB673]" }), u = () => /* @__PURE__ */ t(x, { className: "mint:h-4 mint:w-4 mint:bg-[#CB3A32]" });
|
|
57
|
-
export {
|
|
58
|
-
k as InputSectionContainer
|
|
59
|
-
};
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
import { jsxs as c, jsx as n, Fragment as y } from "react/jsx-runtime";
|
|
2
|
-
import { SpinnerIosRegular as N, PlayRegular as P, ChevronUpDownFilled as w, CheckmarkCircleRegular as k, CopySelectRegular as C } from "@fluentui/react-icons";
|
|
3
|
-
import { useState as g, useContext as f, useEffect as S, useMemo as B } from "react";
|
|
4
|
-
import { getMethodColor as x } from "../../../components/Api/colors.js";
|
|
5
|
-
import { MethodPill as I } from "../../../components/Api/MethodPill.js";
|
|
6
|
-
import { useApiPlaygroundInputs as $ } from "../../../hooks/useMDXContentController/useApiPlaygroundInputs.js";
|
|
7
|
-
import { addPathParams as W, joinWithSingleSlash as E, addServerVariables as M } from "../../../hooks/useSendPlaygroundRequest.js";
|
|
8
|
-
import { copyToClipboard as R } from "../../../utils/copyToClipboard.js";
|
|
9
|
-
import { ApiPlaygroundContext as v } from "../ApiPlaygroundContext.js";
|
|
10
|
-
import { cn as h } from "../../../utils/cn.js";
|
|
11
|
-
const _ = ({
|
|
12
|
-
endpoint: t,
|
|
13
|
-
display: m,
|
|
14
|
-
onClickInteractive: r,
|
|
15
|
-
hasGrayBackground: s
|
|
16
|
-
}) => /* @__PURE__ */ c("div", { className: "mint:flex mint:items-center mint:space-x-1.5", children: [
|
|
17
|
-
/* @__PURE__ */ n(j, { endpoint: t, display: m, hasGrayBackground: s }),
|
|
18
|
-
m === "simple" ? null : /* @__PURE__ */ n(A, { method: t.method, label: "Try it", onClick: r })
|
|
19
|
-
] }), U = () => {
|
|
20
|
-
const { baseUrlOptions: t, selectedBaseUrlIndex: m, setSelectedBaseUrlIndex: r } = f(v), [s, o] = g(0), i = t == null ? void 0 : t[m];
|
|
21
|
-
return S(() => {
|
|
22
|
-
const e = document.createElement("span");
|
|
23
|
-
e.className = "mint:text-sm mint:absolute mint:font-mono mint:invisible";
|
|
24
|
-
const a = sessionStorage.getItem("selectedBaseUrl");
|
|
25
|
-
a && a !== i && t && r && t.includes(a) ? (r(t.indexOf(a)), e.textContent = a) : e.textContent = i ?? "", document.body.appendChild(e), o(e.offsetWidth + 16), document.body.removeChild(e);
|
|
26
|
-
}, [i, r, m, t]), !t || t.length <= 1 || !r ? null : /* @__PURE__ */ c("div", { className: "mint:flex mint:items-center mint:gap-1 mint:relative mint:-mr-1", children: [
|
|
27
|
-
/* @__PURE__ */ n(
|
|
28
|
-
"select",
|
|
29
|
-
{
|
|
30
|
-
"aria-label": "Base Path Selector",
|
|
31
|
-
className: "mint:bg-transparent mint:text-sm mint:text-gray-600 mint:dark:text-gray-400 mint:outline-0 mint:font-mono mint:cursor-pointer mint:hover:text-gray-900 mint:dark:hover:text-gray-300",
|
|
32
|
-
value: m,
|
|
33
|
-
onClick: (e) => e.stopPropagation(),
|
|
34
|
-
onChange: (e) => {
|
|
35
|
-
sessionStorage.setItem("selectedBaseUrl", t[Number(e.target.value)] ?? ""), r(Number(e.target.value));
|
|
36
|
-
},
|
|
37
|
-
style: { width: `${s}px` },
|
|
38
|
-
children: t.map((e, a) => /* @__PURE__ */ n("option", { value: a, children: e }, e))
|
|
39
|
-
}
|
|
40
|
-
),
|
|
41
|
-
/* @__PURE__ */ n(
|
|
42
|
-
w,
|
|
43
|
-
{
|
|
44
|
-
className: "mint:absolute mint:right-0 mint:w-3 mint:h-3 mint:text-gray-400 mint:dark:text-white/30 mint:pointer-events-none"
|
|
45
|
-
}
|
|
46
|
-
)
|
|
47
|
-
] });
|
|
48
|
-
}, j = ({ endpoint: t, display: m, hasGrayBackground: r }) => {
|
|
49
|
-
const [s, o] = g(!1), { baseUrlOptions: i, selectedBaseUrlIndex: e } = f(v), a = $(), l = (i == null ? void 0 : i[e]) ?? (i == null ? void 0 : i[0]) ?? "", p = async () => {
|
|
50
|
-
const d = W(t.path, a.path), b = E(M(l, a.server), d);
|
|
51
|
-
await R(b) === "success" && (o(!0), setTimeout(() => {
|
|
52
|
-
o(!1);
|
|
53
|
-
}, 2e3));
|
|
54
|
-
};
|
|
55
|
-
return /* @__PURE__ */ c(
|
|
56
|
-
"div",
|
|
57
|
-
{
|
|
58
|
-
className: h(
|
|
59
|
-
"mint:relative mint:flex-1 mint:flex mint:gap-2 mint:min-w-0 mint:rounded-xl mint:items-center mint:cursor-pointer mint:p-1.5 mint:pr-0 mint:overflow-hidden",
|
|
60
|
-
m != "simple" && "mint:border-standard",
|
|
61
|
-
r && "mint:bg-gray-50 mint:dark:bg-white/5"
|
|
62
|
-
),
|
|
63
|
-
onClick: p,
|
|
64
|
-
children: [
|
|
65
|
-
/* @__PURE__ */ n(
|
|
66
|
-
I,
|
|
67
|
-
{
|
|
68
|
-
method: t.type === "webhook" ? "webhook" : t.method,
|
|
69
|
-
isActive: !1
|
|
70
|
-
}
|
|
71
|
-
),
|
|
72
|
-
/* @__PURE__ */ c("div", { className: "mint:flex mint:items-center mint:space-x-2 mint:overflow-x-auto mint:flex-1 mint:no-scrollbar", children: [
|
|
73
|
-
t.type !== "webhook" && /* @__PURE__ */ n(U, {}),
|
|
74
|
-
/* @__PURE__ */ n(
|
|
75
|
-
F,
|
|
76
|
-
{
|
|
77
|
-
endpoint: t,
|
|
78
|
-
display: m,
|
|
79
|
-
isCopiedActive: s,
|
|
80
|
-
hasGrayBackground: r
|
|
81
|
-
}
|
|
82
|
-
)
|
|
83
|
-
] })
|
|
84
|
-
]
|
|
85
|
-
}
|
|
86
|
-
);
|
|
87
|
-
}, F = ({
|
|
88
|
-
endpoint: t,
|
|
89
|
-
isCopiedActive: m,
|
|
90
|
-
hasGrayBackground: r
|
|
91
|
-
}) => {
|
|
92
|
-
const s = B(() => t.path.split("/").flatMap((o, i) => {
|
|
93
|
-
const e = [];
|
|
94
|
-
return i > 0 && e.push(/* @__PURE__ */ n(T, {}, i)), o.split("{").forEach((a, l) => {
|
|
95
|
-
if (a.includes("}")) {
|
|
96
|
-
const [p, d] = a.split("}");
|
|
97
|
-
e.push(
|
|
98
|
-
/* @__PURE__ */ n(H, { method: t.method, children: p }, `${i}-${l}-param`)
|
|
99
|
-
), d && e.push(/* @__PURE__ */ n(u, { children: d }, `${i}-${l}`));
|
|
100
|
-
} else a && e.push(/* @__PURE__ */ n(u, { children: a }, `${i}-${l}`));
|
|
101
|
-
}), e;
|
|
102
|
-
}), [t.path, t.method]);
|
|
103
|
-
return /* @__PURE__ */ c("div", { className: "mint:group mint:flex mint:items-center mint:flex-1 mint:gap-0.5 mint:font-mono mint:pr-1.5", children: [
|
|
104
|
-
/* @__PURE__ */ n(
|
|
105
|
-
"div",
|
|
106
|
-
{
|
|
107
|
-
className: h(
|
|
108
|
-
"mint:absolute mint:right-0 mint:p-2 mint:bg-background-light mint:dark:bg-background-dark mint:rounded-lg",
|
|
109
|
-
r && "mint:bg-transparent mint:dark:bg-transparent",
|
|
110
|
-
m ? "mint:block" : "mint:hidden mint:group-hover:block"
|
|
111
|
-
),
|
|
112
|
-
children: m ? /* @__PURE__ */ n(
|
|
113
|
-
k,
|
|
114
|
-
{
|
|
115
|
-
className: "mint:w-4 mint:h-4 mint:bg-primary mint:dark:bg-primary-light"
|
|
116
|
-
}
|
|
117
|
-
) : /* @__PURE__ */ n(C, { className: "mint:w-4 mint:h-4 mint:bg-gray-400 mint:dark:bg-white/30" })
|
|
118
|
-
}
|
|
119
|
-
),
|
|
120
|
-
s
|
|
121
|
-
] });
|
|
122
|
-
}, u = ({ children: t }) => /* @__PURE__ */ n("div", { className: "mint:text-sm mint:font-medium mint:text-gray-800 mint:dark:text-white mint:min-w-max", children: t }), H = ({ children: t, method: m }) => {
|
|
123
|
-
const { activeNavPillBg: r, activeNavPillText: s, inactiveNavPillText: o, inactiveNavPillBg: i } = x(m);
|
|
124
|
-
return /* @__PURE__ */ n(
|
|
125
|
-
"div",
|
|
126
|
-
{
|
|
127
|
-
className: h("mint:text-sm mint:font-mono mint:font-medium mint:rounded-md mint:px-1 mint:border-2 mint:min-w-max", r, s, o, i),
|
|
128
|
-
children: `{${t}}`
|
|
129
|
-
}
|
|
130
|
-
);
|
|
131
|
-
}, T = () => /* @__PURE__ */ n("div", { className: "mint:text-sm mint:text-gray-400", children: "/" }), A = ({
|
|
132
|
-
label: t,
|
|
133
|
-
method: m,
|
|
134
|
-
onClick: r,
|
|
135
|
-
isSending: s,
|
|
136
|
-
className: o
|
|
137
|
-
}) => {
|
|
138
|
-
const { activeNavPillBg: i } = x(m);
|
|
139
|
-
return /* @__PURE__ */ n(
|
|
140
|
-
"button",
|
|
141
|
-
{
|
|
142
|
-
className: h(
|
|
143
|
-
"try-it-button",
|
|
144
|
-
"mint:flex mint:items-center mint:justify-center mint:px-3 mint:h-9 mint:text-white mint:font-medium mint:rounded-xl mint:mouse-pointer mint:disabled:opacity-70 mint:hover:opacity-80 mint:gap-1.5",
|
|
145
|
-
i,
|
|
146
|
-
o
|
|
147
|
-
),
|
|
148
|
-
onClick: r,
|
|
149
|
-
disabled: s,
|
|
150
|
-
"data-testid": "try-it-button",
|
|
151
|
-
children: s ? /* @__PURE__ */ n(N, { className: "mint:w-4 mint:h-4 mint:bg-white mint:animate-spin" }) : /* @__PURE__ */ c(y, { children: [
|
|
152
|
-
/* @__PURE__ */ n("span", { children: t }),
|
|
153
|
-
/* @__PURE__ */ n(P, { className: "mint:w-3 mint:h-3 mint:bg-white" })
|
|
154
|
-
] })
|
|
155
|
-
}
|
|
156
|
-
);
|
|
157
|
-
};
|
|
158
|
-
export {
|
|
159
|
-
_ as EndpointHeader,
|
|
160
|
-
j as PathHeader,
|
|
161
|
-
A as SendPill
|
|
162
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { useSelectedLocale as m } from "../../../utils/locales/index.js";
|
|
3
|
-
import { TrashIcon as o } from "lucide-react";
|
|
4
|
-
import "@mintlify/validation";
|
|
5
|
-
import { cn as i } from "../../../utils/cn.js";
|
|
6
|
-
const x = ({
|
|
7
|
-
className: r,
|
|
8
|
-
onClick: e
|
|
9
|
-
}) => {
|
|
10
|
-
const a = m();
|
|
11
|
-
return /* @__PURE__ */ t(
|
|
12
|
-
"button",
|
|
13
|
-
{
|
|
14
|
-
className: i(
|
|
15
|
-
"mint:px-1 mint:text-gray-400 mint:dark:text-gray-600 mint:hover:text-gray-600 mint:dark:hover:text-gray-400",
|
|
16
|
-
r
|
|
17
|
-
),
|
|
18
|
-
onClick: e,
|
|
19
|
-
"aria-label": a["aria.deleteItem"],
|
|
20
|
-
children: /* @__PURE__ */ t(o, { className: "mint:w-4 mint:h-4" })
|
|
21
|
-
}
|
|
22
|
-
);
|
|
23
|
-
};
|
|
24
|
-
export {
|
|
25
|
-
x as TrashButton
|
|
26
|
-
};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { useContext as U, useState as o, useEffect as b } from "react";
|
|
3
|
-
import { DocsConfigContext as L } from "../../contexts/ConfigContext.js";
|
|
4
|
-
import { EndpointLocationProvider as T } from "../../contexts/EndpointLocationContext.js";
|
|
5
|
-
import { useBaseUrlOptions as j } from "../../hooks/useBaseUrlOptions.js";
|
|
6
|
-
import { useKeyboardShortcut as y } from "../../hooks/useKeyboardShortcut.js";
|
|
7
|
-
import { useApiPlaygroundInputs as F } from "../../hooks/useMDXContentController/useApiPlaygroundInputs.js";
|
|
8
|
-
import { useSetApiBaseIndexCallback as K } from "../../hooks/useMDXContentController/useMDXContentCallbacks/useSetApiBaseIndexCallback.js";
|
|
9
|
-
import { useSetApiPlaygroundInputsCallback as D } from "../../hooks/useMDXContentController/useMDXContentCallbacks/useSetApiPlaygroundInputsCallback.js";
|
|
10
|
-
import { useSendPlaygroundRequest as N } from "../../hooks/useSendPlaygroundRequest.js";
|
|
11
|
-
import Q from "../../components/Api/ErrorBoundary.js";
|
|
12
|
-
import { ApiPlaygroundContext as W } from "./ApiPlaygroundContext.js";
|
|
13
|
-
import { Request as _ } from "./Request/index.js";
|
|
14
|
-
const se = ({ endpoint: r, display: f, pathname: x }) => {
|
|
15
|
-
var p, m;
|
|
16
|
-
const { docsConfig: a } = U(L), h = F(), I = D(), g = K(), e = j(), [c, P] = o(0), [l, i] = o(!1), [S, w] = o(!1), [E, B] = o(), [k, z] = o(0), v = Object.keys(r.request.body)[k], [A, C] = o(0), R = (e == null ? void 0 : e[c]) ?? (e == null ? void 0 : e[0]) ?? "";
|
|
17
|
-
b(() => {
|
|
18
|
-
new URLSearchParams(window.location.search).has("playground") && requestAnimationFrame(() => {
|
|
19
|
-
i(!0);
|
|
20
|
-
});
|
|
21
|
-
}, []);
|
|
22
|
-
const d = N({
|
|
23
|
-
endpoint: r,
|
|
24
|
-
baseUrl: R,
|
|
25
|
-
contentType: v ?? "application/json",
|
|
26
|
-
setIsFetching: w,
|
|
27
|
-
setResult: B
|
|
28
|
-
}), q = (t) => {
|
|
29
|
-
P(t), g(t);
|
|
30
|
-
}, u = (t) => {
|
|
31
|
-
if (i(t), t) {
|
|
32
|
-
const s = new URL(window.location.href);
|
|
33
|
-
s.searchParams.set("playground", "open"), window.history.replaceState({}, "", s);
|
|
34
|
-
} else {
|
|
35
|
-
const s = new URL(window.location.href);
|
|
36
|
-
s.searchParams.delete("playground"), window.history.replaceState({}, "", s);
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
return y({
|
|
40
|
-
key: "Enter",
|
|
41
|
-
callback: ((m = (p = a == null ? void 0 : a.api) == null ? void 0 : p.playground) == null ? void 0 : m.display) === "interactive" ? d : void 0
|
|
42
|
-
}), y({
|
|
43
|
-
key: "Escape",
|
|
44
|
-
callback: l ? () => u(!1) : void 0,
|
|
45
|
-
isSingleKey: !0
|
|
46
|
-
}), /* @__PURE__ */ n(Q, { children: /* @__PURE__ */ n(
|
|
47
|
-
W.Provider,
|
|
48
|
-
{
|
|
49
|
-
value: {
|
|
50
|
-
isSending: S,
|
|
51
|
-
sendRequest: d,
|
|
52
|
-
result: E,
|
|
53
|
-
setSelectedBaseUrlIndex: q,
|
|
54
|
-
selectedBaseUrlIndex: c,
|
|
55
|
-
baseUrlOptions: e,
|
|
56
|
-
isPlaygroundExpanded: l,
|
|
57
|
-
setIsPlaygroundExpanded: u,
|
|
58
|
-
selectedExampleIndex: A,
|
|
59
|
-
setSelectedExampleIndex: C
|
|
60
|
-
},
|
|
61
|
-
children: /* @__PURE__ */ n("div", { className: "mint:flex mint:w-full mint:flex-col mint:space-y-4", children: /* @__PURE__ */ n(T, { location: "request", children: /* @__PURE__ */ n(_, { inputs: h, setInputs: I, endpoint: r, display: f, pathname: x }) }) })
|
|
62
|
-
}
|
|
63
|
-
) });
|
|
64
|
-
};
|
|
65
|
-
export {
|
|
66
|
-
se as ApiPlayground
|
|
67
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { jsxs as i, jsx as l } from "react/jsx-runtime";
|
|
2
|
-
import { useSelectedLocale as o } from "../../../../utils/locales/index.js";
|
|
3
|
-
import { getXFilteredEnumValues as m } from "../../../../openapi/filterEnums.js";
|
|
4
|
-
const d = ({ schema: r }) => {
|
|
5
|
-
const e = m({ schema: r, userGroups: void 0 }), s = o();
|
|
6
|
-
return e.length === 0 ? null : /* @__PURE__ */ i("div", { className: "mint:whitespace-pre-wrap mint:prose-sm mint:mt-6", children: [
|
|
7
|
-
s.availableOptions,
|
|
8
|
-
":",
|
|
9
|
-
" ",
|
|
10
|
-
e.map((t, n) => /* @__PURE__ */ i("div", { className: "mint:inline-block", children: [
|
|
11
|
-
/* @__PURE__ */ l("code", { children: t }),
|
|
12
|
-
n !== e.length - 1 && ",",
|
|
13
|
-
" "
|
|
14
|
-
] }, `${t}-${n}`))
|
|
15
|
-
] });
|
|
16
|
-
};
|
|
17
|
-
export {
|
|
18
|
-
d as EnumOptions
|
|
19
|
-
};
|
package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/NumberMetadata.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { jsxs as u, Fragment as r, jsx as l } from "react/jsx-runtime";
|
|
2
|
-
const o = ({ schema: i }) => {
|
|
3
|
-
const e = i.exclusiveMinimum || i.exclusiveMinimum !== void 0, n = i.exclusiveMaximum || i.exclusiveMaximum !== void 0;
|
|
4
|
-
let m = "";
|
|
5
|
-
return i.maximum !== void 0 && (m = `x ${n ? "<" : "<="} ${i.maximum}`), i.minimum !== void 0 && (m = `x ${e ? ">" : ">="} ${i.minimum}`), i.maximum !== void 0 && i.minimum !== void 0 && (m = `${i.minimum} ${e ? "<" : "<="} x ${n ? "<" : "<="} ${i.maximum}`), m === "" && i.multipleOf === void 0 ? null : /* @__PURE__ */ u("div", { className: "mint:prose mint:prose-sm mint:prose-gray mint:dark:prose-invert mint:mt-6", children: [
|
|
6
|
-
m && /* @__PURE__ */ u(r, { children: [
|
|
7
|
-
"Required range: ",
|
|
8
|
-
/* @__PURE__ */ l("code", { children: m })
|
|
9
|
-
] }),
|
|
10
|
-
i.multipleOf && /* @__PURE__ */ u(r, { children: [
|
|
11
|
-
"Must be a multiple of ",
|
|
12
|
-
/* @__PURE__ */ l("code", { children: i.multipleOf })
|
|
13
|
-
] })
|
|
14
|
-
] });
|
|
15
|
-
};
|
|
16
|
-
export {
|
|
17
|
-
o as NumberMetadata
|
|
18
|
-
};
|
package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/StringMetadata.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { jsxs as n, Fragment as t, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import "@mintlify/validation";
|
|
3
|
-
import { cn as d } from "../../../../utils/cn.js";
|
|
4
|
-
const s = ({
|
|
5
|
-
schema: r,
|
|
6
|
-
description: i
|
|
7
|
-
}) => /* @__PURE__ */ n(t, { children: [
|
|
8
|
-
r.const !== void 0 && /* @__PURE__ */ n("div", { className: d("mint:prose mint:prose-sm mint:prose-gray mint:dark:prose-invert", i && "mint:mt-6"), children: [
|
|
9
|
-
"Allowed value: ",
|
|
10
|
-
/* @__PURE__ */ e("code", { children: `"${r.const}"` })
|
|
11
|
-
] }),
|
|
12
|
-
(r.minLength !== void 0 || r.maxLength !== void 0) && /* @__PURE__ */ e("div", { className: d("mint:prose mint:prose-sm mint:prose-gray mint:dark:prose-invert", i && "mint:mt-6"), children: /* @__PURE__ */ e(o, { minLength: r.minLength, maxLength: r.maxLength }) })
|
|
13
|
-
] }), o = ({ minLength: r, maxLength: i }) => r === i && r !== void 0 ? /* @__PURE__ */ n(t, { children: [
|
|
14
|
-
"Required string length: ",
|
|
15
|
-
/* @__PURE__ */ e("code", { children: r })
|
|
16
|
-
] }) : r && i ? /* @__PURE__ */ n(t, { children: [
|
|
17
|
-
"Required string length: ",
|
|
18
|
-
/* @__PURE__ */ e("code", { children: `${r} - ${i}` })
|
|
19
|
-
] }) : r ? /* @__PURE__ */ n(t, { children: [
|
|
20
|
-
"Minimum length: ",
|
|
21
|
-
/* @__PURE__ */ e("code", { children: r })
|
|
22
|
-
] }) : i ? /* @__PURE__ */ n(t, { children: [
|
|
23
|
-
"Maximum length: ",
|
|
24
|
-
/* @__PURE__ */ e("code", { children: i })
|
|
25
|
-
] }) : "";
|
|
26
|
-
export {
|
|
27
|
-
s as StringMetadata
|
|
28
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
2
|
-
import i from "@sindresorhus/slugify";
|
|
3
|
-
import "../../../contexts/EndpointLocationContext.js";
|
|
4
|
-
const s = (r, t, e, $) => i(
|
|
5
|
-
`${r ? `${r}-` : ""}${e ? `${e}-` : ""}${t || ""}-`,
|
|
6
|
-
{
|
|
7
|
-
decamelize: !0
|
|
8
|
-
}
|
|
9
|
-
), m = (r, t) => r ? `${t ? `${t}` : ""}${r}.` : "";
|
|
10
|
-
export {
|
|
11
|
-
s as buildRecursiveParamFieldId,
|
|
12
|
-
m as getRecursiveParentName
|
|
13
|
-
};
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { jsx as n, jsxs as u } from "react/jsx-runtime";
|
|
2
|
-
import { useState as d } from "react";
|
|
3
|
-
import { SectionHeading as f } from "../../../api-playground/EndpointFields/components/SectionHeading.js";
|
|
4
|
-
import { Classes as y } from "../../types/index.js";
|
|
5
|
-
import { cn as z } from "../../../utils/cn.js";
|
|
6
|
-
import { PrimitiveParamField as o } from "./fields/PrimitiveParamField.js";
|
|
7
|
-
const T = ({
|
|
8
|
-
apiReferenceData: m
|
|
9
|
-
}) => {
|
|
10
|
-
var c;
|
|
11
|
-
const [a, l] = d(0), s = (c = m.dependencies) == null ? void 0 : c.processedSecurityOptions;
|
|
12
|
-
if (!s) return null;
|
|
13
|
-
const p = s[a];
|
|
14
|
-
if (!p) return null;
|
|
15
|
-
const { scheme: e, schema: t } = p, i = [];
|
|
16
|
-
if (e.type === "apiKey" && "name" in e && "in" in e)
|
|
17
|
-
i.push(
|
|
18
|
-
/* @__PURE__ */ n(
|
|
19
|
-
o,
|
|
20
|
-
{
|
|
21
|
-
fieldType: "authorization",
|
|
22
|
-
schema: t,
|
|
23
|
-
typeOptions: ["string"],
|
|
24
|
-
name: e.name
|
|
25
|
-
},
|
|
26
|
-
`${e.in}:${e.name}`
|
|
27
|
-
)
|
|
28
|
-
);
|
|
29
|
-
else if (e.type === "http" && "scheme" in e)
|
|
30
|
-
if (e.scheme === "basic") {
|
|
31
|
-
const r = { ...t, type: "string" };
|
|
32
|
-
i.push(
|
|
33
|
-
/* @__PURE__ */ n(
|
|
34
|
-
o,
|
|
35
|
-
{
|
|
36
|
-
fieldType: "authorization",
|
|
37
|
-
schema: r,
|
|
38
|
-
typeOptions: ["string"],
|
|
39
|
-
name: t.title ?? "Authorization"
|
|
40
|
-
},
|
|
41
|
-
`header:${t.title}`
|
|
42
|
-
)
|
|
43
|
-
);
|
|
44
|
-
} else e.scheme === "bearer" && i.push(
|
|
45
|
-
/* @__PURE__ */ n(
|
|
46
|
-
o,
|
|
47
|
-
{
|
|
48
|
-
fieldType: "authorization",
|
|
49
|
-
schema: t,
|
|
50
|
-
typeOptions: ["string"],
|
|
51
|
-
name: t.title ?? "Authorization"
|
|
52
|
-
},
|
|
53
|
-
`header:${t.title}`
|
|
54
|
-
)
|
|
55
|
-
);
|
|
56
|
-
else e.type === "oauth2" && i.push(
|
|
57
|
-
/* @__PURE__ */ n(
|
|
58
|
-
o,
|
|
59
|
-
{
|
|
60
|
-
fieldType: "authorization",
|
|
61
|
-
schema: t,
|
|
62
|
-
typeOptions: ["string"],
|
|
63
|
-
name: t.title ?? "Authorization"
|
|
64
|
-
},
|
|
65
|
-
`header:${t.title}`
|
|
66
|
-
)
|
|
67
|
-
);
|
|
68
|
-
if (i.length === 0) return null;
|
|
69
|
-
const h = s.map(
|
|
70
|
-
(r) => r.schema.title ?? "Authorization"
|
|
71
|
-
);
|
|
72
|
-
return /* @__PURE__ */ u("div", { className: z(y.APISection), children: [
|
|
73
|
-
/* @__PURE__ */ n(
|
|
74
|
-
f,
|
|
75
|
-
{
|
|
76
|
-
title: "Authorizations",
|
|
77
|
-
options: h,
|
|
78
|
-
selectedIndex: a,
|
|
79
|
-
onSelectOption: l
|
|
80
|
-
}
|
|
81
|
-
),
|
|
82
|
-
i
|
|
83
|
-
] });
|
|
84
|
-
};
|
|
85
|
-
export {
|
|
86
|
-
T as EndpointSecurity
|
|
87
|
-
};
|