@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,15 +1,16 @@
|
|
|
1
|
-
import { jsx as m, jsxs as
|
|
1
|
+
import { jsx as m, jsxs as s } from "react/jsx-runtime";
|
|
2
2
|
import "@mintlify/validation";
|
|
3
|
+
import "@sindresorhus/slugify";
|
|
3
4
|
import { cn as d } from "../../utils/cn.js";
|
|
4
5
|
import * as t from "@radix-ui/react-dropdown-menu";
|
|
5
6
|
import { ChevronRightFilled as l, CheckmarkCircleRegular as c, CircleRegular as p } from "@fluentui/react-icons";
|
|
6
7
|
import * as o from "react";
|
|
7
8
|
const f = o.forwardRef((n, e) => /* @__PURE__ */ m(t.Root, { modal: !1, ...n }));
|
|
8
9
|
f.displayName = t.Root.displayName;
|
|
9
|
-
const
|
|
10
|
+
const k = t.Trigger, u = o.forwardRef(({ className: n, inset: e, children: i, ...a }, r) => /* @__PURE__ */ s(
|
|
10
11
|
t.SubTrigger,
|
|
11
12
|
{
|
|
12
|
-
ref:
|
|
13
|
+
ref: r,
|
|
13
14
|
className: d(
|
|
14
15
|
"mint:flex mint:cursor-default mint:select-none mint:items-center mint:rounded-md mint:px-2 mint:py-1.5 mint:text-sm mint:outline-none mint:focus:bg-accent mint:data-[state=open]:bg-accent",
|
|
15
16
|
e && "mint:pl-8",
|
|
@@ -48,10 +49,10 @@ const g = o.forwardRef(({ className: n, sideOffset: e = 8, ...i }, a) => /* @__P
|
|
|
48
49
|
}
|
|
49
50
|
) }));
|
|
50
51
|
g.displayName = t.Content.displayName;
|
|
51
|
-
const w = o.forwardRef(({ className: n, inset: e, isSelected: i, ...a },
|
|
52
|
+
const w = o.forwardRef(({ className: n, inset: e, isSelected: i, ...a }, r) => /* @__PURE__ */ m(
|
|
52
53
|
t.Item,
|
|
53
54
|
{
|
|
54
|
-
ref:
|
|
55
|
+
ref: r,
|
|
55
56
|
className: d(
|
|
56
57
|
"mint:relative mint:flex mint:cursor-pointer mint:select-none mint:items-center mint:rounded-lg mint:px-2 mint:py-1.5 mint:text-sm mint:outline-none mint:focus:bg-accent mint:focus:text-accent-foreground mint:data-[disabled]:pointer-events-none mint:data-[disabled]:opacity-50 mint:hover:bg-zinc-950/5 mint:dark:hover:bg-white/5",
|
|
57
58
|
e && "mint:pl-8",
|
|
@@ -62,10 +63,10 @@ const w = o.forwardRef(({ className: n, inset: e, isSelected: i, ...a }, s) => /
|
|
|
62
63
|
}
|
|
63
64
|
));
|
|
64
65
|
w.displayName = t.Item.displayName;
|
|
65
|
-
const h = o.forwardRef(({ className: n, children: e, checked: i, ...a },
|
|
66
|
+
const h = o.forwardRef(({ className: n, children: e, checked: i, ...a }, r) => /* @__PURE__ */ s(
|
|
66
67
|
t.CheckboxItem,
|
|
67
68
|
{
|
|
68
|
-
ref:
|
|
69
|
+
ref: r,
|
|
69
70
|
className: d(
|
|
70
71
|
"mint:relative mint:flex mint:cursor-default mint:select-none mint:items-center mint:rounded-sm mint:py-1.5 mint:pl-8 mint:pr-2 mint:text-sm mint:outline-none mint:transition-colors mint:focus:bg-accent mint:focus:text-accent-foreground mint:data-[disabled]:pointer-events-none mint:data-[disabled]:opacity-50",
|
|
71
72
|
n
|
|
@@ -79,7 +80,7 @@ const h = o.forwardRef(({ className: n, children: e, checked: i, ...a }, s) => /
|
|
|
79
80
|
}
|
|
80
81
|
));
|
|
81
82
|
h.displayName = t.CheckboxItem.displayName;
|
|
82
|
-
const N = o.forwardRef(({ className: n, children: e, ...i }, a) => /* @__PURE__ */
|
|
83
|
+
const N = o.forwardRef(({ className: n, children: e, ...i }, a) => /* @__PURE__ */ s(
|
|
83
84
|
t.RadioItem,
|
|
84
85
|
{
|
|
85
86
|
ref: a,
|
|
@@ -123,5 +124,5 @@ export {
|
|
|
123
124
|
x as DropdownMenuSeparator,
|
|
124
125
|
b as DropdownMenuSubContent,
|
|
125
126
|
u as DropdownMenuSubTrigger,
|
|
126
|
-
|
|
127
|
+
k as DropdownMenuTrigger
|
|
127
128
|
};
|
|
@@ -6,7 +6,7 @@ import { cn as g } from "../../utils/cn.js";
|
|
|
6
6
|
import { CopyToClipboardButton as B } from "./code-block.js";
|
|
7
7
|
import { getNodeText as G } from "../../utils/get-node-text.js";
|
|
8
8
|
import { capitalize as D } from "../../utils/string.js";
|
|
9
|
-
const
|
|
9
|
+
const Q = y(function({ children: r, onChange: a, className: o, dropdown: l, noMargins: h, isSmallText: q, ...T }, C) {
|
|
10
10
|
var k, N;
|
|
11
11
|
const { defaultValue: u, ...S } = T, x = z(/* @__PURE__ */ new Map()), i = Array.isArray(r) ? r : j.Children.toArray(r), [v, A] = F(0), w = L(
|
|
12
12
|
(n) => {
|
|
@@ -133,7 +133,7 @@ const K = y(function({ children: r, onChange: a, className: o, dropdown: l, noMa
|
|
|
133
133
|
}
|
|
134
134
|
);
|
|
135
135
|
});
|
|
136
|
-
function
|
|
136
|
+
function U({ text: b }) {
|
|
137
137
|
return /* @__PURE__ */ e(
|
|
138
138
|
"div",
|
|
139
139
|
{
|
|
@@ -144,6 +144,6 @@ function Q({ text: b }) {
|
|
|
144
144
|
);
|
|
145
145
|
}
|
|
146
146
|
export {
|
|
147
|
-
|
|
148
|
-
|
|
147
|
+
U as CodeBlockTooltip,
|
|
148
|
+
Q as CodeGroup
|
|
149
149
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useContext as c, useRef as s, createContext as a } from "react";
|
|
3
3
|
import { useCheckHash as p } from "../hooks/useCheckHash.js";
|
|
4
|
-
const o =
|
|
4
|
+
const o = a({}), u = () => c(o);
|
|
5
5
|
function x({
|
|
6
6
|
location: t,
|
|
7
7
|
children: n
|
|
8
8
|
}) {
|
|
9
|
-
const e =
|
|
9
|
+
const e = s(!1), r = p();
|
|
10
10
|
return /* @__PURE__ */ i(o.Provider, { value: { location: t, anchor: r, hasScrolledToAnchorRef: e }, children: n });
|
|
11
11
|
}
|
|
12
12
|
o.displayName = "EndpointLocationContext";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useContext as r } from "react";
|
|
2
|
+
import { DocsConfigContext as d } from "../contexts/ConfigContext.js";
|
|
3
|
+
const F = () => {
|
|
4
|
+
var o, p, t, n;
|
|
5
|
+
const { mintConfig: i, docsConfig: a } = r(d), e = (p = (o = i == null ? void 0 : i.api) == null ? void 0 : o.paramFields) == null ? void 0 : p.expanded;
|
|
6
|
+
return ((n = (t = a == null ? void 0 : a.api) == null ? void 0 : t.params) == null ? void 0 : n.expanded) ?? e;
|
|
7
|
+
};
|
|
8
|
+
export {
|
|
9
|
+
F as useApiParamFieldOption
|
|
10
|
+
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useMemo as n, useContext as t } from "react";
|
|
2
2
|
import { ApiReferenceContext as o } from "../contexts/ConfigContext.js";
|
|
3
3
|
const p = () => {
|
|
4
4
|
const {
|
|
5
5
|
apiReferenceData: { endpoint: e }
|
|
6
|
-
} =
|
|
6
|
+
} = t(o);
|
|
7
7
|
return e;
|
|
8
8
|
}, s = () => {
|
|
9
9
|
const e = p();
|
|
10
|
-
return
|
|
10
|
+
return n(() => e, [e]);
|
|
11
11
|
};
|
|
12
12
|
export {
|
|
13
13
|
s as useEndpoint,
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { useCallback as
|
|
2
|
-
const
|
|
3
|
-
key:
|
|
1
|
+
import { useCallback as w, useEffect as y } from "react";
|
|
2
|
+
const C = ({
|
|
3
|
+
key: n,
|
|
4
4
|
callback: r,
|
|
5
5
|
isSingleKey: h,
|
|
6
|
-
excludedActiveElementId:
|
|
7
|
-
excludedActiveElements:
|
|
6
|
+
excludedActiveElementId: t,
|
|
7
|
+
excludedActiveElements: u,
|
|
8
8
|
isDisabled: i
|
|
9
9
|
}) => {
|
|
10
|
-
const
|
|
11
|
-
(
|
|
10
|
+
const f = w(
|
|
11
|
+
(p) => {
|
|
12
12
|
if (i) return;
|
|
13
|
-
let
|
|
13
|
+
let s = !1;
|
|
14
14
|
const o = document.activeElement;
|
|
15
|
-
|
|
15
|
+
t && (s = !!(o != null && o.id) && t.includes(o.id)), u && !s && (s = u.includes(
|
|
16
16
|
o == null ? void 0 : o.tagName.toLowerCase()
|
|
17
|
-
)),
|
|
17
|
+
)), p.key === n && h && !s && (p.preventDefault(), r == null || r());
|
|
18
18
|
},
|
|
19
|
-
[r,
|
|
19
|
+
[r, n, h, t, u, i]
|
|
20
20
|
);
|
|
21
|
-
|
|
21
|
+
y(() => (addEventListener("keydown", f), () => removeEventListener("keydown", f)), [f]);
|
|
22
22
|
};
|
|
23
23
|
export {
|
|
24
|
-
|
|
24
|
+
C as useKeyboardShortcut
|
|
25
25
|
};
|
|
@@ -1,148 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}) =>
|
|
12
|
-
var f, p;
|
|
13
|
-
const e = j(), { docsConfig: a } = b(g), d = ((p = (f = a == null ? void 0 : a.api) == null ? void 0 : f.playground) == null ? void 0 : p.proxy) === !1;
|
|
14
|
-
return S(async () => {
|
|
15
|
-
o(!0);
|
|
16
|
-
const y = await import("axios").then((i) => i.default), u = w(t.path, e.path), h = O(
|
|
17
|
-
x(n, e.server),
|
|
18
|
-
u
|
|
19
|
-
), m = A(e.header, r), c = {
|
|
20
|
-
method: t.method,
|
|
21
|
-
url: h,
|
|
22
|
-
header: m,
|
|
23
|
-
body: e.body,
|
|
24
|
-
cookie: e.cookie,
|
|
25
|
-
query: e.query
|
|
26
|
-
};
|
|
27
|
-
try {
|
|
28
|
-
if (d) {
|
|
29
|
-
const i = await C(c);
|
|
30
|
-
s({
|
|
31
|
-
error: !1,
|
|
32
|
-
response: {
|
|
33
|
-
status: i.status,
|
|
34
|
-
statusText: i.statusText,
|
|
35
|
-
headers: i.headers,
|
|
36
|
-
data: i.data
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
} else if (r.includes("multipart/form-data")) {
|
|
40
|
-
const i = await D(c);
|
|
41
|
-
s(i);
|
|
42
|
-
} else {
|
|
43
|
-
const { data: i } = await y.post(`${l.BASE_PATH}/_mintlify/api/request`, c);
|
|
44
|
-
s(i);
|
|
45
|
-
}
|
|
46
|
-
} catch (i) {
|
|
47
|
-
s({
|
|
48
|
-
error: !0,
|
|
49
|
-
errorMessage: "unable to complete request"
|
|
50
|
-
}), console.error(i);
|
|
51
|
-
}
|
|
52
|
-
o(!1);
|
|
53
|
-
}, [
|
|
54
|
-
o,
|
|
55
|
-
t,
|
|
56
|
-
e,
|
|
57
|
-
n,
|
|
58
|
-
r,
|
|
59
|
-
d,
|
|
60
|
-
s
|
|
61
|
-
]);
|
|
62
|
-
}, w = (t, n) => Object.entries(n).reduce((r, [s, o]) => o == null ? r : r.replace(
|
|
63
|
-
`{${s}}`,
|
|
64
|
-
encodeURIComponent(o.toString())
|
|
65
|
-
), t), x = (t, n) => {
|
|
66
|
-
let r = t;
|
|
67
|
-
return Object.entries(n).forEach(([s, o]) => {
|
|
68
|
-
o && (r = r.replace(`{${s}}`, o));
|
|
69
|
-
}), r;
|
|
70
|
-
}, O = (t, n) => t.replace(/\/$/, "") + "/" + n.replace(/^\//, ""), A = (t, n) => Object.keys(t).some((r) => r.toLowerCase() === "content-type") ? t : {
|
|
71
|
-
...t,
|
|
72
|
-
"content-type": n
|
|
73
|
-
}, C = async (t) => {
|
|
74
|
-
const n = await import("axios").then((e) => e.default), r = Object.keys(t.header).find(
|
|
75
|
-
(e) => e.toLowerCase() === "content-type"
|
|
76
|
-
);
|
|
77
|
-
let s = t.body, o = t.header;
|
|
78
|
-
if (r != null && r.includes("multipart/form-data")) {
|
|
79
|
-
const { data: e, headers: a } = E(t);
|
|
80
|
-
s = e, o = a;
|
|
81
|
-
}
|
|
82
|
-
return n({
|
|
83
|
-
url: t.url,
|
|
84
|
-
method: t.method,
|
|
85
|
-
params: t.query,
|
|
86
|
-
data: s,
|
|
87
|
-
headers: o,
|
|
88
|
-
// prevent axios from adding [] after array query params
|
|
89
|
-
paramsSerializer: {
|
|
90
|
-
indexes: null
|
|
91
|
-
},
|
|
92
|
-
responseType: "arraybuffer",
|
|
93
|
-
// prevent axios from erroring on bad status codes
|
|
94
|
-
validateStatus: () => !0,
|
|
95
|
-
// prevent axios from parsing json, losing whitespace information, and using default utf-8 encoding
|
|
96
|
-
// we can't use `responseEncoding` as it's ignored client-side
|
|
97
|
-
transformResponse: (e) => Buffer.from(e).toString("base64")
|
|
98
|
-
});
|
|
99
|
-
}, D = async (t) => {
|
|
100
|
-
const n = await import("axios").then((o) => o.default), r = new FormData();
|
|
101
|
-
r.append(
|
|
102
|
-
"requestInfo",
|
|
103
|
-
JSON.stringify({
|
|
104
|
-
method: t.method,
|
|
105
|
-
url: t.url,
|
|
106
|
-
header: t.header,
|
|
107
|
-
query: t.query,
|
|
108
|
-
cookie: t.cookie
|
|
109
|
-
})
|
|
110
|
-
), typeof t.body == "object" && t.body !== null && Object.entries(t.body).forEach(([o, e]) => {
|
|
111
|
-
e instanceof File ? r.append(o, e) : Array.isArray(e) ? e.forEach((a) => {
|
|
112
|
-
a instanceof File ? r.append(o, a) : a != null && r.append(
|
|
113
|
-
o,
|
|
114
|
-
typeof a == "object" ? JSON.stringify(a) : a.toString()
|
|
115
|
-
);
|
|
116
|
-
}) : e != null && r.append(
|
|
117
|
-
o,
|
|
118
|
-
typeof e == "object" ? JSON.stringify(e) : e.toString()
|
|
119
|
-
);
|
|
120
|
-
});
|
|
121
|
-
const { data: s } = await n.post(`${l.BASE_PATH}/_mintlify/api/file-request`, r);
|
|
122
|
-
return s;
|
|
123
|
-
}, E = (t) => {
|
|
124
|
-
var s;
|
|
125
|
-
let n = t.body;
|
|
126
|
-
const r = t.header;
|
|
127
|
-
if ((s = r["content-type"]) != null && s.includes("multipart/form-data")) {
|
|
128
|
-
const o = new FormData();
|
|
129
|
-
typeof n == "object" && n !== null && (Object.entries(n).forEach(([e, a]) => {
|
|
130
|
-
a instanceof File ? o.append(e, a) : Array.isArray(a) ? a.forEach((d) => {
|
|
131
|
-
d instanceof File ? o.append(e, d) : d != null && o.append(
|
|
132
|
-
e,
|
|
133
|
-
typeof d == "object" ? JSON.stringify(d) : d.toString()
|
|
134
|
-
);
|
|
135
|
-
}) : a != null && o.append(
|
|
136
|
-
e,
|
|
137
|
-
typeof a == "object" ? JSON.stringify(a) : a.toString()
|
|
138
|
-
);
|
|
139
|
-
}), n = o, delete r["content-type"]);
|
|
140
|
-
}
|
|
141
|
-
return { data: n, headers: r };
|
|
142
|
-
};
|
|
1
|
+
import "react";
|
|
2
|
+
import "../env.js";
|
|
3
|
+
const i = (r, t) => Object.entries(t).reduce((e, [o, n]) => n == null ? e : e.replace(
|
|
4
|
+
`{${o}}`,
|
|
5
|
+
encodeURIComponent(n.toString())
|
|
6
|
+
), r), l = (r, t) => {
|
|
7
|
+
let e = r;
|
|
8
|
+
return Object.entries(t).forEach(([o, n]) => {
|
|
9
|
+
n && (e = e.replace(`{${o}}`, n));
|
|
10
|
+
}), e;
|
|
11
|
+
}, s = (r, t) => r.replace(/\/$/, "") + "/" + t.replace(/^\//, "");
|
|
143
12
|
export {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
_ as useSendPlaygroundRequest
|
|
13
|
+
i as addPathParams,
|
|
14
|
+
l as addServerVariables,
|
|
15
|
+
s as joinWithSingleSlash
|
|
148
16
|
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const n = "", e = `
|
|
2
|
+
`;
|
|
3
|
+
class d {
|
|
4
|
+
/**
|
|
5
|
+
* Helper object to format and aggragate lines of code.
|
|
6
|
+
* Lines are aggregated in a `code` array, and need to be joined to obtain a proper code snippet.
|
|
7
|
+
*/
|
|
8
|
+
constructor({ indent: o, join: h } = {}) {
|
|
9
|
+
this.postProcessors = [], this.code = [], this.indentationCharacter = n, this.lineJoin = e, this.indentLine = (t, s = 0) => `${this.indentationCharacter.repeat(s)}${t}`, this.unshift = (t, s) => {
|
|
10
|
+
const i = this.indentLine(t, s);
|
|
11
|
+
this.code.unshift(i);
|
|
12
|
+
}, this.push = (t, s) => {
|
|
13
|
+
const i = this.indentLine(t, s);
|
|
14
|
+
this.code.push(i);
|
|
15
|
+
}, this.blank = () => {
|
|
16
|
+
this.code.push("");
|
|
17
|
+
}, this.join = () => {
|
|
18
|
+
const t = this.code.join(this.lineJoin);
|
|
19
|
+
return this.postProcessors.reduce((i, r) => r(i), t);
|
|
20
|
+
}, this.addPostProcessor = (t) => {
|
|
21
|
+
this.postProcessors = [...this.postProcessors, t];
|
|
22
|
+
}, this.indentationCharacter = o || n, this.lineJoin = h ?? e;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
d as CodeBuilder
|
|
27
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
function s(t, u = {}) {
|
|
2
|
+
const { delimiter: n = '"', escapeChar: r = "\\", escapeNewlines: i = !0 } = u;
|
|
3
|
+
return [...t.toString()].map((e) => e === "\b" ? `${r}b` : e === " " ? `${r}t` : e === `
|
|
4
|
+
` ? i ? `${r}n` : e : e === "\f" ? `${r}f` : e === "\r" ? i ? `${r}r` : e : e === r ? r + r : e === n ? r + n : e < " " || e > "~" ? JSON.stringify(e).slice(1, -1) : e).join("");
|
|
5
|
+
}
|
|
6
|
+
const f = (t) => s(t, { delimiter: "'" }), o = (t) => s(t, { delimiter: '"' });
|
|
7
|
+
export {
|
|
8
|
+
o as escapeForDoubleQuotes,
|
|
9
|
+
f as escapeForSingleQuotes,
|
|
10
|
+
s as escapeString
|
|
11
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const n = (e, o) => Object.keys(e).find((t) => t.toLowerCase() === o.toLowerCase()), s = (e, o) => {
|
|
2
|
+
const t = n(e, o);
|
|
3
|
+
if (t)
|
|
4
|
+
return e[t];
|
|
5
|
+
}, a = (e, o) => !!n(e, o), i = (e) => ["application/json", "application/x-json", "text/json", "text/x-json", "+json"].some(
|
|
6
|
+
(o) => e.indexOf(o) > -1
|
|
7
|
+
);
|
|
8
|
+
export {
|
|
9
|
+
s as getHeader,
|
|
10
|
+
n as getHeaderName,
|
|
11
|
+
a as hasHeader,
|
|
12
|
+
i as isMimeTypeJSON
|
|
13
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
function i(t) {
|
|
2
|
+
if (!t)
|
|
3
|
+
return "";
|
|
4
|
+
if (t.href && !t.protocol && !t.host && !t.hostname)
|
|
5
|
+
return t.href;
|
|
6
|
+
let e = "";
|
|
7
|
+
if (t.protocol && (e += t.protocol, t.protocol.endsWith(":") || (e += ":")), (t.slashes || t.protocol && (t.host || t.hostname)) && (e += "//"), t.auth) {
|
|
8
|
+
const h = t.auth.split(":").map((a, o) => o === 0 ? a : a.replace(/@/g, "%40")).join(":");
|
|
9
|
+
e += `${h}@`;
|
|
10
|
+
}
|
|
11
|
+
if (t.host ? e += t.host : t.hostname && (e += t.hostname, t.port && (e += `:${t.port}`)), t.pathname) {
|
|
12
|
+
const s = t.pathname.startsWith("/") ? t.pathname : `/${t.pathname}`;
|
|
13
|
+
e += s;
|
|
14
|
+
}
|
|
15
|
+
if (t.search)
|
|
16
|
+
e += t.search.startsWith("?") ? t.search : `?${t.search}`;
|
|
17
|
+
else if (t.query)
|
|
18
|
+
if (typeof t.query == "string")
|
|
19
|
+
e += t.query.startsWith("?") ? t.query : `?${t.query}`;
|
|
20
|
+
else {
|
|
21
|
+
const s = new URLSearchParams();
|
|
22
|
+
for (const [a, o] of Object.entries(t.query))
|
|
23
|
+
if (Array.isArray(o))
|
|
24
|
+
for (const n of o)
|
|
25
|
+
s.append(a, n);
|
|
26
|
+
else
|
|
27
|
+
s.append(a, o);
|
|
28
|
+
const h = s.toString();
|
|
29
|
+
h && (e += `?${h}`);
|
|
30
|
+
}
|
|
31
|
+
return t.hash && (e += t.hash.startsWith("#") ? t.hash : `#${t.hash}`), e;
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
i as format
|
|
35
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
function z(l, f = !1, $ = !1) {
|
|
2
|
+
let c = l;
|
|
3
|
+
$ && !l.match(/^[a-z][a-z0-9+.-]*:/i) && (c = `http://${l}`);
|
|
4
|
+
let e;
|
|
5
|
+
try {
|
|
6
|
+
e = new URL(c);
|
|
7
|
+
} catch {
|
|
8
|
+
try {
|
|
9
|
+
e = new URL(c, "http://example.com");
|
|
10
|
+
} catch {
|
|
11
|
+
return {
|
|
12
|
+
auth: null,
|
|
13
|
+
hash: null,
|
|
14
|
+
host: null,
|
|
15
|
+
hostname: null,
|
|
16
|
+
href: l,
|
|
17
|
+
path: null,
|
|
18
|
+
pathname: null,
|
|
19
|
+
protocol: null,
|
|
20
|
+
search: null,
|
|
21
|
+
slashes: null,
|
|
22
|
+
query: f ? {} : "",
|
|
23
|
+
port: null
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const y = e.username || e.password ? `${decodeURIComponent(e.username)}${e.password ? `:${decodeURIComponent(e.password)}` : ""}` : null;
|
|
28
|
+
let s = e.hostname || null;
|
|
29
|
+
s && s.startsWith("[") && s.endsWith("]") && (s = s.slice(1, -1));
|
|
30
|
+
let t = e.port || null;
|
|
31
|
+
const d = l.match(/:(\d+)(?:\/|$|\?|#)/);
|
|
32
|
+
!t && d && (t = d[1]);
|
|
33
|
+
let i = null;
|
|
34
|
+
if (s) {
|
|
35
|
+
const a = s.includes(":");
|
|
36
|
+
t ? i = a ? `[${s}]:${t}` : `${s}:${t}` : i = s;
|
|
37
|
+
}
|
|
38
|
+
const n = l.includes("?") && !e.search ? "?" : e.search || null, w = l.includes("#") && !e.hash ? "#" : e.hash || null;
|
|
39
|
+
let h = null;
|
|
40
|
+
try {
|
|
41
|
+
const a = c.match(/^[a-z][a-z0-9+.-]*:\/\/[^/]+(\/[^?#]*)/i);
|
|
42
|
+
a && a[1] ? h = a[1] : h = e.pathname || null;
|
|
43
|
+
} catch {
|
|
44
|
+
h = e.pathname || null;
|
|
45
|
+
}
|
|
46
|
+
const U = n ? `${h}${n}` : h;
|
|
47
|
+
let u;
|
|
48
|
+
if (f && n) {
|
|
49
|
+
const a = new URLSearchParams(n), o = {};
|
|
50
|
+
for (const [r, p] of a.entries())
|
|
51
|
+
if (r in o) {
|
|
52
|
+
const m = o[r];
|
|
53
|
+
Array.isArray(m) ? m.push(p) : o[r] = [m, p];
|
|
54
|
+
} else
|
|
55
|
+
o[r] = p;
|
|
56
|
+
u = o;
|
|
57
|
+
} else
|
|
58
|
+
u = n ? n.slice(1) : "";
|
|
59
|
+
return {
|
|
60
|
+
auth: y,
|
|
61
|
+
hash: w,
|
|
62
|
+
host: i,
|
|
63
|
+
hostname: s,
|
|
64
|
+
href: e.href,
|
|
65
|
+
path: U,
|
|
66
|
+
pathname: h,
|
|
67
|
+
protocol: e.protocol || null,
|
|
68
|
+
search: n,
|
|
69
|
+
slashes: e.protocol ? !0 : null,
|
|
70
|
+
query: u,
|
|
71
|
+
port: t
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
export {
|
|
75
|
+
z as parse
|
|
76
|
+
};
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { stringify as f } from "qs";
|
|
2
|
+
import { getHeaderName as w } from "./helpers/headers.js";
|
|
3
|
+
import { reducer as T } from "./helpers/reducer.js";
|
|
4
|
+
import { targets as x } from "./targets/index.js";
|
|
5
|
+
import { parse as E } from "./helpers/url-parse.js";
|
|
6
|
+
import { format as $ } from "./helpers/url-format.js";
|
|
7
|
+
const N = (m) => typeof m == "object" && "log" in m && typeof m.log == "object" && "entries" in m.log && Array.isArray(m.log.entries);
|
|
8
|
+
class V {
|
|
9
|
+
constructor(a, t = {}) {
|
|
10
|
+
this.initCalled = !1, this.entries = [], this.requests = [], this.options = {}, this.options = {
|
|
11
|
+
harIsAlreadyEncoded: !1,
|
|
12
|
+
...t
|
|
13
|
+
}, this.requests = [], N(a) ? this.entries = a.log.entries : this.entries = [
|
|
14
|
+
{
|
|
15
|
+
request: a
|
|
16
|
+
}
|
|
17
|
+
];
|
|
18
|
+
}
|
|
19
|
+
init() {
|
|
20
|
+
return this.initCalled = !0, this.requests = this.entries.map(({ request: a }) => {
|
|
21
|
+
var e;
|
|
22
|
+
const t = {
|
|
23
|
+
bodySize: 0,
|
|
24
|
+
headersSize: 0,
|
|
25
|
+
headers: [],
|
|
26
|
+
cookies: [],
|
|
27
|
+
httpVersion: "HTTP/1.1",
|
|
28
|
+
queryString: [],
|
|
29
|
+
postData: {
|
|
30
|
+
mimeType: ((e = a.postData) == null ? void 0 : e.mimeType) || "application/octet-stream"
|
|
31
|
+
},
|
|
32
|
+
...a
|
|
33
|
+
};
|
|
34
|
+
return t.postData && !t.postData.mimeType && (t.postData.mimeType = "application/octet-stream"), this.prepare(t, this.options);
|
|
35
|
+
}), this;
|
|
36
|
+
}
|
|
37
|
+
prepare(a, t) {
|
|
38
|
+
var j, b, D;
|
|
39
|
+
const e = {
|
|
40
|
+
...a,
|
|
41
|
+
fullUrl: "",
|
|
42
|
+
uriObj: {},
|
|
43
|
+
queryObj: {},
|
|
44
|
+
headersObj: {},
|
|
45
|
+
cookiesObj: {},
|
|
46
|
+
allHeaders: {}
|
|
47
|
+
};
|
|
48
|
+
if (e != null && e.queryString.length && (e.queryObj = e.queryString.reduce(T, {})), e != null && e.headers.length) {
|
|
49
|
+
const r = /^HTTP\/2/;
|
|
50
|
+
e.headersObj = e.headers.reduce((p, { name: u, value: d }) => {
|
|
51
|
+
const h = r.exec(e.httpVersion) ? u.toLocaleLowerCase() : u;
|
|
52
|
+
return {
|
|
53
|
+
...p,
|
|
54
|
+
[h]: d
|
|
55
|
+
};
|
|
56
|
+
}, {});
|
|
57
|
+
}
|
|
58
|
+
e != null && e.cookies.length && (e.cookiesObj = e.cookies.reduceRight(
|
|
59
|
+
(r, { name: p, value: u }) => ({
|
|
60
|
+
...r,
|
|
61
|
+
[p]: u
|
|
62
|
+
}),
|
|
63
|
+
{}
|
|
64
|
+
));
|
|
65
|
+
const s = (j = e.cookies) == null ? void 0 : j.map(({ name: r, value: p }) => t.harIsAlreadyEncoded ? `${r}=${p}` : `${encodeURIComponent(r)}=${encodeURIComponent(p)}`);
|
|
66
|
+
switch (s != null && s.length && (e.allHeaders.cookie = s.join("; ")), e.postData.mimeType) {
|
|
67
|
+
case "multipart/mixed":
|
|
68
|
+
case "multipart/related":
|
|
69
|
+
case "multipart/form-data":
|
|
70
|
+
case "multipart/alternative":
|
|
71
|
+
if (e.postData.text = "", e.postData.mimeType = "multipart/form-data", (b = e.postData) != null && b.params) {
|
|
72
|
+
const r = "---011000010111000001101001", p = `${r}--`, u = `\r
|
|
73
|
+
`;
|
|
74
|
+
/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
|
|
75
|
+
const d = (l) => l.replace(/\n/g, "%0A").replace(/\r/g, "%0D").replace(/"/g, "%22"), h = (l) => l.replace(/\r?\n|\r/g, `\r
|
|
76
|
+
`), c = [`--${r}`];
|
|
77
|
+
(D = e.postData) == null || D.params.forEach((l, k) => {
|
|
78
|
+
const g = l.name, S = l.value || "", O = l.fileName || null, A = l.contentType || "application/octet-stream";
|
|
79
|
+
O ? (c.push(
|
|
80
|
+
`Content-Disposition: form-data; name="${d(h(g))}"; filename="${O}"`
|
|
81
|
+
), c.push(`Content-Type: ${A}`)) : c.push(`Content-Disposition: form-data; name="${escape(h(g))}"`), c.push(""), c.push(h(S)), k !== e.postData.params.length - 1 && c.push(`--${r}`);
|
|
82
|
+
}), c.push(`--${p}`), e.postData.boundary = r, e.postData.text = c.join(u);
|
|
83
|
+
const H = w(e.headersObj, "content-type") || "content-type";
|
|
84
|
+
e.headersObj[H] = `multipart/form-data; boundary=${r}`;
|
|
85
|
+
}
|
|
86
|
+
break;
|
|
87
|
+
case "application/x-www-form-urlencoded":
|
|
88
|
+
e.postData.params ? (e.postData.paramsObj = e.postData.params.reduce(T, {}), e.postData.text = f(e.postData.paramsObj)) : e.postData.text = "";
|
|
89
|
+
break;
|
|
90
|
+
case "text/json":
|
|
91
|
+
case "text/x-json":
|
|
92
|
+
case "application/json":
|
|
93
|
+
case "application/x-json":
|
|
94
|
+
if (e.postData.mimeType = "application/json", e.postData.text)
|
|
95
|
+
try {
|
|
96
|
+
e.postData.jsonObj = JSON.parse(e.postData.text);
|
|
97
|
+
} catch {
|
|
98
|
+
e.postData.mimeType = "text/plain";
|
|
99
|
+
}
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
102
|
+
const i = {
|
|
103
|
+
...e.allHeaders,
|
|
104
|
+
...e.headersObj
|
|
105
|
+
}, n = E(e.url, !0, !0);
|
|
106
|
+
e.queryObj = {
|
|
107
|
+
...e.queryObj,
|
|
108
|
+
...n.query
|
|
109
|
+
};
|
|
110
|
+
let o;
|
|
111
|
+
t.harIsAlreadyEncoded ? o = f(e.queryObj, {
|
|
112
|
+
encode: !1,
|
|
113
|
+
indices: !1
|
|
114
|
+
}) : o = f(e.queryObj, {
|
|
115
|
+
indices: !1
|
|
116
|
+
});
|
|
117
|
+
const y = {
|
|
118
|
+
...n,
|
|
119
|
+
query: e.queryObj,
|
|
120
|
+
search: o,
|
|
121
|
+
path: o ? `${n.pathname}?${o}` : n.pathname
|
|
122
|
+
}, q = $({
|
|
123
|
+
...n,
|
|
124
|
+
query: null,
|
|
125
|
+
search: null
|
|
126
|
+
}), C = $({
|
|
127
|
+
...n,
|
|
128
|
+
...y
|
|
129
|
+
});
|
|
130
|
+
return {
|
|
131
|
+
...e,
|
|
132
|
+
allHeaders: i,
|
|
133
|
+
fullUrl: C,
|
|
134
|
+
url: q,
|
|
135
|
+
uriObj: y
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
convert(a, t, e) {
|
|
139
|
+
this.initCalled || this.init(), !e && t && (e = { clientId: t });
|
|
140
|
+
const s = x[a];
|
|
141
|
+
if (!s)
|
|
142
|
+
return [!1];
|
|
143
|
+
const { convert: i } = s.clientsById[t || s.info.default];
|
|
144
|
+
return this.requests.map((o) => i(o, e));
|
|
145
|
+
}
|
|
146
|
+
installation(a, t, e) {
|
|
147
|
+
this.initCalled || this.init(), !e && t && (e = { clientId: t });
|
|
148
|
+
const s = x[a];
|
|
149
|
+
if (!s)
|
|
150
|
+
return [!1];
|
|
151
|
+
const { info: i } = s.clientsById[t || s.info.default];
|
|
152
|
+
return this.requests.map((o) => i != null && i.installation ? i.installation(o, e) : !1);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
export {
|
|
156
|
+
V as HTTPSnippet
|
|
157
|
+
};
|