@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
|
@@ -1,252 +1,25 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
import { Tab as X } from "../components/content-components/tabs/tab.js";
|
|
15
|
-
const re = " | null";
|
|
16
|
-
function ke({ pageMetadata: s }) {
|
|
17
|
-
return /* @__PURE__ */ t("div", { className: b("mint:mb-14"), children: s.openapi && /* @__PURE__ */ t(ie, {}) });
|
|
18
|
-
}
|
|
19
|
-
const ie = () => {
|
|
20
|
-
const { apiReferenceData2: s } = T(v);
|
|
21
|
-
if (!s.operation)
|
|
1
|
+
import { jsx as t, jsxs as m, Fragment as p } from "react/jsx-runtime";
|
|
2
|
+
import { memo as c, useContext as f } from "react";
|
|
3
|
+
import { Security as l } from "./components/EndpointFields/Security.js";
|
|
4
|
+
import { Parameters as u } from "./components/EndpointFields/Parameters.js";
|
|
5
|
+
import { Body as h } from "./components/EndpointFields/Body.js";
|
|
6
|
+
import { Response as y } from "./components/EndpointFields/Response.js";
|
|
7
|
+
import { ApiReferenceContext2 as R } from "../contexts/ConfigContext.js";
|
|
8
|
+
import { EndpointLocationProvider as o } from "../contexts/EndpointLocationContext.js";
|
|
9
|
+
const A = c(function({ pageMetadata: r }) {
|
|
10
|
+
return /* @__PURE__ */ t("div", { className: "mint:mb-14", children: r.openapi && /* @__PURE__ */ t(x, {}) });
|
|
11
|
+
}), x = () => {
|
|
12
|
+
const { apiReferenceData2: e } = f(R);
|
|
13
|
+
if (!e.operation)
|
|
22
14
|
return null;
|
|
23
|
-
const { dependencies:
|
|
24
|
-
return /* @__PURE__ */
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
] });
|
|
30
|
-
}, ce = () => {
|
|
31
|
-
var o;
|
|
32
|
-
const { apiReferenceData2: s } = T(v), n = f(() => {
|
|
33
|
-
var c;
|
|
34
|
-
return ((c = s.dependencies) == null ? void 0 : c.parameters) ?? {};
|
|
35
|
-
}, [(o = s.dependencies) == null ? void 0 : o.parameters]), l = f(() => {
|
|
36
|
-
const c = {
|
|
37
|
-
header: {},
|
|
38
|
-
path: {},
|
|
39
|
-
query: {},
|
|
40
|
-
cookie: {}
|
|
41
|
-
};
|
|
42
|
-
return Object.entries(n).forEach(([i, r]) => {
|
|
43
|
-
const m = r.in;
|
|
44
|
-
m in c && c[m] && (c[m][r.name] = r);
|
|
45
|
-
}), c;
|
|
46
|
-
}, [n]);
|
|
47
|
-
return /* @__PURE__ */ S(V, { children: [
|
|
48
|
-
/* @__PURE__ */ t(I, { title: "Headers", parameters: l.header ?? {} }),
|
|
49
|
-
/* @__PURE__ */ t(I, { title: "Path Parameters", parameters: l.path ?? {} }),
|
|
50
|
-
/* @__PURE__ */ t(I, { title: "Query Parameters", parameters: l.query ?? {} }),
|
|
51
|
-
/* @__PURE__ */ t(I, { title: "Cookies", parameters: l.cookie ?? {} })
|
|
52
|
-
] });
|
|
53
|
-
}, I = ({
|
|
54
|
-
parameters: s,
|
|
55
|
-
title: n
|
|
56
|
-
}) => {
|
|
57
|
-
const { apiReferenceData2: l } = T(v);
|
|
58
|
-
if (Object.keys(s).length === 0)
|
|
59
|
-
return null;
|
|
60
|
-
const o = Object.entries(s).map(([c, i]) => {
|
|
61
|
-
var r;
|
|
62
|
-
return !i.schema || !g(i.schema) ? null : /* @__PURE__ */ t(
|
|
63
|
-
x,
|
|
64
|
-
{
|
|
65
|
-
schema: i.schema,
|
|
66
|
-
displayFlattened: !0,
|
|
67
|
-
fieldType: "parameter",
|
|
68
|
-
name: i.name,
|
|
69
|
-
style: i.style,
|
|
70
|
-
explode: i.explode,
|
|
71
|
-
required: i.required,
|
|
72
|
-
schemas: (r = l.dependencies) == null ? void 0 : r.schemas
|
|
73
|
-
},
|
|
74
|
-
i.name
|
|
75
|
-
);
|
|
76
|
-
});
|
|
77
|
-
return /* @__PURE__ */ S("div", { className: b(A.APISection), children: [
|
|
78
|
-
/* @__PURE__ */ t(R, { title: n }),
|
|
79
|
-
o
|
|
80
|
-
] });
|
|
81
|
-
}, ae = () => {
|
|
82
|
-
var O, j;
|
|
83
|
-
const [s, n] = P(0), { apiReferenceData2: l } = T(v), o = (O = l.dependencies) == null ? void 0 : O.requestBody, c = o == null ? void 0 : o.description, i = Object.keys((o == null ? void 0 : o.content) ?? {}), r = Object.fromEntries(
|
|
84
|
-
i.map((p) => {
|
|
85
|
-
var h;
|
|
86
|
-
return [p, (h = o == null ? void 0 : o.content[p]) == null ? void 0 : h.schema];
|
|
87
|
-
}).filter((p) => p[1] !== void 0)
|
|
88
|
-
), m = Object.values(r)[s];
|
|
89
|
-
return m === void 0 ? null : /* @__PURE__ */ S("div", { className: b(A.APISection), children: [
|
|
90
|
-
i.length > 1 ? /* @__PURE__ */ t(
|
|
91
|
-
R,
|
|
92
|
-
{
|
|
93
|
-
title: "Body",
|
|
94
|
-
options: i,
|
|
95
|
-
selectedIndex: s,
|
|
96
|
-
onSelectOption: n,
|
|
97
|
-
subtitle: c
|
|
98
|
-
}
|
|
99
|
-
) : /* @__PURE__ */ t(R, { title: "Body", rightElement: i[0], subtitle: c }),
|
|
100
|
-
Object.keys(r).length > 1 ? /* @__PURE__ */ t("div", { className: "mint:mt-4 mint:rounded-xl mint:border mint:border-gray-100 mint:px-4 mint:pt-2 mint:dark:border-white/10", children: /* @__PURE__ */ t(
|
|
101
|
-
W,
|
|
102
|
-
{
|
|
103
|
-
className: "mint:-mt-1! mint:border-gray-100! mint:mb-0! mint:dark:border-white/10!",
|
|
104
|
-
children: Object.values(r).map((p, h) => {
|
|
105
|
-
var k;
|
|
106
|
-
return /* @__PURE__ */ t(X, { title: Object.keys(r)[h] ?? "", children: /* @__PURE__ */ t(
|
|
107
|
-
x,
|
|
108
|
-
{
|
|
109
|
-
schema: p,
|
|
110
|
-
fieldType: "body",
|
|
111
|
-
displayFlattened: !0,
|
|
112
|
-
schemas: (k = l.dependencies) == null ? void 0 : k.schemas
|
|
113
|
-
}
|
|
114
|
-
) }, h);
|
|
115
|
-
})
|
|
116
|
-
},
|
|
117
|
-
s
|
|
118
|
-
) }) : /* @__PURE__ */ t(
|
|
119
|
-
x,
|
|
120
|
-
{
|
|
121
|
-
schema: m,
|
|
122
|
-
fieldType: "body",
|
|
123
|
-
displayFlattened: !0,
|
|
124
|
-
schemas: (j = l.dependencies) == null ? void 0 : j.schemas
|
|
125
|
-
}
|
|
126
|
-
)
|
|
127
|
-
] });
|
|
128
|
-
}, le = () => {
|
|
129
|
-
var B, $, _, L;
|
|
130
|
-
const { apiReferenceData2: s } = T(v), [n, l] = P(0), [o, c] = P(0), i = f(() => {
|
|
131
|
-
var e;
|
|
132
|
-
return ((e = s.dependencies) == null ? void 0 : e.responses) ?? {};
|
|
133
|
-
}, [(B = s.dependencies) == null ? void 0 : B.responses]), r = f(() => {
|
|
134
|
-
var a;
|
|
135
|
-
const e = (a = s.operation) == null ? void 0 : a.responses;
|
|
136
|
-
return e ? Object.entries(e).map(([u, E]) => {
|
|
137
|
-
const y = i[E];
|
|
138
|
-
return [u, (y == null ? void 0 : y.content) ?? {}];
|
|
139
|
-
}) : [];
|
|
140
|
-
}, [i, ($ = s.operation) == null ? void 0 : $.responses]), m = f(() => {
|
|
141
|
-
const e = r[n];
|
|
142
|
-
return !e || !e[1] ? [] : Object.entries(e[1]);
|
|
143
|
-
}, [r, n]), O = U(
|
|
144
|
-
(e) => {
|
|
145
|
-
l(e);
|
|
146
|
-
const a = r[e];
|
|
147
|
-
a && a[1] && o >= Object.entries(a[1]).length && c(0);
|
|
148
|
-
},
|
|
149
|
-
[r, o]
|
|
150
|
-
), j = U((e) => {
|
|
151
|
-
c(e);
|
|
152
|
-
}, []), {
|
|
153
|
-
contentType: p,
|
|
154
|
-
schema: h,
|
|
155
|
-
description: k
|
|
156
|
-
} = f(() => {
|
|
157
|
-
var G, Q;
|
|
158
|
-
const e = m[o];
|
|
159
|
-
if (!e)
|
|
160
|
-
return { contentType: void 0, schema: void 0, description: void 0 };
|
|
161
|
-
const [a, u] = e, E = u.schema, y = r[n], M = y ? String(y[0]) : void 0, z = M ? (Q = (G = s.operation) == null ? void 0 : G.responses) == null ? void 0 : Q[M] : void 0, N = z ? i[z] : void 0, H = N == null ? void 0 : N.description;
|
|
162
|
-
return a === "_mintlify/placeholder" ? {
|
|
163
|
-
schema: E,
|
|
164
|
-
contentType: "",
|
|
165
|
-
description: H
|
|
166
|
-
} : {
|
|
167
|
-
schema: E,
|
|
168
|
-
contentType: a,
|
|
169
|
-
description: H
|
|
170
|
-
};
|
|
171
|
-
}, [
|
|
172
|
-
m,
|
|
173
|
-
o,
|
|
174
|
-
r,
|
|
175
|
-
n,
|
|
176
|
-
i,
|
|
177
|
-
(_ = s.operation) == null ? void 0 : _.responses
|
|
178
|
-
]);
|
|
179
|
-
if (!h) return null;
|
|
180
|
-
let d = [h];
|
|
181
|
-
const C = se(d);
|
|
182
|
-
d.some((e) => g(e) && e.type === "null") && (d = d.filter(
|
|
183
|
-
(e) => !g(e) || e.type !== "null"
|
|
184
|
-
));
|
|
185
|
-
const Y = r.map(([e, a]) => ({
|
|
186
|
-
label: String(e),
|
|
187
|
-
schema: a
|
|
188
|
-
})), Z = m.filter(([e]) => e !== "_mintlify/placeholder").map(([e, a]) => ({
|
|
189
|
-
label: String(e),
|
|
190
|
-
schema: a
|
|
191
|
-
})), w = r[0] ? `${r[0][0]}` : "", F = p === "" ? "" : `${p}`, ee = `${w}${w && F ? " - " : ""}${F}`, q = r.length > 1, D = m.length > 1, te = q || D;
|
|
192
|
-
return /* @__PURE__ */ S("div", { className: b(A.APISection), children: [
|
|
193
|
-
/* @__PURE__ */ t(
|
|
194
|
-
R,
|
|
195
|
-
{
|
|
196
|
-
title: "Response",
|
|
197
|
-
subtitle: k,
|
|
198
|
-
rightElement: te ? /* @__PURE__ */ S("div", { className: "mint:flex mint:items-center mint:gap-x-3 mint:font-mono mint:text-xs", children: [
|
|
199
|
-
/* @__PURE__ */ t(
|
|
200
|
-
J,
|
|
201
|
-
{
|
|
202
|
-
onSelectOption: O,
|
|
203
|
-
options: Y,
|
|
204
|
-
selectedIndex: n,
|
|
205
|
-
className: b(
|
|
206
|
-
"mint:bg-transparent mint:dark:bg-transparent",
|
|
207
|
-
q && "mint:hover:text-zinc-950 mint:dark:hover:text-white mint:transition-all"
|
|
208
|
-
)
|
|
209
|
-
}
|
|
210
|
-
),
|
|
211
|
-
/* @__PURE__ */ t(
|
|
212
|
-
J,
|
|
213
|
-
{
|
|
214
|
-
onSelectOption: j,
|
|
215
|
-
options: Z,
|
|
216
|
-
selectedIndex: o,
|
|
217
|
-
className: b(
|
|
218
|
-
"mint:bg-transparent mint:dark:bg-transparent",
|
|
219
|
-
D && "mint:hover:text-zinc-950 mint:dark:hover:text-white mint:transition-all"
|
|
220
|
-
)
|
|
221
|
-
}
|
|
222
|
-
)
|
|
223
|
-
] }) : ee,
|
|
224
|
-
children: C[0] && C[0].includes(re) && /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(oe, { className: "mint:max-w-fit mint:text-xs mint:font-medium mint:font-mono mint:break-words", children: C[0] }) })
|
|
225
|
-
}
|
|
226
|
-
),
|
|
227
|
-
d.length > 1 ? /* @__PURE__ */ t(W, { children: d.map((e, a) => {
|
|
228
|
-
var u;
|
|
229
|
-
return /* @__PURE__ */ t(X, { title: C[a] ?? "", children: g(e) && /* @__PURE__ */ t(
|
|
230
|
-
x,
|
|
231
|
-
{
|
|
232
|
-
schema: e,
|
|
233
|
-
fieldType: "response",
|
|
234
|
-
displayFlattened: !0,
|
|
235
|
-
schemas: (u = s.dependencies) == null ? void 0 : u.schemas
|
|
236
|
-
}
|
|
237
|
-
) }, a);
|
|
238
|
-
}) }) : d[0] && g(d[0]) && /* @__PURE__ */ t(
|
|
239
|
-
x,
|
|
240
|
-
{
|
|
241
|
-
schema: d[0],
|
|
242
|
-
fieldType: "response",
|
|
243
|
-
displayFlattened: !0,
|
|
244
|
-
schemas: (L = s.dependencies) == null ? void 0 : L.schemas
|
|
245
|
-
}
|
|
246
|
-
)
|
|
15
|
+
const { dependencies: r } = e, s = (r == null ? void 0 : r.processedSecurityOptions) && r.processedSecurityOptions.length > 0, a = (r == null ? void 0 : r.parameters) && Object.keys(r.parameters).length > 0, i = r == null ? void 0 : r.requestBody, n = (r == null ? void 0 : r.responses) && Object.keys(r.responses).length > 0;
|
|
16
|
+
return /* @__PURE__ */ m(p, { children: [
|
|
17
|
+
s && /* @__PURE__ */ t(l, { apiReferenceData: e }),
|
|
18
|
+
a && /* @__PURE__ */ t(u, { apiReferenceData: e }),
|
|
19
|
+
i && /* @__PURE__ */ t(o, { location: "request", children: /* @__PURE__ */ t(h, { apiReferenceData: e }) }),
|
|
20
|
+
n && /* @__PURE__ */ t(o, { location: "response", children: /* @__PURE__ */ t(y, { apiReferenceData: e }) })
|
|
247
21
|
] });
|
|
248
22
|
};
|
|
249
23
|
export {
|
|
250
|
-
|
|
251
|
-
re as orNullTypeString
|
|
24
|
+
A as ApiFields
|
|
252
25
|
};
|
|
@@ -1,51 +1,63 @@
|
|
|
1
1
|
import { jsxs as n, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
import { useState as u } from "react";
|
|
3
|
+
import { BasePathSelector as x } from "../api-playground/ApiPlayground/components/BasePathSelector.js";
|
|
4
|
+
import { PrettyPath as h } from "../api-playground/ApiPlayground/components/PrettyPath.js";
|
|
5
|
+
import { MethodPill as y } from "../components/Api/MethodPill.js";
|
|
6
|
+
import { cn as v } from "../utils/cn.js";
|
|
7
|
+
import { copyToClipboard as C } from "../utils/copyToClipboard.js";
|
|
8
|
+
import { useCopyPathWithInputs as P } from "./hooks/useCopyPathWithInputs.js";
|
|
9
|
+
const W = ({
|
|
10
|
+
baseUrl: r,
|
|
11
|
+
baseUrlOptions: s,
|
|
9
12
|
selectedBaseUrlIndex: m,
|
|
10
|
-
setSelectedBaseUrlIndex:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
13
|
+
setSelectedBaseUrlIndex: a,
|
|
14
|
+
display: w,
|
|
15
|
+
path: i,
|
|
16
|
+
method: o,
|
|
17
|
+
onBaseUrlChange: c,
|
|
18
|
+
isInPlaygroundModal: p
|
|
19
|
+
}) => {
|
|
20
|
+
const [l, e] = u(!1), f = P({
|
|
21
|
+
path: i,
|
|
22
|
+
baseUrl: r
|
|
23
|
+
}), d = async () => {
|
|
24
|
+
await C(f) === "success" && (e(!0), setTimeout(() => {
|
|
25
|
+
e(!1);
|
|
26
|
+
}, 2e3));
|
|
27
|
+
};
|
|
28
|
+
return /* @__PURE__ */ n(
|
|
29
|
+
"div",
|
|
30
|
+
{
|
|
31
|
+
className: v(
|
|
32
|
+
"mint:relative mint:flex-1 mint:flex mint:gap-2 mint:min-w-0 mint:items-center mint:p-1.5 mint:pr-0 mint:cursor-pointer mint:overflow-hidden mint:rounded-xl"
|
|
33
|
+
),
|
|
34
|
+
onClick: d,
|
|
35
|
+
children: [
|
|
36
|
+
/* @__PURE__ */ t(y, { method: o, isActive: !1 }),
|
|
37
|
+
/* @__PURE__ */ n("div", { className: "mint:flex mint:items-center mint:space-x-2 mint:overflow-x-auto mint:flex-1 mint:no-scrollbar", children: [
|
|
38
|
+
/* @__PURE__ */ t(
|
|
39
|
+
x,
|
|
40
|
+
{
|
|
41
|
+
baseUrlOptions: s,
|
|
42
|
+
selectedBaseUrlIndex: m,
|
|
43
|
+
setSelectedBaseUrlIndex: a,
|
|
44
|
+
onBaseUrlChange: c
|
|
45
|
+
}
|
|
46
|
+
),
|
|
47
|
+
/* @__PURE__ */ t(
|
|
48
|
+
h,
|
|
49
|
+
{
|
|
50
|
+
path: i,
|
|
51
|
+
method: o,
|
|
52
|
+
isCopiedActive: l,
|
|
53
|
+
hasGrayBackground: p
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
] })
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
};
|
|
49
61
|
export {
|
|
50
|
-
|
|
62
|
+
W as EndpointHeader
|
|
51
63
|
};
|
|
@@ -1,94 +1,98 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useContext as
|
|
3
|
-
import {
|
|
1
|
+
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as w, useState as P, useEffect as b } from "react";
|
|
3
|
+
import { useSelectedBaseUrl as v } from "./hooks/useSelectedBaseUrl.js";
|
|
4
|
+
import { SendPill as U } from "../api-playground/ApiPlayground/components/SendPill.js";
|
|
4
5
|
import { PageContext as E } from "../contexts/ConfigContext.js";
|
|
5
|
-
import { useApiPlaygroundDisplay as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
const
|
|
14
|
-
apiReferenceData:
|
|
15
|
-
operation:
|
|
6
|
+
import { useApiPlaygroundDisplay as I } from "../hooks/useApiPlaygroundDisplay.js";
|
|
7
|
+
import { ApiExamples as C } from "./ApiExamples.js";
|
|
8
|
+
import { ApiFields as S } from "./ApiFields.js";
|
|
9
|
+
import { EndpointHeader as N } from "./EndpointHeader.js";
|
|
10
|
+
import { Playground as A } from "./Playground.js";
|
|
11
|
+
import { ApiPlaygroundContext as k } from "./contexts/ApiPlaygroundContext.js";
|
|
12
|
+
import { Classes as B } from "./types/index.js";
|
|
13
|
+
import { cn as L } from "../utils/cn.js";
|
|
14
|
+
const J = ({
|
|
15
|
+
apiReferenceData: c,
|
|
16
|
+
operation: f,
|
|
16
17
|
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
17
|
-
children:
|
|
18
|
+
children: u
|
|
18
19
|
}) => {
|
|
19
|
-
const { path:
|
|
20
|
-
|
|
20
|
+
const { path: g, method: a, baseUrlOptions: o } = f, { pageMetadata: x } = w(E), d = I(), [l, m] = P(!1), s = d === "simple", { selectedBaseUrlIndex: h, setSelectedBaseUrlIndex: y, baseUrl: p } = v();
|
|
21
|
+
b(() => {
|
|
21
22
|
if (typeof window > "u") return;
|
|
22
23
|
new URLSearchParams(window.location.search).has("playground") && requestAnimationFrame(() => {
|
|
23
|
-
|
|
24
|
+
m(!0);
|
|
24
25
|
});
|
|
25
26
|
}, []);
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}, a = (n) => {
|
|
32
|
-
if (u(n), !(typeof window > "u"))
|
|
33
|
-
if (n) {
|
|
34
|
-
const t = new URL(window.location.href);
|
|
35
|
-
t.searchParams.set("playground", "open"), window.history.replaceState({}, "", t);
|
|
27
|
+
const r = (i) => {
|
|
28
|
+
if (m(i), !(typeof window > "u"))
|
|
29
|
+
if (i) {
|
|
30
|
+
const n = new URL(window.location.href);
|
|
31
|
+
n.searchParams.set("playground", "open"), window.history.replaceState({}, "", n);
|
|
36
32
|
} else {
|
|
37
|
-
const
|
|
38
|
-
|
|
33
|
+
const n = new URL(window.location.href);
|
|
34
|
+
n.searchParams.delete("playground"), window.history.replaceState({}, "", n);
|
|
39
35
|
}
|
|
40
36
|
};
|
|
41
|
-
return /* @__PURE__ */
|
|
42
|
-
|
|
37
|
+
return /* @__PURE__ */ t(
|
|
38
|
+
k.Provider,
|
|
43
39
|
{
|
|
44
40
|
value: {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
baseUrlOptions: r,
|
|
48
|
-
isPlaygroundExpanded: p,
|
|
49
|
-
setIsPlaygroundExpanded: a
|
|
41
|
+
isPlaygroundExpanded: l,
|
|
42
|
+
setIsPlaygroundExpanded: r
|
|
50
43
|
},
|
|
51
44
|
children: [
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
/* @__PURE__ */ e(
|
|
56
|
-
|
|
45
|
+
/* @__PURE__ */ t("div", { className: "mint:flex mint:flex-col mint:gap-8", id: "api-playground-2-operation-page", children: [
|
|
46
|
+
/* @__PURE__ */ t("div", { className: "mint:flex mint:w-full mint:flex-col mint:space-y-4", children: [
|
|
47
|
+
/* @__PURE__ */ e("div", { className: "mint:flex mint:items-center mint:gap-3 mint:border mint:border-gray-200 mint:dark:border-[#2d2d2d] mint:rounded-2xl mint:p-1.5", children: /* @__PURE__ */ t("div", { className: "mint:flex mint:items-center mint:gap-0 mint:flex-1 mint:bg-white mint:dark:bg-[#1a1a1a] mint:border mint:border-gray-200 mint:dark:border-[#2d2d2d] mint:rounded-2xl", children: [
|
|
48
|
+
/* @__PURE__ */ e(
|
|
49
|
+
N,
|
|
57
50
|
{
|
|
58
|
-
|
|
59
|
-
baseUrlOptions:
|
|
60
|
-
selectedBaseUrlIndex:
|
|
61
|
-
setSelectedBaseUrlIndex:
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
method: d,
|
|
51
|
+
baseUrl: p,
|
|
52
|
+
baseUrlOptions: o,
|
|
53
|
+
selectedBaseUrlIndex: h,
|
|
54
|
+
setSelectedBaseUrlIndex: y,
|
|
55
|
+
display: d,
|
|
56
|
+
path: g,
|
|
57
|
+
method: a,
|
|
66
58
|
onBaseUrlChange: () => {
|
|
67
59
|
},
|
|
68
60
|
isInPlaygroundModal: !1
|
|
69
61
|
}
|
|
70
|
-
)
|
|
71
|
-
|
|
72
|
-
|
|
62
|
+
),
|
|
63
|
+
s ? null : /* @__PURE__ */ e(
|
|
64
|
+
U,
|
|
73
65
|
{
|
|
74
66
|
label: "Try it",
|
|
75
|
-
method:
|
|
76
|
-
onClick: () =>
|
|
67
|
+
method: a,
|
|
68
|
+
onClick: () => r(!0)
|
|
77
69
|
}
|
|
78
70
|
)
|
|
79
|
-
] }),
|
|
80
|
-
/* @__PURE__ */ e("div", { className: "mint:mt-8 mint:lg:mt-0 mint:flex mint:flex-col mint:gap-6 mint:xl
|
|
71
|
+
] }) }),
|
|
72
|
+
/* @__PURE__ */ e("div", { className: "mint:mt-8 mint:lg:mt-0 mint:flex mint:flex-col mint:gap-6 mint:xl:hidden mint:max-h-[30rem]", children: /* @__PURE__ */ e(C, { noInputs: !0 }) })
|
|
81
73
|
] }),
|
|
82
|
-
/* @__PURE__ */
|
|
74
|
+
/* @__PURE__ */ t(
|
|
75
|
+
"div",
|
|
76
|
+
{
|
|
77
|
+
className: L(
|
|
78
|
+
B.Content,
|
|
79
|
+
"relative"
|
|
80
|
+
),
|
|
81
|
+
children: [
|
|
82
|
+
u,
|
|
83
|
+
/* @__PURE__ */ e(S, { pageMetadata: x })
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
)
|
|
83
87
|
] }),
|
|
84
|
-
!
|
|
85
|
-
|
|
88
|
+
!s && /* @__PURE__ */ e(
|
|
89
|
+
A,
|
|
86
90
|
{
|
|
87
|
-
isPlaygroundExpanded:
|
|
88
|
-
setIsPlaygroundExpanded:
|
|
89
|
-
baseUrl:
|
|
90
|
-
baseUrlOptions:
|
|
91
|
-
apiReferenceData:
|
|
91
|
+
isPlaygroundExpanded: l,
|
|
92
|
+
setIsPlaygroundExpanded: r,
|
|
93
|
+
baseUrl: p,
|
|
94
|
+
baseUrlOptions: o,
|
|
95
|
+
apiReferenceData: c
|
|
92
96
|
}
|
|
93
97
|
)
|
|
94
98
|
]
|
|
@@ -96,5 +100,5 @@ const V = ({
|
|
|
96
100
|
);
|
|
97
101
|
};
|
|
98
102
|
export {
|
|
99
|
-
|
|
103
|
+
J as OperationPage
|
|
100
104
|
};
|