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