@mintlify/msft-sdk 1.1.61 → 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/generateSnippet.js +1 -1
- 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/httpsnippet/src/helpers/code-builder.js +27 -0
- package/dist/httpsnippet/src/helpers/escape.js +11 -0
- package/dist/httpsnippet/src/helpers/headers.js +13 -0
- package/dist/httpsnippet/src/helpers/reducer.js +7 -0
- package/dist/httpsnippet/src/helpers/shell.js +5 -0
- package/dist/httpsnippet/src/helpers/url-format.js +35 -0
- package/dist/httpsnippet/src/helpers/url-parse.js +76 -0
- package/dist/httpsnippet/src/index.js +157 -0
- package/dist/httpsnippet/src/targets/c/libcurl/client.js +22 -0
- package/dist/httpsnippet/src/targets/c/target.js +15 -0
- package/dist/httpsnippet/src/targets/clojure/clj_http/client.js +120 -0
- package/dist/httpsnippet/src/targets/clojure/target.js +14 -0
- package/dist/httpsnippet/src/targets/csharp/httpclient/client.js +76 -0
- package/dist/httpsnippet/src/targets/csharp/restsharp/client.js +63 -0
- package/dist/httpsnippet/src/targets/csharp/target.js +17 -0
- package/dist/httpsnippet/src/targets/go/native/client.js +24 -0
- package/dist/httpsnippet/src/targets/go/target.js +15 -0
- package/dist/httpsnippet/src/targets/http/http1.1/client.js +34 -0
- package/dist/httpsnippet/src/targets/http/target.js +14 -0
- package/dist/httpsnippet/src/targets/index.js +43 -0
- package/dist/httpsnippet/src/targets/java/asynchttp/client.js +23 -0
- package/dist/httpsnippet/src/targets/java/nethttp/client.js +28 -0
- package/dist/httpsnippet/src/targets/java/okhttp/client.js +23 -0
- package/dist/httpsnippet/src/targets/java/target.js +20 -0
- package/dist/httpsnippet/src/targets/java/unirest/client.js +23 -0
- package/dist/httpsnippet/src/targets/javascript/axios/client.js +50 -0
- package/dist/httpsnippet/src/targets/javascript/fetch/client.js +61 -0
- package/dist/httpsnippet/src/targets/javascript/jquery/client.js +51 -0
- package/dist/httpsnippet/src/targets/javascript/target.js +20 -0
- package/dist/httpsnippet/src/targets/javascript/xhr/client.js +49 -0
- package/dist/httpsnippet/src/targets/json/native/client.js +39 -0
- package/dist/httpsnippet/src/targets/json/target.js +14 -0
- package/dist/httpsnippet/src/targets/kotlin/okhttp/client.js +23 -0
- package/dist/httpsnippet/src/targets/kotlin/target.js +14 -0
- package/dist/httpsnippet/src/targets/node/axios/client.js +40 -0
- package/dist/httpsnippet/src/targets/node/fetch/client.js +68 -0
- package/dist/httpsnippet/src/targets/node/native/client.js +45 -0
- package/dist/httpsnippet/src/targets/node/target.js +19 -0
- package/dist/httpsnippet/src/targets/objc/helpers.js +27 -0
- package/dist/httpsnippet/src/targets/objc/nsurlsession/client.js +63 -0
- package/dist/httpsnippet/src/targets/objc/target.js +14 -0
- package/dist/httpsnippet/src/targets/ocaml/cohttp/client.js +32 -0
- package/dist/httpsnippet/src/targets/ocaml/target.js +14 -0
- package/dist/httpsnippet/src/targets/php/curl/client.js +85 -0
- package/dist/httpsnippet/src/targets/php/guzzle/client.js +57 -0
- package/dist/httpsnippet/src/targets/php/helpers.js +65 -0
- package/dist/httpsnippet/src/targets/php/http1/client.js +28 -0
- package/dist/httpsnippet/src/targets/php/http2/client.js +55 -0
- package/dist/httpsnippet/src/targets/php/target.js +21 -0
- package/dist/httpsnippet/src/targets/powershell/common.js +19 -0
- package/dist/httpsnippet/src/targets/powershell/restmethod/client.js +14 -0
- package/dist/httpsnippet/src/targets/powershell/target.js +16 -0
- package/dist/httpsnippet/src/targets/powershell/webrequest/client.js +14 -0
- package/dist/httpsnippet/src/targets/python/helpers.js +33 -0
- package/dist/httpsnippet/src/targets/python/requests/client.js +74 -0
- package/dist/httpsnippet/src/targets/python/target.js +15 -0
- package/dist/httpsnippet/src/targets/r/httr/client.js +46 -0
- package/dist/httpsnippet/src/targets/r/target.js +14 -0
- package/dist/httpsnippet/src/targets/ruby/native/client.js +37 -0
- package/dist/httpsnippet/src/targets/ruby/target.js +14 -0
- package/dist/httpsnippet/src/targets/shell/curl/client.js +92 -0
- package/dist/httpsnippet/src/targets/shell/httpie/client.js +56 -0
- package/dist/httpsnippet/src/targets/shell/target.js +19 -0
- package/dist/httpsnippet/src/targets/shell/wget/client.js +30 -0
- package/dist/httpsnippet/src/targets/swift/helpers.js +38 -0
- package/dist/httpsnippet/src/targets/swift/target.js +14 -0
- package/dist/httpsnippet/src/targets/swift/urlsession/client.js +59 -0
- 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 +17 -4
- 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,103 +1,121 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { v4 as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { jsx as p, Fragment as w, jsxs as N } from "react/jsx-runtime";
|
|
2
|
+
import { useState as V } from "react";
|
|
3
|
+
import { v4 as W } from "uuid";
|
|
4
|
+
import { usePlaygroundInputsStore as F } from "../../../hooks/usePlaygroundInputsStore.js";
|
|
5
|
+
import { getUniqueInputKey as U } from "../../../schemaGraph/addUniqueKeysToSchema.js";
|
|
6
|
+
import { isSchemaObject as b, escapeDots as j, convertAnySchemaToOneOfs as z } from "../../../schemaGraph/utils.js";
|
|
7
|
+
import { AdditionalPropertyButton as C } from "../../../../api-playground/ApiPlayground/components/AdditionalPropertyButton.js";
|
|
8
|
+
import { DifferentiatedInput as A } from "./DifferentiatedInput.js";
|
|
9
|
+
const Y = ({
|
|
10
|
+
schema: n,
|
|
11
|
+
depth: d,
|
|
10
12
|
parentNames: m,
|
|
11
|
-
style:
|
|
12
|
-
explode:
|
|
13
|
-
inputKeyPrefix:
|
|
14
|
-
name:
|
|
13
|
+
style: K,
|
|
14
|
+
explode: O,
|
|
15
|
+
inputKeyPrefix: o,
|
|
16
|
+
name: c,
|
|
17
|
+
arrayIndices: i
|
|
15
18
|
}) => {
|
|
16
|
-
const
|
|
17
|
-
Object.entries(
|
|
18
|
-
if (
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
/* @__PURE__ */
|
|
22
|
-
|
|
19
|
+
const $ = F((t) => t.deleteInput), S = [];
|
|
20
|
+
Object.entries(n.properties ?? {}).forEach(([t, e]) => {
|
|
21
|
+
if (b(e)) {
|
|
22
|
+
const l = c ? [...m ?? [], c] : void 0;
|
|
23
|
+
S.push(
|
|
24
|
+
/* @__PURE__ */ p(
|
|
25
|
+
A,
|
|
23
26
|
{
|
|
24
|
-
name:
|
|
25
|
-
schema:
|
|
26
|
-
depth: (
|
|
27
|
-
parentNames:
|
|
28
|
-
style:
|
|
29
|
-
explode:
|
|
30
|
-
|
|
27
|
+
name: t,
|
|
28
|
+
schema: e,
|
|
29
|
+
depth: (d ?? 0) + 1,
|
|
30
|
+
parentNames: l,
|
|
31
|
+
style: K,
|
|
32
|
+
explode: O,
|
|
33
|
+
arrayIndices: i,
|
|
34
|
+
inputKeyPrefix: o
|
|
31
35
|
},
|
|
32
|
-
|
|
36
|
+
t
|
|
33
37
|
)
|
|
34
38
|
);
|
|
35
39
|
}
|
|
36
40
|
});
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
var
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
const v = n.additionalProperties !== !1, T = W(), [q, y] = V([]), P = [];
|
|
42
|
+
q.forEach((t) => {
|
|
43
|
+
var l;
|
|
44
|
+
const e = c ? [...m ?? [], c] : m;
|
|
45
|
+
if (b(n.additionalProperties)) {
|
|
46
|
+
const f = n.uniqueKey ?? "", h = f ? `${f}.${j(t)}` : j(t), r = { ...n.additionalProperties, uniqueKey: h }, s = U(o, r, i), u = () => {
|
|
47
|
+
$(s), y((a) => a.filter((I) => I !== t));
|
|
48
|
+
};
|
|
49
|
+
P.push(
|
|
50
|
+
/* @__PURE__ */ p(
|
|
51
|
+
A,
|
|
45
52
|
{
|
|
46
|
-
name:
|
|
47
|
-
schema:
|
|
48
|
-
depth: (
|
|
49
|
-
parentNames:
|
|
50
|
-
style:
|
|
51
|
-
explode:
|
|
52
|
-
|
|
53
|
+
name: t,
|
|
54
|
+
schema: r,
|
|
55
|
+
depth: (d ?? 0) + 1,
|
|
56
|
+
parentNames: e,
|
|
57
|
+
style: K,
|
|
58
|
+
explode: O,
|
|
59
|
+
arrayIndices: i,
|
|
60
|
+
inputKeyPrefix: o,
|
|
61
|
+
clearValue: u
|
|
53
62
|
},
|
|
54
|
-
|
|
63
|
+
t
|
|
55
64
|
)
|
|
56
65
|
);
|
|
57
66
|
} else {
|
|
58
|
-
const
|
|
59
|
-
oneOf: (
|
|
60
|
-
...
|
|
61
|
-
uniqueKey:
|
|
62
|
-
}))
|
|
67
|
+
const f = n.uniqueKey ?? "", h = z(), r = `${f}.${j(t)}.oneOf`, s = {
|
|
68
|
+
oneOf: (l = h.oneOf) == null ? void 0 : l.map((u, a) => ({
|
|
69
|
+
...u,
|
|
70
|
+
uniqueKey: `${r}.${a}`
|
|
71
|
+
})),
|
|
72
|
+
uniqueKey: r
|
|
63
73
|
};
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
74
|
+
if (b(s)) {
|
|
75
|
+
const u = () => {
|
|
76
|
+
const a = U(o, s, i);
|
|
77
|
+
$(a), y((I) => I.filter((E) => E !== t));
|
|
78
|
+
};
|
|
79
|
+
P.push(
|
|
80
|
+
/* @__PURE__ */ p(
|
|
81
|
+
A,
|
|
82
|
+
{
|
|
83
|
+
name: t,
|
|
84
|
+
schema: s,
|
|
85
|
+
depth: (d ?? 0) + 1,
|
|
86
|
+
parentNames: e,
|
|
87
|
+
style: K,
|
|
88
|
+
explode: O,
|
|
89
|
+
arrayIndices: i,
|
|
90
|
+
inputKeyPrefix: o,
|
|
91
|
+
clearValue: u
|
|
92
|
+
},
|
|
93
|
+
t
|
|
94
|
+
)
|
|
95
|
+
);
|
|
96
|
+
}
|
|
79
97
|
}
|
|
80
98
|
});
|
|
81
|
-
const
|
|
82
|
-
if (
|
|
83
|
-
return /* @__PURE__ */
|
|
84
|
-
const
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
},
|
|
88
|
-
return /* @__PURE__ */
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
99
|
+
const g = [...S, ...P];
|
|
100
|
+
if (d === 0)
|
|
101
|
+
return /* @__PURE__ */ p(w, { children: g });
|
|
102
|
+
const B = (t) => {
|
|
103
|
+
const e = [...q, t];
|
|
104
|
+
y(e);
|
|
105
|
+
}, D = [...Object.keys(n.properties ?? {}), ...q];
|
|
106
|
+
return /* @__PURE__ */ N(w, { children: [
|
|
107
|
+
g,
|
|
108
|
+
v ? /* @__PURE__ */ p(
|
|
109
|
+
C,
|
|
92
110
|
{
|
|
93
|
-
existingKeys:
|
|
94
|
-
onAddKey:
|
|
95
|
-
dataTestId: ("name" in
|
|
111
|
+
existingKeys: D,
|
|
112
|
+
onAddKey: B,
|
|
113
|
+
dataTestId: ("name" in n && n.name ? n.name : "") + "-additional-property-button"
|
|
96
114
|
},
|
|
97
|
-
"add-property-button" +
|
|
115
|
+
"add-property-button" + T
|
|
98
116
|
) : null
|
|
99
117
|
] });
|
|
100
118
|
};
|
|
101
119
|
export {
|
|
102
|
-
|
|
120
|
+
Y as ObjectInput
|
|
103
121
|
};
|
|
@@ -1,76 +1,84 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { isSchemaObject as
|
|
6
|
-
import { TypeDropdown as
|
|
7
|
-
import { DifferentiatedInput as
|
|
8
|
-
import { Tabs as
|
|
9
|
-
import { Tab as
|
|
10
|
-
const
|
|
11
|
-
name:
|
|
2
|
+
import { useState as L } from "react";
|
|
3
|
+
import { usePlaygroundInputsStore as h } from "../../../hooks/usePlaygroundInputsStore.js";
|
|
4
|
+
import { getUniqueInputKey as k } from "../../../schemaGraph/addUniqueKeysToSchema.js";
|
|
5
|
+
import { isSchemaObject as A, generateSimpleSchemaLabel as q, isObjectArray as v, generateSchemaOptionLabels as x } from "../../../schemaGraph/utils.js";
|
|
6
|
+
import { TypeDropdown as C } from "../../TypeDropdown.js";
|
|
7
|
+
import { DifferentiatedInput as O } from "./DifferentiatedInput.js";
|
|
8
|
+
import { Tabs as W } from "../../../../components/content-components/tabs/tabs.js";
|
|
9
|
+
import { Tab as U } from "../../../../components/content-components/tabs/tab.js";
|
|
10
|
+
const R = ({
|
|
11
|
+
name: p,
|
|
12
12
|
schema: r,
|
|
13
|
-
clearValue:
|
|
14
|
-
parentNames:
|
|
15
|
-
style:
|
|
16
|
-
explode:
|
|
17
|
-
inputKeyPrefix: s
|
|
13
|
+
clearValue: a,
|
|
14
|
+
parentNames: d,
|
|
15
|
+
style: f,
|
|
16
|
+
explode: u,
|
|
17
|
+
inputKeyPrefix: s,
|
|
18
|
+
arrayIndices: c,
|
|
19
|
+
isArrayChild: I,
|
|
20
|
+
isBody: y
|
|
18
21
|
}) => {
|
|
19
|
-
const [i,
|
|
20
|
-
label:
|
|
22
|
+
const [i, T] = L(0), n = "oneOf" in r && r.oneOf ? r.oneOf.filter(A) : [], g = n.map((e) => ({
|
|
23
|
+
label: q(e),
|
|
21
24
|
schema: e
|
|
22
|
-
})),
|
|
23
|
-
|
|
25
|
+
})), l = n[i], b = h((e) => e.setInput), j = h((e) => e.deleteInput), m = k(s, r, c), S = (e) => {
|
|
26
|
+
j(m);
|
|
27
|
+
const t = n[e];
|
|
28
|
+
t && "type" in t && t.type === "null" ? b(m, null) : b(m, void 0), T(e);
|
|
24
29
|
};
|
|
25
|
-
if (!
|
|
26
|
-
|
|
27
|
-
|
|
30
|
+
if (!l) return null;
|
|
31
|
+
const w = n.every((e) => e.type === "object" || v(e));
|
|
32
|
+
if (!I && w && y) {
|
|
33
|
+
const e = x(n);
|
|
28
34
|
return /* @__PURE__ */ o(
|
|
29
|
-
|
|
35
|
+
W,
|
|
30
36
|
{
|
|
31
|
-
|
|
32
|
-
|
|
37
|
+
defaultTabIndex: i,
|
|
38
|
+
onClickTab: S,
|
|
33
39
|
className: "mint:border-gray-100! mint:mb-4! mint:dark:border-white/10!",
|
|
34
|
-
children: e.map((
|
|
35
|
-
|
|
40
|
+
children: e.map((t) => /* @__PURE__ */ o(U, { title: t, children: /* @__PURE__ */ o(
|
|
41
|
+
O,
|
|
36
42
|
{
|
|
37
43
|
skipContainer: !0,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
+
arrayIndices: c,
|
|
45
|
+
name: p,
|
|
46
|
+
schema: l,
|
|
47
|
+
clearValue: a,
|
|
48
|
+
parentNames: d,
|
|
49
|
+
style: f,
|
|
50
|
+
explode: u,
|
|
44
51
|
inputKeyPrefix: s
|
|
45
52
|
}
|
|
46
|
-
) },
|
|
53
|
+
) }, t))
|
|
47
54
|
}
|
|
48
55
|
);
|
|
49
56
|
}
|
|
50
|
-
const
|
|
57
|
+
const D = g.filter(
|
|
51
58
|
({ schema: e }) => e.type !== "null"
|
|
52
59
|
);
|
|
53
60
|
return /* @__PURE__ */ o(
|
|
54
|
-
|
|
61
|
+
O,
|
|
55
62
|
{
|
|
56
|
-
name:
|
|
57
|
-
schema:
|
|
63
|
+
name: p,
|
|
64
|
+
schema: l,
|
|
58
65
|
typeDropdown: /* @__PURE__ */ o(
|
|
59
|
-
|
|
66
|
+
C,
|
|
60
67
|
{
|
|
61
|
-
options:
|
|
68
|
+
options: D,
|
|
62
69
|
selectedIndex: i,
|
|
63
|
-
onSelectOption:
|
|
70
|
+
onSelectOption: S
|
|
64
71
|
}
|
|
65
72
|
),
|
|
66
|
-
clearValue:
|
|
67
|
-
parentNames:
|
|
68
|
-
style:
|
|
69
|
-
explode:
|
|
70
|
-
inputKeyPrefix: s
|
|
73
|
+
clearValue: a,
|
|
74
|
+
parentNames: d,
|
|
75
|
+
style: f,
|
|
76
|
+
explode: u,
|
|
77
|
+
inputKeyPrefix: s,
|
|
78
|
+
arrayIndices: c
|
|
71
79
|
}
|
|
72
80
|
);
|
|
73
81
|
};
|
|
74
82
|
export {
|
|
75
|
-
|
|
83
|
+
R as OneOfInput
|
|
76
84
|
};
|
|
@@ -1,51 +1,52 @@
|
|
|
1
1
|
import { jsxs as c, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { isBoolean as
|
|
3
|
-
import { ChevronDownIcon as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
2
|
+
import { isBoolean as x, isString as S, isNumber as b, isInteger as v } from "../../../../common/guards.js";
|
|
3
|
+
import { ChevronDownIcon as y } from "lucide-react";
|
|
4
|
+
import { usePlaygroundInput as I } from "../../../hooks/usePlaygroundInputsStore.js";
|
|
5
|
+
import { getUniqueInputKey as w } from "../../../schemaGraph/addUniqueKeysToSchema.js";
|
|
6
|
+
import { getSchemaPlaceholder as N } from "../../../schemaGraph/utils.js";
|
|
7
|
+
import { useSelectedLocale as k } from "../../../../utils/locales/index.js";
|
|
8
|
+
import { cn as P } from "../../../../utils/cn.js";
|
|
8
9
|
const U = ({
|
|
9
10
|
name: a,
|
|
10
11
|
schema: n,
|
|
11
12
|
inputKeyPrefix: u,
|
|
12
13
|
enumType: m,
|
|
13
|
-
|
|
14
|
+
arrayIndices: p
|
|
14
15
|
}) => {
|
|
15
|
-
const g =
|
|
16
|
+
const g = k(), l = N(n), d = n.type === "boolean" ? [!0, !1] : n.enum ?? [], r = w(u, n, p), { value: f, setInput: s } = I(r), i = ((t, e) => {
|
|
16
17
|
switch (t) {
|
|
17
18
|
case "integer":
|
|
18
|
-
return y(e) ? e : void 0;
|
|
19
|
-
case "number":
|
|
20
19
|
return v(e) ? e : void 0;
|
|
21
|
-
case "
|
|
20
|
+
case "number":
|
|
22
21
|
return b(e) ? e : void 0;
|
|
23
|
-
case "
|
|
22
|
+
case "string":
|
|
24
23
|
return S(e) ? e : void 0;
|
|
24
|
+
case "boolean":
|
|
25
|
+
return x(e) ? e : void 0;
|
|
25
26
|
default:
|
|
26
27
|
return;
|
|
27
28
|
}
|
|
28
|
-
})(m,
|
|
29
|
+
})(m, f), h = (t) => {
|
|
29
30
|
m === "boolean" ? s(r, t.target.value === "true") : s(r, t.target.value);
|
|
30
31
|
};
|
|
31
32
|
return /* @__PURE__ */ c("div", { className: "mint:relative", children: [
|
|
32
33
|
/* @__PURE__ */ c(
|
|
33
34
|
"select",
|
|
34
35
|
{
|
|
35
|
-
className:
|
|
36
|
+
className: P(
|
|
36
37
|
"mint:relative mint:text-playground-input mint:w-full mint:text-left mint:flex-1 mint:outline-0 mint:cursor-pointer mint:bg-transparent",
|
|
37
38
|
i !== void 0 ? "mint:text-gray-900! mint:dark:text-gray-100!" : "mint:text-gray-400! mint:dark:text-white/30!"
|
|
38
39
|
),
|
|
39
40
|
value: (i == null ? void 0 : i.toString()) ?? "",
|
|
40
41
|
"aria-label": l ?? g["aria.selectOption"].replace("{name}", a || "option"),
|
|
41
|
-
onChange:
|
|
42
|
+
onChange: h,
|
|
42
43
|
children: [
|
|
43
44
|
/* @__PURE__ */ o("option", { value: "", disabled: !0, children: l ?? `select ${a || "option"}` }),
|
|
44
|
-
|
|
45
|
+
d.map((t) => /* @__PURE__ */ o("option", { value: t.toString(), children: t.toString() }, t.toString()))
|
|
45
46
|
]
|
|
46
47
|
}
|
|
47
48
|
),
|
|
48
|
-
/* @__PURE__ */ o(
|
|
49
|
+
/* @__PURE__ */ o(y, { className: "mint:absolute mint:right-2 mint:top-1/2 mint:-translate-y-1/2 mint:h-4 mint:w-4 mint:text-gray-400 mint:dark:text-white/30 mint:pointer-events-none" })
|
|
49
50
|
] });
|
|
50
51
|
};
|
|
51
52
|
export {
|
|
@@ -1,34 +1,35 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { isString as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { jsxs as v, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { isString as y } from "../../../../common/guards.js";
|
|
3
|
+
import { usePlaygroundInput as I } from "../../../hooks/usePlaygroundInputsStore.js";
|
|
4
|
+
import { getUniqueInputKey as b } from "../../../schemaGraph/addUniqueKeysToSchema.js";
|
|
5
|
+
import { getSchemaPlaceholder as P } from "../../../schemaGraph/utils.js";
|
|
6
|
+
import { useSelectedLocale as S } from "../../../../utils/locales/index.js";
|
|
7
|
+
import { Ids as j } from "../../../types/index.js";
|
|
8
|
+
const A = ({ name: t, schema: i, inputKeyPrefix: p, arrayIndices: d }) => {
|
|
9
|
+
const f = S(), l = P(i), { prefix: e, placeholder: a } = k(i.format), r = b(p, i, d), { value: s, setInput: m } = I(r), n = y(s) ? s : void 0, g = e && (n != null && n.startsWith(e)) ? n.substring(e.length) : n, x = (o) => {
|
|
9
10
|
const u = `${e ?? ""}${o}`;
|
|
10
|
-
u ?
|
|
11
|
-
},
|
|
12
|
-
|
|
11
|
+
u ? m(r, u) : m(r, void 0);
|
|
12
|
+
}, h = (o) => {
|
|
13
|
+
x(o.target.value);
|
|
13
14
|
};
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
+
return /* @__PURE__ */ v("div", { className: "mint:relative mint:flex mint:flex-1 mint:items-center", children: [
|
|
15
16
|
/* @__PURE__ */ c("div", { className: "mint:absolute mint:left-2.5 mint:top-0 mint:bottom-0 mint:flex mint:items-center mint:justify-center mint:text-sm mint:text-gray-800 mint:dark:text-gray-100", children: e }),
|
|
16
17
|
/* @__PURE__ */ c(
|
|
17
18
|
"input",
|
|
18
19
|
{
|
|
19
|
-
id:
|
|
20
|
+
id: j.APIPlaygroundInput,
|
|
20
21
|
className: "mint:flex-1 mint:min-w-0 mint:bg-transparent mint:outline-0 mint:text-playground-input",
|
|
21
22
|
style: { paddingLeft: e ? e.length * 0.52 + "rem" : void 0 },
|
|
22
|
-
placeholder:
|
|
23
|
-
"aria-label":
|
|
23
|
+
placeholder: l ?? a ?? `enter ${t ?? "value"}`,
|
|
24
|
+
"aria-label": l ?? a ?? f["aria.enterValue"].replace("{name}", t ?? "value"),
|
|
24
25
|
type: "text",
|
|
25
|
-
value:
|
|
26
|
-
onChange:
|
|
26
|
+
value: g ?? "",
|
|
27
|
+
onChange: h,
|
|
27
28
|
spellCheck: !1
|
|
28
29
|
}
|
|
29
30
|
)
|
|
30
31
|
] });
|
|
31
|
-
},
|
|
32
|
+
}, k = (t) => {
|
|
32
33
|
switch (t == null ? void 0 : t.toLowerCase()) {
|
|
33
34
|
case "bearer":
|
|
34
35
|
return {
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { isString as
|
|
3
|
-
import {
|
|
4
|
-
import { getUniqueInputKey as
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { isString as f } from "../../../../common/guards.js";
|
|
3
|
+
import { usePlaygroundInput as g } from "../../../hooks/usePlaygroundInputsStore.js";
|
|
4
|
+
import { getUniqueInputKey as x } from "../../../schemaGraph/addUniqueKeysToSchema.js";
|
|
5
|
+
import { getSchemaPlaceholder as d } from "../../../schemaGraph/utils.js";
|
|
6
|
+
import { useSelectedLocale as h } from "../../../../utils/locales/index.js";
|
|
7
|
+
const b = ({ name: e, schema: t, inputKeyPrefix: r, arrayIndices: l }) => {
|
|
8
|
+
const i = h(), o = x(r, t, l), { value: n, setInput: m } = g(o), u = f(n) ? n : void 0, p = (s) => {
|
|
9
|
+
m(o, s.target.value);
|
|
10
|
+
}, a = d(t);
|
|
11
|
+
return /* @__PURE__ */ c(
|
|
11
12
|
"textarea",
|
|
12
13
|
{
|
|
13
14
|
className: "mint:-mx-3.5 mint:px-3.5 mint:flex-1 mint:min-h-[2.5rem] mint:min-w-0 mint:bg-transparent mint:outline-0 mint:text-playground-input mint:resize-y",
|
|
14
15
|
rows: 2,
|
|
15
16
|
placeholder: a ?? `Enter ${e ?? "value"}`,
|
|
16
17
|
"aria-label": a ?? i["aria.enterValue"].replace("{name}", e ?? "value"),
|
|
17
|
-
value:
|
|
18
|
+
value: u,
|
|
18
19
|
onChange: p,
|
|
19
20
|
spellCheck: !1,
|
|
20
21
|
autoCapitalize: "off",
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { useState as u } from "react";
|
|
3
|
+
import { SendPill as S } from "../../api-playground/ApiPlayground/components/SendPill.js";
|
|
4
|
+
import { useSendPlaygroundRequest as f } from "../hooks/useSendPlaygroundRequest.js";
|
|
5
|
+
import { getRequestBodyContentType as c } from "../schemaGraph/utils.js";
|
|
6
|
+
const C = ({
|
|
7
|
+
apiReferenceData: e,
|
|
8
|
+
baseUrl: t,
|
|
9
|
+
selectedRequestBodyContentTypeIndex: o,
|
|
10
|
+
setResult: n,
|
|
11
|
+
label: r,
|
|
12
|
+
method: s,
|
|
13
|
+
className: i
|
|
14
|
+
}) => {
|
|
15
|
+
const [m, p] = u(!1), d = f({
|
|
16
|
+
apiReferenceData: e,
|
|
17
|
+
baseUrl: t,
|
|
18
|
+
contentType: c(e, o),
|
|
19
|
+
setResult: n,
|
|
20
|
+
setIsSending: p
|
|
21
|
+
});
|
|
22
|
+
return /* @__PURE__ */ l(
|
|
23
|
+
S,
|
|
24
|
+
{
|
|
25
|
+
label: r,
|
|
26
|
+
method: s,
|
|
27
|
+
isSending: m,
|
|
28
|
+
onClick: d,
|
|
29
|
+
className: i
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
};
|
|
33
|
+
export {
|
|
34
|
+
C as SendPillWrapper
|
|
35
|
+
};
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { createContext as e } from "react";
|
|
2
|
-
const
|
|
2
|
+
const o = e({
|
|
3
3
|
isSending: !1,
|
|
4
|
-
|
|
5
|
-
isPlaygroundExpanded: !1,
|
|
6
|
-
selectedExampleIndex: 0
|
|
4
|
+
isPlaygroundExpanded: !1
|
|
7
5
|
});
|
|
8
6
|
export {
|
|
9
|
-
|
|
7
|
+
o as ApiPlaygroundContext
|
|
10
8
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const r = ({
|
|
2
|
+
securityOption: a,
|
|
3
|
+
inputs: n
|
|
4
|
+
}) => {
|
|
5
|
+
if (!a) return [];
|
|
6
|
+
const i = [];
|
|
7
|
+
return a.schemes.forEach(({ scheme: e, name: c }) => {
|
|
8
|
+
if ("in" in e && e.in === "cookie") {
|
|
9
|
+
const o = "name" in e ? e.name : c;
|
|
10
|
+
n.cookie[o] && typeof n.cookie[o] == "string" ? i.push({
|
|
11
|
+
name: o,
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
13
|
+
value: n.cookie[o]
|
|
14
|
+
}) : i.push({
|
|
15
|
+
name: o,
|
|
16
|
+
value: ""
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}), i;
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
r as createCookies
|
|
23
|
+
};
|