zudoku 0.0.0-fb7d300 → 0.0.0-fc5c03b
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/client.d.ts +7 -0
- package/dist/app/entry.client.d.ts +1 -0
- package/dist/app/entry.client.js +13 -0
- package/dist/app/entry.client.js.map +1 -1
- package/dist/app/entry.server.d.ts +1 -0
- package/dist/app/entry.server.js +1 -0
- package/dist/app/entry.server.js.map +1 -1
- package/dist/app/main.js +2 -1
- package/dist/app/main.js.map +1 -1
- package/dist/app/sentry.d.ts +3 -0
- package/dist/app/sentry.js +19 -0
- package/dist/app/sentry.js.map +1 -0
- package/dist/app/tailwind.d.ts +2 -1
- package/dist/app/tailwind.js +64 -52
- package/dist/app/tailwind.js.map +1 -1
- package/dist/cli/cli.js +0 -2
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/common/logger.js +9 -0
- package/dist/cli/common/logger.js.map +1 -1
- package/dist/cli/common/outdated.js +2 -1
- package/dist/cli/common/outdated.js.map +1 -1
- package/dist/config/common.d.ts +8 -0
- package/dist/config/common.js +2 -0
- package/dist/config/common.js.map +1 -0
- package/dist/config/config.d.ts +3 -2
- package/dist/config/loader.d.ts +20 -0
- package/dist/config/loader.js +154 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/config/validators/InputSidebarSchema.d.ts +14 -13
- package/dist/config/validators/InputSidebarSchema.js.map +1 -1
- package/dist/config/validators/common.d.ts +4911 -0
- package/dist/config/validators/common.js +276 -0
- package/dist/config/validators/common.js.map +1 -0
- package/dist/config/validators/icon-types.d.ts +1 -0
- package/dist/config/validators/icon-types.js +2 -0
- package/dist/config/validators/icon-types.js.map +1 -0
- package/dist/config/validators/validate.d.ts +777 -521
- package/dist/config/validators/validate.js +9 -228
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/lib/authentication/providers/openid.js +7 -2
- package/dist/lib/authentication/providers/openid.js.map +1 -1
- package/dist/lib/components/Heading.d.ts +4 -4
- package/dist/lib/components/Heading.js +1 -1
- package/dist/lib/components/Heading.js.map +1 -1
- package/dist/lib/components/Layout.js +3 -2
- package/dist/lib/components/Layout.js.map +1 -1
- package/dist/lib/components/Markdown.js +1 -1
- package/dist/lib/components/Markdown.js.map +1 -1
- package/dist/lib/components/MobileTopNavigation.js +1 -1
- package/dist/lib/components/MobileTopNavigation.js.map +1 -1
- package/dist/lib/components/ReactMarkdown.d.ts +29 -0
- package/dist/lib/components/ReactMarkdown.js +182 -0
- package/dist/lib/components/ReactMarkdown.js.map +1 -0
- package/dist/lib/components/Search.d.ts +3 -1
- package/dist/lib/components/Search.js +3 -3
- package/dist/lib/components/Search.js.map +1 -1
- package/dist/lib/components/SyntaxHighlight.js +0 -4
- package/dist/lib/components/SyntaxHighlight.js.map +1 -1
- package/dist/lib/components/TopNavigation.d.ts +1 -1
- package/dist/lib/components/navigation/Sidebar.d.ts +3 -1
- package/dist/lib/components/navigation/Sidebar.js +2 -2
- package/dist/lib/components/navigation/Sidebar.js.map +1 -1
- package/dist/lib/components/navigation/SidebarCategory.d.ts +2 -2
- package/dist/lib/components/navigation/SidebarCategory.js +3 -4
- package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
- package/dist/lib/components/navigation/SidebarItem.d.ts +2 -4
- package/dist/lib/components/navigation/SidebarItem.js +5 -10
- package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
- package/dist/lib/components/navigation/SidebarWrapper.js +1 -1
- package/dist/lib/components/navigation/SidebarWrapper.js.map +1 -1
- package/dist/lib/core/ZudokuContext.d.ts +1 -1
- package/dist/lib/oas/graphql/index.js +4 -1
- package/dist/lib/oas/graphql/index.js.map +1 -1
- package/dist/lib/oas/parser/upgrade/index.d.ts +2 -2
- package/dist/lib/oas/parser/upgrade/index.js +3 -20
- package/dist/lib/oas/parser/upgrade/index.js.map +1 -1
- package/dist/lib/plugins/api-catalog/Catalog.d.ts +6 -0
- package/dist/lib/plugins/api-catalog/Catalog.js +29 -0
- package/dist/lib/plugins/api-catalog/Catalog.js.map +1 -0
- package/dist/lib/plugins/api-catalog/index.d.ts +23 -0
- package/dist/lib/plugins/api-catalog/index.js +15 -0
- package/dist/lib/plugins/api-catalog/index.js.map +1 -0
- package/dist/lib/plugins/markdown/MdxPage.d.ts +9 -1
- package/dist/lib/plugins/markdown/MdxPage.js +15 -2
- package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
- package/dist/lib/plugins/markdown/index.d.ts +2 -1
- package/dist/lib/plugins/markdown/index.js +1 -1
- package/dist/lib/plugins/markdown/index.js.map +1 -1
- package/dist/lib/plugins/markdown/resolver.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.js +47 -2
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/client/GraphQLClient.js +12 -0
- package/dist/lib/plugins/openapi/client/GraphQLClient.js.map +1 -1
- package/dist/lib/plugins/openapi/client/useCreateQuery.d.ts +1 -1
- package/dist/lib/plugins/openapi/client/useCreateQuery.js +4 -2
- package/dist/lib/plugins/openapi/client/useCreateQuery.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.d.ts +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.js +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/graphql.d.ts +2 -0
- package/dist/lib/plugins/openapi/graphql/graphql.js +1 -0
- package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
- package/dist/lib/plugins/openapi/interfaces.d.ts +1 -1
- package/dist/lib/plugins/openapi/playground/PathParams.js +1 -1
- package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
- package/dist/lib/plugins/openapi/post-processors/removeExtensions.d.ts +6 -0
- package/dist/lib/plugins/openapi/post-processors/removeExtensions.js +14 -0
- package/dist/lib/plugins/openapi/post-processors/removeExtensions.js.map +1 -0
- package/dist/lib/plugins/openapi/post-processors/removeExtensions.test.d.ts +1 -0
- package/dist/lib/plugins/openapi/post-processors/removeExtensions.test.js +125 -0
- package/dist/lib/plugins/openapi/post-processors/removeExtensions.test.js.map +1 -0
- package/dist/lib/plugins/openapi/post-processors/removePaths.d.ts +11 -0
- package/dist/lib/plugins/openapi/post-processors/removePaths.js +33 -0
- package/dist/lib/plugins/openapi/post-processors/removePaths.js.map +1 -0
- package/dist/lib/plugins/openapi/post-processors/removePaths.test.d.ts +1 -0
- package/dist/lib/plugins/openapi/post-processors/removePaths.test.js +104 -0
- package/dist/lib/plugins/openapi/post-processors/removePaths.test.js.map +1 -0
- package/dist/lib/plugins/openapi/post-processors/traverse.d.ts +1 -0
- package/dist/lib/plugins/openapi/post-processors/traverse.js +2 -0
- package/dist/lib/plugins/openapi/post-processors/traverse.js.map +1 -0
- package/dist/lib/plugins/redirect/index.d.ts +1 -1
- package/dist/lib/ui/Button.d.ts +1 -1
- package/dist/lib/ui/Command.d.ts +1 -1
- package/dist/lib/util/MdxComponents.d.ts +2 -3
- package/dist/lib/util/MdxComponents.js.map +1 -1
- package/dist/lib/util/traverse.d.ts +2 -0
- package/dist/lib/util/traverse.js +18 -0
- package/dist/lib/util/traverse.js.map +1 -0
- package/dist/vite/build.js +15 -3
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/config.d.ts +6 -4
- package/dist/vite/config.js +54 -15
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/config.test.js +7 -5
- package/dist/vite/config.test.js.map +1 -1
- package/dist/vite/dev-server.js +12 -3
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/output.d.ts +1 -1
- package/dist/vite/output.js +39 -10
- package/dist/vite/output.js.map +1 -1
- package/dist/vite/plugin-api.js +67 -20
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-component.js +15 -19
- package/dist/vite/plugin-component.js.map +1 -1
- package/dist/vite/plugin-config-reload.d.ts +1 -2
- package/dist/vite/plugin-config-reload.js.map +1 -1
- package/dist/vite/plugin-config.js +20 -0
- package/dist/vite/plugin-config.js.map +1 -1
- package/dist/vite/plugin-docs.test.js +15 -23
- package/dist/vite/plugin-docs.test.js.map +1 -1
- package/dist/vite/plugin-mdx.js +58 -4
- package/dist/vite/plugin-mdx.js.map +1 -1
- package/dist/vite/{plugin-custom-css.d.ts → plugin-theme-css.d.ts} +2 -2
- package/dist/vite/{plugin-custom-css.js → plugin-theme-css.js} +10 -3
- package/dist/vite/plugin-theme-css.js.map +1 -0
- package/dist/vite/plugin.d.ts +1 -2
- package/dist/vite/plugin.js +2 -2
- package/dist/vite/plugin.js.map +1 -1
- package/dist/vite/prerender.d.ts +2 -1
- package/dist/vite/prerender.js +2 -2
- package/dist/vite/prerender.js.map +1 -1
- package/dist/vite/sitemap.d.ts +1 -1
- package/dist/zuplo/env.d.ts +6 -0
- package/dist/zuplo/env.js +9 -0
- package/dist/zuplo/env.js.map +1 -0
- package/dist/zuplo/with-zuplo.d.ts +3 -0
- package/dist/zuplo/with-zuplo.js +28 -0
- package/dist/zuplo/with-zuplo.js.map +1 -0
- package/lib/AnchorLink-BR0MvI7n.js +35 -0
- package/lib/AnchorLink-BR0MvI7n.js.map +1 -0
- package/lib/{Markdown-ievDDhFT.js → Markdown-CRsmPPfY.js} +13084 -13096
- package/lib/Markdown-CRsmPPfY.js.map +1 -0
- package/lib/MdxPage-Wp8QU0-q.js +188 -0
- package/lib/MdxPage-Wp8QU0-q.js.map +1 -0
- package/lib/{OperationList-BwBl1xrD.js → OperationList-u8xHU9-b.js} +1031 -1016
- package/lib/OperationList-u8xHU9-b.js.map +1 -0
- package/lib/{SlotletProvider-DyomlzGx.js → SlotletProvider-BgvYIPQe.js} +2 -2
- package/lib/{SlotletProvider-DyomlzGx.js.map → SlotletProvider-BgvYIPQe.js.map} +1 -1
- package/lib/{SyntaxHighlight-DkLOsjHS.js → SyntaxHighlight-C31iouiO.js} +1 -3
- package/lib/{SyntaxHighlight-DkLOsjHS.js.map → SyntaxHighlight-C31iouiO.js.map} +1 -1
- package/lib/assets/{worker-CPsGZsve.js → worker-C_2va8B8.js} +8 -9
- package/lib/assets/worker-C_2va8B8.js.map +1 -0
- package/lib/{createServer-DK-g7kbB.js → createServer-BCAHdrpE.js} +4461 -5248
- package/lib/createServer-BCAHdrpE.js.map +1 -0
- package/lib/{index-DNxQ_rCt.js → index-CmdLGbbk.js} +53 -47
- package/lib/index-CmdLGbbk.js.map +1 -0
- package/lib/{AnchorLink-CDlhr8gL.js → index.esm-Bm8pj-bc.js} +223 -254
- package/lib/index.esm-Bm8pj-bc.js.map +1 -0
- package/lib/object_hash-CvlLgU-M.js +785 -0
- package/lib/object_hash-CvlLgU-M.js.map +1 -0
- package/lib/post-processors/removeExtensions.js +11 -0
- package/lib/post-processors/removeExtensions.js.map +1 -0
- package/lib/post-processors/removePaths.js +28 -0
- package/lib/post-processors/removePaths.js.map +1 -0
- package/lib/post-processors/traverse.js +12 -0
- package/lib/post-processors/traverse.js.map +1 -0
- package/lib/ui/Drawer.js +79 -79
- package/lib/ui/Drawer.js.map +1 -1
- package/lib/zudoku.auth-openid.js +42 -37
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +386 -367
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.openapi-worker.js +1 -1
- package/lib/zudoku.plugin-api-catalog.js +121 -0
- package/lib/zudoku.plugin-api-catalog.js.map +1 -0
- package/lib/zudoku.plugin-api-keys.js +1 -1
- package/lib/zudoku.plugin-custom-pages.js +1 -1
- package/lib/zudoku.plugin-markdown.js +15 -14
- package/lib/zudoku.plugin-markdown.js.map +1 -1
- package/lib/zudoku.plugin-openapi.js +1 -1
- package/lib/zudoku.plugin-redirect.js.map +1 -1
- package/package.json +32 -9
- package/src/app/entry.client.tsx +15 -0
- package/src/app/entry.server.tsx +1 -0
- package/src/app/main.tsx +5 -1
- package/src/app/sentry.ts +24 -0
- package/src/app/tailwind.ts +67 -52
- package/src/lib/authentication/providers/openid.tsx +7 -2
- package/src/lib/components/Heading.tsx +13 -13
- package/src/lib/components/Layout.tsx +8 -3
- package/src/lib/components/Markdown.tsx +1 -1
- package/src/lib/components/MobileTopNavigation.tsx +18 -18
- package/src/lib/components/ReactMarkdown.license.txt +21 -0
- package/src/lib/components/ReactMarkdown.tsx +264 -0
- package/src/lib/components/Search.tsx +3 -3
- package/src/lib/components/SyntaxHighlight.tsx +0 -4
- package/src/lib/components/TopNavigation.tsx +1 -1
- package/src/lib/components/navigation/Sidebar.tsx +18 -8
- package/src/lib/components/navigation/SidebarCategory.tsx +10 -9
- package/src/lib/components/navigation/SidebarItem.tsx +10 -13
- package/src/lib/components/navigation/SidebarWrapper.tsx +1 -1
- package/src/lib/core/ZudokuContext.ts +1 -1
- package/src/lib/oas/graphql/index.ts +4 -1
- package/src/lib/oas/parser/upgrade/index.ts +4 -27
- package/src/lib/plugins/api-catalog/Catalog.tsx +124 -0
- package/src/lib/plugins/api-catalog/index.tsx +50 -0
- package/src/lib/plugins/markdown/MdxPage.tsx +27 -1
- package/src/lib/plugins/markdown/index.tsx +3 -1
- package/src/lib/plugins/markdown/resolver.ts +2 -4
- package/src/lib/plugins/openapi/OperationList.tsx +64 -3
- package/src/lib/plugins/openapi/client/GraphQLClient.tsx +17 -0
- package/src/lib/plugins/openapi/client/useCreateQuery.ts +5 -2
- package/src/lib/plugins/openapi/graphql/gql.ts +2 -2
- package/src/lib/plugins/openapi/graphql/graphql.ts +3 -0
- package/src/lib/plugins/openapi/interfaces.ts +1 -1
- package/src/lib/plugins/openapi/playground/PathParams.tsx +1 -0
- package/src/lib/plugins/openapi/post-processors/removeExtensions.test.ts +144 -0
- package/src/lib/plugins/openapi/post-processors/removeExtensions.ts +24 -0
- package/src/lib/plugins/openapi/post-processors/removePaths.test.ts +126 -0
- package/src/lib/plugins/openapi/post-processors/removePaths.ts +55 -0
- package/src/lib/plugins/openapi/post-processors/traverse.ts +1 -0
- package/src/lib/plugins/redirect/index.tsx +1 -1
- package/src/lib/util/MdxComponents.tsx +2 -5
- package/src/lib/util/traverse.ts +25 -0
- package/dist/vite/plugin-custom-css.js.map +0 -1
- package/lib/AnchorLink-CDlhr8gL.js.map +0 -1
- package/lib/Markdown-ievDDhFT.js.map +0 -1
- package/lib/MdxPage-Bwn-VSsH.js +0 -174
- package/lib/MdxPage-Bwn-VSsH.js.map +0 -1
- package/lib/OperationList-BwBl1xrD.js.map +0 -1
- package/lib/assets/worker-CPsGZsve.js.map +0 -1
- package/lib/createServer-DK-g7kbB.js.map +0 -1
- package/lib/index-DNxQ_rCt.js.map +0 -1
- package/lib/prism-markup-templating-DZrrEs0A.js +0 -62
- package/lib/prism-markup-templating-DZrrEs0A.js.map +0 -1
- package/lib/prism-php.min-o7FpoMP_.js +0 -11
- package/lib/prism-php.min-o7FpoMP_.js.map +0 -1
|
@@ -1,36 +1,39 @@
|
|
|
1
1
|
import { j as d } from "./jsx-runtime-B6kdoens.js";
|
|
2
2
|
import { g as Ht } from "./utils-DcpDOncX.js";
|
|
3
|
+
import { H as Tn } from "./index.esm-Bm8pj-bc.js";
|
|
3
4
|
import { C as nr } from "./CategoryHeading-Bb9dqxD3.js";
|
|
4
|
-
import { I as
|
|
5
|
+
import { I as Cn, M as be, H as _e, P as we } from "./Markdown-CRsmPPfY.js";
|
|
5
6
|
import { c as D } from "./cn-BmFQLtkS.js";
|
|
6
|
-
import { CheckIcon as
|
|
7
|
-
import { useContext as
|
|
8
|
-
import { a as
|
|
9
|
-
import { Button as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
7
|
+
import { CheckIcon as Pn, CopyIcon as kn, ChevronDownIcon as En, CircleFadingPlusIcon as Nn, CircleDotIcon as Rn, CircleIcon as An, SquareMinusIcon as qn, SquarePlusIcon as In, ListPlusIcon as Ln } from "lucide-react";
|
|
8
|
+
import { useContext as Un, useMemo as Jr, useTransition as Gr, useState as ve, useRef as Vr, useEffect as Qr, useLayoutEffect as Fn, Fragment as _n, useCallback as Hn } from "react";
|
|
9
|
+
import { a as Kr } from "./state-tsXBLONe.js";
|
|
10
|
+
import { Button as Dr } from "./ui/Button.js";
|
|
11
|
+
import { h as Bn } from "./object_hash-CvlLgU-M.js";
|
|
12
|
+
import { a as Mn, u as Bt } from "./context-D1nXWxm7.js";
|
|
13
|
+
import { g as ut, S as Yr, C as Xr, P as zn } from "./index-CmdLGbbk.js";
|
|
14
|
+
import { Tabs as Wn, TabsList as Jn, TabsTrigger as Gn, TabsContent as Vn } from "./ui/Tabs.js";
|
|
15
|
+
import { T as fe, b as Qn } from "./SidebarBadge-DxFJcJ6V.js";
|
|
16
|
+
import { Card as de, CardHeader as Kn, CardTitle as Dn, CardContent as Yn } from "./ui/Card.js";
|
|
17
|
+
import { g as Xn, c as He, a as Zn } from "./_commonjsHelpers-BkfeUUK-.js";
|
|
18
|
+
import { _ as eo } from "./__vite-browser-external-BYRIRx8p.js";
|
|
19
|
+
import { u as to } from "./index-Yn8c3UWE.js";
|
|
20
|
+
import { S as Mt } from "./SyntaxHighlight-C31iouiO.js";
|
|
19
21
|
import { B as or } from "./Button-jK0EsymC.js";
|
|
20
22
|
import * as ee from "@radix-ui/react-collapsible";
|
|
21
23
|
import * as De from "@radix-ui/react-tabs";
|
|
22
|
-
function
|
|
24
|
+
function ro(t, e) {
|
|
23
25
|
return e;
|
|
24
26
|
}
|
|
25
27
|
const zt = (t, ...e) => {
|
|
26
|
-
const r =
|
|
28
|
+
const r = Un(Mn);
|
|
27
29
|
if (r === void 0)
|
|
28
30
|
throw new Error("useGraphQL must be used within a GraphQLProvider");
|
|
31
|
+
const o = Jr(() => Bn(e[0] ?? {}), [e]);
|
|
29
32
|
return {
|
|
30
33
|
queryFn: () => r.fetch(t, ...e),
|
|
31
|
-
queryKey: [t,
|
|
34
|
+
queryKey: [t, o]
|
|
32
35
|
};
|
|
33
|
-
},
|
|
36
|
+
}, no = ut(
|
|
34
37
|
/* GraphQL */
|
|
35
38
|
`
|
|
36
39
|
query ServersQuery($input: JSON!, $type: SchemaType!) {
|
|
@@ -45,7 +48,7 @@ const zt = (t, ...e) => {
|
|
|
45
48
|
), ar = ({ url: t }) => {
|
|
46
49
|
const [e, r] = ve(!1);
|
|
47
50
|
return /* @__PURE__ */ d.jsx(
|
|
48
|
-
|
|
51
|
+
Dr,
|
|
49
52
|
{
|
|
50
53
|
onClick: () => {
|
|
51
54
|
navigator.clipboard.writeText(t).then(() => {
|
|
@@ -54,30 +57,30 @@ const zt = (t, ...e) => {
|
|
|
54
57
|
},
|
|
55
58
|
variant: "ghost",
|
|
56
59
|
size: "icon",
|
|
57
|
-
children: e ? /* @__PURE__ */ d.jsx(
|
|
60
|
+
children: e ? /* @__PURE__ */ d.jsx(Pn, { className: "text-green-600", size: 14 }) : /* @__PURE__ */ d.jsx(kn, { size: 14, strokeWidth: 1.3 })
|
|
58
61
|
}
|
|
59
62
|
);
|
|
60
|
-
},
|
|
61
|
-
const { input: t, type: e } = Bt(), r = zt(
|
|
62
|
-
return
|
|
63
|
+
}, oo = () => {
|
|
64
|
+
const { input: t, type: e } = Bt(), r = zt(no, { input: t, type: e }), o = Ht(r), [, s] = Gr(), { selectedServer: a, setSelectedServer: n } = Kr(), { servers: i } = o.data.schema;
|
|
65
|
+
return i.length === 1 ? /* @__PURE__ */ d.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
63
66
|
/* @__PURE__ */ d.jsx("span", { className: "font-medium text-sm", children: "Endpoint:" }),
|
|
64
|
-
/* @__PURE__ */ d.jsx(
|
|
65
|
-
/* @__PURE__ */ d.jsx(ar, { url:
|
|
67
|
+
/* @__PURE__ */ d.jsx(Cn, { className: "text-xs px-2 py-1.5", selectOnClick: !0, children: i[0].url }),
|
|
68
|
+
/* @__PURE__ */ d.jsx(ar, { url: i[0].url })
|
|
66
69
|
] }) : /* @__PURE__ */ d.jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
67
70
|
/* @__PURE__ */ d.jsxs("span", { className: "font-medium text-sm", children: [
|
|
68
|
-
|
|
71
|
+
i.length > 1 ? "Endpoints" : "Endpoint",
|
|
69
72
|
":"
|
|
70
73
|
] }),
|
|
71
74
|
/* @__PURE__ */ d.jsx(
|
|
72
|
-
|
|
75
|
+
Yr,
|
|
73
76
|
{
|
|
74
77
|
className: "font-mono text-xs bg-border/50 dark:bg-border/70 py-1.5 max-w-[450px] truncate",
|
|
75
|
-
onChange: (l) =>
|
|
78
|
+
onChange: (l) => s(() => {
|
|
76
79
|
n(l.target.value);
|
|
77
80
|
}),
|
|
78
81
|
value: a ?? o.data.schema.url,
|
|
79
|
-
showChevrons:
|
|
80
|
-
options:
|
|
82
|
+
showChevrons: i.length > 1,
|
|
83
|
+
options: i.map((l) => ({
|
|
81
84
|
value: l.url,
|
|
82
85
|
label: l.url
|
|
83
86
|
}))
|
|
@@ -85,24 +88,24 @@ const zt = (t, ...e) => {
|
|
|
85
88
|
),
|
|
86
89
|
/* @__PURE__ */ d.jsx(ar, { url: a ?? o.data.schema.url })
|
|
87
90
|
] });
|
|
88
|
-
},
|
|
91
|
+
}, Zr = (t, e) => t.reduce(
|
|
89
92
|
(r, o) => {
|
|
90
|
-
const
|
|
91
|
-
return r[
|
|
93
|
+
const s = e(o);
|
|
94
|
+
return r[s] || (r[s] = []), r[s].push(o), r;
|
|
92
95
|
},
|
|
93
96
|
{}
|
|
94
|
-
),
|
|
97
|
+
), ao = (t, e) => t ? e(t) : void 0, io = (t) => t.schema != null && typeof t.schema == "object" ? t.schema : {
|
|
95
98
|
type: "string"
|
|
96
|
-
},
|
|
99
|
+
}, so = ({
|
|
97
100
|
parameter: t,
|
|
98
101
|
group: e,
|
|
99
102
|
id: r
|
|
100
103
|
}) => {
|
|
101
|
-
const o =
|
|
104
|
+
const o = io(t);
|
|
102
105
|
return /* @__PURE__ */ d.jsxs("li", { className: "p-4 bg-border/20 text-sm flex flex-col gap-1", children: [
|
|
103
106
|
/* @__PURE__ */ d.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
104
107
|
/* @__PURE__ */ d.jsx("code", { children: e === "path" ? /* @__PURE__ */ d.jsx(
|
|
105
|
-
|
|
108
|
+
Xr,
|
|
106
109
|
{
|
|
107
110
|
name: t.name,
|
|
108
111
|
backgroundOpacity: "15%",
|
|
@@ -120,14 +123,14 @@ const zt = (t, ...e) => {
|
|
|
120
123
|
}
|
|
121
124
|
)
|
|
122
125
|
] });
|
|
123
|
-
},
|
|
126
|
+
}, lo = ({
|
|
124
127
|
group: t,
|
|
125
128
|
parameters: e,
|
|
126
129
|
id: r
|
|
127
130
|
}) => /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
|
|
128
131
|
/* @__PURE__ */ d.jsx(_e, { level: 3, id: `${r}/${t}-parameters`, className: "capitalize", children: t === "header" ? "Headers" : `${t} Parameters` }),
|
|
129
|
-
/* @__PURE__ */ d.jsx(de, { children: /* @__PURE__ */ d.jsx("ul", { className: "list-none m-0 px-0 divide-y ", children: e.sort((o,
|
|
130
|
-
|
|
132
|
+
/* @__PURE__ */ d.jsx(de, { children: /* @__PURE__ */ d.jsx("ul", { className: "list-none m-0 px-0 divide-y ", children: e.sort((o, s) => o.required === s.required ? 0 : o.required ? -1 : 1).map((o) => /* @__PURE__ */ d.jsx(
|
|
133
|
+
so,
|
|
131
134
|
{
|
|
132
135
|
parameter: o,
|
|
133
136
|
id: r,
|
|
@@ -147,41 +150,41 @@ var ir = (t, e) => {
|
|
|
147
150
|
*/
|
|
148
151
|
constructor({ indent: t, join: e } = {}) {
|
|
149
152
|
this.postProcessors = [], this.code = [], this.indentationCharacter = sr, this.lineJoin = lr, this.indentLine = (r, o = 0) => `${this.indentationCharacter.repeat(o)}${r}`, this.unshift = (r, o) => {
|
|
150
|
-
const
|
|
151
|
-
this.code.unshift(
|
|
153
|
+
const s = this.indentLine(r, o);
|
|
154
|
+
this.code.unshift(s);
|
|
152
155
|
}, this.push = (r, o) => {
|
|
153
|
-
const
|
|
154
|
-
this.code.push(
|
|
156
|
+
const s = this.indentLine(r, o);
|
|
157
|
+
this.code.push(s);
|
|
155
158
|
}, this.blank = () => {
|
|
156
159
|
this.code.push("");
|
|
157
160
|
}, this.join = () => {
|
|
158
161
|
const r = this.code.join(this.lineJoin);
|
|
159
|
-
return this.postProcessors.reduce((
|
|
162
|
+
return this.postProcessors.reduce((s, a) => a(s), r);
|
|
160
163
|
}, this.addPostProcessor = (r) => {
|
|
161
164
|
this.postProcessors = [...this.postProcessors, r];
|
|
162
165
|
}, this.indentationCharacter = t || sr, this.lineJoin = e ?? lr;
|
|
163
166
|
}
|
|
164
|
-
},
|
|
167
|
+
}, co = function(t) {
|
|
165
168
|
return Object.prototype.toString.call(t) === "[object RegExp]";
|
|
166
|
-
},
|
|
169
|
+
}, uo = function(t) {
|
|
167
170
|
var e = typeof t;
|
|
168
171
|
return t !== null && (e === "object" || e === "function");
|
|
169
172
|
}, Wt = {};
|
|
170
173
|
Object.defineProperty(Wt, "__esModule", { value: !0 });
|
|
171
174
|
Wt.default = (t) => Object.getOwnPropertySymbols(t).filter((e) => Object.prototype.propertyIsEnumerable.call(t, e));
|
|
172
|
-
const
|
|
173
|
-
var
|
|
175
|
+
const po = co, fo = uo, ho = Wt.default;
|
|
176
|
+
var yo = (t, e, r) => {
|
|
174
177
|
const o = [];
|
|
175
|
-
return function
|
|
176
|
-
n = n || {}, n.indent = n.indent || " ",
|
|
178
|
+
return function s(a, n, i) {
|
|
179
|
+
n = n || {}, n.indent = n.indent || " ", i = i || "";
|
|
177
180
|
let l;
|
|
178
181
|
n.inlineCharacterLimit === void 0 ? l = {
|
|
179
182
|
newLine: `
|
|
180
183
|
`,
|
|
181
184
|
newLineOrSpace: `
|
|
182
185
|
`,
|
|
183
|
-
pad:
|
|
184
|
-
indent:
|
|
186
|
+
pad: i,
|
|
187
|
+
indent: i + n.indent
|
|
185
188
|
} : l = {
|
|
186
189
|
newLine: "@@__STRINGIFY_OBJECT_NEW_LINE__@@",
|
|
187
190
|
newLineOrSpace: "@@__STRINGIFY_OBJECT_NEW_LINE_OR_SPACE__@@",
|
|
@@ -193,11 +196,11 @@ var fo = (t, e, r) => {
|
|
|
193
196
|
return u;
|
|
194
197
|
const f = u.replace(new RegExp(l.newLine, "g"), "").replace(new RegExp(l.newLineOrSpace, "g"), " ").replace(new RegExp(l.pad + "|" + l.indent, "g"), "");
|
|
195
198
|
return f.length <= n.inlineCharacterLimit ? f : u.replace(new RegExp(l.newLine + "|" + l.newLineOrSpace, "g"), `
|
|
196
|
-
`).replace(new RegExp(l.pad, "g"),
|
|
199
|
+
`).replace(new RegExp(l.pad, "g"), i).replace(new RegExp(l.indent, "g"), i + n.indent);
|
|
197
200
|
};
|
|
198
201
|
if (o.indexOf(a) !== -1)
|
|
199
202
|
return '"[Circular]"';
|
|
200
|
-
if (a == null || typeof a == "number" || typeof a == "boolean" || typeof a == "function" || typeof a == "symbol" ||
|
|
203
|
+
if (a == null || typeof a == "number" || typeof a == "boolean" || typeof a == "function" || typeof a == "symbol" || po(a))
|
|
201
204
|
return String(a);
|
|
202
205
|
if (a instanceof Date)
|
|
203
206
|
return `new Date('${a.toISOString()}')`;
|
|
@@ -207,19 +210,19 @@ var fo = (t, e, r) => {
|
|
|
207
210
|
o.push(a);
|
|
208
211
|
const u = "[" + l.newLine + a.map((f, p) => {
|
|
209
212
|
const h = a.length - 1 === p ? l.newLine : "," + l.newLineOrSpace;
|
|
210
|
-
let y =
|
|
213
|
+
let y = s(f, n, i + n.indent);
|
|
211
214
|
return n.transform && (y = n.transform(a, p, y)), l.indent + y + h;
|
|
212
215
|
}).join("") + l.pad + "]";
|
|
213
216
|
return o.pop(), c(u);
|
|
214
217
|
}
|
|
215
|
-
if (
|
|
216
|
-
let u = Object.keys(a).concat(
|
|
218
|
+
if (fo(a)) {
|
|
219
|
+
let u = Object.keys(a).concat(ho(a));
|
|
217
220
|
if (n.filter && (u = u.filter((p) => n.filter(a, p))), u.length === 0)
|
|
218
221
|
return "{}";
|
|
219
222
|
o.push(a);
|
|
220
223
|
const f = "{" + l.newLine + u.map((p, h) => {
|
|
221
|
-
const y = u.length - 1 === h ? l.newLine : "," + l.newLineOrSpace, g = typeof p == "symbol", b = !g && /^[a-z$_][a-z$_0-9]*$/i.test(p), x = g || b ? p :
|
|
222
|
-
let m =
|
|
224
|
+
const y = u.length - 1 === h ? l.newLine : "," + l.newLineOrSpace, g = typeof p == "symbol", b = !g && /^[a-z$_][a-z$_0-9]*$/i.test(p), x = g || b ? p : s(p, n);
|
|
225
|
+
let m = s(a[p], n, i + n.indent);
|
|
223
226
|
return n.transform && (m = n.transform(a, p, m)), l.indent + String(x) + ": " + m + y;
|
|
224
227
|
}).join("") + l.pad + "}";
|
|
225
228
|
return o.pop(), c(f);
|
|
@@ -228,13 +231,13 @@ var fo = (t, e, r) => {
|
|
|
228
231
|
` ? "\\n" : "\\r"), n.singleQuotes === !1 ? (a = a.replace(/"/g, '\\"'), `"${a}"`) : (a = a.replace(/\\?'/g, "\\'"), `'${a}'`);
|
|
229
232
|
}(t, e, r);
|
|
230
233
|
};
|
|
231
|
-
const z = /* @__PURE__ */
|
|
234
|
+
const z = /* @__PURE__ */ Xn(yo);
|
|
232
235
|
function We(t, e = {}) {
|
|
233
|
-
const { delimiter: r = '"', escapeChar: o = "\\", escapeNewlines:
|
|
236
|
+
const { delimiter: r = '"', escapeChar: o = "\\", escapeNewlines: s = !0 } = e;
|
|
234
237
|
return [...t.toString()].map((n) => n === "\b" ? `${o}b` : n === " " ? `${o}t` : n === `
|
|
235
|
-
` ?
|
|
238
|
+
` ? s ? `${o}n` : n : n === "\f" ? `${o}f` : n === "\r" ? s ? `${o}r` : n : n === o ? o + o : n === r ? o + r : n < " " || n > "~" ? JSON.stringify(n).slice(1, -1) : n).join("");
|
|
236
239
|
}
|
|
237
|
-
var Je = (t) => We(t, { delimiter: "'" }), H = (t) => We(t, { delimiter: '"' }),
|
|
240
|
+
var Je = (t) => We(t, { delimiter: "'" }), H = (t) => We(t, { delimiter: '"' }), mo = {
|
|
238
241
|
info: {
|
|
239
242
|
key: "libcurl",
|
|
240
243
|
title: "Libcurl",
|
|
@@ -242,15 +245,15 @@ var Je = (t) => We(t, { delimiter: "'" }), H = (t) => We(t, { delimiter: '"' }),
|
|
|
242
245
|
description: "Simple REST and HTTP API Client for C",
|
|
243
246
|
extname: ".c"
|
|
244
247
|
},
|
|
245
|
-
convert: ({ method: t, fullUrl: e, headersObj: r, allHeaders: o, postData:
|
|
246
|
-
const { push: a, blank: n, join:
|
|
248
|
+
convert: ({ method: t, fullUrl: e, headersObj: r, allHeaders: o, postData: s }) => {
|
|
249
|
+
const { push: a, blank: n, join: i } = new C();
|
|
247
250
|
a("CURL *hnd = curl_easy_init();"), n(), a(`curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "${t.toUpperCase()}");`), a("curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);"), a(`curl_easy_setopt(hnd, CURLOPT_URL, "${e}");`);
|
|
248
251
|
const l = Object.keys(r);
|
|
249
252
|
return l.length && (n(), a("struct curl_slist *headers = NULL;"), l.forEach((c) => {
|
|
250
253
|
a(`headers = curl_slist_append(headers, "${c}: ${H(r[c])}");`);
|
|
251
|
-
}), a("curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);")), o.cookie && (n(), a(`curl_easy_setopt(hnd, CURLOPT_COOKIE, "${o.cookie}");`)),
|
|
254
|
+
}), a("curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);")), o.cookie && (n(), a(`curl_easy_setopt(hnd, CURLOPT_COOKIE, "${o.cookie}");`)), s.text && (n(), a(`curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, ${JSON.stringify(s.text)});`)), n(), a("CURLcode ret = curl_easy_perform(hnd);"), i();
|
|
252
255
|
}
|
|
253
|
-
},
|
|
256
|
+
}, go = {
|
|
254
257
|
info: {
|
|
255
258
|
key: "c",
|
|
256
259
|
title: "C",
|
|
@@ -258,30 +261,30 @@ var Je = (t) => We(t, { delimiter: "'" }), H = (t) => We(t, { delimiter: '"' }),
|
|
|
258
261
|
cli: "c"
|
|
259
262
|
},
|
|
260
263
|
clientsById: {
|
|
261
|
-
libcurl:
|
|
264
|
+
libcurl: mo
|
|
262
265
|
}
|
|
263
266
|
}, J = (t, e) => Object.keys(t).find((r) => r.toLowerCase() === e.toLowerCase()), ue = (t, e) => {
|
|
264
267
|
const r = J(t, e);
|
|
265
268
|
if (r)
|
|
266
269
|
return t[r];
|
|
267
|
-
}, pt = (t, e) => !!J(t, e),
|
|
270
|
+
}, pt = (t, e) => !!J(t, e), bo = (t) => ["application/json", "application/x-json", "text/json", "text/x-json", "+json"].some(
|
|
268
271
|
(e) => t.indexOf(e) > -1
|
|
269
272
|
), cr = class {
|
|
270
273
|
constructor(t) {
|
|
271
274
|
this.name = "", this.toString = () => `:${this.name}`, this.name = t;
|
|
272
275
|
}
|
|
273
|
-
},
|
|
276
|
+
}, vo = class {
|
|
274
277
|
constructor(t) {
|
|
275
278
|
this.path = "", this.toString = () => `(clojure.java.io/file "${this.path}")`, this.path = t;
|
|
276
279
|
}
|
|
277
|
-
},
|
|
280
|
+
}, en = (t) => t === void 0 ? null : t === null ? "null" : t.constructor.name.toLowerCase(), tn = (t) => t === void 0 ? !0 : en(t) === "object" ? Object.keys(t).length === 0 : !1, ur = (t) => (Object.keys(t).filter((e) => tn(t[e])).forEach((e) => {
|
|
278
281
|
delete t[e];
|
|
279
282
|
}), t), et = (t, e) => {
|
|
280
283
|
const r = " ".repeat(t);
|
|
281
284
|
return e.replace(/\n/g, `
|
|
282
285
|
${r}`);
|
|
283
286
|
}, Ct = (t) => {
|
|
284
|
-
switch (
|
|
287
|
+
switch (en(t)) {
|
|
285
288
|
case "string":
|
|
286
289
|
return `"${t.replace(/"/g, '\\"')}"`;
|
|
287
290
|
case "file":
|
|
@@ -294,8 +297,8 @@ ${r}`);
|
|
|
294
297
|
return `#"${t.source}"`;
|
|
295
298
|
case "object": {
|
|
296
299
|
const e = Object.keys(t).reduce((r, o) => {
|
|
297
|
-
const
|
|
298
|
-
return `${r}:${o} ${
|
|
300
|
+
const s = et(o.length + 2, Ct(t[o]));
|
|
301
|
+
return `${r}:${o} ${s}
|
|
299
302
|
`;
|
|
300
303
|
}, "").trim();
|
|
301
304
|
return `{${et(1, e)}}`;
|
|
@@ -307,7 +310,7 @@ ${r}`);
|
|
|
307
310
|
default:
|
|
308
311
|
return t.toString();
|
|
309
312
|
}
|
|
310
|
-
},
|
|
313
|
+
}, xo = {
|
|
311
314
|
info: {
|
|
312
315
|
key: "clj_http",
|
|
313
316
|
title: "clj-http",
|
|
@@ -315,12 +318,12 @@ ${r}`);
|
|
|
315
318
|
description: "An idiomatic clojure http client wrapping the apache client.",
|
|
316
319
|
extname: ".clj"
|
|
317
320
|
},
|
|
318
|
-
convert: ({ queryObj: t, method: e, postData: r, url: o, allHeaders:
|
|
319
|
-
const { push: n, join:
|
|
321
|
+
convert: ({ queryObj: t, method: e, postData: r, url: o, allHeaders: s }, a) => {
|
|
322
|
+
const { push: n, join: i } = new C({ indent: a == null ? void 0 : a.indent }), l = ["get", "post", "put", "delete", "patch", "head", "options"];
|
|
320
323
|
if (e = e.toLowerCase(), !l.includes(e))
|
|
321
|
-
return n("Method not supported"),
|
|
324
|
+
return n("Method not supported"), i();
|
|
322
325
|
const c = {
|
|
323
|
-
headers:
|
|
326
|
+
headers: s,
|
|
324
327
|
"query-params": t
|
|
325
328
|
};
|
|
326
329
|
switch (r.mimeType) {
|
|
@@ -349,7 +352,7 @@ ${r}`);
|
|
|
349
352
|
if (r.params) {
|
|
350
353
|
c.multipart = r.params.map((f) => f.fileName && !f.value ? {
|
|
351
354
|
name: f.name,
|
|
352
|
-
content: new
|
|
355
|
+
content: new vo(f.fileName)
|
|
353
356
|
} : {
|
|
354
357
|
name: f.name,
|
|
355
358
|
content: f.value
|
|
@@ -370,24 +373,24 @@ ${r}`);
|
|
|
370
373
|
break;
|
|
371
374
|
}
|
|
372
375
|
if (n(`(require '[clj-http.client :as client])
|
|
373
|
-
`),
|
|
376
|
+
`), tn(ur(c)))
|
|
374
377
|
n(`(client/${e} "${o}")`);
|
|
375
378
|
else {
|
|
376
379
|
const u = 11 + e.length + o.length, f = et(u, Ct(ur(c)));
|
|
377
380
|
n(`(client/${e} "${o}" ${f})`);
|
|
378
381
|
}
|
|
379
|
-
return
|
|
382
|
+
return i();
|
|
380
383
|
}
|
|
381
|
-
},
|
|
384
|
+
}, $o = {
|
|
382
385
|
info: {
|
|
383
386
|
key: "clojure",
|
|
384
387
|
title: "Clojure",
|
|
385
388
|
default: "clj_http"
|
|
386
389
|
},
|
|
387
390
|
clientsById: {
|
|
388
|
-
clj_http:
|
|
391
|
+
clj_http: xo
|
|
389
392
|
}
|
|
390
|
-
},
|
|
393
|
+
}, jo = (t) => {
|
|
391
394
|
let e = ue(t, "accept-encoding");
|
|
392
395
|
if (!e)
|
|
393
396
|
return [];
|
|
@@ -395,16 +398,16 @@ ${r}`);
|
|
|
395
398
|
gzip: "DecompressionMethods.GZip",
|
|
396
399
|
deflate: "DecompressionMethods.Deflate"
|
|
397
400
|
}, o = [];
|
|
398
|
-
return typeof e == "string" && (e = [e]), e.forEach((
|
|
399
|
-
|
|
401
|
+
return typeof e == "string" && (e = [e]), e.forEach((s) => {
|
|
402
|
+
s.split(",").forEach((a) => {
|
|
400
403
|
const n = /\s*([^;\s]+)/.exec(a);
|
|
401
404
|
if (n) {
|
|
402
|
-
const
|
|
403
|
-
|
|
405
|
+
const i = r[n[1]];
|
|
406
|
+
i && o.push(i);
|
|
404
407
|
}
|
|
405
408
|
});
|
|
406
409
|
}), o;
|
|
407
|
-
},
|
|
410
|
+
}, wo = {
|
|
408
411
|
info: {
|
|
409
412
|
key: "httpclient",
|
|
410
413
|
title: "HttpClient",
|
|
@@ -412,15 +415,15 @@ ${r}`);
|
|
|
412
415
|
description: ".NET Standard HTTP Client",
|
|
413
416
|
extname: ".cs"
|
|
414
417
|
},
|
|
415
|
-
convert: ({ allHeaders: t, postData: e, method: r, fullUrl: o },
|
|
418
|
+
convert: ({ allHeaders: t, postData: e, method: r, fullUrl: o }, s) => {
|
|
416
419
|
var h, y;
|
|
417
420
|
const a = {
|
|
418
421
|
indent: " ",
|
|
419
|
-
...
|
|
420
|
-
}, { push: n, join:
|
|
422
|
+
...s
|
|
423
|
+
}, { push: n, join: i } = new C({ indent: a.indent });
|
|
421
424
|
n("using System.Net.Http.Headers;");
|
|
422
425
|
let l = "";
|
|
423
|
-
const c = !!t.cookie, u =
|
|
426
|
+
const c = !!t.cookie, u = jo(t);
|
|
424
427
|
(c || u.length) && (l = "clientHandler", n("var clientHandler = new HttpClientHandler"), n("{"), c && n("UseCookies = false,", 1), u.length && n(`AutomaticDecompression = ${u.join(" | ")},`, 1), n("};")), n(`var client = new HttpClient(${l});`), n("var request = new HttpRequestMessage"), n("{");
|
|
425
428
|
const f = ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS", "TRACE"];
|
|
426
429
|
r = r.toUpperCase(), r && f.includes(r) ? r = `HttpMethod.${r[0]}${r.substring(1).toLowerCase()}` : r = `new HttpMethod("${r}")`, n(`Method = ${r},`, 1), n(`RequestUri = new Uri("${o}"),`, 1);
|
|
@@ -454,13 +457,13 @@ ${r}`);
|
|
|
454
457
|
break;
|
|
455
458
|
}
|
|
456
459
|
}
|
|
457
|
-
return n("};"), n("using (var response = await client.SendAsync(request))"), n("{"), n("response.EnsureSuccessStatusCode();", 1), n("var body = await response.Content.ReadAsStringAsync();", 1), n("Console.WriteLine(body);", 1), n("}"),
|
|
460
|
+
return n("};"), n("using (var response = await client.SendAsync(request))"), n("{"), n("response.EnsureSuccessStatusCode();", 1), n("var body = await response.Content.ReadAsStringAsync();", 1), n("Console.WriteLine(body);", 1), n("}"), i();
|
|
458
461
|
}
|
|
459
462
|
};
|
|
460
|
-
function
|
|
463
|
+
function So(t) {
|
|
461
464
|
return t[0].toUpperCase() + t.slice(1).toLowerCase();
|
|
462
465
|
}
|
|
463
|
-
var
|
|
466
|
+
var Oo = {
|
|
464
467
|
info: {
|
|
465
468
|
key: "restsharp",
|
|
466
469
|
title: "RestSharp",
|
|
@@ -469,8 +472,8 @@ var jo = {
|
|
|
469
472
|
extname: ".cs",
|
|
470
473
|
installation: "dotnet add package RestSharp"
|
|
471
474
|
},
|
|
472
|
-
convert: ({ method: t, fullUrl: e, headersObj: r, cookies: o, postData:
|
|
473
|
-
const { push: n, join:
|
|
475
|
+
convert: ({ method: t, fullUrl: e, headersObj: r, cookies: o, postData: s, uriObj: a }) => {
|
|
476
|
+
const { push: n, join: i } = new C();
|
|
474
477
|
if (!["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"].includes(
|
|
475
478
|
t.toUpperCase()
|
|
476
479
|
))
|
|
@@ -478,43 +481,43 @@ var jo = {
|
|
|
478
481
|
n(`using RestSharp;
|
|
479
482
|
|
|
480
483
|
`), n(`var options = new RestClientOptions("${e}");`), n("var client = new RestClient(options);"), n('var request = new RestRequest("");');
|
|
481
|
-
const c =
|
|
484
|
+
const c = s.mimeType && s.mimeType === "multipart/form-data";
|
|
482
485
|
switch (c && n("request.AlwaysMultipartFormData = true;"), Object.keys(r).forEach((u) => {
|
|
483
|
-
if (
|
|
484
|
-
c &&
|
|
486
|
+
if (s.mimeType && u.toLowerCase() === "content-type" && s.text) {
|
|
487
|
+
c && s.boundary && n(`request.FormBoundary = "${s.boundary}";`);
|
|
485
488
|
return;
|
|
486
489
|
}
|
|
487
490
|
n(`request.AddHeader("${u}", "${H(r[u])}");`);
|
|
488
491
|
}), o.forEach(({ name: u, value: f }) => {
|
|
489
492
|
n(`request.AddCookie("${u}", "${H(f)}", "${a.pathname}", "${a.host}");`);
|
|
490
|
-
}),
|
|
493
|
+
}), s.mimeType) {
|
|
491
494
|
case "multipart/form-data":
|
|
492
|
-
if (!
|
|
493
|
-
|
|
495
|
+
if (!s.params) break;
|
|
496
|
+
s.params.forEach((u) => {
|
|
494
497
|
u.fileName ? n(`request.AddFile("${u.name}", "${u.fileName}");`) : n(`request.AddParameter("${u.name}", "${u.value}");`);
|
|
495
498
|
});
|
|
496
499
|
break;
|
|
497
500
|
case "application/x-www-form-urlencoded":
|
|
498
|
-
if (!
|
|
499
|
-
|
|
501
|
+
if (!s.params) break;
|
|
502
|
+
s.params.forEach((u) => {
|
|
500
503
|
n(`request.AddParameter("${u.name}", "${u.value}");`);
|
|
501
504
|
});
|
|
502
505
|
break;
|
|
503
506
|
case "application/json": {
|
|
504
|
-
if (!
|
|
505
|
-
const u = JSON.stringify(
|
|
507
|
+
if (!s.text) break;
|
|
508
|
+
const u = JSON.stringify(s.text);
|
|
506
509
|
n(`request.AddJsonBody(${u}, false);`);
|
|
507
510
|
break;
|
|
508
511
|
}
|
|
509
512
|
default:
|
|
510
|
-
if (!
|
|
511
|
-
n(`request.AddStringBody("${
|
|
513
|
+
if (!s.text) break;
|
|
514
|
+
n(`request.AddStringBody("${s.text}", "${s.mimeType}");`);
|
|
512
515
|
}
|
|
513
|
-
return n(`var response = await client.${
|
|
516
|
+
return n(`var response = await client.${So(t)}Async(request);
|
|
514
517
|
`), n(`Console.WriteLine("{0}", response.Content);
|
|
515
|
-
`),
|
|
518
|
+
`), i();
|
|
516
519
|
}
|
|
517
|
-
},
|
|
520
|
+
}, To = {
|
|
518
521
|
info: {
|
|
519
522
|
key: "csharp",
|
|
520
523
|
title: "C#",
|
|
@@ -522,10 +525,10 @@ var jo = {
|
|
|
522
525
|
cli: "dotnet"
|
|
523
526
|
},
|
|
524
527
|
clientsById: {
|
|
525
|
-
httpclient:
|
|
526
|
-
restsharp:
|
|
528
|
+
httpclient: wo,
|
|
529
|
+
restsharp: Oo
|
|
527
530
|
}
|
|
528
|
-
},
|
|
531
|
+
}, Co = {
|
|
529
532
|
info: {
|
|
530
533
|
key: "native",
|
|
531
534
|
title: "NewRequest",
|
|
@@ -533,17 +536,17 @@ var jo = {
|
|
|
533
536
|
description: "Golang HTTP client request",
|
|
534
537
|
extname: ".go"
|
|
535
538
|
},
|
|
536
|
-
convert: ({ postData: t, method: e, allHeaders: r, fullUrl: o },
|
|
537
|
-
const { blank: a, push: n, join:
|
|
539
|
+
convert: ({ postData: t, method: e, allHeaders: r, fullUrl: o }, s = {}) => {
|
|
540
|
+
const { blank: a, push: n, join: i } = new C({ indent: " " }), { showBoilerplate: l = !0, checkErrors: c = !1, printBody: u = !0, timeout: f = -1 } = s, p = c ? "err" : "_", h = l ? 1 : 0, y = () => {
|
|
538
541
|
c && (n("if err != nil {", h), n("panic(err)", h + 1), n("}", h));
|
|
539
542
|
};
|
|
540
543
|
l && (n("package main"), a(), n("import ("), n('"fmt"', h), f > 0 && n('"time"', h), t.text && n('"strings"', h), n('"net/http"', h), u && n('"io"', h), n(")"), a(), n("func main() {"), a());
|
|
541
544
|
const g = f > 0, b = g, x = b ? "client" : "http.DefaultClient";
|
|
542
545
|
return b && (n("client := http.Client{", h), g && n(`Timeout: time.Duration(${f} * time.Second),`, h + 1), n("}", h), a()), n(`url := "${o}"`, h), a(), t.text ? (n(`payload := strings.NewReader(${JSON.stringify(t.text)})`, h), a(), n(`req, ${p} := http.NewRequest("${e}", url, payload)`, h), a()) : (n(`req, ${p} := http.NewRequest("${e}", url, nil)`, h), a()), y(), Object.keys(r).length && (Object.keys(r).forEach((m) => {
|
|
543
546
|
n(`req.Header.Add("${m}", "${H(r[m])}")`, h);
|
|
544
|
-
}), a()), n(`res, ${p} := ${x}.Do(req)`, h), y(), u && (a(), n("defer res.Body.Close()", h), n(`body, ${p} := io.ReadAll(res.Body)`, h), y()), a(), u && n("fmt.Println(string(body))", h), l && (a(), n("}")),
|
|
547
|
+
}), a()), n(`res, ${p} := ${x}.Do(req)`, h), y(), u && (a(), n("defer res.Body.Close()", h), n(`body, ${p} := io.ReadAll(res.Body)`, h), y()), a(), u && n("fmt.Println(string(body))", h), l && (a(), n("}")), i();
|
|
545
548
|
}
|
|
546
|
-
},
|
|
549
|
+
}, Po = {
|
|
547
550
|
info: {
|
|
548
551
|
key: "go",
|
|
549
552
|
title: "Go",
|
|
@@ -551,10 +554,10 @@ var jo = {
|
|
|
551
554
|
cli: "go"
|
|
552
555
|
},
|
|
553
556
|
clientsById: {
|
|
554
|
-
native:
|
|
557
|
+
native: Co
|
|
555
558
|
}
|
|
556
559
|
}, pr = `\r
|
|
557
|
-
`,
|
|
560
|
+
`, ko = {
|
|
558
561
|
info: {
|
|
559
562
|
key: "http1.1",
|
|
560
563
|
title: "HTTP/1.1",
|
|
@@ -562,19 +565,19 @@ var jo = {
|
|
|
562
565
|
description: "HTTP/1.1 request string in accordance with RFC 7230",
|
|
563
566
|
extname: null
|
|
564
567
|
},
|
|
565
|
-
convert: ({ method: t, fullUrl: e, uriObj: r, httpVersion: o, allHeaders:
|
|
566
|
-
const
|
|
568
|
+
convert: ({ method: t, fullUrl: e, uriObj: r, httpVersion: o, allHeaders: s, postData: a }, n) => {
|
|
569
|
+
const i = {
|
|
567
570
|
absoluteURI: !1,
|
|
568
571
|
autoContentLength: !0,
|
|
569
572
|
autoHost: !0,
|
|
570
573
|
...n
|
|
571
|
-
}, { blank: l, push: c, join: u } = new C({ indent: "", join: pr }), f =
|
|
574
|
+
}, { blank: l, push: c, join: u } = new C({ indent: "", join: pr }), f = i.absoluteURI ? e : r.path;
|
|
572
575
|
c(`${t} ${f} ${o}`);
|
|
573
|
-
const p = Object.keys(
|
|
576
|
+
const p = Object.keys(s);
|
|
574
577
|
if (p.forEach((g) => {
|
|
575
578
|
const b = g.toLowerCase().replace(/(^|-)(\w)/g, (x) => x.toUpperCase());
|
|
576
|
-
c(`${b}: ${
|
|
577
|
-
}),
|
|
579
|
+
c(`${b}: ${s[g]}`);
|
|
580
|
+
}), i.autoHost && !p.includes("host") && c(`Host: ${r.host}`), i.autoContentLength && a.text && !p.includes("content-length")) {
|
|
578
581
|
const b = new TextEncoder().encode(a.text).length.toString();
|
|
579
582
|
c(`Content-Length: ${b}`);
|
|
580
583
|
}
|
|
@@ -582,16 +585,16 @@ var jo = {
|
|
|
582
585
|
const h = u(), y = a.text || "";
|
|
583
586
|
return `${h}${pr}${y}`;
|
|
584
587
|
}
|
|
585
|
-
},
|
|
588
|
+
}, Eo = {
|
|
586
589
|
info: {
|
|
587
590
|
key: "http",
|
|
588
591
|
title: "HTTP",
|
|
589
592
|
default: "http1.1"
|
|
590
593
|
},
|
|
591
594
|
clientsById: {
|
|
592
|
-
"http1.1":
|
|
595
|
+
"http1.1": ko
|
|
593
596
|
}
|
|
594
|
-
},
|
|
597
|
+
}, No = {
|
|
595
598
|
info: {
|
|
596
599
|
key: "asynchttp",
|
|
597
600
|
title: "AsyncHttp",
|
|
@@ -599,16 +602,16 @@ var jo = {
|
|
|
599
602
|
description: "Asynchronous Http and WebSocket Client library for Java",
|
|
600
603
|
extname: ".java"
|
|
601
604
|
},
|
|
602
|
-
convert: ({ method: t, allHeaders: e, postData: r, fullUrl: o },
|
|
605
|
+
convert: ({ method: t, allHeaders: e, postData: r, fullUrl: o }, s) => {
|
|
603
606
|
const a = {
|
|
604
607
|
indent: " ",
|
|
605
|
-
...
|
|
606
|
-
}, { blank: n, push:
|
|
607
|
-
return
|
|
608
|
-
|
|
609
|
-
}), r.text &&
|
|
608
|
+
...s
|
|
609
|
+
}, { blank: n, push: i, join: l } = new C({ indent: a.indent });
|
|
610
|
+
return i("AsyncHttpClient client = new DefaultAsyncHttpClient();"), i(`client.prepare("${t.toUpperCase()}", "${o}")`), Object.keys(e).forEach((c) => {
|
|
611
|
+
i(`.setHeader("${c}", "${H(e[c])}")`, 1);
|
|
612
|
+
}), r.text && i(`.setBody(${JSON.stringify(r.text)})`, 1), i(".execute()", 1), i(".toCompletableFuture()", 1), i(".thenAccept(System.out::println)", 1), i(".join();", 1), n(), i("client.close();"), l();
|
|
610
613
|
}
|
|
611
|
-
},
|
|
614
|
+
}, Ro = {
|
|
612
615
|
info: {
|
|
613
616
|
key: "nethttp",
|
|
614
617
|
title: "java.net.http",
|
|
@@ -616,11 +619,11 @@ var jo = {
|
|
|
616
619
|
description: "Java Standardized HTTP Client API",
|
|
617
620
|
extname: ".java"
|
|
618
621
|
},
|
|
619
|
-
convert: ({ allHeaders: t, fullUrl: e, method: r, postData: o },
|
|
622
|
+
convert: ({ allHeaders: t, fullUrl: e, method: r, postData: o }, s) => {
|
|
620
623
|
const a = {
|
|
621
624
|
indent: " ",
|
|
622
|
-
...
|
|
623
|
-
}, { push: n, join:
|
|
625
|
+
...s
|
|
626
|
+
}, { push: n, join: i } = new C({ indent: a.indent });
|
|
624
627
|
return n("HttpRequest request = HttpRequest.newBuilder()"), n(`.uri(URI.create("${e}"))`, 2), Object.keys(t).forEach((l) => {
|
|
625
628
|
n(`.header("${l}", "${H(t[l])}")`, 2);
|
|
626
629
|
}), o.text ? n(
|
|
@@ -628,9 +631,9 @@ var jo = {
|
|
|
628
631
|
2
|
|
629
632
|
) : n(`.method("${r.toUpperCase()}", HttpRequest.BodyPublishers.noBody())`, 2), n(".build();", 2), n(
|
|
630
633
|
"HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());"
|
|
631
|
-
), n("System.out.println(response.body());"),
|
|
634
|
+
), n("System.out.println(response.body());"), i();
|
|
632
635
|
}
|
|
633
|
-
},
|
|
636
|
+
}, Ao = {
|
|
634
637
|
info: {
|
|
635
638
|
key: "okhttp",
|
|
636
639
|
title: "OkHttp",
|
|
@@ -638,16 +641,16 @@ var jo = {
|
|
|
638
641
|
description: "An HTTP Request Client Library",
|
|
639
642
|
extname: ".java"
|
|
640
643
|
},
|
|
641
|
-
convert: ({ postData: t, method: e, fullUrl: r, allHeaders: o },
|
|
644
|
+
convert: ({ postData: t, method: e, fullUrl: r, allHeaders: o }, s) => {
|
|
642
645
|
const a = {
|
|
643
646
|
indent: " ",
|
|
644
|
-
...
|
|
645
|
-
}, { push: n, blank:
|
|
646
|
-
return n("OkHttpClient client = new OkHttpClient();"),
|
|
647
|
+
...s
|
|
648
|
+
}, { push: n, blank: i, join: l } = new C({ indent: a.indent }), c = ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD"], u = ["POST", "PUT", "DELETE", "PATCH"];
|
|
649
|
+
return n("OkHttpClient client = new OkHttpClient();"), i(), t.text && (t.boundary ? n(`MediaType mediaType = MediaType.parse("${t.mimeType}; boundary=${t.boundary}");`) : n(`MediaType mediaType = MediaType.parse("${t.mimeType}");`), n(`RequestBody body = RequestBody.create(mediaType, ${JSON.stringify(t.text)});`)), n("Request request = new Request.Builder()"), n(`.url("${r}")`, 1), c.includes(e.toUpperCase()) ? u.includes(e.toUpperCase()) ? t.text ? n(`.${e.toLowerCase()}(body)`, 1) : n(`.${e.toLowerCase()}(null)`, 1) : n(`.${e.toLowerCase()}()`, 1) : t.text ? n(`.method("${e.toUpperCase()}", body)`, 1) : n(`.method("${e.toUpperCase()}", null)`, 1), Object.keys(o).forEach((f) => {
|
|
647
650
|
n(`.addHeader("${f}", "${H(o[f])}")`, 1);
|
|
648
|
-
}), n(".build();", 1),
|
|
651
|
+
}), n(".build();", 1), i(), n("Response response = client.newCall(request).execute();"), l();
|
|
649
652
|
}
|
|
650
|
-
},
|
|
653
|
+
}, qo = {
|
|
651
654
|
info: {
|
|
652
655
|
key: "unirest",
|
|
653
656
|
title: "Unirest",
|
|
@@ -655,28 +658,28 @@ var jo = {
|
|
|
655
658
|
description: "Lightweight HTTP Request Client Library",
|
|
656
659
|
extname: ".java"
|
|
657
660
|
},
|
|
658
|
-
convert: ({ method: t, allHeaders: e, postData: r, fullUrl: o },
|
|
661
|
+
convert: ({ method: t, allHeaders: e, postData: r, fullUrl: o }, s) => {
|
|
659
662
|
const a = {
|
|
660
663
|
indent: " ",
|
|
661
|
-
...
|
|
662
|
-
}, { join: n, push:
|
|
663
|
-
return ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"].includes(t.toUpperCase()) ?
|
|
664
|
-
|
|
665
|
-
}), r.text &&
|
|
664
|
+
...s
|
|
665
|
+
}, { join: n, push: i } = new C({ indent: a.indent });
|
|
666
|
+
return ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"].includes(t.toUpperCase()) ? i(`HttpResponse<String> response = Unirest.${t.toLowerCase()}("${o}")`) : i(`HttpResponse<String> response = Unirest.customMethod("${t.toUpperCase()}","${o}")`), Object.keys(e).forEach((c) => {
|
|
667
|
+
i(`.header("${c}", "${H(e[c])}")`, 1);
|
|
668
|
+
}), r.text && i(`.body(${JSON.stringify(r.text)})`, 1), i(".asString();", 1), n();
|
|
666
669
|
}
|
|
667
|
-
},
|
|
670
|
+
}, Io = {
|
|
668
671
|
info: {
|
|
669
672
|
key: "java",
|
|
670
673
|
title: "Java",
|
|
671
674
|
default: "unirest"
|
|
672
675
|
},
|
|
673
676
|
clientsById: {
|
|
674
|
-
asynchttp:
|
|
675
|
-
nethttp:
|
|
676
|
-
okhttp:
|
|
677
|
-
unirest:
|
|
677
|
+
asynchttp: No,
|
|
678
|
+
nethttp: Ro,
|
|
679
|
+
okhttp: Ao,
|
|
680
|
+
unirest: qo
|
|
678
681
|
}
|
|
679
|
-
},
|
|
682
|
+
}, Lo = {
|
|
680
683
|
info: {
|
|
681
684
|
key: "axios",
|
|
682
685
|
title: "Axios",
|
|
@@ -685,42 +688,42 @@ var jo = {
|
|
|
685
688
|
extname: ".js",
|
|
686
689
|
installation: "npm install axios --save"
|
|
687
690
|
},
|
|
688
|
-
convert: ({ allHeaders: t, method: e, url: r, queryObj: o, postData:
|
|
691
|
+
convert: ({ allHeaders: t, method: e, url: r, queryObj: o, postData: s }, a) => {
|
|
689
692
|
const n = {
|
|
690
693
|
indent: " ",
|
|
691
694
|
...a
|
|
692
|
-
}, { blank:
|
|
693
|
-
l("import axios from 'axios';"),
|
|
695
|
+
}, { blank: i, push: l, join: c, addPostProcessor: u } = new C({ indent: n.indent });
|
|
696
|
+
l("import axios from 'axios';"), i();
|
|
694
697
|
const f = {
|
|
695
698
|
method: e,
|
|
696
699
|
url: r
|
|
697
700
|
};
|
|
698
|
-
switch (Object.keys(o).length && (f.params = o), Object.keys(t).length && (f.headers = t),
|
|
701
|
+
switch (Object.keys(o).length && (f.params = o), Object.keys(t).length && (f.headers = t), s.mimeType) {
|
|
699
702
|
case "application/x-www-form-urlencoded":
|
|
700
|
-
|
|
703
|
+
s.params && (l("const encodedParams = new URLSearchParams();"), s.params.forEach((h) => {
|
|
701
704
|
l(`encodedParams.set('${h.name}', '${h.value}');`);
|
|
702
|
-
}),
|
|
705
|
+
}), i(), f.data = "encodedParams,", u((h) => h.replace(/'encodedParams,'/, "encodedParams,")));
|
|
703
706
|
break;
|
|
704
707
|
case "application/json":
|
|
705
|
-
|
|
708
|
+
s.jsonObj && (f.data = s.jsonObj);
|
|
706
709
|
break;
|
|
707
710
|
case "multipart/form-data":
|
|
708
|
-
if (!
|
|
711
|
+
if (!s.params)
|
|
709
712
|
break;
|
|
710
|
-
l("const form = new FormData();"),
|
|
713
|
+
l("const form = new FormData();"), s.params.forEach((h) => {
|
|
711
714
|
l(`form.append('${h.name}', '${h.value || h.fileName || ""}');`);
|
|
712
|
-
}),
|
|
715
|
+
}), i(), f.data = "[form]";
|
|
713
716
|
break;
|
|
714
717
|
default:
|
|
715
|
-
|
|
718
|
+
s.text && (f.data = s.text);
|
|
716
719
|
}
|
|
717
720
|
const p = z(f, {
|
|
718
721
|
indent: " ",
|
|
719
722
|
inlineCharacterLimit: 80
|
|
720
723
|
}).replace('"[form]"', "form");
|
|
721
|
-
return l(`const options = ${p};`),
|
|
724
|
+
return l(`const options = ${p};`), i(), l("axios"), l(".request(options)", 1), l(".then(function (response) {", 1), l("console.log(response.data);", 2), l("})", 1), l(".catch(function (error) {", 1), l("console.error(error);", 2), l("});", 1), c();
|
|
722
725
|
}
|
|
723
|
-
},
|
|
726
|
+
}, Uo = {
|
|
724
727
|
info: {
|
|
725
728
|
key: "fetch",
|
|
726
729
|
title: "fetch",
|
|
@@ -728,12 +731,12 @@ var jo = {
|
|
|
728
731
|
description: "Perform asynchronous HTTP requests with the Fetch API",
|
|
729
732
|
extname: ".js"
|
|
730
733
|
},
|
|
731
|
-
convert: ({ method: t, allHeaders: e, postData: r, fullUrl: o },
|
|
734
|
+
convert: ({ method: t, allHeaders: e, postData: r, fullUrl: o }, s) => {
|
|
732
735
|
const a = {
|
|
733
736
|
indent: " ",
|
|
734
737
|
credentials: null,
|
|
735
|
-
...
|
|
736
|
-
}, { blank: n, join:
|
|
738
|
+
...s
|
|
739
|
+
}, { blank: n, join: i, push: l } = new C({ indent: a.indent }), c = {
|
|
737
740
|
method: t
|
|
738
741
|
};
|
|
739
742
|
switch (Object.keys(e).length && (c.headers = e), a.credentials !== null && (c.credentials = a.credentials), r.mimeType) {
|
|
@@ -771,9 +774,9 @@ var jo = {
|
|
|
771
774
|
return p;
|
|
772
775
|
}
|
|
773
776
|
})};`
|
|
774
|
-
), n(), r.params && r.mimeType === "multipart/form-data" && (l("options.body = form;"), n()), l(`fetch('${o}', options)`), l(".then(response => response.json())", 1), l(".then(response => console.log(response))", 1), l(".catch(err => console.error(err));", 1),
|
|
777
|
+
), n(), r.params && r.mimeType === "multipart/form-data" && (l("options.body = form;"), n()), l(`fetch('${o}', options)`), l(".then(response => response.json())", 1), l(".then(response => console.log(response))", 1), l(".catch(err => console.error(err));", 1), i();
|
|
775
778
|
}
|
|
776
|
-
},
|
|
779
|
+
}, Fo = {
|
|
777
780
|
info: {
|
|
778
781
|
key: "jquery",
|
|
779
782
|
title: "jQuery",
|
|
@@ -781,12 +784,12 @@ var jo = {
|
|
|
781
784
|
description: "Perform an asynchronous HTTP (Ajax) requests with jQuery",
|
|
782
785
|
extname: ".js"
|
|
783
786
|
},
|
|
784
|
-
convert: ({ fullUrl: t, method: e, allHeaders: r, postData: o },
|
|
787
|
+
convert: ({ fullUrl: t, method: e, allHeaders: r, postData: o }, s) => {
|
|
785
788
|
var f;
|
|
786
789
|
const a = {
|
|
787
790
|
indent: " ",
|
|
788
|
-
...
|
|
789
|
-
}, { blank: n, push:
|
|
791
|
+
...s
|
|
792
|
+
}, { blank: n, push: i, join: l } = new C({ indent: a.indent }), c = {
|
|
790
793
|
async: !0,
|
|
791
794
|
crossDomain: !0,
|
|
792
795
|
url: t,
|
|
@@ -803,8 +806,8 @@ var jo = {
|
|
|
803
806
|
case "multipart/form-data":
|
|
804
807
|
if (!o.params)
|
|
805
808
|
break;
|
|
806
|
-
if (
|
|
807
|
-
|
|
809
|
+
if (i("const form = new FormData();"), o.params.forEach((p) => {
|
|
810
|
+
i(`form.append('${p.name}', '${p.value || p.fileName || ""}');`);
|
|
808
811
|
}), c.processData = !1, c.contentType = !1, c.mimeType = "multipart/form-data", c.data = "[form]", pt(r, "content-type") && (f = ue(r, "content-type")) != null && f.includes("boundary")) {
|
|
809
812
|
const p = J(r, "content-type");
|
|
810
813
|
p && delete c.headers[p];
|
|
@@ -815,9 +818,9 @@ var jo = {
|
|
|
815
818
|
o.text && (c.data = o.text);
|
|
816
819
|
}
|
|
817
820
|
const u = z(c, { indent: a.indent }).replace("'[form]'", "form");
|
|
818
|
-
return
|
|
821
|
+
return i(`const settings = ${u};`), n(), i("$.ajax(settings).done(function (response) {"), i("console.log(response);", 1), i("});"), l();
|
|
819
822
|
}
|
|
820
|
-
},
|
|
823
|
+
}, _o = {
|
|
821
824
|
info: {
|
|
822
825
|
key: "xhr",
|
|
823
826
|
title: "XMLHttpRequest",
|
|
@@ -825,16 +828,16 @@ var jo = {
|
|
|
825
828
|
description: "W3C Standard API that provides scripted client functionality",
|
|
826
829
|
extname: ".js"
|
|
827
830
|
},
|
|
828
|
-
convert: ({ postData: t, allHeaders: e, method: r, fullUrl: o },
|
|
831
|
+
convert: ({ postData: t, allHeaders: e, method: r, fullUrl: o }, s) => {
|
|
829
832
|
var c;
|
|
830
833
|
const a = {
|
|
831
834
|
indent: " ",
|
|
832
835
|
cors: !0,
|
|
833
|
-
...
|
|
834
|
-
}, { blank: n, push:
|
|
836
|
+
...s
|
|
837
|
+
}, { blank: n, push: i, join: l } = new C({ indent: a.indent });
|
|
835
838
|
switch (t.mimeType) {
|
|
836
839
|
case "application/json":
|
|
837
|
-
|
|
840
|
+
i(
|
|
838
841
|
`const data = JSON.stringify(${z(t.jsonObj, {
|
|
839
842
|
indent: a.indent
|
|
840
843
|
})});`
|
|
@@ -843,8 +846,8 @@ var jo = {
|
|
|
843
846
|
case "multipart/form-data":
|
|
844
847
|
if (!t.params)
|
|
845
848
|
break;
|
|
846
|
-
if (
|
|
847
|
-
|
|
849
|
+
if (i("const data = new FormData();"), t.params.forEach((u) => {
|
|
850
|
+
i(`data.append('${u.name}', '${u.value || u.fileName || ""}');`);
|
|
848
851
|
}), pt(e, "content-type") && (c = ue(e, "content-type")) != null && c.includes("boundary")) {
|
|
849
852
|
const u = J(e, "content-type");
|
|
850
853
|
u && delete e[u];
|
|
@@ -852,25 +855,25 @@ var jo = {
|
|
|
852
855
|
n();
|
|
853
856
|
break;
|
|
854
857
|
default:
|
|
855
|
-
|
|
858
|
+
i(`const data = ${t.text ? `'${t.text}'` : "null"};`), n();
|
|
856
859
|
}
|
|
857
|
-
return
|
|
858
|
-
|
|
859
|
-
}), n(),
|
|
860
|
+
return i("const xhr = new XMLHttpRequest();"), a.cors && i("xhr.withCredentials = true;"), n(), i("xhr.addEventListener('readystatechange', function () {"), i("if (this.readyState === this.DONE) {", 1), i("console.log(this.responseText);", 2), i("}", 1), i("});"), n(), i(`xhr.open('${r}', '${o}');`), Object.keys(e).forEach((u) => {
|
|
861
|
+
i(`xhr.setRequestHeader('${u}', '${Je(e[u])}');`);
|
|
862
|
+
}), n(), i("xhr.send(data);"), l();
|
|
860
863
|
}
|
|
861
|
-
},
|
|
864
|
+
}, Ho = {
|
|
862
865
|
info: {
|
|
863
866
|
key: "javascript",
|
|
864
867
|
title: "JavaScript",
|
|
865
868
|
default: "xhr"
|
|
866
869
|
},
|
|
867
870
|
clientsById: {
|
|
868
|
-
xhr:
|
|
869
|
-
axios:
|
|
870
|
-
fetch:
|
|
871
|
-
jquery:
|
|
871
|
+
xhr: _o,
|
|
872
|
+
axios: Lo,
|
|
873
|
+
fetch: Uo,
|
|
874
|
+
jquery: Fo
|
|
872
875
|
}
|
|
873
|
-
},
|
|
876
|
+
}, Bo = {
|
|
874
877
|
info: {
|
|
875
878
|
key: "native",
|
|
876
879
|
title: "Native JSON",
|
|
@@ -894,26 +897,26 @@ var jo = {
|
|
|
894
897
|
case "multipart/form-data":
|
|
895
898
|
if (!t.params)
|
|
896
899
|
break;
|
|
897
|
-
const
|
|
900
|
+
const s = {};
|
|
898
901
|
t.params.forEach((a) => {
|
|
899
|
-
|
|
900
|
-
}), o =
|
|
902
|
+
s[a.name] = a.value;
|
|
903
|
+
}), o = s;
|
|
901
904
|
break;
|
|
902
905
|
default:
|
|
903
906
|
t.text && (o = t.text);
|
|
904
907
|
}
|
|
905
908
|
return typeof o > "u" || o === "" ? "No JSON body" : JSON.stringify(o, null, r.indent);
|
|
906
909
|
}
|
|
907
|
-
},
|
|
910
|
+
}, Mo = {
|
|
908
911
|
info: {
|
|
909
912
|
key: "json",
|
|
910
913
|
title: "JSON",
|
|
911
914
|
default: "native"
|
|
912
915
|
},
|
|
913
916
|
clientsById: {
|
|
914
|
-
native:
|
|
917
|
+
native: Bo
|
|
915
918
|
}
|
|
916
|
-
},
|
|
919
|
+
}, zo = {
|
|
917
920
|
info: {
|
|
918
921
|
key: "okhttp",
|
|
919
922
|
title: "OkHttp",
|
|
@@ -921,25 +924,25 @@ var jo = {
|
|
|
921
924
|
description: "An HTTP Request Client Library",
|
|
922
925
|
extname: ".kt"
|
|
923
926
|
},
|
|
924
|
-
convert: ({ postData: t, fullUrl: e, method: r, allHeaders: o },
|
|
927
|
+
convert: ({ postData: t, fullUrl: e, method: r, allHeaders: o }, s) => {
|
|
925
928
|
const a = {
|
|
926
929
|
indent: " ",
|
|
927
|
-
...
|
|
928
|
-
}, { blank: n, join:
|
|
930
|
+
...s
|
|
931
|
+
}, { blank: n, join: i, push: l } = new C({ indent: a.indent }), c = ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD"], u = ["POST", "PUT", "DELETE", "PATCH"];
|
|
929
932
|
return l("val client = OkHttpClient()"), n(), t.text && (t.boundary ? l(`val mediaType = MediaType.parse("${t.mimeType}; boundary=${t.boundary}")`) : l(`val mediaType = MediaType.parse("${t.mimeType}")`), l(`val body = RequestBody.create(mediaType, ${JSON.stringify(t.text)})`)), l("val request = Request.Builder()"), l(`.url("${e}")`, 1), c.includes(r.toUpperCase()) ? u.includes(r.toUpperCase()) ? t.text ? l(`.${r.toLowerCase()}(body)`, 1) : l(`.${r.toLowerCase()}(null)`, 1) : l(`.${r.toLowerCase()}()`, 1) : t.text ? l(`.method("${r.toUpperCase()}", body)`, 1) : l(`.method("${r.toUpperCase()}", null)`, 1), Object.keys(o).forEach((f) => {
|
|
930
933
|
l(`.addHeader("${f}", "${H(o[f])}")`, 1);
|
|
931
|
-
}), l(".build()", 1), n(), l("val response = client.newCall(request).execute()"),
|
|
934
|
+
}), l(".build()", 1), n(), l("val response = client.newCall(request).execute()"), i();
|
|
932
935
|
}
|
|
933
|
-
},
|
|
936
|
+
}, Wo = {
|
|
934
937
|
info: {
|
|
935
938
|
key: "kotlin",
|
|
936
939
|
title: "Kotlin",
|
|
937
940
|
default: "okhttp"
|
|
938
941
|
},
|
|
939
942
|
clientsById: {
|
|
940
|
-
okhttp:
|
|
943
|
+
okhttp: zo
|
|
941
944
|
}
|
|
942
|
-
},
|
|
945
|
+
}, Jo = {
|
|
943
946
|
info: {
|
|
944
947
|
key: "axios",
|
|
945
948
|
title: "Axios",
|
|
@@ -948,11 +951,11 @@ var jo = {
|
|
|
948
951
|
extname: ".cjs",
|
|
949
952
|
installation: "npm install axios --save"
|
|
950
953
|
},
|
|
951
|
-
convert: ({ method: t, fullUrl: e, allHeaders: r, postData: o },
|
|
954
|
+
convert: ({ method: t, fullUrl: e, allHeaders: r, postData: o }, s) => {
|
|
952
955
|
const a = {
|
|
953
956
|
indent: " ",
|
|
954
|
-
...
|
|
955
|
-
}, { blank: n, join:
|
|
957
|
+
...s
|
|
958
|
+
}, { blank: n, join: i, push: l, addPostProcessor: c } = new C({ indent: a.indent });
|
|
956
959
|
l("const axios = require('axios');");
|
|
957
960
|
const u = {
|
|
958
961
|
method: t,
|
|
@@ -971,9 +974,9 @@ var jo = {
|
|
|
971
974
|
n(), o.text && (u.data = o.text);
|
|
972
975
|
}
|
|
973
976
|
const f = z(u, { indent: " ", inlineCharacterLimit: 80 });
|
|
974
|
-
return l(`const options = ${f};`), n(), l("axios"), l(".request(options)", 1), l(".then(function (response) {", 1), l("console.log(response.data);", 2), l("})", 1), l(".catch(function (error) {", 1), l("console.error(error);", 2), l("});", 1),
|
|
977
|
+
return l(`const options = ${f};`), n(), l("axios"), l(".request(options)", 1), l(".then(function (response) {", 1), l("console.log(response.data);", 2), l("})", 1), l(".catch(function (error) {", 1), l("console.error(error);", 2), l("});", 1), i();
|
|
975
978
|
}
|
|
976
|
-
},
|
|
979
|
+
}, Go = {
|
|
977
980
|
info: {
|
|
978
981
|
key: "fetch",
|
|
979
982
|
title: "Fetch",
|
|
@@ -982,13 +985,13 @@ var jo = {
|
|
|
982
985
|
extname: ".cjs",
|
|
983
986
|
installation: "npm install node-fetch@2 --save"
|
|
984
987
|
},
|
|
985
|
-
convert: ({ method: t, fullUrl: e, postData: r, headersObj: o, cookies:
|
|
988
|
+
convert: ({ method: t, fullUrl: e, postData: r, headersObj: o, cookies: s }, a) => {
|
|
986
989
|
var g;
|
|
987
990
|
const n = {
|
|
988
991
|
indent: " ",
|
|
989
992
|
...a
|
|
990
993
|
};
|
|
991
|
-
let
|
|
994
|
+
let i = !1;
|
|
992
995
|
const { blank: l, push: c, join: u, unshift: f } = new C({ indent: n.indent });
|
|
993
996
|
c("const fetch = require('node-fetch');");
|
|
994
997
|
const p = e, h = {
|
|
@@ -1012,14 +1015,14 @@ var jo = {
|
|
|
1012
1015
|
c(`formData.append('${x.name}', '${x.value}');`);
|
|
1013
1016
|
return;
|
|
1014
1017
|
}
|
|
1015
|
-
x.fileName && (
|
|
1018
|
+
x.fileName && (i = !0, c(`formData.append('${x.name}', fs.createReadStream('${x.fileName}'));`));
|
|
1016
1019
|
});
|
|
1017
1020
|
break;
|
|
1018
1021
|
default:
|
|
1019
1022
|
r.text && (h.body = r.text);
|
|
1020
1023
|
}
|
|
1021
|
-
if (
|
|
1022
|
-
const b =
|
|
1024
|
+
if (s.length) {
|
|
1025
|
+
const b = s.map(({ name: x, value: m }) => `${encodeURIComponent(x)}=${encodeURIComponent(m)}`).join("; ");
|
|
1023
1026
|
h.headers || (h.headers = {}), h.headers.cookie = b;
|
|
1024
1027
|
}
|
|
1025
1028
|
l(), c(`const url = '${p}';`), h.headers && !Object.keys(h.headers).length && delete h.headers;
|
|
@@ -1031,9 +1034,9 @@ var jo = {
|
|
|
1031
1034
|
// in a `JSON.stringify` call.
|
|
1032
1035
|
transform: (b, x, m) => x === "body" && r.mimeType === "application/json" ? `JSON.stringify(${m})` : m
|
|
1033
1036
|
});
|
|
1034
|
-
return c(`const options = ${y};`), l(),
|
|
1037
|
+
return c(`const options = ${y};`), l(), i && f("const fs = require('fs');"), r.params && r.mimeType === "multipart/form-data" && (c("options.body = formData;"), l()), c("fetch(url, options)"), c(".then(res => res.json())", 1), c(".then(json => console.log(json))", 1), c(".catch(err => console.error('error:' + err));", 1), u().replace(/'encodedParams'/, "encodedParams").replace(/"fs\.createReadStream\(\\"(.+)\\"\)"/, 'fs.createReadStream("$1")');
|
|
1035
1038
|
}
|
|
1036
|
-
},
|
|
1039
|
+
}, Vo = {
|
|
1037
1040
|
info: {
|
|
1038
1041
|
key: "native",
|
|
1039
1042
|
title: "HTTP",
|
|
@@ -1041,9 +1044,9 @@ var jo = {
|
|
|
1041
1044
|
description: "Node.js native HTTP interface",
|
|
1042
1045
|
extname: ".cjs"
|
|
1043
1046
|
},
|
|
1044
|
-
convert: ({ uriObj: t, method: e, allHeaders: r, postData: o },
|
|
1047
|
+
convert: ({ uriObj: t, method: e, allHeaders: r, postData: o }, s = {}) => {
|
|
1045
1048
|
var f;
|
|
1046
|
-
const { indent: a = " " } =
|
|
1049
|
+
const { indent: a = " " } = s, { blank: n, join: i, push: l, unshift: c } = new C({ indent: a }), u = {
|
|
1047
1050
|
method: e,
|
|
1048
1051
|
hostname: t.hostname,
|
|
1049
1052
|
port: t.port,
|
|
@@ -1070,9 +1073,9 @@ var jo = {
|
|
|
1070
1073
|
default:
|
|
1071
1074
|
o.text && l(`req.write(${z(o.text, { indent: a })});`);
|
|
1072
1075
|
}
|
|
1073
|
-
return l("req.end();"),
|
|
1076
|
+
return l("req.end();"), i();
|
|
1074
1077
|
}
|
|
1075
|
-
},
|
|
1078
|
+
}, Qo = {
|
|
1076
1079
|
info: {
|
|
1077
1080
|
key: "request",
|
|
1078
1081
|
title: "Request",
|
|
@@ -1081,19 +1084,19 @@ var jo = {
|
|
|
1081
1084
|
extname: ".cjs",
|
|
1082
1085
|
installation: "npm install request --save"
|
|
1083
1086
|
},
|
|
1084
|
-
convert: ({ method: t, url: e, fullUrl: r, postData: o, headersObj:
|
|
1085
|
-
const
|
|
1087
|
+
convert: ({ method: t, url: e, fullUrl: r, postData: o, headersObj: s, cookies: a }, n) => {
|
|
1088
|
+
const i = {
|
|
1086
1089
|
indent: " ",
|
|
1087
1090
|
...n
|
|
1088
1091
|
};
|
|
1089
1092
|
let l = !1;
|
|
1090
|
-
const { push: c, blank: u, join: f, unshift: p, addPostProcessor: h } = new C({ indent:
|
|
1093
|
+
const { push: c, blank: u, join: f, unshift: p, addPostProcessor: h } = new C({ indent: i.indent });
|
|
1091
1094
|
c("const request = require('request');"), u();
|
|
1092
1095
|
const y = {
|
|
1093
1096
|
method: t,
|
|
1094
1097
|
url: r
|
|
1095
1098
|
};
|
|
1096
|
-
switch (Object.keys(
|
|
1099
|
+
switch (Object.keys(s).length && (y.headers = s), o.mimeType) {
|
|
1097
1100
|
case "application/x-www-form-urlencoded":
|
|
1098
1101
|
y.form = o.paramsObj;
|
|
1099
1102
|
break;
|
|
@@ -1125,7 +1128,7 @@ var jo = {
|
|
|
1125
1128
|
c(`jar.setCookie(request.cookie('${encodeURIComponent(g)}=${encodeURIComponent(b)}'), '${e}');`);
|
|
1126
1129
|
}), u(), h((g) => g.replace(/'JAR'/, "jar"))), l && p("const fs = require('fs');"), c(`const options = ${z(y, { indent: " ", inlineCharacterLimit: 80 })};`), u(), c("request(options, function (error, response, body) {"), c("if (error) throw new Error(error);", 1), u(), c("console.log(body);", 1), c("});"), f();
|
|
1127
1130
|
}
|
|
1128
|
-
},
|
|
1131
|
+
}, Ko = {
|
|
1129
1132
|
info: {
|
|
1130
1133
|
key: "unirest",
|
|
1131
1134
|
title: "Unirest",
|
|
@@ -1133,40 +1136,40 @@ var jo = {
|
|
|
1133
1136
|
description: "Lightweight HTTP Request Client Library",
|
|
1134
1137
|
extname: ".cjs"
|
|
1135
1138
|
},
|
|
1136
|
-
convert: ({ method: t, url: e, cookies: r, queryObj: o, postData:
|
|
1137
|
-
const
|
|
1139
|
+
convert: ({ method: t, url: e, cookies: r, queryObj: o, postData: s, headersObj: a }, n) => {
|
|
1140
|
+
const i = {
|
|
1138
1141
|
indent: " ",
|
|
1139
1142
|
...n
|
|
1140
1143
|
};
|
|
1141
1144
|
let l = !1;
|
|
1142
1145
|
const { addPostProcessor: c, blank: u, join: f, push: p, unshift: h } = new C({
|
|
1143
|
-
indent:
|
|
1146
|
+
indent: i.indent
|
|
1144
1147
|
});
|
|
1145
1148
|
switch (p("const unirest = require('unirest');"), u(), p(`const req = unirest('${t}', '${e}');`), u(), r.length && (p("const CookieJar = unirest.jar();"), r.forEach((y) => {
|
|
1146
1149
|
p(`CookieJar.add('${encodeURIComponent(y.name)}=${encodeURIComponent(y.value)}', '${e}');`);
|
|
1147
|
-
}), p("req.jar(CookieJar);"), u()), Object.keys(o).length && (p(`req.query(${z(o, { indent:
|
|
1150
|
+
}), p("req.jar(CookieJar);"), u()), Object.keys(o).length && (p(`req.query(${z(o, { indent: i.indent })});`), u()), Object.keys(a).length && (p(`req.headers(${z(a, { indent: i.indent })});`), u()), s.mimeType) {
|
|
1148
1151
|
case "application/x-www-form-urlencoded":
|
|
1149
|
-
|
|
1152
|
+
s.paramsObj && (p(`req.form(${z(s.paramsObj, { indent: i.indent })});`), u());
|
|
1150
1153
|
break;
|
|
1151
1154
|
case "application/json":
|
|
1152
|
-
|
|
1155
|
+
s.jsonObj && (p("req.type('json');"), p(`req.send(${z(s.jsonObj, { indent: i.indent })});`), u());
|
|
1153
1156
|
break;
|
|
1154
1157
|
case "multipart/form-data": {
|
|
1155
|
-
if (!
|
|
1158
|
+
if (!s.params)
|
|
1156
1159
|
break;
|
|
1157
1160
|
const y = [];
|
|
1158
|
-
|
|
1161
|
+
s.params.forEach((g) => {
|
|
1159
1162
|
const b = {};
|
|
1160
1163
|
g.fileName && !g.value ? (l = !0, b.body = `fs.createReadStream('${g.fileName}')`, c((x) => x.replace(/'fs\.createReadStream\(\\'(.+)\\'\)'/, "fs.createReadStream('$1')"))) : g.value && (b.body = g.value), b.body && (g.contentType && (b["content-type"] = g.contentType), y.push(b));
|
|
1161
|
-
}), p(`req.multipart(${z(y, { indent:
|
|
1164
|
+
}), p(`req.multipart(${z(y, { indent: i.indent })});`), u();
|
|
1162
1165
|
break;
|
|
1163
1166
|
}
|
|
1164
1167
|
default:
|
|
1165
|
-
|
|
1168
|
+
s.text && (p(`req.send(${z(s.text, { indent: i.indent })});`), u());
|
|
1166
1169
|
}
|
|
1167
1170
|
return l && h("const fs = require('fs');"), p("req.end(function (res) {"), p("if (res.error) throw new Error(res.error);", 1), u(), p("console.log(res.body);", 1), p("});"), f();
|
|
1168
1171
|
}
|
|
1169
|
-
},
|
|
1172
|
+
}, Do = {
|
|
1170
1173
|
info: {
|
|
1171
1174
|
key: "node",
|
|
1172
1175
|
title: "Node.js",
|
|
@@ -1174,15 +1177,15 @@ var jo = {
|
|
|
1174
1177
|
cli: "node %s"
|
|
1175
1178
|
},
|
|
1176
1179
|
clientsById: {
|
|
1177
|
-
native:
|
|
1178
|
-
request:
|
|
1179
|
-
unirest:
|
|
1180
|
-
axios:
|
|
1181
|
-
fetch:
|
|
1180
|
+
native: Vo,
|
|
1181
|
+
request: Qo,
|
|
1182
|
+
unirest: Ko,
|
|
1183
|
+
axios: Jo,
|
|
1184
|
+
fetch: Go
|
|
1182
1185
|
}
|
|
1183
1186
|
}, ht = (t, e, r, o) => {
|
|
1184
|
-
const
|
|
1185
|
-
return `${
|
|
1187
|
+
const s = `${t} *${e} = `, a = Pt(r, o ? s.length : void 0);
|
|
1188
|
+
return `${s}${a};`;
|
|
1186
1189
|
}, Pt = (t, e) => {
|
|
1187
1190
|
const r = e === void 0 ? ", " : `,
|
|
1188
1191
|
${" ".repeat(e)}`;
|
|
@@ -1190,11 +1193,11 @@ var jo = {
|
|
|
1190
1193
|
case "[object Number]":
|
|
1191
1194
|
return `@${t}`;
|
|
1192
1195
|
case "[object Array]":
|
|
1193
|
-
return `@[ ${t.map((
|
|
1196
|
+
return `@[ ${t.map((s) => Pt(s)).join(r)} ]`;
|
|
1194
1197
|
case "[object Object]": {
|
|
1195
1198
|
const o = [];
|
|
1196
|
-
return Object.keys(t).forEach((
|
|
1197
|
-
o.push(`@"${
|
|
1199
|
+
return Object.keys(t).forEach((s) => {
|
|
1200
|
+
o.push(`@"${s}": ${Pt(t[s])}`);
|
|
1198
1201
|
}), `@{ ${o.join(r)} }`;
|
|
1199
1202
|
}
|
|
1200
1203
|
case "[object Boolean]":
|
|
@@ -1202,7 +1205,7 @@ var jo = {
|
|
|
1202
1205
|
default:
|
|
1203
1206
|
return t == null ? "" : `@"${t.toString().replace(/"/g, '\\"')}"`;
|
|
1204
1207
|
}
|
|
1205
|
-
},
|
|
1208
|
+
}, Yo = {
|
|
1206
1209
|
info: {
|
|
1207
1210
|
key: "nsurlsession",
|
|
1208
1211
|
title: "NSURLSession",
|
|
@@ -1210,14 +1213,14 @@ var jo = {
|
|
|
1210
1213
|
description: "Foundation's NSURLSession request",
|
|
1211
1214
|
extname: ".m"
|
|
1212
1215
|
},
|
|
1213
|
-
convert: ({ allHeaders: t, postData: e, method: r, fullUrl: o },
|
|
1216
|
+
convert: ({ allHeaders: t, postData: e, method: r, fullUrl: o }, s) => {
|
|
1214
1217
|
var u;
|
|
1215
1218
|
const a = {
|
|
1216
1219
|
indent: " ",
|
|
1217
1220
|
pretty: !0,
|
|
1218
1221
|
timeout: 10,
|
|
1219
|
-
...
|
|
1220
|
-
}, { push: n, join:
|
|
1222
|
+
...s
|
|
1223
|
+
}, { push: n, join: i, blank: l } = new C({ indent: a.indent }), c = {
|
|
1221
1224
|
hasHeaders: !1,
|
|
1222
1225
|
hasBody: !1
|
|
1223
1226
|
};
|
|
@@ -1257,18 +1260,18 @@ var jo = {
|
|
|
1257
1260
|
), n(" if (error) {", 1), n(' NSLog(@"%@", error);', 2), n(" } else {", 1), n(
|
|
1258
1261
|
" NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;",
|
|
1259
1262
|
2
|
|
1260
|
-
), n(' NSLog(@"%@", httpResponse);', 2), n(" }", 1), n(" }];"), n("[dataTask resume];"),
|
|
1263
|
+
), n(' NSLog(@"%@", httpResponse);', 2), n(" }", 1), n(" }];"), n("[dataTask resume];"), i();
|
|
1261
1264
|
}
|
|
1262
|
-
},
|
|
1265
|
+
}, Xo = {
|
|
1263
1266
|
info: {
|
|
1264
1267
|
key: "objc",
|
|
1265
1268
|
title: "Objective-C",
|
|
1266
1269
|
default: "nsurlsession"
|
|
1267
1270
|
},
|
|
1268
1271
|
clientsById: {
|
|
1269
|
-
nsurlsession:
|
|
1272
|
+
nsurlsession: Yo
|
|
1270
1273
|
}
|
|
1271
|
-
},
|
|
1274
|
+
}, Zo = {
|
|
1272
1275
|
info: {
|
|
1273
1276
|
key: "cohttp",
|
|
1274
1277
|
title: "CoHTTP",
|
|
@@ -1277,31 +1280,31 @@ var jo = {
|
|
|
1277
1280
|
extname: ".ml",
|
|
1278
1281
|
installation: "opam install cohttp-lwt-unix cohttp-async"
|
|
1279
1282
|
},
|
|
1280
|
-
convert: ({ fullUrl: t, allHeaders: e, postData: r, method: o },
|
|
1283
|
+
convert: ({ fullUrl: t, allHeaders: e, postData: r, method: o }, s) => {
|
|
1281
1284
|
const a = {
|
|
1282
1285
|
indent: " ",
|
|
1283
|
-
...
|
|
1284
|
-
}, n = ["get", "post", "head", "delete", "patch", "put", "options"], { push:
|
|
1285
|
-
|
|
1286
|
+
...s
|
|
1287
|
+
}, n = ["get", "post", "head", "delete", "patch", "put", "options"], { push: i, blank: l, join: c } = new C({ indent: a.indent });
|
|
1288
|
+
i("open Cohttp_lwt_unix"), i("open Cohttp"), i("open Lwt"), l(), i(`let uri = Uri.of_string "${t}" in`);
|
|
1286
1289
|
const u = Object.keys(e);
|
|
1287
|
-
u.length === 1 ?
|
|
1290
|
+
u.length === 1 ? i(
|
|
1288
1291
|
`let headers = Header.add (Header.init ()) "${u[0]}" "${H(
|
|
1289
1292
|
e[u[0]]
|
|
1290
1293
|
)}" in`
|
|
1291
|
-
) : u.length > 1 && (
|
|
1292
|
-
|
|
1293
|
-
}),
|
|
1294
|
+
) : u.length > 1 && (i("let headers = Header.add_list (Header.init ()) ["), u.forEach((y) => {
|
|
1295
|
+
i(`("${y}", "${H(e[y])}");`, 1);
|
|
1296
|
+
}), i("] in")), r.text && i(`let body = Cohttp_lwt_body.of_string ${JSON.stringify(r.text)} in`), l();
|
|
1294
1297
|
const f = u.length ? "~headers " : "", p = r.text ? "~body " : "", h = n.includes(o.toLowerCase()) ? `\`${o.toUpperCase()}` : `(Code.method_of_string "${o}")`;
|
|
1295
|
-
return
|
|
1298
|
+
return i(`Client.call ${f}${p}${h} uri`), i(">>= fun (res, body_stream) ->"), i("(* Do stuff with the result *)", 1), c();
|
|
1296
1299
|
}
|
|
1297
|
-
},
|
|
1300
|
+
}, ea = {
|
|
1298
1301
|
info: {
|
|
1299
1302
|
key: "ocaml",
|
|
1300
1303
|
title: "OCaml",
|
|
1301
1304
|
default: "cohttp"
|
|
1302
1305
|
},
|
|
1303
1306
|
clientsById: {
|
|
1304
|
-
cohttp:
|
|
1307
|
+
cohttp: Zo
|
|
1305
1308
|
}
|
|
1306
1309
|
}, N = (t, e, r) => {
|
|
1307
1310
|
switch (r = r || "", e = e || "", Object.prototype.toString.call(t)) {
|
|
@@ -1316,7 +1319,7 @@ var jo = {
|
|
|
1316
1319
|
case "[object Number]":
|
|
1317
1320
|
return t.toString();
|
|
1318
1321
|
case "[object Array]": {
|
|
1319
|
-
const o = t.map((
|
|
1322
|
+
const o = t.map((s) => N(s, `${e}${e}`, e)).join(`,
|
|
1320
1323
|
${e}`);
|
|
1321
1324
|
return `[
|
|
1322
1325
|
${e}${o}
|
|
@@ -1324,8 +1327,8 @@ ${r}]`;
|
|
|
1324
1327
|
}
|
|
1325
1328
|
case "[object Object]": {
|
|
1326
1329
|
const o = [];
|
|
1327
|
-
for (const
|
|
1328
|
-
Object.prototype.hasOwnProperty.call(t,
|
|
1330
|
+
for (const s in t)
|
|
1331
|
+
Object.prototype.hasOwnProperty.call(t, s) && o.push(`${N(s, e)} => ${N(t[s], `${e}${e}`, e)}`);
|
|
1329
1332
|
return `[
|
|
1330
1333
|
${e}${o.join(`,
|
|
1331
1334
|
${e}`)}
|
|
@@ -1362,7 +1365,7 @@ ${r}]`;
|
|
|
1362
1365
|
"UNLOCK",
|
|
1363
1366
|
"UPDATE",
|
|
1364
1367
|
"VERSION_CONTROL"
|
|
1365
|
-
],
|
|
1368
|
+
], ta = {
|
|
1366
1369
|
info: {
|
|
1367
1370
|
key: "curl",
|
|
1368
1371
|
title: "cURL",
|
|
@@ -1370,7 +1373,7 @@ ${r}]`;
|
|
|
1370
1373
|
description: "PHP with ext-curl",
|
|
1371
1374
|
extname: ".php"
|
|
1372
1375
|
},
|
|
1373
|
-
convert: ({ uriObj: t, postData: e, fullUrl: r, method: o, httpVersion:
|
|
1376
|
+
convert: ({ uriObj: t, postData: e, fullUrl: r, method: o, httpVersion: s, cookies: a, headersObj: n }, i = {}) => {
|
|
1374
1377
|
const {
|
|
1375
1378
|
closingTag: l = !1,
|
|
1376
1379
|
indent: c = " ",
|
|
@@ -1379,7 +1382,7 @@ ${r}]`;
|
|
|
1379
1382
|
noTags: p = !1,
|
|
1380
1383
|
shortTags: h = !1,
|
|
1381
1384
|
timeout: y = 30
|
|
1382
|
-
} =
|
|
1385
|
+
} = i, { push: g, blank: b, join: x } = new C({ indent: c });
|
|
1383
1386
|
p || (g(h ? "<?" : "<?php"), b()), g("$curl = curl_init();"), b();
|
|
1384
1387
|
const m = [
|
|
1385
1388
|
{
|
|
@@ -1415,7 +1418,7 @@ ${r}]`;
|
|
|
1415
1418
|
{
|
|
1416
1419
|
escape: !1,
|
|
1417
1420
|
name: "CURLOPT_HTTP_VERSION",
|
|
1418
|
-
value:
|
|
1421
|
+
value: s === "HTTP/1.0" ? "CURL_HTTP_VERSION_1_0" : "CURL_HTTP_VERSION_1_1"
|
|
1419
1422
|
},
|
|
1420
1423
|
{
|
|
1421
1424
|
escape: !0,
|
|
@@ -1434,13 +1437,13 @@ ${c}` });
|
|
|
1434
1437
|
m.forEach(({ value: S, name: k, escape: E }) => {
|
|
1435
1438
|
S != null && v.push(`${k} => ${E ? JSON.stringify(S) : S},`);
|
|
1436
1439
|
});
|
|
1437
|
-
const
|
|
1438
|
-
|
|
1439
|
-
const
|
|
1440
|
-
return
|
|
1440
|
+
const w = a.map((S) => `${encodeURIComponent(S.name)}=${encodeURIComponent(S.value)}`);
|
|
1441
|
+
w.length && v.push(`CURLOPT_COOKIE => "${w.join("; ")}",`);
|
|
1442
|
+
const j = Object.keys(n).sort().map((S) => `"${S}: ${H(n[S])}"`);
|
|
1443
|
+
return j.length && (v.push("CURLOPT_HTTPHEADER => ["), v.push(j.join(`,
|
|
1441
1444
|
${c}${c}`), 1), v.push("],")), g(v.join(), 1), g("]);"), b(), g("$response = curl_exec($curl);"), g("$err = curl_error($curl);"), b(), g("curl_close($curl);"), b(), g("if ($err) {"), g(f ? 'echo array_flip(get_defined_constants(true)["curl"])[$err];' : 'echo "cURL Error #:" . $err;', 1), g("} else {"), g("echo $response;", 1), g("}"), !p && l && (b(), g("?>")), x();
|
|
1442
1445
|
}
|
|
1443
|
-
},
|
|
1446
|
+
}, ra = {
|
|
1444
1447
|
info: {
|
|
1445
1448
|
key: "guzzle",
|
|
1446
1449
|
title: "Guzzle",
|
|
@@ -1449,7 +1452,7 @@ ${c}${c}`), 1), v.push("],")), g(v.join(), 1), g("]);"), b(), g("$response = cur
|
|
|
1449
1452
|
extname: ".php",
|
|
1450
1453
|
installation: "composer require guzzlehttp/guzzle"
|
|
1451
1454
|
},
|
|
1452
|
-
convert: ({ postData: t, fullUrl: e, method: r, cookies: o, headersObj:
|
|
1455
|
+
convert: ({ postData: t, fullUrl: e, method: r, cookies: o, headersObj: s }, a) => {
|
|
1453
1456
|
var g;
|
|
1454
1457
|
const n = {
|
|
1455
1458
|
closingTag: !1,
|
|
@@ -1457,8 +1460,8 @@ ${c}${c}`), 1), v.push("],")), g(v.join(), 1), g("]);"), b(), g("$response = cur
|
|
|
1457
1460
|
noTags: !1,
|
|
1458
1461
|
shortTags: !1,
|
|
1459
1462
|
...a
|
|
1460
|
-
}, { push:
|
|
1461
|
-
switch (n.noTags ||
|
|
1463
|
+
}, { push: i, blank: l, join: c } = new C({ indent: n.indent }), { code: u, push: f, join: p } = new C({ indent: n.indent });
|
|
1464
|
+
switch (n.noTags || i(n.shortTags ? "<?" : "<?php"), i("require_once('vendor/autoload.php');"), l(), t.mimeType) {
|
|
1462
1465
|
case "application/x-www-form-urlencoded":
|
|
1463
1466
|
f(`'form_params' => ${N(t.paramsObj, n.indent + n.indent, n.indent)},`, 1);
|
|
1464
1467
|
break;
|
|
@@ -1476,22 +1479,22 @@ ${c}${c}`), 1), v.push("],")), g(v.join(), 1), g("]);"), b(), g("$response = cur
|
|
|
1476
1479
|
name: x.name,
|
|
1477
1480
|
contents: x.value
|
|
1478
1481
|
});
|
|
1479
|
-
}), b.length && (f(`'multipart' => ${N(b, n.indent + n.indent, n.indent)}`, 1), pt(
|
|
1480
|
-
const x = J(
|
|
1481
|
-
x && delete
|
|
1482
|
+
}), b.length && (f(`'multipart' => ${N(b, n.indent + n.indent, n.indent)}`, 1), pt(s, "content-type") && (g = ue(s, "content-type")) != null && g.indexOf("boundary"))) {
|
|
1483
|
+
const x = J(s, "content-type");
|
|
1484
|
+
x && delete s[x];
|
|
1482
1485
|
}
|
|
1483
1486
|
break;
|
|
1484
1487
|
}
|
|
1485
1488
|
default:
|
|
1486
1489
|
t.text && f(`'body' => ${N(t.text)},`, 1);
|
|
1487
1490
|
}
|
|
1488
|
-
const h = Object.keys(
|
|
1489
|
-
return `${n.indent}${n.indent}'${b}' => '${Je(
|
|
1491
|
+
const h = Object.keys(s).sort().map(function(b) {
|
|
1492
|
+
return `${n.indent}${n.indent}'${b}' => '${Je(s[b])}',`;
|
|
1490
1493
|
}), y = o.map((b) => `${encodeURIComponent(b.name)}=${encodeURIComponent(b.value)}`).join("; ");
|
|
1491
1494
|
return y.length && h.push(`${n.indent}${n.indent}'cookie' => '${Je(y)}',`), h.length && (f("'headers' => [", 1), f(h.join(`
|
|
1492
|
-
`)), f("],", 1)),
|
|
1495
|
+
`)), f("],", 1)), i("$client = new \\GuzzleHttp\\Client();"), l(), u.length ? (i(`$response = $client->request('${r}', '${e}', [`), i(p()), i("]);")) : i(`$response = $client->request('${r}', '${e}');`), l(), i("echo $response->getBody();"), !n.noTags && n.closingTag && (l(), i("?>")), c();
|
|
1493
1496
|
}
|
|
1494
|
-
},
|
|
1497
|
+
}, na = {
|
|
1495
1498
|
info: {
|
|
1496
1499
|
key: "http1",
|
|
1497
1500
|
title: "HTTP v1",
|
|
@@ -1499,9 +1502,9 @@ ${c}${c}`), 1), v.push("],")), g(v.join(), 1), g("]);"), b(), g("$response = cur
|
|
|
1499
1502
|
description: "PHP with pecl/http v1",
|
|
1500
1503
|
extname: ".php"
|
|
1501
1504
|
},
|
|
1502
|
-
convert: ({ method: t, url: e, postData: r, queryObj: o, headersObj:
|
|
1503
|
-
const { closingTag:
|
|
1504
|
-
switch (c || (f(u ? "<?" : "<?php"), p()), fr.includes(t.toUpperCase()) || f(`HttpRequest::methodRegister('${t}');`), f("$request = new HttpRequest();"), f(`$request->setUrl(${N(e)});`), fr.includes(t.toUpperCase()) ? f(`$request->setMethod(HTTP_METH_${t.toUpperCase()});`) : f(`$request->setMethod(HttpRequest::HTTP_METH_${t.toUpperCase()});`), p(), Object.keys(o).length && (f(`$request->setQueryData(${N(o, l)});`), p()), Object.keys(
|
|
1505
|
+
convert: ({ method: t, url: e, postData: r, queryObj: o, headersObj: s, cookiesObj: a }, n = {}) => {
|
|
1506
|
+
const { closingTag: i = !1, indent: l = " ", noTags: c = !1, shortTags: u = !1 } = n, { push: f, blank: p, join: h } = new C({ indent: l });
|
|
1507
|
+
switch (c || (f(u ? "<?" : "<?php"), p()), fr.includes(t.toUpperCase()) || f(`HttpRequest::methodRegister('${t}');`), f("$request = new HttpRequest();"), f(`$request->setUrl(${N(e)});`), fr.includes(t.toUpperCase()) ? f(`$request->setMethod(HTTP_METH_${t.toUpperCase()});`) : f(`$request->setMethod(HttpRequest::HTTP_METH_${t.toUpperCase()});`), p(), Object.keys(o).length && (f(`$request->setQueryData(${N(o, l)});`), p()), Object.keys(s).length && (f(`$request->setHeaders(${N(s, l)});`), p()), Object.keys(a).length && (f(`$request->setCookies(${N(a, l)});`), p()), r.mimeType) {
|
|
1505
1508
|
case "application/x-www-form-urlencoded":
|
|
1506
1509
|
f(`$request->setContentType(${N(r.mimeType)});`), f(`$request->setPostFields(${N(r.paramsObj, l)});`), p();
|
|
1507
1510
|
break;
|
|
@@ -1511,9 +1514,9 @@ ${c}${c}`), 1), v.push("],")), g(v.join(), 1), g("]);"), b(), g("$response = cur
|
|
|
1511
1514
|
default:
|
|
1512
1515
|
r.text && (f(`$request->setBody(${N(r.text)});`), p());
|
|
1513
1516
|
}
|
|
1514
|
-
return f("try {"), f("$response = $request->send();", 1), p(), f("echo $response->getBody();", 1), f("} catch (HttpException $ex) {"), f("echo $ex;", 1), f("}"), !c &&
|
|
1517
|
+
return f("try {"), f("$response = $request->send();", 1), p(), f("echo $response->getBody();", 1), f("} catch (HttpException $ex) {"), f("echo $ex;", 1), f("}"), !c && i && (p(), f("?>")), h();
|
|
1515
1518
|
}
|
|
1516
|
-
},
|
|
1519
|
+
}, oa = {
|
|
1517
1520
|
info: {
|
|
1518
1521
|
key: "http2",
|
|
1519
1522
|
title: "HTTP v2",
|
|
@@ -1521,9 +1524,9 @@ ${c}${c}`), 1), v.push("],")), g(v.join(), 1), g("]);"), b(), g("$response = cur
|
|
|
1521
1524
|
description: "PHP with pecl/http v2",
|
|
1522
1525
|
extname: ".php"
|
|
1523
1526
|
},
|
|
1524
|
-
convert: ({ postData: t, headersObj: e, method: r, queryObj: o, cookiesObj:
|
|
1527
|
+
convert: ({ postData: t, headersObj: e, method: r, queryObj: o, cookiesObj: s, url: a }, n = {}) => {
|
|
1525
1528
|
var g;
|
|
1526
|
-
const { closingTag:
|
|
1529
|
+
const { closingTag: i = !1, indent: l = " ", noTags: c = !1, shortTags: u = !1 } = n, { push: f, blank: p, join: h } = new C({ indent: l });
|
|
1527
1530
|
let y = !1;
|
|
1528
1531
|
switch (c || (f(u ? "<?" : "<?php"), p()), f("$client = new http\\Client;"), f("$request = new http\\Client\\Request;"), p(), t.mimeType) {
|
|
1529
1532
|
case "application/x-www-form-urlencoded":
|
|
@@ -1533,22 +1536,22 @@ ${c}${c}`), 1), v.push("],")), g(v.join(), 1), g("]);"), b(), g("$response = cur
|
|
|
1533
1536
|
if (!t.params)
|
|
1534
1537
|
break;
|
|
1535
1538
|
const b = [], x = {};
|
|
1536
|
-
t.params.forEach(({ name:
|
|
1537
|
-
if (
|
|
1539
|
+
t.params.forEach(({ name: w, fileName: j, value: S, contentType: k }) => {
|
|
1540
|
+
if (j) {
|
|
1538
1541
|
b.push({
|
|
1539
|
-
name:
|
|
1542
|
+
name: w,
|
|
1540
1543
|
type: k,
|
|
1541
|
-
file:
|
|
1544
|
+
file: j,
|
|
1542
1545
|
data: S
|
|
1543
1546
|
});
|
|
1544
1547
|
return;
|
|
1545
1548
|
}
|
|
1546
|
-
S && (x[
|
|
1549
|
+
S && (x[w] = S);
|
|
1547
1550
|
});
|
|
1548
1551
|
const m = Object.keys(x).length ? N(x, l) : "null", v = b.length ? N(b, l) : "null";
|
|
1549
1552
|
if (f("$body = new http\\Message\\Body;"), f(`$body->addForm(${m}, ${v});`), pt(e, "content-type") && (g = ue(e, "content-type")) != null && g.indexOf("boundary")) {
|
|
1550
|
-
const
|
|
1551
|
-
|
|
1553
|
+
const w = J(e, "content-type");
|
|
1554
|
+
w && delete e[w];
|
|
1552
1555
|
}
|
|
1553
1556
|
p(), y = !0;
|
|
1554
1557
|
break;
|
|
@@ -1559,9 +1562,9 @@ ${c}${c}`), 1), v.push("],")), g(v.join(), 1), g("]);"), b(), g("$response = cur
|
|
|
1559
1562
|
default:
|
|
1560
1563
|
t.text && (f("$body = new http\\Message\\Body;"), f(`$body->append(${N(t.text)});`), p(), y = !0);
|
|
1561
1564
|
}
|
|
1562
|
-
return f(`$request->setRequestUrl(${N(a)});`), f(`$request->setRequestMethod(${N(r)});`), y && (f("$request->setBody($body);"), p()), Object.keys(o).length && (f(`$request->setQuery(new http\\QueryString(${N(o, l)}));`), p()), Object.keys(e).length && (f(`$request->setHeaders(${N(e, l)});`), p()), Object.keys(
|
|
1565
|
+
return f(`$request->setRequestUrl(${N(a)});`), f(`$request->setRequestMethod(${N(r)});`), y && (f("$request->setBody($body);"), p()), Object.keys(o).length && (f(`$request->setQuery(new http\\QueryString(${N(o, l)}));`), p()), Object.keys(e).length && (f(`$request->setHeaders(${N(e, l)});`), p()), Object.keys(s).length && (p(), f(`$client->setCookies(${N(s, l)});`), p()), f("$client->enqueue($request)->send();"), f("$response = $client->getResponse();"), p(), f("echo $response->getBody();"), !c && i && (p(), f("?>")), h();
|
|
1563
1566
|
}
|
|
1564
|
-
},
|
|
1567
|
+
}, aa = {
|
|
1565
1568
|
info: {
|
|
1566
1569
|
key: "php",
|
|
1567
1570
|
title: "PHP",
|
|
@@ -1569,24 +1572,24 @@ ${c}${c}`), 1), v.push("],")), g(v.join(), 1), g("]);"), b(), g("$response = cur
|
|
|
1569
1572
|
cli: "php %s"
|
|
1570
1573
|
},
|
|
1571
1574
|
clientsById: {
|
|
1572
|
-
curl:
|
|
1573
|
-
guzzle:
|
|
1574
|
-
http1:
|
|
1575
|
-
http2:
|
|
1575
|
+
curl: ta,
|
|
1576
|
+
guzzle: ra,
|
|
1577
|
+
http1: na,
|
|
1578
|
+
http2: oa
|
|
1576
1579
|
}
|
|
1577
|
-
},
|
|
1580
|
+
}, rn = (t) => ({ method: r, headersObj: o, cookies: s, uriObj: a, fullUrl: n, postData: i, allHeaders: l }) => {
|
|
1578
1581
|
const { push: c, join: u } = new C();
|
|
1579
1582
|
if (!["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"].includes(r.toUpperCase()))
|
|
1580
1583
|
return "Method not supported";
|
|
1581
1584
|
const p = [], h = Object.keys(o);
|
|
1582
1585
|
return h.length && (c("$headers=@{}"), h.forEach((y) => {
|
|
1583
1586
|
y !== "connection" && c(`$headers.Add("${y}", "${We(o[y], { escapeChar: "`" })}")`);
|
|
1584
|
-
}), p.push("-Headers $headers")),
|
|
1587
|
+
}), p.push("-Headers $headers")), s.length && (c("$session = New-Object Microsoft.PowerShell.Commands.WebRequestSession"), s.forEach((y) => {
|
|
1585
1588
|
c("$cookie = New-Object System.Net.Cookie"), c(`$cookie.Name = '${y.name}'`), c(`$cookie.Value = '${y.value}'`), c(`$cookie.Domain = '${a.host}'`), c("$session.Cookies.Add($cookie)");
|
|
1586
|
-
}), p.push("-WebSession $session")),
|
|
1589
|
+
}), p.push("-WebSession $session")), i.text && (p.push(
|
|
1587
1590
|
`-ContentType '${We(ue(l, "content-type"), { delimiter: "'", escapeChar: "`" })}'`
|
|
1588
|
-
), p.push(`-Body '${
|
|
1589
|
-
},
|
|
1591
|
+
), p.push(`-Body '${i.text}'`)), c(`$response = ${t} -Uri '${n}' -Method ${r} ${p.join(" ")}`.trim()), u();
|
|
1592
|
+
}, ia = {
|
|
1590
1593
|
info: {
|
|
1591
1594
|
key: "restmethod",
|
|
1592
1595
|
title: "Invoke-RestMethod",
|
|
@@ -1594,8 +1597,8 @@ ${c}${c}`), 1), v.push("],")), g(v.join(), 1), g("]);"), b(), g("$response = cur
|
|
|
1594
1597
|
description: "Powershell Invoke-RestMethod client",
|
|
1595
1598
|
extname: ".ps1"
|
|
1596
1599
|
},
|
|
1597
|
-
convert:
|
|
1598
|
-
},
|
|
1600
|
+
convert: rn("Invoke-RestMethod")
|
|
1601
|
+
}, sa = {
|
|
1599
1602
|
info: {
|
|
1600
1603
|
key: "webrequest",
|
|
1601
1604
|
title: "Invoke-WebRequest",
|
|
@@ -1603,24 +1606,24 @@ ${c}${c}`), 1), v.push("],")), g(v.join(), 1), g("]);"), b(), g("$response = cur
|
|
|
1603
1606
|
description: "Powershell Invoke-WebRequest client",
|
|
1604
1607
|
extname: ".ps1"
|
|
1605
1608
|
},
|
|
1606
|
-
convert:
|
|
1607
|
-
},
|
|
1609
|
+
convert: rn("Invoke-WebRequest")
|
|
1610
|
+
}, la = {
|
|
1608
1611
|
info: {
|
|
1609
1612
|
key: "powershell",
|
|
1610
1613
|
title: "Powershell",
|
|
1611
1614
|
default: "webrequest"
|
|
1612
1615
|
},
|
|
1613
1616
|
clientsById: {
|
|
1614
|
-
webrequest:
|
|
1615
|
-
restmethod:
|
|
1617
|
+
webrequest: sa,
|
|
1618
|
+
restmethod: ia
|
|
1616
1619
|
}
|
|
1617
1620
|
};
|
|
1618
|
-
function dr(t, e, r, o,
|
|
1619
|
-
const a = o.repeat(
|
|
1621
|
+
function dr(t, e, r, o, s) {
|
|
1622
|
+
const a = o.repeat(s), n = o.repeat(s - 1), i = r ? `,
|
|
1620
1623
|
${a}` : ", ", l = t === "object" ? "{" : "[", c = t === "object" ? "}" : "]";
|
|
1621
1624
|
return r ? `${l}
|
|
1622
|
-
${a}${e.join(
|
|
1623
|
-
${n}${c}` : t === "object" && e.length > 0 ? `${l} ${e.join(
|
|
1625
|
+
${a}${e.join(i)}
|
|
1626
|
+
${n}${c}` : t === "object" && e.length > 0 ? `${l} ${e.join(i)} ${c}` : `${l}${e.join(i)}${c}`;
|
|
1624
1627
|
}
|
|
1625
1628
|
var ke = (t, e, r) => {
|
|
1626
1629
|
switch (r = r === void 0 ? 1 : r + 1, Object.prototype.toString.call(t)) {
|
|
@@ -1628,13 +1631,13 @@ var ke = (t, e, r) => {
|
|
|
1628
1631
|
return t;
|
|
1629
1632
|
case "[object Array]": {
|
|
1630
1633
|
let o = !1;
|
|
1631
|
-
const
|
|
1632
|
-
return dr("array",
|
|
1634
|
+
const s = t.map((a) => (Object.prototype.toString.call(a) === "[object Object]" && (o = Object.keys(a).length > 1), ke(a, e, r)));
|
|
1635
|
+
return dr("array", s, o, e.indent, r);
|
|
1633
1636
|
}
|
|
1634
1637
|
case "[object Object]": {
|
|
1635
1638
|
const o = [];
|
|
1636
|
-
for (const
|
|
1637
|
-
o.push(`"${
|
|
1639
|
+
for (const s in t)
|
|
1640
|
+
o.push(`"${s}": ${ke(t[s], e, r)}`);
|
|
1638
1641
|
return dr("object", o, e.pretty && o.length > 1, e.indent, r);
|
|
1639
1642
|
}
|
|
1640
1643
|
case "[object Null]":
|
|
@@ -1644,7 +1647,7 @@ var ke = (t, e, r) => {
|
|
|
1644
1647
|
default:
|
|
1645
1648
|
return t == null ? "" : `"${t.toString().replace(/"/g, '\\"')}"`;
|
|
1646
1649
|
}
|
|
1647
|
-
},
|
|
1650
|
+
}, ca = ["HEAD", "GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"], ua = {
|
|
1648
1651
|
info: {
|
|
1649
1652
|
key: "requests",
|
|
1650
1653
|
title: "Requests",
|
|
@@ -1653,13 +1656,13 @@ var ke = (t, e, r) => {
|
|
|
1653
1656
|
extname: ".py",
|
|
1654
1657
|
installation: "python -m pip install requests"
|
|
1655
1658
|
},
|
|
1656
|
-
convert: ({ fullUrl: t, postData: e, allHeaders: r, method: o },
|
|
1659
|
+
convert: ({ fullUrl: t, postData: e, allHeaders: r, method: o }, s) => {
|
|
1657
1660
|
const a = {
|
|
1658
1661
|
indent: " ",
|
|
1659
1662
|
pretty: !0,
|
|
1660
|
-
...
|
|
1661
|
-
}, { push: n, blank:
|
|
1662
|
-
n("import requests"),
|
|
1663
|
+
...s
|
|
1664
|
+
}, { push: n, blank: i, join: l, addPostProcessor: c } = new C({ indent: a.indent });
|
|
1665
|
+
n("import requests"), i(), n(`url = "${t}"`), i();
|
|
1663
1666
|
const u = r;
|
|
1664
1667
|
let f = {};
|
|
1665
1668
|
const p = {};
|
|
@@ -1696,21 +1699,21 @@ var ke = (t, e, r) => {
|
|
|
1696
1699
|
}
|
|
1697
1700
|
const b = Object.keys(u).length;
|
|
1698
1701
|
if (b === 0 && (y || h))
|
|
1699
|
-
|
|
1702
|
+
i();
|
|
1700
1703
|
else if (b === 1)
|
|
1701
1704
|
Object.keys(u).forEach((m) => {
|
|
1702
|
-
n(`headers = {"${m}": "${H(u[m])}"}`),
|
|
1705
|
+
n(`headers = {"${m}": "${H(u[m])}"}`), i();
|
|
1703
1706
|
});
|
|
1704
1707
|
else if (b > 1) {
|
|
1705
1708
|
let m = 1;
|
|
1706
1709
|
n("headers = {"), Object.keys(u).forEach((v) => {
|
|
1707
1710
|
n(m !== b ? `"${v}": "${H(u[v])}",` : `"${v}": "${H(u[v])}"`, 1), m += 1;
|
|
1708
|
-
}), n("}"),
|
|
1711
|
+
}), n("}"), i();
|
|
1709
1712
|
}
|
|
1710
|
-
let x =
|
|
1711
|
-
return y && (g ? x += ", json=payload" : x += ", data=payload"), h && (x += ", files=files"), b > 0 && (x += ", headers=headers"), x += ")", n(x),
|
|
1713
|
+
let x = ca.includes(o) ? `response = requests.${o.toLowerCase()}(url` : `response = requests.request("${o}", url`;
|
|
1714
|
+
return y && (g ? x += ", json=payload" : x += ", data=payload"), h && (x += ", files=files"), b > 0 && (x += ", headers=headers"), x += ")", n(x), i(), n("print(response.text)"), l();
|
|
1712
1715
|
}
|
|
1713
|
-
},
|
|
1716
|
+
}, pa = {
|
|
1714
1717
|
info: {
|
|
1715
1718
|
key: "python",
|
|
1716
1719
|
title: "Python",
|
|
@@ -1718,9 +1721,9 @@ var ke = (t, e, r) => {
|
|
|
1718
1721
|
cli: "python3 %s"
|
|
1719
1722
|
},
|
|
1720
1723
|
clientsById: {
|
|
1721
|
-
requests:
|
|
1724
|
+
requests: ua
|
|
1722
1725
|
}
|
|
1723
|
-
},
|
|
1726
|
+
}, fa = {
|
|
1724
1727
|
info: {
|
|
1725
1728
|
key: "httr",
|
|
1726
1729
|
title: "httr",
|
|
@@ -1728,47 +1731,47 @@ var ke = (t, e, r) => {
|
|
|
1728
1731
|
description: "httr: Tools for Working with URLs and HTTP",
|
|
1729
1732
|
extname: ".r"
|
|
1730
1733
|
},
|
|
1731
|
-
convert: ({ url: t, queryObj: e, queryString: r, postData: o, allHeaders:
|
|
1732
|
-
const { push: n, blank:
|
|
1733
|
-
n("library(httr)"),
|
|
1734
|
+
convert: ({ url: t, queryObj: e, queryString: r, postData: o, allHeaders: s, method: a }) => {
|
|
1735
|
+
const { push: n, blank: i, join: l } = new C();
|
|
1736
|
+
n("library(httr)"), i(), n(`url <- "${t}"`), i();
|
|
1734
1737
|
const c = e;
|
|
1735
1738
|
delete e.key;
|
|
1736
1739
|
const u = Object.keys(c).length;
|
|
1737
|
-
r.length === 1 ? (n(`queryString <- list(${Object.keys(c)} = "${Object.values(c).toString()}")`),
|
|
1738
|
-
S !== u - 1 ? n(` ${
|
|
1739
|
-
}), n(")"),
|
|
1740
|
+
r.length === 1 ? (n(`queryString <- list(${Object.keys(c)} = "${Object.values(c).toString()}")`), i()) : r.length > 1 && (n("queryString <- list("), Object.keys(c).forEach((j, S) => {
|
|
1741
|
+
S !== u - 1 ? n(` ${j} = "${c[j].toString()}",`) : n(` ${j} = "${c[j].toString()}"`);
|
|
1742
|
+
}), n(")"), i());
|
|
1740
1743
|
const f = JSON.stringify(o.text);
|
|
1741
|
-
if (f && (n(`payload <- ${f}`),
|
|
1744
|
+
if (f && (n(`payload <- ${f}`), i()), o.text || o.jsonObj || o.params)
|
|
1742
1745
|
switch (o.mimeType) {
|
|
1743
1746
|
case "application/x-www-form-urlencoded":
|
|
1744
|
-
n('encode <- "form"'),
|
|
1747
|
+
n('encode <- "form"'), i();
|
|
1745
1748
|
break;
|
|
1746
1749
|
case "application/json":
|
|
1747
|
-
n('encode <- "json"'),
|
|
1750
|
+
n('encode <- "json"'), i();
|
|
1748
1751
|
break;
|
|
1749
1752
|
case "multipart/form-data":
|
|
1750
|
-
n('encode <- "multipart"'),
|
|
1753
|
+
n('encode <- "multipart"'), i();
|
|
1751
1754
|
break;
|
|
1752
1755
|
default:
|
|
1753
|
-
n('encode <- "raw"'),
|
|
1756
|
+
n('encode <- "raw"'), i();
|
|
1754
1757
|
break;
|
|
1755
1758
|
}
|
|
1756
|
-
const p = ue(
|
|
1759
|
+
const p = ue(s, "cookie"), h = ue(s, "accept"), y = p ? `set_cookies(\`${String(p).replace(/;/g, '", `').replace(/` /g, "`").replace(/[=]/g, '` = "')}")` : void 0, g = h ? `accept("${H(h)}")` : void 0, b = `content_type("${H(o.mimeType)}")`, x = Object.entries(s).filter(([j]) => !["cookie", "accept", "content-type"].includes(j.toLowerCase())).map(([j, S]) => `'${j}' = '${Je(S)}'`).join(", "), m = x ? `add_headers(${x})` : void 0;
|
|
1757
1760
|
let v = `response <- VERB("${a}", url`;
|
|
1758
1761
|
f && (v += ", body = payload"), r.length && (v += ", query = queryString");
|
|
1759
|
-
const
|
|
1760
|
-
return
|
|
1762
|
+
const w = [m, b, g, y].filter((j) => !!j).join(", ");
|
|
1763
|
+
return w && (v += `, ${w}`), (o.text || o.jsonObj || o.params) && (v += ", encode = encode"), v += ")", n(v), i(), n('content(response, "text")'), l();
|
|
1761
1764
|
}
|
|
1762
|
-
},
|
|
1765
|
+
}, da = {
|
|
1763
1766
|
info: {
|
|
1764
1767
|
key: "r",
|
|
1765
1768
|
title: "R",
|
|
1766
1769
|
default: "httr"
|
|
1767
1770
|
},
|
|
1768
1771
|
clientsById: {
|
|
1769
|
-
httr:
|
|
1772
|
+
httr: fa
|
|
1770
1773
|
}
|
|
1771
|
-
},
|
|
1774
|
+
}, ha = {
|
|
1772
1775
|
info: {
|
|
1773
1776
|
key: "native",
|
|
1774
1777
|
title: "net::http",
|
|
@@ -1776,8 +1779,8 @@ var ke = (t, e, r) => {
|
|
|
1776
1779
|
description: "Ruby HTTP client",
|
|
1777
1780
|
extname: ".rb"
|
|
1778
1781
|
},
|
|
1779
|
-
convert: ({ uriObj: t, method: e, fullUrl: r, postData: o, allHeaders:
|
|
1780
|
-
const { push: a, blank: n, join:
|
|
1782
|
+
convert: ({ uriObj: t, method: e, fullUrl: r, postData: o, allHeaders: s }) => {
|
|
1783
|
+
const { push: a, blank: n, join: i } = new C();
|
|
1781
1784
|
a("require 'uri'"), a("require 'net/http'"), n();
|
|
1782
1785
|
const l = e.toUpperCase(), c = [
|
|
1783
1786
|
"GET",
|
|
@@ -1794,21 +1797,21 @@ var ke = (t, e, r) => {
|
|
|
1794
1797
|
"TRACE"
|
|
1795
1798
|
], u = l.charAt(0) + l.substring(1).toLowerCase();
|
|
1796
1799
|
c.includes(l) || (a(`class Net::HTTP::${u} < Net::HTTPRequest`), a(` METHOD = '${l.toUpperCase()}'`), a(` REQUEST_HAS_BODY = '${o.text ? "true" : "false"}'`), a(" RESPONSE_HAS_BODY = true"), a("end"), n()), a(`url = URI("${r}")`), n(), a("http = Net::HTTP.new(url.host, url.port)"), t.protocol === "https:" && a("http.use_ssl = true"), n(), a(`request = Net::HTTP::${u}.new(url)`);
|
|
1797
|
-
const f = Object.keys(
|
|
1800
|
+
const f = Object.keys(s);
|
|
1798
1801
|
return f.length && f.forEach((p) => {
|
|
1799
|
-
a(`request["${p}"] = '${Je(
|
|
1800
|
-
}), o.text && a(`request.body = ${JSON.stringify(o.text)}`), n(), a("response = http.request(request)"), a("puts response.read_body"),
|
|
1802
|
+
a(`request["${p}"] = '${Je(s[p])}'`);
|
|
1803
|
+
}), o.text && a(`request.body = ${JSON.stringify(o.text)}`), n(), a("response = http.request(request)"), a("puts response.read_body"), i();
|
|
1801
1804
|
}
|
|
1802
|
-
},
|
|
1805
|
+
}, ya = {
|
|
1803
1806
|
info: {
|
|
1804
1807
|
key: "ruby",
|
|
1805
1808
|
title: "Ruby",
|
|
1806
1809
|
default: "native"
|
|
1807
1810
|
},
|
|
1808
1811
|
clientsById: {
|
|
1809
|
-
native:
|
|
1812
|
+
native: ha
|
|
1810
1813
|
}
|
|
1811
|
-
}, M = (t = "") => /^[a-z0-9-_/.@%^=:]+$/i.test(t) ? t : `'${t.replace(/'/g, "'\\''")}'`,
|
|
1814
|
+
}, M = (t = "") => /^[a-z0-9-_/.@%^=:]+$/i.test(t) ? t : `'${t.replace(/'/g, "'\\''")}'`, ma = (t) => t.replace(/\r/g, "\\r").replace(/\n/g, "\\n"), ga = {
|
|
1812
1815
|
"http1.0": "0",
|
|
1813
1816
|
"url ": "",
|
|
1814
1817
|
cookie: "b",
|
|
@@ -1818,13 +1821,13 @@ var ke = (t, e, r) => {
|
|
|
1818
1821
|
header: "H",
|
|
1819
1822
|
insecure: "k",
|
|
1820
1823
|
request: "X"
|
|
1821
|
-
},
|
|
1824
|
+
}, ba = (t) => (e) => {
|
|
1822
1825
|
if (t) {
|
|
1823
|
-
const r =
|
|
1826
|
+
const r = ga[e];
|
|
1824
1827
|
return r ? `-${r}` : "";
|
|
1825
1828
|
}
|
|
1826
1829
|
return `--${e}`;
|
|
1827
|
-
},
|
|
1830
|
+
}, va = {
|
|
1828
1831
|
info: {
|
|
1829
1832
|
key: "curl",
|
|
1830
1833
|
title: "cURL",
|
|
@@ -1832,28 +1835,28 @@ var ke = (t, e, r) => {
|
|
|
1832
1835
|
description: "cURL is a command line tool and library for transferring data with URL syntax",
|
|
1833
1836
|
extname: ".sh"
|
|
1834
1837
|
},
|
|
1835
|
-
convert: ({ fullUrl: t, method: e, httpVersion: r, headersObj: o, allHeaders:
|
|
1838
|
+
convert: ({ fullUrl: t, method: e, httpVersion: r, headersObj: o, allHeaders: s, postData: a }, n = {}) => {
|
|
1836
1839
|
var b;
|
|
1837
|
-
const { indent:
|
|
1838
|
-
...typeof
|
|
1839
|
-
join:
|
|
1840
|
-
${
|
|
1841
|
-
}), y =
|
|
1840
|
+
const { indent: i = " ", short: l = !1, binary: c = !1, globOff: u = !1 } = n, f = " ", { push: p, join: h } = new C({
|
|
1841
|
+
...typeof i == "string" ? { indent: i } : {},
|
|
1842
|
+
join: i !== !1 ? ` \\
|
|
1843
|
+
${i}` : " "
|
|
1844
|
+
}), y = ba(l);
|
|
1842
1845
|
let g = M(t);
|
|
1843
|
-
if (p(`curl ${y("request")} ${e}`), u && (g = unescape(g), p(y("globoff"))), p(`${y("url ")}${g}`), r === "HTTP/1.0" && p(y("http1.0")), ue(
|
|
1846
|
+
if (p(`curl ${y("request")} ${e}`), u && (g = unescape(g), p(y("globoff"))), p(`${y("url ")}${g}`), r === "HTTP/1.0" && p(y("http1.0")), ue(s, "accept-encoding") && p("--compressed"), a.mimeType === "multipart/form-data") {
|
|
1844
1847
|
const x = J(o, "content-type");
|
|
1845
1848
|
if (x) {
|
|
1846
1849
|
const m = o[x];
|
|
1847
1850
|
if (x && m) {
|
|
1848
1851
|
const v = String(m).replace(/; boundary.+?(?=(;|$))/, "");
|
|
1849
|
-
o[x] = v,
|
|
1852
|
+
o[x] = v, s[x] = v;
|
|
1850
1853
|
}
|
|
1851
1854
|
}
|
|
1852
1855
|
}
|
|
1853
1856
|
switch (Object.keys(o).sort().forEach((x) => {
|
|
1854
1857
|
const m = `${x}: ${o[x]}`;
|
|
1855
1858
|
p(`${y("header")} ${M(m)}`);
|
|
1856
|
-
}),
|
|
1859
|
+
}), s.cookie && p(`${y("cookie")} ${M(s.cookie)}`), a.mimeType) {
|
|
1857
1860
|
case "multipart/form-data":
|
|
1858
1861
|
(b = a.params) == null || b.forEach((m) => {
|
|
1859
1862
|
let v = "";
|
|
@@ -1862,7 +1865,7 @@ ${s}` : " "
|
|
|
1862
1865
|
break;
|
|
1863
1866
|
case "application/x-www-form-urlencoded":
|
|
1864
1867
|
a.params ? a.params.forEach((m) => {
|
|
1865
|
-
const v = m.name,
|
|
1868
|
+
const v = m.name, w = encodeURIComponent(m.name), j = w !== v, S = j ? w : v, k = c ? "--data-binary" : j ? "--data-urlencode" : y("data");
|
|
1866
1869
|
p(`${k} ${M(`${S}=${m.value}`)}`);
|
|
1867
1870
|
}) : p(`${c ? "--data-binary" : y("data")} ${M(a.text)}`);
|
|
1868
1871
|
break;
|
|
@@ -1870,7 +1873,7 @@ ${s}` : " "
|
|
|
1870
1873
|
if (!a.text)
|
|
1871
1874
|
break;
|
|
1872
1875
|
let x = !1;
|
|
1873
|
-
if (
|
|
1876
|
+
if (bo(a.mimeType) && a.text.length > 20)
|
|
1874
1877
|
try {
|
|
1875
1878
|
const m = JSON.parse(a.text);
|
|
1876
1879
|
x = !0, a.text.indexOf("'") > 0 ? p(
|
|
@@ -1892,7 +1895,7 @@ ${JSON.stringify(m, null, f)}
|
|
|
1892
1895
|
}
|
|
1893
1896
|
return h();
|
|
1894
1897
|
}
|
|
1895
|
-
},
|
|
1898
|
+
}, xa = {
|
|
1896
1899
|
info: {
|
|
1897
1900
|
key: "httpie",
|
|
1898
1901
|
title: "HTTPie",
|
|
@@ -1901,8 +1904,8 @@ ${JSON.stringify(m, null, f)}
|
|
|
1901
1904
|
extname: ".sh",
|
|
1902
1905
|
installation: "brew install httpie"
|
|
1903
1906
|
},
|
|
1904
|
-
convert: ({ allHeaders: t, postData: e, queryObj: r, fullUrl: o, method:
|
|
1905
|
-
const
|
|
1907
|
+
convert: ({ allHeaders: t, postData: e, queryObj: r, fullUrl: o, method: s, url: a }, n) => {
|
|
1908
|
+
const i = {
|
|
1906
1909
|
body: !1,
|
|
1907
1910
|
cert: !1,
|
|
1908
1911
|
headers: !1,
|
|
@@ -1917,31 +1920,31 @@ ${JSON.stringify(m, null, f)}
|
|
|
1917
1920
|
verify: !1,
|
|
1918
1921
|
...n
|
|
1919
1922
|
}, { push: l, join: c, unshift: u } = new C({
|
|
1920
|
-
indent:
|
|
1923
|
+
indent: i.indent,
|
|
1921
1924
|
// @ts-expect-error SEEMS LEGIT
|
|
1922
|
-
join:
|
|
1923
|
-
${
|
|
1925
|
+
join: i.indent !== !1 ? ` \\
|
|
1926
|
+
${i.indent}` : " "
|
|
1924
1927
|
});
|
|
1925
1928
|
let f = !1;
|
|
1926
1929
|
const p = [];
|
|
1927
|
-
|
|
1930
|
+
i.headers && p.push(i.short ? "-h" : "--headers"), i.body && p.push(i.short ? "-b" : "--body"), i.verbose && p.push(i.short ? "-v" : "--verbose"), i.print && p.push(`${i.short ? "-p" : "--print"}=${i.print}`), i.verify && p.push(`--verify=${i.verify}`), i.cert && p.push(`--cert=${i.cert}`), i.pretty && p.push(`--pretty=${i.pretty}`), i.style && p.push(`--style=${i.style}`), i.timeout && p.push(`--timeout=${i.timeout}`), i.queryParams && Object.keys(r).forEach((y) => {
|
|
1928
1931
|
const g = r[y];
|
|
1929
1932
|
Array.isArray(g) ? g.forEach((b) => {
|
|
1930
1933
|
l(`${y}==${M(b)}`);
|
|
1931
1934
|
}) : l(`${y}==${M(g)}`);
|
|
1932
1935
|
}), Object.keys(t).sort().forEach((y) => {
|
|
1933
1936
|
l(`${y}:${M(t[y])}`);
|
|
1934
|
-
}), e.mimeType === "application/x-www-form-urlencoded" ? e.params && e.params.length && (p.push(
|
|
1937
|
+
}), e.mimeType === "application/x-www-form-urlencoded" ? e.params && e.params.length && (p.push(i.short ? "-f" : "--form"), e.params.forEach((y) => {
|
|
1935
1938
|
l(`${y.name}=${M(y.value)}`);
|
|
1936
1939
|
})) : f = !0;
|
|
1937
1940
|
const h = p.length ? `${p.join(" ")} ` : "";
|
|
1938
|
-
if (a = M(
|
|
1941
|
+
if (a = M(i.queryParams ? a : o), u(`http ${h}${s} ${a}`), f && e.text) {
|
|
1939
1942
|
const y = M(e.text);
|
|
1940
1943
|
u(`echo ${y} | `);
|
|
1941
1944
|
}
|
|
1942
1945
|
return c();
|
|
1943
1946
|
}
|
|
1944
|
-
},
|
|
1947
|
+
}, $a = {
|
|
1945
1948
|
info: {
|
|
1946
1949
|
key: "wget",
|
|
1947
1950
|
title: "Wget",
|
|
@@ -1949,13 +1952,13 @@ ${s.indent}` : " "
|
|
|
1949
1952
|
description: "a free software package for retrieving files using HTTP, HTTPS",
|
|
1950
1953
|
extname: ".sh"
|
|
1951
1954
|
},
|
|
1952
|
-
convert: ({ method: t, postData: e, allHeaders: r, fullUrl: o },
|
|
1955
|
+
convert: ({ method: t, postData: e, allHeaders: r, fullUrl: o }, s) => {
|
|
1953
1956
|
const a = {
|
|
1954
1957
|
indent: " ",
|
|
1955
1958
|
short: !1,
|
|
1956
1959
|
verbose: !1,
|
|
1957
|
-
...
|
|
1958
|
-
}, { push: n, join:
|
|
1960
|
+
...s
|
|
1961
|
+
}, { push: n, join: i } = new C({
|
|
1959
1962
|
...typeof a.indent == "string" ? { indent: a.indent } : {},
|
|
1960
1963
|
join: a.indent !== !1 ? ` \\
|
|
1961
1964
|
${a.indent}` : " "
|
|
@@ -1963,9 +1966,9 @@ ${a.indent}` : " "
|
|
|
1963
1966
|
return a.verbose ? n(`wget ${a.short ? "-v" : "--verbose"}`) : n(`wget ${a.short ? "-q" : "--quiet"}`), n(`--method ${M(t)}`), Object.keys(r).forEach((l) => {
|
|
1964
1967
|
const c = `${l}: ${r[l]}`;
|
|
1965
1968
|
n(`--header ${M(c)}`);
|
|
1966
|
-
}), e.text && n(`--body-data ${
|
|
1969
|
+
}), e.text && n(`--body-data ${ma(M(e.text))}`), n(a.short ? "-O" : "--output-document"), n(`- ${M(o)}`), i();
|
|
1967
1970
|
}
|
|
1968
|
-
},
|
|
1971
|
+
}, ja = {
|
|
1969
1972
|
info: {
|
|
1970
1973
|
key: "shell",
|
|
1971
1974
|
title: "Shell",
|
|
@@ -1973,15 +1976,15 @@ ${a.indent}` : " "
|
|
|
1973
1976
|
cli: "%s"
|
|
1974
1977
|
},
|
|
1975
1978
|
clientsById: {
|
|
1976
|
-
curl:
|
|
1977
|
-
httpie:
|
|
1978
|
-
wget:
|
|
1979
|
+
curl: va,
|
|
1980
|
+
httpie: xa,
|
|
1981
|
+
wget: $a
|
|
1979
1982
|
}
|
|
1980
1983
|
}, hr = (t, e) => e.repeat(t), yr = (t, e, r, o) => {
|
|
1981
|
-
const
|
|
1982
|
-
${
|
|
1984
|
+
const s = hr(o, r), a = hr(o - 1, r), n = e ? `,
|
|
1985
|
+
${s}` : ", ";
|
|
1983
1986
|
return e ? `[
|
|
1984
|
-
${
|
|
1987
|
+
${s}${t.join(n)}
|
|
1985
1988
|
${a}]` : `[${t.join(n)}]`;
|
|
1986
1989
|
}, mr = (t, e, r) => `let ${t} = ${ot(e, r)}`, ot = (t, e, r) => {
|
|
1987
1990
|
switch (r = r === void 0 ? 1 : r + 1, Object.prototype.toString.call(t)) {
|
|
@@ -1989,13 +1992,13 @@ ${a}]` : `[${t.join(n)}]`;
|
|
|
1989
1992
|
return t;
|
|
1990
1993
|
case "[object Array]": {
|
|
1991
1994
|
let o = !1;
|
|
1992
|
-
const
|
|
1993
|
-
return yr(
|
|
1995
|
+
const s = t.map((a) => (Object.prototype.toString.call(a) === "[object Object]" && (o = Object.keys(a).length > 1), ot(a, e, r)));
|
|
1996
|
+
return yr(s, o, e.indent, r);
|
|
1994
1997
|
}
|
|
1995
1998
|
case "[object Object]": {
|
|
1996
1999
|
const o = [];
|
|
1997
|
-
for (const
|
|
1998
|
-
o.push(`"${
|
|
2000
|
+
for (const s in t)
|
|
2001
|
+
o.push(`"${s}": ${ot(t[s], e, r)}`);
|
|
1999
2002
|
return yr(
|
|
2000
2003
|
o,
|
|
2001
2004
|
// @ts-expect-error needs better types
|
|
@@ -2010,7 +2013,7 @@ ${a}]` : `[${t.join(n)}]`;
|
|
|
2010
2013
|
default:
|
|
2011
2014
|
return t == null ? "nil" : `"${t.toString().replace(/"/g, '\\"')}"`;
|
|
2012
2015
|
}
|
|
2013
|
-
},
|
|
2016
|
+
}, wa = {
|
|
2014
2017
|
info: {
|
|
2015
2018
|
key: "urlsession",
|
|
2016
2019
|
title: "URLSession",
|
|
@@ -2018,90 +2021,90 @@ ${a}]` : `[${t.join(n)}]`;
|
|
|
2018
2021
|
description: "Foundation's URLSession request",
|
|
2019
2022
|
extname: ".swift"
|
|
2020
2023
|
},
|
|
2021
|
-
convert: ({ allHeaders: t, postData: e, uriObj: r, queryObj: o, method:
|
|
2024
|
+
convert: ({ allHeaders: t, postData: e, uriObj: r, queryObj: o, method: s }, a) => {
|
|
2022
2025
|
var p;
|
|
2023
2026
|
const n = {
|
|
2024
2027
|
indent: " ",
|
|
2025
2028
|
pretty: !0,
|
|
2026
2029
|
timeout: 10,
|
|
2027
2030
|
...a
|
|
2028
|
-
}, { push:
|
|
2029
|
-
|
|
2031
|
+
}, { push: i, blank: l, join: c } = new C({ indent: n.indent });
|
|
2032
|
+
i("import Foundation"), l();
|
|
2030
2033
|
const u = e.text || e.jsonObj || e.params;
|
|
2031
2034
|
if (u)
|
|
2032
2035
|
switch (e.mimeType) {
|
|
2033
2036
|
case "application/x-www-form-urlencoded":
|
|
2034
2037
|
if ((p = e.params) != null && p.length) {
|
|
2035
2038
|
const h = e.params.map((y) => `"${y.name}": "${y.value}"`);
|
|
2036
|
-
n.pretty ? (
|
|
2039
|
+
n.pretty ? (i("let parameters = ["), h.forEach((y) => i(`${y},`, 1)), i("]")) : i(`let parameters = [${h.join(", ")}]`), i('let joinedParameters = parameters.map { "\\($0.key)=\\($0.value)" }.joined(separator: "&")'), i("let postData = Data(joinedParameters.utf8)"), l();
|
|
2037
2040
|
}
|
|
2038
2041
|
break;
|
|
2039
2042
|
case "application/json":
|
|
2040
|
-
e.jsonObj && (
|
|
2043
|
+
e.jsonObj && (i(`${mr("parameters", e.jsonObj, n)} as [String : Any?]`), l(), i("let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])"), l());
|
|
2041
2044
|
break;
|
|
2042
2045
|
case "multipart/form-data":
|
|
2043
|
-
|
|
2046
|
+
i(mr("parameters", e.params, n)), l(), i(`let boundary = "${e.boundary}"`), l(), i('var body = ""'), i("for param in parameters {"), i('let paramName = param["name"]!', 1), i('body += "--\\(boundary)\\r\\n"', 1), i('body += "Content-Disposition:form-data; name=\\"\\(paramName)\\""', 1), i('if let filename = param["fileName"] {', 1), i('let contentType = param["contentType"]!', 2), i("let fileContent = try String(contentsOfFile: filename, encoding: .utf8)", 2), i('body += "; filename=\\"\\(filename)\\"\\r\\n"', 2), i('body += "Content-Type: \\(contentType)\\r\\n\\r\\n"', 2), i("body += fileContent", 2), i('} else if let paramValue = param["value"] {', 1), i('body += "\\r\\n\\r\\n\\(paramValue)"', 2), i("}", 1), i("}"), l(), i("let postData = Data(body.utf8)"), l();
|
|
2044
2047
|
break;
|
|
2045
2048
|
default:
|
|
2046
|
-
|
|
2049
|
+
i(`let postData = Data("${e.text}".utf8)`), l();
|
|
2047
2050
|
}
|
|
2048
|
-
|
|
2051
|
+
i(`let url = URL(string: "${r.href}")!`);
|
|
2049
2052
|
const f = o ? Object.entries(o) : [];
|
|
2050
|
-
return f.length < 1 ?
|
|
2053
|
+
return f.length < 1 ? i("var request = URLRequest(url: url)") : (i("var components = URLComponents(url: url, resolvingAgainstBaseURL: true)!"), i("let queryItems: [URLQueryItem] = ["), f.forEach((h) => {
|
|
2051
2054
|
const y = h[0], g = h[1];
|
|
2052
2055
|
switch (Object.prototype.toString.call(g)) {
|
|
2053
2056
|
case "[object String]":
|
|
2054
|
-
|
|
2057
|
+
i(`URLQueryItem(name: "${y}", value: "${g}"),`, 1);
|
|
2055
2058
|
break;
|
|
2056
2059
|
case "[object Array]":
|
|
2057
2060
|
g.forEach((b) => {
|
|
2058
|
-
|
|
2061
|
+
i(`URLQueryItem(name: "${y}", value: "${b}"),`, 1);
|
|
2059
2062
|
});
|
|
2060
2063
|
break;
|
|
2061
2064
|
}
|
|
2062
|
-
}),
|
|
2065
|
+
}), i("]"), i("components.queryItems = components.queryItems.map { $0 + queryItems } ?? queryItems"), l(), i("var request = URLRequest(url: components.url!)")), i(`request.httpMethod = "${s}"`), i(`request.timeoutInterval = ${n.timeout}`), Object.keys(t).length && i(`request.allHTTPHeaderFields = ${ot(t, n)}`), u && i("request.httpBody = postData"), l(), i("let (data, _) = try await URLSession.shared.data(for: request)"), i("print(String(decoding: data, as: UTF8.self))"), c();
|
|
2063
2066
|
}
|
|
2064
|
-
},
|
|
2067
|
+
}, Sa = {
|
|
2065
2068
|
info: {
|
|
2066
2069
|
key: "swift",
|
|
2067
2070
|
title: "Swift",
|
|
2068
2071
|
default: "urlsession"
|
|
2069
2072
|
},
|
|
2070
2073
|
clientsById: {
|
|
2071
|
-
urlsession:
|
|
2072
|
-
}
|
|
2073
|
-
},
|
|
2074
|
-
c:
|
|
2075
|
-
clojure:
|
|
2076
|
-
csharp:
|
|
2077
|
-
go:
|
|
2078
|
-
http:
|
|
2079
|
-
java:
|
|
2080
|
-
javascript:
|
|
2081
|
-
json:
|
|
2082
|
-
kotlin:
|
|
2083
|
-
node:
|
|
2084
|
-
objc:
|
|
2085
|
-
ocaml:
|
|
2086
|
-
php:
|
|
2087
|
-
powershell:
|
|
2088
|
-
python:
|
|
2089
|
-
r:
|
|
2090
|
-
ruby:
|
|
2091
|
-
shell:
|
|
2092
|
-
swift:
|
|
2074
|
+
urlsession: wa
|
|
2075
|
+
}
|
|
2076
|
+
}, Oa = {
|
|
2077
|
+
c: go,
|
|
2078
|
+
clojure: $o,
|
|
2079
|
+
csharp: To,
|
|
2080
|
+
go: Po,
|
|
2081
|
+
http: Eo,
|
|
2082
|
+
java: Io,
|
|
2083
|
+
javascript: Ho,
|
|
2084
|
+
json: Mo,
|
|
2085
|
+
kotlin: Wo,
|
|
2086
|
+
node: Do,
|
|
2087
|
+
objc: Xo,
|
|
2088
|
+
ocaml: ea,
|
|
2089
|
+
php: aa,
|
|
2090
|
+
powershell: la,
|
|
2091
|
+
python: pa,
|
|
2092
|
+
r: da,
|
|
2093
|
+
ruby: ya,
|
|
2094
|
+
shell: ja,
|
|
2095
|
+
swift: Sa
|
|
2093
2096
|
}, at = { exports: {} };
|
|
2094
2097
|
/*! https://mths.be/punycode v1.4.1 by @mathias */
|
|
2095
2098
|
at.exports;
|
|
2096
2099
|
(function(t, e) {
|
|
2097
2100
|
(function(r) {
|
|
2098
|
-
var o = e && !e.nodeType && e,
|
|
2101
|
+
var o = e && !e.nodeType && e, s = t && !t.nodeType && t, a = typeof He == "object" && He;
|
|
2099
2102
|
(a.global === a || a.window === a || a.self === a) && (r = a);
|
|
2100
|
-
var n,
|
|
2103
|
+
var n, i = 2147483647, l = 36, c = 1, u = 26, f = 38, p = 700, h = 72, y = 128, g = "-", b = /^xn--/, x = /[^\x20-\x7E]/, m = /[\x2E\u3002\uFF0E\uFF61]/g, v = {
|
|
2101
2104
|
overflow: "Overflow: input needs wider integers to process",
|
|
2102
2105
|
"not-basic": "Illegal input >= 0x80 (not a basic code point)",
|
|
2103
2106
|
"invalid-input": "Invalid input"
|
|
2104
|
-
},
|
|
2107
|
+
}, w = l - c, j = Math.floor, S = String.fromCharCode, k;
|
|
2105
2108
|
function E($) {
|
|
2106
2109
|
throw new RangeError(v[$]);
|
|
2107
2110
|
}
|
|
@@ -2135,18 +2138,18 @@ at.exports;
|
|
|
2135
2138
|
}
|
|
2136
2139
|
function Q($, O, P) {
|
|
2137
2140
|
var A = 0;
|
|
2138
|
-
for ($ = P ?
|
|
2139
|
-
$ =
|
|
2140
|
-
return
|
|
2141
|
+
for ($ = P ? j($ / p) : $ >> 1, $ += j($ / O); $ > w * u >> 1; A += l)
|
|
2142
|
+
$ = j($ / w);
|
|
2143
|
+
return j(A + (w + 1) * $ / ($ + f));
|
|
2141
2144
|
}
|
|
2142
2145
|
function Y($) {
|
|
2143
2146
|
var O = [], P = $.length, A, I = 0, K = y, B = h, X, ne, ie, pe, W, Z, oe, ye, $e;
|
|
2144
2147
|
for (X = $.lastIndexOf(g), X < 0 && (X = 0), ne = 0; ne < X; ++ne)
|
|
2145
2148
|
$.charCodeAt(ne) >= 128 && E("not-basic"), O.push($.charCodeAt(ne));
|
|
2146
2149
|
for (ie = X > 0 ? X + 1 : 0; ie < P; ) {
|
|
2147
|
-
for (pe = I, W = 1, Z = l; ie >= P && E("invalid-input"), oe = L($.charCodeAt(ie++)), (oe >= l || oe >
|
|
2148
|
-
$e = l - ye, W >
|
|
2149
|
-
A = O.length + 1, B = Q(I - pe, A, pe == 0),
|
|
2150
|
+
for (pe = I, W = 1, Z = l; ie >= P && E("invalid-input"), oe = L($.charCodeAt(ie++)), (oe >= l || oe > j((i - I) / W)) && E("overflow"), I += oe * W, ye = Z <= B ? c : Z >= B + u ? u : Z - B, !(oe < ye); Z += l)
|
|
2151
|
+
$e = l - ye, W > j(i / $e) && E("overflow"), W *= $e;
|
|
2152
|
+
A = O.length + 1, B = Q(I - pe, A, pe == 0), j(I / A) > i - K && E("overflow"), K += j(I / A), I %= A, O.splice(I++, 0, K);
|
|
2150
2153
|
}
|
|
2151
2154
|
return re(O);
|
|
2152
2155
|
}
|
|
@@ -2155,14 +2158,14 @@ at.exports;
|
|
|
2155
2158
|
for ($ = te($), oe = $.length, O = y, P = 0, K = h, B = 0; B < oe; ++B)
|
|
2156
2159
|
W = $[B], W < 128 && Z.push(S(W));
|
|
2157
2160
|
for (A = I = Z.length, I && Z.push(g); A < oe; ) {
|
|
2158
|
-
for (X =
|
|
2161
|
+
for (X = i, B = 0; B < oe; ++B)
|
|
2159
2162
|
W = $[B], W >= O && W < X && (X = W);
|
|
2160
|
-
for (ye = A + 1, X - O >
|
|
2161
|
-
if (W = $[B], W < O && ++P >
|
|
2163
|
+
for (ye = A + 1, X - O > j((i - P) / ye) && E("overflow"), P += (X - O) * ye, O = X, B = 0; B < oe; ++B)
|
|
2164
|
+
if (W = $[B], W < O && ++P > i && E("overflow"), W == O) {
|
|
2162
2165
|
for (ne = P, ie = l; pe = ie <= K ? c : ie >= K + u ? u : ie - K, !(ne < pe); ie += l)
|
|
2163
2166
|
dt = ne - pe, $e = l - pe, Z.push(
|
|
2164
2167
|
S(V(pe + dt % $e, 0))
|
|
2165
|
-
), ne =
|
|
2168
|
+
), ne = j(dt / $e);
|
|
2166
2169
|
Z.push(S(V(ne, 0))), K = Q(P, ye, A == I), P = 0, ++A;
|
|
2167
2170
|
}
|
|
2168
2171
|
++P, ++O;
|
|
@@ -2201,9 +2204,9 @@ at.exports;
|
|
|
2201
2204
|
encode: he,
|
|
2202
2205
|
toASCII: Ke,
|
|
2203
2206
|
toUnicode: ft
|
|
2204
|
-
}, o &&
|
|
2207
|
+
}, o && s)
|
|
2205
2208
|
if (t.exports == o)
|
|
2206
|
-
|
|
2209
|
+
s.exports = n;
|
|
2207
2210
|
else
|
|
2208
2211
|
for (k in n)
|
|
2209
2212
|
n.hasOwnProperty(k) && (o[k] = n[k]);
|
|
@@ -2211,7 +2214,7 @@ at.exports;
|
|
|
2211
2214
|
r.punycode = n;
|
|
2212
2215
|
})(He);
|
|
2213
2216
|
})(at, at.exports);
|
|
2214
|
-
var
|
|
2217
|
+
var Ta = at.exports, Ca = Error, Pa = EvalError, ka = RangeError, Ea = ReferenceError, nn = SyntaxError, Ve = TypeError, Na = URIError, Ra = function() {
|
|
2215
2218
|
if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function")
|
|
2216
2219
|
return !1;
|
|
2217
2220
|
if (typeof Symbol.iterator == "symbol")
|
|
@@ -2219,8 +2222,8 @@ var Sa = at.exports, Oa = Error, Ta = EvalError, Ca = RangeError, Pa = Reference
|
|
|
2219
2222
|
var e = {}, r = Symbol("test"), o = Object(r);
|
|
2220
2223
|
if (typeof r == "string" || Object.prototype.toString.call(r) !== "[object Symbol]" || Object.prototype.toString.call(o) !== "[object Symbol]")
|
|
2221
2224
|
return !1;
|
|
2222
|
-
var
|
|
2223
|
-
e[r] =
|
|
2225
|
+
var s = 42;
|
|
2226
|
+
e[r] = s;
|
|
2224
2227
|
for (r in e)
|
|
2225
2228
|
return !1;
|
|
2226
2229
|
if (typeof Object.keys == "function" && Object.keys(e).length !== 0 || typeof Object.getOwnPropertyNames == "function" && Object.getOwnPropertyNames(e).length !== 0)
|
|
@@ -2230,37 +2233,37 @@ var Sa = at.exports, Oa = Error, Ta = EvalError, Ca = RangeError, Pa = Reference
|
|
|
2230
2233
|
return !1;
|
|
2231
2234
|
if (typeof Object.getOwnPropertyDescriptor == "function") {
|
|
2232
2235
|
var n = Object.getOwnPropertyDescriptor(e, r);
|
|
2233
|
-
if (n.value !==
|
|
2236
|
+
if (n.value !== s || n.enumerable !== !0)
|
|
2234
2237
|
return !1;
|
|
2235
2238
|
}
|
|
2236
2239
|
return !0;
|
|
2237
|
-
}, gr = typeof Symbol < "u" && Symbol,
|
|
2238
|
-
return typeof gr != "function" || typeof Symbol != "function" || typeof gr("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 :
|
|
2240
|
+
}, gr = typeof Symbol < "u" && Symbol, Aa = Ra, qa = function() {
|
|
2241
|
+
return typeof gr != "function" || typeof Symbol != "function" || typeof gr("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : Aa();
|
|
2239
2242
|
}, yt = {
|
|
2240
2243
|
__proto__: null,
|
|
2241
2244
|
foo: {}
|
|
2242
|
-
},
|
|
2243
|
-
return { __proto__: yt }.foo === yt.foo && !(yt instanceof
|
|
2244
|
-
},
|
|
2245
|
-
for (var o = [],
|
|
2246
|
-
o[
|
|
2245
|
+
}, Ia = Object, La = function() {
|
|
2246
|
+
return { __proto__: yt }.foo === yt.foo && !(yt instanceof Ia);
|
|
2247
|
+
}, Ua = "Function.prototype.bind called on incompatible ", Fa = Object.prototype.toString, _a = Math.max, Ha = "[object Function]", br = function(e, r) {
|
|
2248
|
+
for (var o = [], s = 0; s < e.length; s += 1)
|
|
2249
|
+
o[s] = e[s];
|
|
2247
2250
|
for (var a = 0; a < r.length; a += 1)
|
|
2248
2251
|
o[a + e.length] = r[a];
|
|
2249
2252
|
return o;
|
|
2250
|
-
},
|
|
2251
|
-
for (var o = [],
|
|
2252
|
-
o[a] = e[
|
|
2253
|
+
}, Ba = function(e, r) {
|
|
2254
|
+
for (var o = [], s = r, a = 0; s < e.length; s += 1, a += 1)
|
|
2255
|
+
o[a] = e[s];
|
|
2253
2256
|
return o;
|
|
2254
|
-
},
|
|
2257
|
+
}, Ma = function(t, e) {
|
|
2255
2258
|
for (var r = "", o = 0; o < t.length; o += 1)
|
|
2256
2259
|
r += t[o], o + 1 < t.length && (r += e);
|
|
2257
2260
|
return r;
|
|
2258
|
-
},
|
|
2261
|
+
}, za = function(e) {
|
|
2259
2262
|
var r = this;
|
|
2260
|
-
if (typeof r != "function" ||
|
|
2261
|
-
throw new TypeError(
|
|
2262
|
-
for (var o =
|
|
2263
|
-
if (this instanceof
|
|
2263
|
+
if (typeof r != "function" || Fa.apply(r) !== Ha)
|
|
2264
|
+
throw new TypeError(Ua + r);
|
|
2265
|
+
for (var o = Ba(arguments, 1), s, a = function() {
|
|
2266
|
+
if (this instanceof s) {
|
|
2264
2267
|
var u = r.apply(
|
|
2265
2268
|
this,
|
|
2266
2269
|
br(o, arguments)
|
|
@@ -2271,17 +2274,17 @@ var Sa = at.exports, Oa = Error, Ta = EvalError, Ca = RangeError, Pa = Reference
|
|
|
2271
2274
|
e,
|
|
2272
2275
|
br(o, arguments)
|
|
2273
2276
|
);
|
|
2274
|
-
}, n =
|
|
2275
|
-
|
|
2276
|
-
if (
|
|
2277
|
+
}, n = _a(0, r.length - o.length), i = [], l = 0; l < n; l++)
|
|
2278
|
+
i[l] = "$" + l;
|
|
2279
|
+
if (s = Function("binder", "return function (" + Ma(i, ",") + "){ return binder.apply(this,arguments); }")(a), r.prototype) {
|
|
2277
2280
|
var c = function() {
|
|
2278
2281
|
};
|
|
2279
|
-
c.prototype = r.prototype,
|
|
2282
|
+
c.prototype = r.prototype, s.prototype = new c(), c.prototype = null;
|
|
2280
2283
|
}
|
|
2281
|
-
return
|
|
2282
|
-
},
|
|
2284
|
+
return s;
|
|
2285
|
+
}, Wa = za, Jt = Function.prototype.bind || Wa, Ja = Function.prototype.call, Ga = Object.prototype.hasOwnProperty, Va = Jt, Qa = Va.call(Ja, Ga), T, Ka = Ca, Da = Pa, Ya = ka, Xa = Ea, Ae = nn, Ee = Ve, Za = Na, on = Function, mt = function(t) {
|
|
2283
2286
|
try {
|
|
2284
|
-
return
|
|
2287
|
+
return on('"use strict"; return (' + t + ").constructor;")();
|
|
2285
2288
|
} catch {
|
|
2286
2289
|
}
|
|
2287
2290
|
}, Se = Object.getOwnPropertyDescriptor;
|
|
@@ -2293,7 +2296,7 @@ if (Se)
|
|
|
2293
2296
|
}
|
|
2294
2297
|
var gt = function() {
|
|
2295
2298
|
throw new Ee();
|
|
2296
|
-
},
|
|
2299
|
+
}, ei = Se ? function() {
|
|
2297
2300
|
try {
|
|
2298
2301
|
return arguments.callee, gt;
|
|
2299
2302
|
} catch {
|
|
@@ -2303,9 +2306,9 @@ var gt = function() {
|
|
|
2303
2306
|
return gt;
|
|
2304
2307
|
}
|
|
2305
2308
|
}
|
|
2306
|
-
}() : gt, Te =
|
|
2309
|
+
}() : gt, Te = qa(), ti = La(), _ = Object.getPrototypeOf || (ti ? function(t) {
|
|
2307
2310
|
return t.__proto__;
|
|
2308
|
-
} : null), Pe = {},
|
|
2311
|
+
} : null), Pe = {}, ri = typeof Uint8Array > "u" || !_ ? T : _(Uint8Array), Oe = {
|
|
2309
2312
|
__proto__: null,
|
|
2310
2313
|
"%AggregateError%": typeof AggregateError > "u" ? T : AggregateError,
|
|
2311
2314
|
"%Array%": Array,
|
|
@@ -2327,14 +2330,14 @@ var gt = function() {
|
|
|
2327
2330
|
"%decodeURIComponent%": decodeURIComponent,
|
|
2328
2331
|
"%encodeURI%": encodeURI,
|
|
2329
2332
|
"%encodeURIComponent%": encodeURIComponent,
|
|
2330
|
-
"%Error%":
|
|
2333
|
+
"%Error%": Ka,
|
|
2331
2334
|
"%eval%": eval,
|
|
2332
2335
|
// eslint-disable-line no-eval
|
|
2333
|
-
"%EvalError%":
|
|
2336
|
+
"%EvalError%": Da,
|
|
2334
2337
|
"%Float32Array%": typeof Float32Array > "u" ? T : Float32Array,
|
|
2335
2338
|
"%Float64Array%": typeof Float64Array > "u" ? T : Float64Array,
|
|
2336
2339
|
"%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? T : FinalizationRegistry,
|
|
2337
|
-
"%Function%":
|
|
2340
|
+
"%Function%": on,
|
|
2338
2341
|
"%GeneratorFunction%": Pe,
|
|
2339
2342
|
"%Int8Array%": typeof Int8Array > "u" ? T : Int8Array,
|
|
2340
2343
|
"%Int16Array%": typeof Int16Array > "u" ? T : Int16Array,
|
|
@@ -2352,8 +2355,8 @@ var gt = function() {
|
|
|
2352
2355
|
"%parseInt%": parseInt,
|
|
2353
2356
|
"%Promise%": typeof Promise > "u" ? T : Promise,
|
|
2354
2357
|
"%Proxy%": typeof Proxy > "u" ? T : Proxy,
|
|
2355
|
-
"%RangeError%":
|
|
2356
|
-
"%ReferenceError%":
|
|
2358
|
+
"%RangeError%": Ya,
|
|
2359
|
+
"%ReferenceError%": Xa,
|
|
2357
2360
|
"%Reflect%": typeof Reflect > "u" ? T : Reflect,
|
|
2358
2361
|
"%RegExp%": RegExp,
|
|
2359
2362
|
"%Set%": typeof Set > "u" ? T : Set,
|
|
@@ -2363,14 +2366,14 @@ var gt = function() {
|
|
|
2363
2366
|
"%StringIteratorPrototype%": Te && _ ? _(""[Symbol.iterator]()) : T,
|
|
2364
2367
|
"%Symbol%": Te ? Symbol : T,
|
|
2365
2368
|
"%SyntaxError%": Ae,
|
|
2366
|
-
"%ThrowTypeError%":
|
|
2367
|
-
"%TypedArray%":
|
|
2369
|
+
"%ThrowTypeError%": ei,
|
|
2370
|
+
"%TypedArray%": ri,
|
|
2368
2371
|
"%TypeError%": Ee,
|
|
2369
2372
|
"%Uint8Array%": typeof Uint8Array > "u" ? T : Uint8Array,
|
|
2370
2373
|
"%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? T : Uint8ClampedArray,
|
|
2371
2374
|
"%Uint16Array%": typeof Uint16Array > "u" ? T : Uint16Array,
|
|
2372
2375
|
"%Uint32Array%": typeof Uint32Array > "u" ? T : Uint32Array,
|
|
2373
|
-
"%URIError%":
|
|
2376
|
+
"%URIError%": Za,
|
|
2374
2377
|
"%WeakMap%": typeof WeakMap > "u" ? T : WeakMap,
|
|
2375
2378
|
"%WeakRef%": typeof WeakRef > "u" ? T : WeakRef,
|
|
2376
2379
|
"%WeakSet%": typeof WeakSet > "u" ? T : WeakSet
|
|
@@ -2379,10 +2382,10 @@ if (_)
|
|
|
2379
2382
|
try {
|
|
2380
2383
|
null.error;
|
|
2381
2384
|
} catch (t) {
|
|
2382
|
-
var
|
|
2383
|
-
Oe["%Error.prototype%"] =
|
|
2385
|
+
var ni = _(_(t));
|
|
2386
|
+
Oe["%Error.prototype%"] = ni;
|
|
2384
2387
|
}
|
|
2385
|
-
var
|
|
2388
|
+
var oi = function t(e) {
|
|
2386
2389
|
var r;
|
|
2387
2390
|
if (e === "%AsyncFunction%")
|
|
2388
2391
|
r = mt("async function () {}");
|
|
@@ -2394,8 +2397,8 @@ var ri = function t(e) {
|
|
|
2394
2397
|
var o = t("%AsyncGeneratorFunction%");
|
|
2395
2398
|
o && (r = o.prototype);
|
|
2396
2399
|
} else if (e === "%AsyncIteratorPrototype%") {
|
|
2397
|
-
var
|
|
2398
|
-
|
|
2400
|
+
var s = t("%AsyncGenerator%");
|
|
2401
|
+
s && _ && (r = _(s.prototype));
|
|
2399
2402
|
}
|
|
2400
2403
|
return Oe[e] = r, r;
|
|
2401
2404
|
}, vr = {
|
|
@@ -2451,24 +2454,24 @@ var ri = function t(e) {
|
|
|
2451
2454
|
"%URIErrorPrototype%": ["URIError", "prototype"],
|
|
2452
2455
|
"%WeakMapPrototype%": ["WeakMap", "prototype"],
|
|
2453
2456
|
"%WeakSetPrototype%": ["WeakSet", "prototype"]
|
|
2454
|
-
}, Qe = Jt, it =
|
|
2457
|
+
}, Qe = Jt, it = Qa, ai = Qe.call(Function.call, Array.prototype.concat), ii = Qe.call(Function.apply, Array.prototype.splice), xr = Qe.call(Function.call, String.prototype.replace), st = Qe.call(Function.call, String.prototype.slice), si = Qe.call(Function.call, RegExp.prototype.exec), li = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, ci = /\\(\\)?/g, ui = function(e) {
|
|
2455
2458
|
var r = st(e, 0, 1), o = st(e, -1);
|
|
2456
2459
|
if (r === "%" && o !== "%")
|
|
2457
2460
|
throw new Ae("invalid intrinsic syntax, expected closing `%`");
|
|
2458
2461
|
if (o === "%" && r !== "%")
|
|
2459
2462
|
throw new Ae("invalid intrinsic syntax, expected opening `%`");
|
|
2460
|
-
var
|
|
2461
|
-
return xr(e,
|
|
2462
|
-
|
|
2463
|
-
}),
|
|
2464
|
-
},
|
|
2465
|
-
var o = e,
|
|
2466
|
-
if (it(vr, o) && (
|
|
2463
|
+
var s = [];
|
|
2464
|
+
return xr(e, li, function(a, n, i, l) {
|
|
2465
|
+
s[s.length] = i ? xr(l, ci, "$1") : n || a;
|
|
2466
|
+
}), s;
|
|
2467
|
+
}, pi = function(e, r) {
|
|
2468
|
+
var o = e, s;
|
|
2469
|
+
if (it(vr, o) && (s = vr[o], o = "%" + s[0] + "%"), it(Oe, o)) {
|
|
2467
2470
|
var a = Oe[o];
|
|
2468
|
-
if (a === Pe && (a =
|
|
2471
|
+
if (a === Pe && (a = oi(o)), typeof a > "u" && !r)
|
|
2469
2472
|
throw new Ee("intrinsic " + e + " exists, but is not available. Please file an issue!");
|
|
2470
2473
|
return {
|
|
2471
|
-
alias:
|
|
2474
|
+
alias: s,
|
|
2472
2475
|
name: o,
|
|
2473
2476
|
value: a
|
|
2474
2477
|
};
|
|
@@ -2479,32 +2482,32 @@ var ri = function t(e) {
|
|
|
2479
2482
|
throw new Ee("intrinsic name must be a non-empty string");
|
|
2480
2483
|
if (arguments.length > 1 && typeof r != "boolean")
|
|
2481
2484
|
throw new Ee('"allowMissing" argument must be a boolean');
|
|
2482
|
-
if (
|
|
2485
|
+
if (si(/^%?[^%]*%?$/, e) === null)
|
|
2483
2486
|
throw new Ae("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
|
|
2484
|
-
var o =
|
|
2485
|
-
c && (
|
|
2487
|
+
var o = ui(e), s = o.length > 0 ? o[0] : "", a = pi("%" + s + "%", r), n = a.name, i = a.value, l = !1, c = a.alias;
|
|
2488
|
+
c && (s = c[0], ii(o, ai([0, 1], c)));
|
|
2486
2489
|
for (var u = 1, f = !0; u < o.length; u += 1) {
|
|
2487
2490
|
var p = o[u], h = st(p, 0, 1), y = st(p, -1);
|
|
2488
2491
|
if ((h === '"' || h === "'" || h === "`" || y === '"' || y === "'" || y === "`") && h !== y)
|
|
2489
2492
|
throw new Ae("property names with quotes must have matching quotes");
|
|
2490
|
-
if ((p === "constructor" || !f) && (l = !0),
|
|
2491
|
-
|
|
2492
|
-
else if (
|
|
2493
|
-
if (!(p in
|
|
2493
|
+
if ((p === "constructor" || !f) && (l = !0), s += "." + p, n = "%" + s + "%", it(Oe, n))
|
|
2494
|
+
i = Oe[n];
|
|
2495
|
+
else if (i != null) {
|
|
2496
|
+
if (!(p in i)) {
|
|
2494
2497
|
if (!r)
|
|
2495
2498
|
throw new Ee("base intrinsic for " + e + " exists, but the property is not available.");
|
|
2496
2499
|
return;
|
|
2497
2500
|
}
|
|
2498
2501
|
if (Se && u + 1 >= o.length) {
|
|
2499
|
-
var g = Se(
|
|
2500
|
-
f = !!g, f && "get" in g && !("originalValue" in g.get) ?
|
|
2502
|
+
var g = Se(i, p);
|
|
2503
|
+
f = !!g, f && "get" in g && !("originalValue" in g.get) ? i = g.get : i = i[p];
|
|
2501
2504
|
} else
|
|
2502
|
-
f = it(
|
|
2503
|
-
f && !l && (Oe[n] =
|
|
2505
|
+
f = it(i, p), i = i[p];
|
|
2506
|
+
f && !l && (Oe[n] = i);
|
|
2504
2507
|
}
|
|
2505
2508
|
}
|
|
2506
|
-
return
|
|
2507
|
-
},
|
|
2509
|
+
return i;
|
|
2510
|
+
}, an = { exports: {} }, bt, $r;
|
|
2508
2511
|
function Gt() {
|
|
2509
2512
|
if ($r) return bt;
|
|
2510
2513
|
$r = 1;
|
|
@@ -2517,14 +2520,14 @@ function Gt() {
|
|
|
2517
2520
|
}
|
|
2518
2521
|
return bt = e, bt;
|
|
2519
2522
|
}
|
|
2520
|
-
var
|
|
2523
|
+
var fi = Le, tt = fi("%Object.getOwnPropertyDescriptor%", !0);
|
|
2521
2524
|
if (tt)
|
|
2522
2525
|
try {
|
|
2523
2526
|
tt([], "length");
|
|
2524
2527
|
} catch {
|
|
2525
2528
|
tt = null;
|
|
2526
2529
|
}
|
|
2527
|
-
var
|
|
2530
|
+
var sn = tt, jr = Gt(), di = nn, Ce = Ve, wr = sn, hi = function(e, r, o) {
|
|
2528
2531
|
if (!e || typeof e != "object" && typeof e != "function")
|
|
2529
2532
|
throw new Ce("`obj` must be an object or a function`");
|
|
2530
2533
|
if (typeof r != "string" && typeof r != "symbol")
|
|
@@ -2537,22 +2540,22 @@ var an = tt, wr = Gt(), pi = rn, Ce = Ve, jr = an, fi = function(e, r, o) {
|
|
|
2537
2540
|
throw new Ce("`nonConfigurable`, if provided, must be a boolean or null");
|
|
2538
2541
|
if (arguments.length > 6 && typeof arguments[6] != "boolean")
|
|
2539
2542
|
throw new Ce("`loose`, if provided, must be a boolean");
|
|
2540
|
-
var
|
|
2541
|
-
if (
|
|
2542
|
-
|
|
2543
|
+
var s = arguments.length > 3 ? arguments[3] : null, a = arguments.length > 4 ? arguments[4] : null, n = arguments.length > 5 ? arguments[5] : null, i = arguments.length > 6 ? arguments[6] : !1, l = !!wr && wr(e, r);
|
|
2544
|
+
if (jr)
|
|
2545
|
+
jr(e, r, {
|
|
2543
2546
|
configurable: n === null && l ? l.configurable : !n,
|
|
2544
|
-
enumerable:
|
|
2547
|
+
enumerable: s === null && l ? l.enumerable : !s,
|
|
2545
2548
|
value: o,
|
|
2546
2549
|
writable: a === null && l ? l.writable : !a
|
|
2547
2550
|
});
|
|
2548
|
-
else if (
|
|
2551
|
+
else if (i || !s && !a && !n)
|
|
2549
2552
|
e[r] = o;
|
|
2550
2553
|
else
|
|
2551
|
-
throw new
|
|
2552
|
-
}, kt = Gt(),
|
|
2554
|
+
throw new di("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");
|
|
2555
|
+
}, kt = Gt(), ln = function() {
|
|
2553
2556
|
return !!kt;
|
|
2554
2557
|
};
|
|
2555
|
-
|
|
2558
|
+
ln.hasArrayLengthDefineBug = function() {
|
|
2556
2559
|
if (!kt)
|
|
2557
2560
|
return null;
|
|
2558
2561
|
try {
|
|
@@ -2561,17 +2564,17 @@ sn.hasArrayLengthDefineBug = function() {
|
|
|
2561
2564
|
return !0;
|
|
2562
2565
|
}
|
|
2563
2566
|
};
|
|
2564
|
-
var
|
|
2567
|
+
var yi = ln, mi = Le, Sr = hi, gi = yi(), Or = sn, Tr = Ve, bi = mi("%Math.floor%"), vi = function(e, r) {
|
|
2565
2568
|
if (typeof e != "function")
|
|
2566
2569
|
throw new Tr("`fn` is not a function");
|
|
2567
|
-
if (typeof r != "number" || r < 0 || r > 4294967295 ||
|
|
2570
|
+
if (typeof r != "number" || r < 0 || r > 4294967295 || bi(r) !== r)
|
|
2568
2571
|
throw new Tr("`length` must be a positive 32-bit integer");
|
|
2569
|
-
var o = arguments.length > 2 && !!arguments[2],
|
|
2572
|
+
var o = arguments.length > 2 && !!arguments[2], s = !0, a = !0;
|
|
2570
2573
|
if ("length" in e && Or) {
|
|
2571
2574
|
var n = Or(e, "length");
|
|
2572
|
-
n && !n.configurable && (
|
|
2575
|
+
n && !n.configurable && (s = !1), n && !n.writable && (a = !1);
|
|
2573
2576
|
}
|
|
2574
|
-
return (
|
|
2577
|
+
return (s || a || !o) && (gi ? Sr(
|
|
2575
2578
|
/** @type {Parameters<define>[0]} */
|
|
2576
2579
|
e,
|
|
2577
2580
|
"length",
|
|
@@ -2586,11 +2589,11 @@ var di = sn, hi = Le, Sr = fi, yi = di(), Or = an, Tr = Ve, mi = hi("%Math.floor
|
|
|
2586
2589
|
)), e;
|
|
2587
2590
|
};
|
|
2588
2591
|
(function(t) {
|
|
2589
|
-
var e = Jt, r = Le, o =
|
|
2592
|
+
var e = Jt, r = Le, o = vi, s = Ve, a = r("%Function.prototype.apply%"), n = r("%Function.prototype.call%"), i = r("%Reflect.apply%", !0) || e.call(n, a), l = Gt(), c = r("%Math.max%");
|
|
2590
2593
|
t.exports = function(p) {
|
|
2591
2594
|
if (typeof p != "function")
|
|
2592
|
-
throw new
|
|
2593
|
-
var h =
|
|
2595
|
+
throw new s("a function is required");
|
|
2596
|
+
var h = i(e, n, arguments);
|
|
2594
2597
|
return o(
|
|
2595
2598
|
h,
|
|
2596
2599
|
1 + c(0, p.length - (arguments.length - 1)),
|
|
@@ -2598,32 +2601,32 @@ var di = sn, hi = Le, Sr = fi, yi = di(), Or = an, Tr = Ve, mi = hi("%Math.floor
|
|
|
2598
2601
|
);
|
|
2599
2602
|
};
|
|
2600
2603
|
var u = function() {
|
|
2601
|
-
return
|
|
2604
|
+
return i(e, a, arguments);
|
|
2602
2605
|
};
|
|
2603
2606
|
l ? l(t.exports, "apply", { value: u }) : t.exports.apply = u;
|
|
2604
|
-
})(
|
|
2605
|
-
var
|
|
2606
|
-
var o =
|
|
2607
|
-
return typeof o == "function" &&
|
|
2607
|
+
})(an);
|
|
2608
|
+
var xi = an.exports, cn = Le, un = xi, $i = un(cn("String.prototype.indexOf")), ji = function(e, r) {
|
|
2609
|
+
var o = cn(e, !!r);
|
|
2610
|
+
return typeof o == "function" && $i(e, ".prototype.") > -1 ? un(o) : o;
|
|
2608
2611
|
};
|
|
2609
|
-
const
|
|
2610
|
-
var Vt = typeof Map == "function" && Map.prototype, vt = Object.getOwnPropertyDescriptor && Vt ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null, lt = Vt && vt && typeof vt.get == "function" ? vt.get : null, Cr = Vt && Map.prototype.forEach, Qt = typeof Set == "function" && Set.prototype, xt = Object.getOwnPropertyDescriptor && Qt ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null, ct = Qt && xt && typeof xt.get == "function" ? xt.get : null, Pr = Qt && Set.prototype.forEach,
|
|
2612
|
+
const wi = /* @__PURE__ */ Zn(eo);
|
|
2613
|
+
var Vt = typeof Map == "function" && Map.prototype, vt = Object.getOwnPropertyDescriptor && Vt ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null, lt = Vt && vt && typeof vt.get == "function" ? vt.get : null, Cr = Vt && Map.prototype.forEach, Qt = typeof Set == "function" && Set.prototype, xt = Object.getOwnPropertyDescriptor && Qt ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null, ct = Qt && xt && typeof xt.get == "function" ? xt.get : null, Pr = Qt && Set.prototype.forEach, Si = typeof WeakMap == "function" && WeakMap.prototype, Be = Si ? WeakMap.prototype.has : null, Oi = typeof WeakSet == "function" && WeakSet.prototype, Me = Oi ? WeakSet.prototype.has : null, Ti = typeof WeakRef == "function" && WeakRef.prototype, kr = Ti ? WeakRef.prototype.deref : null, Ci = Boolean.prototype.valueOf, Pi = Object.prototype.toString, ki = Function.prototype.toString, Ei = String.prototype.match, Kt = String.prototype.slice, ge = String.prototype.replace, Ni = String.prototype.toUpperCase, Er = String.prototype.toLowerCase, pn = RegExp.prototype.test, Nr = Array.prototype.concat, ce = Array.prototype.join, Ri = Array.prototype.slice, Rr = Math.floor, Et = typeof BigInt == "function" ? BigInt.prototype.valueOf : null, $t = Object.getOwnPropertySymbols, Nt = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Symbol.prototype.toString : null, qe = typeof Symbol == "function" && typeof Symbol.iterator == "object", G = typeof Symbol == "function" && Symbol.toStringTag && (typeof Symbol.toStringTag === qe || !0) ? Symbol.toStringTag : null, fn = Object.prototype.propertyIsEnumerable, Ar = (typeof Reflect == "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(t) {
|
|
2611
2614
|
return t.__proto__;
|
|
2612
2615
|
} : null);
|
|
2613
2616
|
function qr(t, e) {
|
|
2614
|
-
if (t === 1 / 0 || t === -1 / 0 || t !== t || t && t > -1e3 && t < 1e3 ||
|
|
2617
|
+
if (t === 1 / 0 || t === -1 / 0 || t !== t || t && t > -1e3 && t < 1e3 || pn.call(/e/, e))
|
|
2615
2618
|
return e;
|
|
2616
2619
|
var r = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
|
|
2617
2620
|
if (typeof t == "number") {
|
|
2618
2621
|
var o = t < 0 ? -Rr(-t) : Rr(t);
|
|
2619
2622
|
if (o !== t) {
|
|
2620
|
-
var
|
|
2621
|
-
return ge.call(
|
|
2623
|
+
var s = String(o), a = Kt.call(e, s.length + 1);
|
|
2624
|
+
return ge.call(s, r, "$&_") + "." + ge.call(ge.call(a, /([0-9]{3})/g, "$&_"), /_$/, "");
|
|
2622
2625
|
}
|
|
2623
2626
|
}
|
|
2624
2627
|
return ge.call(e, r, "$&_");
|
|
2625
2628
|
}
|
|
2626
|
-
var Rt =
|
|
2629
|
+
var Rt = wi, Ir = Rt.custom, Lr = hn(Ir) ? Ir : null, Ai = function t(e, r, o, s) {
|
|
2627
2630
|
var a = r || {};
|
|
2628
2631
|
if (me(a, "quoteStyle") && a.quoteStyle !== "single" && a.quoteStyle !== "double")
|
|
2629
2632
|
throw new TypeError('option "quoteStyle" must be "single" or "double"');
|
|
@@ -2636,7 +2639,7 @@ var Rt = $i, Ir = Rt.custom, Lr = dn(Ir) ? Ir : null, Ni = function t(e, r, o, i
|
|
|
2636
2639
|
throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
|
|
2637
2640
|
if (me(a, "numericSeparator") && typeof a.numericSeparator != "boolean")
|
|
2638
2641
|
throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
|
|
2639
|
-
var
|
|
2642
|
+
var i = a.numericSeparator;
|
|
2640
2643
|
if (typeof e > "u")
|
|
2641
2644
|
return "undefined";
|
|
2642
2645
|
if (e === null)
|
|
@@ -2644,56 +2647,56 @@ var Rt = $i, Ir = Rt.custom, Lr = dn(Ir) ? Ir : null, Ni = function t(e, r, o, i
|
|
|
2644
2647
|
if (typeof e == "boolean")
|
|
2645
2648
|
return e ? "true" : "false";
|
|
2646
2649
|
if (typeof e == "string")
|
|
2647
|
-
return
|
|
2650
|
+
return mn(e, a);
|
|
2648
2651
|
if (typeof e == "number") {
|
|
2649
2652
|
if (e === 0)
|
|
2650
2653
|
return 1 / 0 / e > 0 ? "0" : "-0";
|
|
2651
2654
|
var l = String(e);
|
|
2652
|
-
return
|
|
2655
|
+
return i ? qr(e, l) : l;
|
|
2653
2656
|
}
|
|
2654
2657
|
if (typeof e == "bigint") {
|
|
2655
2658
|
var c = String(e) + "n";
|
|
2656
|
-
return
|
|
2659
|
+
return i ? qr(e, c) : c;
|
|
2657
2660
|
}
|
|
2658
2661
|
var u = typeof a.depth > "u" ? 5 : a.depth;
|
|
2659
2662
|
if (typeof o > "u" && (o = 0), o >= u && u > 0 && typeof e == "object")
|
|
2660
2663
|
return At(e) ? "[Array]" : "[Object]";
|
|
2661
|
-
var f =
|
|
2662
|
-
if (typeof
|
|
2663
|
-
|
|
2664
|
-
else if (
|
|
2664
|
+
var f = Yi(a, o);
|
|
2665
|
+
if (typeof s > "u")
|
|
2666
|
+
s = [];
|
|
2667
|
+
else if (yn(s, e) >= 0)
|
|
2665
2668
|
return "[Circular]";
|
|
2666
2669
|
function p(L, V, Q) {
|
|
2667
|
-
if (V && (
|
|
2670
|
+
if (V && (s = Ri.call(s), s.push(V)), Q) {
|
|
2668
2671
|
var Y = {
|
|
2669
2672
|
depth: a.depth
|
|
2670
2673
|
};
|
|
2671
|
-
return me(a, "quoteStyle") && (Y.quoteStyle = a.quoteStyle), t(L, Y, o + 1,
|
|
2674
|
+
return me(a, "quoteStyle") && (Y.quoteStyle = a.quoteStyle), t(L, Y, o + 1, s);
|
|
2672
2675
|
}
|
|
2673
|
-
return t(L, a, o + 1,
|
|
2676
|
+
return t(L, a, o + 1, s);
|
|
2674
2677
|
}
|
|
2675
2678
|
if (typeof e == "function" && !Ur(e)) {
|
|
2676
|
-
var h =
|
|
2679
|
+
var h = Mi(e), y = Ye(e, p);
|
|
2677
2680
|
return "[Function" + (h ? ": " + h : " (anonymous)") + "]" + (y.length > 0 ? " { " + ce.call(y, ", ") + " }" : "");
|
|
2678
2681
|
}
|
|
2679
|
-
if (
|
|
2682
|
+
if (hn(e)) {
|
|
2680
2683
|
var g = qe ? ge.call(String(e), /^(Symbol\(.*\))_[^)]*$/, "$1") : Nt.call(e);
|
|
2681
2684
|
return typeof e == "object" && !qe ? Fe(g) : g;
|
|
2682
2685
|
}
|
|
2683
|
-
if (
|
|
2686
|
+
if (Qi(e)) {
|
|
2684
2687
|
for (var b = "<" + Er.call(String(e.nodeName)), x = e.attributes || [], m = 0; m < x.length; m++)
|
|
2685
|
-
b += " " + x[m].name + "=" +
|
|
2688
|
+
b += " " + x[m].name + "=" + dn(qi(x[m].value), "double", a);
|
|
2686
2689
|
return b += ">", e.childNodes && e.childNodes.length && (b += "..."), b += "</" + Er.call(String(e.nodeName)) + ">", b;
|
|
2687
2690
|
}
|
|
2688
2691
|
if (At(e)) {
|
|
2689
2692
|
if (e.length === 0)
|
|
2690
2693
|
return "[]";
|
|
2691
2694
|
var v = Ye(e, p);
|
|
2692
|
-
return f && !
|
|
2695
|
+
return f && !Di(v) ? "[" + qt(v, f) + "]" : "[ " + ce.call(v, ", ") + " ]";
|
|
2693
2696
|
}
|
|
2694
|
-
if (
|
|
2695
|
-
var
|
|
2696
|
-
return !("cause" in Error.prototype) && "cause" in e && !
|
|
2697
|
+
if (Li(e)) {
|
|
2698
|
+
var w = Ye(e, p);
|
|
2699
|
+
return !("cause" in Error.prototype) && "cause" in e && !fn.call(e, "cause") ? "{ [" + String(e) + "] " + ce.call(Nr.call("[cause]: " + p(e.cause), w), ", ") + " }" : w.length === 0 ? "[" + String(e) + "]" : "{ [" + String(e) + "] " + ce.call(w, ", ") + " }";
|
|
2697
2700
|
}
|
|
2698
2701
|
if (typeof e == "object" && n) {
|
|
2699
2702
|
if (Lr && typeof e[Lr] == "function" && Rt)
|
|
@@ -2701,71 +2704,71 @@ var Rt = $i, Ir = Rt.custom, Lr = dn(Ir) ? Ir : null, Ni = function t(e, r, o, i
|
|
|
2701
2704
|
if (n !== "symbol" && typeof e.inspect == "function")
|
|
2702
2705
|
return e.inspect();
|
|
2703
2706
|
}
|
|
2704
|
-
if (
|
|
2705
|
-
var
|
|
2707
|
+
if (zi(e)) {
|
|
2708
|
+
var j = [];
|
|
2706
2709
|
return Cr && Cr.call(e, function(L, V) {
|
|
2707
|
-
|
|
2708
|
-
}), Fr("Map", lt.call(e),
|
|
2710
|
+
j.push(p(V, e, !0) + " => " + p(L, e));
|
|
2711
|
+
}), Fr("Map", lt.call(e), j, f);
|
|
2709
2712
|
}
|
|
2710
|
-
if (
|
|
2713
|
+
if (Gi(e)) {
|
|
2711
2714
|
var S = [];
|
|
2712
2715
|
return Pr && Pr.call(e, function(L) {
|
|
2713
2716
|
S.push(p(L, e));
|
|
2714
2717
|
}), Fr("Set", ct.call(e), S, f);
|
|
2715
2718
|
}
|
|
2716
|
-
if (
|
|
2717
|
-
return
|
|
2719
|
+
if (Wi(e))
|
|
2720
|
+
return jt("WeakMap");
|
|
2721
|
+
if (Vi(e))
|
|
2722
|
+
return jt("WeakSet");
|
|
2718
2723
|
if (Ji(e))
|
|
2719
|
-
return
|
|
2720
|
-
if (zi(e))
|
|
2721
|
-
return wt("WeakRef");
|
|
2722
|
-
if (Li(e))
|
|
2723
|
-
return Fe(p(Number(e)));
|
|
2724
|
+
return jt("WeakRef");
|
|
2724
2725
|
if (Fi(e))
|
|
2726
|
+
return Fe(p(Number(e)));
|
|
2727
|
+
if (Hi(e))
|
|
2725
2728
|
return Fe(p(Et.call(e)));
|
|
2729
|
+
if (_i(e))
|
|
2730
|
+
return Fe(Ci.call(e));
|
|
2726
2731
|
if (Ui(e))
|
|
2727
|
-
return Fe(Oi.call(e));
|
|
2728
|
-
if (Ii(e))
|
|
2729
2732
|
return Fe(p(String(e)));
|
|
2730
2733
|
if (typeof window < "u" && e === window)
|
|
2731
2734
|
return "{ [object Window] }";
|
|
2732
2735
|
if (typeof globalThis < "u" && e === globalThis || typeof He < "u" && e === He)
|
|
2733
2736
|
return "{ [object globalThis] }";
|
|
2734
|
-
if (!
|
|
2737
|
+
if (!Ii(e) && !Ur(e)) {
|
|
2735
2738
|
var k = Ye(e, p), E = Ar ? Ar(e) === Object.prototype : e instanceof Object || e.constructor === Object, R = e instanceof Object ? "" : "null prototype", F = !E && G && Object(e) === e && G in e ? Kt.call(xe(e), 8, -1) : R ? "Object" : "", te = E || typeof e.constructor != "function" ? "" : e.constructor.name ? e.constructor.name + " " : "", re = te + (F || R ? "[" + ce.call(Nr.call([], F || [], R || []), ": ") + "] " : "");
|
|
2736
2739
|
return k.length === 0 ? re + "{}" : f ? re + "{" + qt(k, f) + "}" : re + "{ " + ce.call(k, ", ") + " }";
|
|
2737
2740
|
}
|
|
2738
2741
|
return String(e);
|
|
2739
2742
|
};
|
|
2740
|
-
function
|
|
2743
|
+
function dn(t, e, r) {
|
|
2741
2744
|
var o = (r.quoteStyle || e) === "double" ? '"' : "'";
|
|
2742
2745
|
return o + t + o;
|
|
2743
2746
|
}
|
|
2744
|
-
function
|
|
2747
|
+
function qi(t) {
|
|
2745
2748
|
return ge.call(String(t), /"/g, """);
|
|
2746
2749
|
}
|
|
2747
2750
|
function At(t) {
|
|
2748
2751
|
return xe(t) === "[object Array]" && (!G || !(typeof t == "object" && G in t));
|
|
2749
2752
|
}
|
|
2750
|
-
function
|
|
2753
|
+
function Ii(t) {
|
|
2751
2754
|
return xe(t) === "[object Date]" && (!G || !(typeof t == "object" && G in t));
|
|
2752
2755
|
}
|
|
2753
2756
|
function Ur(t) {
|
|
2754
2757
|
return xe(t) === "[object RegExp]" && (!G || !(typeof t == "object" && G in t));
|
|
2755
2758
|
}
|
|
2756
|
-
function
|
|
2759
|
+
function Li(t) {
|
|
2757
2760
|
return xe(t) === "[object Error]" && (!G || !(typeof t == "object" && G in t));
|
|
2758
2761
|
}
|
|
2759
|
-
function
|
|
2762
|
+
function Ui(t) {
|
|
2760
2763
|
return xe(t) === "[object String]" && (!G || !(typeof t == "object" && G in t));
|
|
2761
2764
|
}
|
|
2762
|
-
function
|
|
2765
|
+
function Fi(t) {
|
|
2763
2766
|
return xe(t) === "[object Number]" && (!G || !(typeof t == "object" && G in t));
|
|
2764
2767
|
}
|
|
2765
|
-
function
|
|
2768
|
+
function _i(t) {
|
|
2766
2769
|
return xe(t) === "[object Boolean]" && (!G || !(typeof t == "object" && G in t));
|
|
2767
2770
|
}
|
|
2768
|
-
function
|
|
2771
|
+
function hn(t) {
|
|
2769
2772
|
if (qe)
|
|
2770
2773
|
return t && typeof t == "object" && t instanceof Symbol;
|
|
2771
2774
|
if (typeof t == "symbol")
|
|
@@ -2778,7 +2781,7 @@ function dn(t) {
|
|
|
2778
2781
|
}
|
|
2779
2782
|
return !1;
|
|
2780
2783
|
}
|
|
2781
|
-
function
|
|
2784
|
+
function Hi(t) {
|
|
2782
2785
|
if (!t || typeof t != "object" || !Et)
|
|
2783
2786
|
return !1;
|
|
2784
2787
|
try {
|
|
@@ -2787,22 +2790,22 @@ function Fi(t) {
|
|
|
2787
2790
|
}
|
|
2788
2791
|
return !1;
|
|
2789
2792
|
}
|
|
2790
|
-
var
|
|
2793
|
+
var Bi = Object.prototype.hasOwnProperty || function(t) {
|
|
2791
2794
|
return t in this;
|
|
2792
2795
|
};
|
|
2793
2796
|
function me(t, e) {
|
|
2794
|
-
return
|
|
2797
|
+
return Bi.call(t, e);
|
|
2795
2798
|
}
|
|
2796
2799
|
function xe(t) {
|
|
2797
|
-
return
|
|
2800
|
+
return Pi.call(t);
|
|
2798
2801
|
}
|
|
2799
|
-
function
|
|
2802
|
+
function Mi(t) {
|
|
2800
2803
|
if (t.name)
|
|
2801
2804
|
return t.name;
|
|
2802
|
-
var e =
|
|
2805
|
+
var e = Ei.call(ki.call(t), /^function\s*([\w$]+)/);
|
|
2803
2806
|
return e ? e[1] : null;
|
|
2804
2807
|
}
|
|
2805
|
-
function
|
|
2808
|
+
function yn(t, e) {
|
|
2806
2809
|
if (t.indexOf)
|
|
2807
2810
|
return t.indexOf(e);
|
|
2808
2811
|
for (var r = 0, o = t.length; r < o; r++)
|
|
@@ -2810,7 +2813,7 @@ function hn(t, e) {
|
|
|
2810
2813
|
return r;
|
|
2811
2814
|
return -1;
|
|
2812
2815
|
}
|
|
2813
|
-
function
|
|
2816
|
+
function zi(t) {
|
|
2814
2817
|
if (!lt || !t || typeof t != "object")
|
|
2815
2818
|
return !1;
|
|
2816
2819
|
try {
|
|
@@ -2825,7 +2828,7 @@ function Bi(t) {
|
|
|
2825
2828
|
}
|
|
2826
2829
|
return !1;
|
|
2827
2830
|
}
|
|
2828
|
-
function
|
|
2831
|
+
function Wi(t) {
|
|
2829
2832
|
if (!Be || !t || typeof t != "object")
|
|
2830
2833
|
return !1;
|
|
2831
2834
|
try {
|
|
@@ -2840,7 +2843,7 @@ function Mi(t) {
|
|
|
2840
2843
|
}
|
|
2841
2844
|
return !1;
|
|
2842
2845
|
}
|
|
2843
|
-
function
|
|
2846
|
+
function Ji(t) {
|
|
2844
2847
|
if (!kr || !t || typeof t != "object")
|
|
2845
2848
|
return !1;
|
|
2846
2849
|
try {
|
|
@@ -2849,7 +2852,7 @@ function zi(t) {
|
|
|
2849
2852
|
}
|
|
2850
2853
|
return !1;
|
|
2851
2854
|
}
|
|
2852
|
-
function
|
|
2855
|
+
function Gi(t) {
|
|
2853
2856
|
if (!ct || !t || typeof t != "object")
|
|
2854
2857
|
return !1;
|
|
2855
2858
|
try {
|
|
@@ -2864,7 +2867,7 @@ function Wi(t) {
|
|
|
2864
2867
|
}
|
|
2865
2868
|
return !1;
|
|
2866
2869
|
}
|
|
2867
|
-
function
|
|
2870
|
+
function Vi(t) {
|
|
2868
2871
|
if (!Me || !t || typeof t != "object")
|
|
2869
2872
|
return !1;
|
|
2870
2873
|
try {
|
|
@@ -2879,18 +2882,18 @@ function Ji(t) {
|
|
|
2879
2882
|
}
|
|
2880
2883
|
return !1;
|
|
2881
2884
|
}
|
|
2882
|
-
function
|
|
2885
|
+
function Qi(t) {
|
|
2883
2886
|
return !t || typeof t != "object" ? !1 : typeof HTMLElement < "u" && t instanceof HTMLElement ? !0 : typeof t.nodeName == "string" && typeof t.getAttribute == "function";
|
|
2884
2887
|
}
|
|
2885
|
-
function
|
|
2888
|
+
function mn(t, e) {
|
|
2886
2889
|
if (t.length > e.maxStringLength) {
|
|
2887
2890
|
var r = t.length - e.maxStringLength, o = "... " + r + " more character" + (r > 1 ? "s" : "");
|
|
2888
|
-
return
|
|
2891
|
+
return mn(Kt.call(t, 0, e.maxStringLength), e) + o;
|
|
2889
2892
|
}
|
|
2890
|
-
var
|
|
2891
|
-
return
|
|
2893
|
+
var s = ge.call(ge.call(t, /(['\\])/g, "\\$1"), /[\x00-\x1f]/g, Ki);
|
|
2894
|
+
return dn(s, "single", e);
|
|
2892
2895
|
}
|
|
2893
|
-
function
|
|
2896
|
+
function Ki(t) {
|
|
2894
2897
|
var e = t.charCodeAt(0), r = {
|
|
2895
2898
|
8: "b",
|
|
2896
2899
|
9: "t",
|
|
@@ -2898,26 +2901,26 @@ function Vi(t) {
|
|
|
2898
2901
|
12: "f",
|
|
2899
2902
|
13: "r"
|
|
2900
2903
|
}[e];
|
|
2901
|
-
return r ? "\\" + r : "\\x" + (e < 16 ? "0" : "") +
|
|
2904
|
+
return r ? "\\" + r : "\\x" + (e < 16 ? "0" : "") + Ni.call(e.toString(16));
|
|
2902
2905
|
}
|
|
2903
2906
|
function Fe(t) {
|
|
2904
2907
|
return "Object(" + t + ")";
|
|
2905
2908
|
}
|
|
2906
|
-
function
|
|
2909
|
+
function jt(t) {
|
|
2907
2910
|
return t + " { ? }";
|
|
2908
2911
|
}
|
|
2909
2912
|
function Fr(t, e, r, o) {
|
|
2910
|
-
var
|
|
2911
|
-
return t + " (" + e + ") {" +
|
|
2913
|
+
var s = o ? qt(r, o) : ce.call(r, ", ");
|
|
2914
|
+
return t + " (" + e + ") {" + s + "}";
|
|
2912
2915
|
}
|
|
2913
|
-
function
|
|
2916
|
+
function Di(t) {
|
|
2914
2917
|
for (var e = 0; e < t.length; e++)
|
|
2915
|
-
if (
|
|
2918
|
+
if (yn(t[e], `
|
|
2916
2919
|
`) >= 0)
|
|
2917
2920
|
return !1;
|
|
2918
2921
|
return !0;
|
|
2919
2922
|
}
|
|
2920
|
-
function
|
|
2923
|
+
function Yi(t, e) {
|
|
2921
2924
|
var r;
|
|
2922
2925
|
if (t.indent === " ")
|
|
2923
2926
|
r = " ";
|
|
@@ -2942,31 +2945,31 @@ function Ye(t, e) {
|
|
|
2942
2945
|
var r = At(t), o = [];
|
|
2943
2946
|
if (r) {
|
|
2944
2947
|
o.length = t.length;
|
|
2945
|
-
for (var
|
|
2946
|
-
o[
|
|
2948
|
+
for (var s = 0; s < t.length; s++)
|
|
2949
|
+
o[s] = me(t, s) ? e(t[s], t) : "";
|
|
2947
2950
|
}
|
|
2948
2951
|
var a = typeof $t == "function" ? $t(t) : [], n;
|
|
2949
2952
|
if (qe) {
|
|
2950
2953
|
n = {};
|
|
2951
|
-
for (var
|
|
2952
|
-
n["$" + a[
|
|
2954
|
+
for (var i = 0; i < a.length; i++)
|
|
2955
|
+
n["$" + a[i]] = a[i];
|
|
2953
2956
|
}
|
|
2954
2957
|
for (var l in t)
|
|
2955
|
-
me(t, l) && (r && String(Number(l)) === l && l < t.length || qe && n["$" + l] instanceof Symbol || (
|
|
2958
|
+
me(t, l) && (r && String(Number(l)) === l && l < t.length || qe && n["$" + l] instanceof Symbol || (pn.call(/[^\w$]/, l) ? o.push(e(l, t) + ": " + e(t[l], t)) : o.push(l + ": " + e(t[l], t))));
|
|
2956
2959
|
if (typeof $t == "function")
|
|
2957
2960
|
for (var c = 0; c < a.length; c++)
|
|
2958
|
-
|
|
2961
|
+
fn.call(t, a[c]) && o.push("[" + e(a[c]) + "]: " + e(t[a[c]], t));
|
|
2959
2962
|
return o;
|
|
2960
2963
|
}
|
|
2961
|
-
var
|
|
2964
|
+
var gn = Le, Ue = ji, Xi = Ai, Zi = Ve, Xe = gn("%WeakMap%", !0), Ze = gn("%Map%", !0), es = Ue("WeakMap.prototype.get", !0), ts = Ue("WeakMap.prototype.set", !0), rs = Ue("WeakMap.prototype.has", !0), ns = Ue("Map.prototype.get", !0), os = Ue("Map.prototype.set", !0), as = Ue("Map.prototype.has", !0), Dt = function(t, e) {
|
|
2962
2965
|
for (var r = t, o; (o = r.next) !== null; r = o)
|
|
2963
2966
|
if (o.key === e)
|
|
2964
2967
|
return r.next = o.next, o.next = /** @type {NonNullable<typeof list.next>} */
|
|
2965
2968
|
t.next, t.next = o, o;
|
|
2966
|
-
},
|
|
2969
|
+
}, is = function(t, e) {
|
|
2967
2970
|
var r = Dt(t, e);
|
|
2968
2971
|
return r && r.value;
|
|
2969
|
-
},
|
|
2972
|
+
}, ss = function(t, e, r) {
|
|
2970
2973
|
var o = Dt(t, e);
|
|
2971
2974
|
o ? o.value = r : t.next = /** @type {import('.').ListNode<typeof value>} */
|
|
2972
2975
|
{
|
|
@@ -2975,77 +2978,77 @@ var mn = Le, Ue = xi, Di = Ni, Yi = Ve, Xe = mn("%WeakMap%", !0), Ze = mn("%Map%
|
|
|
2975
2978
|
next: t.next,
|
|
2976
2979
|
value: r
|
|
2977
2980
|
};
|
|
2978
|
-
},
|
|
2981
|
+
}, ls = function(t, e) {
|
|
2979
2982
|
return !!Dt(t, e);
|
|
2980
|
-
},
|
|
2981
|
-
var e, r, o,
|
|
2983
|
+
}, cs = function() {
|
|
2984
|
+
var e, r, o, s = {
|
|
2982
2985
|
assert: function(a) {
|
|
2983
|
-
if (!
|
|
2984
|
-
throw new
|
|
2986
|
+
if (!s.has(a))
|
|
2987
|
+
throw new Zi("Side channel does not contain " + Xi(a));
|
|
2985
2988
|
},
|
|
2986
2989
|
get: function(a) {
|
|
2987
2990
|
if (Xe && a && (typeof a == "object" || typeof a == "function")) {
|
|
2988
2991
|
if (e)
|
|
2989
|
-
return
|
|
2992
|
+
return es(e, a);
|
|
2990
2993
|
} else if (Ze) {
|
|
2991
2994
|
if (r)
|
|
2992
|
-
return
|
|
2995
|
+
return ns(r, a);
|
|
2993
2996
|
} else if (o)
|
|
2994
|
-
return
|
|
2997
|
+
return is(o, a);
|
|
2995
2998
|
},
|
|
2996
2999
|
has: function(a) {
|
|
2997
3000
|
if (Xe && a && (typeof a == "object" || typeof a == "function")) {
|
|
2998
3001
|
if (e)
|
|
2999
|
-
return
|
|
3002
|
+
return rs(e, a);
|
|
3000
3003
|
} else if (Ze) {
|
|
3001
3004
|
if (r)
|
|
3002
|
-
return
|
|
3005
|
+
return as(r, a);
|
|
3003
3006
|
} else if (o)
|
|
3004
|
-
return
|
|
3007
|
+
return ls(o, a);
|
|
3005
3008
|
return !1;
|
|
3006
3009
|
},
|
|
3007
3010
|
set: function(a, n) {
|
|
3008
|
-
Xe && a && (typeof a == "object" || typeof a == "function") ? (e || (e = new Xe()),
|
|
3011
|
+
Xe && a && (typeof a == "object" || typeof a == "function") ? (e || (e = new Xe()), ts(e, a, n)) : Ze ? (r || (r = new Ze()), os(r, a, n)) : (o || (o = { key: {}, next: null }), ss(o, a, n));
|
|
3009
3012
|
}
|
|
3010
3013
|
};
|
|
3011
|
-
return
|
|
3012
|
-
},
|
|
3014
|
+
return s;
|
|
3015
|
+
}, us = String.prototype.replace, ps = /%20/g, wt = {
|
|
3013
3016
|
RFC1738: "RFC1738",
|
|
3014
3017
|
RFC3986: "RFC3986"
|
|
3015
3018
|
}, Yt = {
|
|
3016
|
-
default:
|
|
3019
|
+
default: wt.RFC3986,
|
|
3017
3020
|
formatters: {
|
|
3018
3021
|
RFC1738: function(t) {
|
|
3019
|
-
return
|
|
3022
|
+
return us.call(t, ps, "+");
|
|
3020
3023
|
},
|
|
3021
3024
|
RFC3986: function(t) {
|
|
3022
3025
|
return String(t);
|
|
3023
3026
|
}
|
|
3024
3027
|
},
|
|
3025
|
-
RFC1738:
|
|
3026
|
-
RFC3986:
|
|
3027
|
-
},
|
|
3028
|
+
RFC1738: wt.RFC1738,
|
|
3029
|
+
RFC3986: wt.RFC3986
|
|
3030
|
+
}, fs = Yt, St = Object.prototype.hasOwnProperty, je = Array.isArray, se = function() {
|
|
3028
3031
|
for (var t = [], e = 0; e < 256; ++e)
|
|
3029
3032
|
t.push("%" + ((e < 16 ? "0" : "") + e.toString(16)).toUpperCase());
|
|
3030
3033
|
return t;
|
|
3031
|
-
}(),
|
|
3034
|
+
}(), ds = function(e) {
|
|
3032
3035
|
for (; e.length > 1; ) {
|
|
3033
3036
|
var r = e.pop(), o = r.obj[r.prop];
|
|
3034
|
-
if (
|
|
3035
|
-
for (var
|
|
3036
|
-
typeof o[a] < "u" &&
|
|
3037
|
-
r.obj[r.prop] =
|
|
3037
|
+
if (je(o)) {
|
|
3038
|
+
for (var s = [], a = 0; a < o.length; ++a)
|
|
3039
|
+
typeof o[a] < "u" && s.push(o[a]);
|
|
3040
|
+
r.obj[r.prop] = s;
|
|
3038
3041
|
}
|
|
3039
3042
|
}
|
|
3040
|
-
},
|
|
3041
|
-
for (var o = r && r.plainObjects ? /* @__PURE__ */ Object.create(null) : {},
|
|
3042
|
-
typeof e[
|
|
3043
|
+
}, bn = function(e, r) {
|
|
3044
|
+
for (var o = r && r.plainObjects ? /* @__PURE__ */ Object.create(null) : {}, s = 0; s < e.length; ++s)
|
|
3045
|
+
typeof e[s] < "u" && (o[s] = e[s]);
|
|
3043
3046
|
return o;
|
|
3044
|
-
},
|
|
3047
|
+
}, hs = function t(e, r, o) {
|
|
3045
3048
|
if (!r)
|
|
3046
3049
|
return e;
|
|
3047
3050
|
if (typeof r != "object") {
|
|
3048
|
-
if (
|
|
3051
|
+
if (je(e))
|
|
3049
3052
|
e.push(r);
|
|
3050
3053
|
else if (e && typeof e == "object")
|
|
3051
3054
|
(o && (o.plainObjects || o.allowPrototypes) || !St.call(Object.prototype, r)) && (e[r] = !0);
|
|
@@ -3055,22 +3058,22 @@ var mn = Le, Ue = xi, Di = Ni, Yi = Ve, Xe = mn("%WeakMap%", !0), Ze = mn("%Map%
|
|
|
3055
3058
|
}
|
|
3056
3059
|
if (!e || typeof e != "object")
|
|
3057
3060
|
return [e].concat(r);
|
|
3058
|
-
var
|
|
3059
|
-
return
|
|
3061
|
+
var s = e;
|
|
3062
|
+
return je(e) && !je(r) && (s = bn(e, o)), je(e) && je(r) ? (r.forEach(function(a, n) {
|
|
3060
3063
|
if (St.call(e, n)) {
|
|
3061
|
-
var
|
|
3062
|
-
|
|
3064
|
+
var i = e[n];
|
|
3065
|
+
i && typeof i == "object" && a && typeof a == "object" ? e[n] = t(i, a, o) : e.push(a);
|
|
3063
3066
|
} else
|
|
3064
3067
|
e[n] = a;
|
|
3065
3068
|
}), e) : Object.keys(r).reduce(function(a, n) {
|
|
3066
|
-
var
|
|
3067
|
-
return St.call(a, n) ? a[n] = t(a[n],
|
|
3068
|
-
},
|
|
3069
|
-
},
|
|
3070
|
-
return Object.keys(r).reduce(function(o,
|
|
3071
|
-
return o[
|
|
3069
|
+
var i = r[n];
|
|
3070
|
+
return St.call(a, n) ? a[n] = t(a[n], i, o) : a[n] = i, a;
|
|
3071
|
+
}, s);
|
|
3072
|
+
}, ys = function(e, r) {
|
|
3073
|
+
return Object.keys(r).reduce(function(o, s) {
|
|
3074
|
+
return o[s] = r[s], o;
|
|
3072
3075
|
}, e);
|
|
3073
|
-
},
|
|
3076
|
+
}, ms = function(t, e, r) {
|
|
3074
3077
|
var o = t.replace(/\+/g, " ");
|
|
3075
3078
|
if (r === "iso-8859-1")
|
|
3076
3079
|
return o.replace(/%[0-9a-f]{2}/gi, unescape);
|
|
@@ -3079,7 +3082,7 @@ var mn = Le, Ue = xi, Di = Ni, Yi = Ve, Xe = mn("%WeakMap%", !0), Ze = mn("%Map%
|
|
|
3079
3082
|
} catch {
|
|
3080
3083
|
return o;
|
|
3081
3084
|
}
|
|
3082
|
-
}, Ot = 1024,
|
|
3085
|
+
}, Ot = 1024, gs = function(e, r, o, s, a) {
|
|
3083
3086
|
if (e.length === 0)
|
|
3084
3087
|
return e;
|
|
3085
3088
|
var n = e;
|
|
@@ -3087,10 +3090,10 @@ var mn = Le, Ue = xi, Di = Ni, Yi = Ve, Xe = mn("%WeakMap%", !0), Ze = mn("%Map%
|
|
|
3087
3090
|
return escape(n).replace(/%u[0-9a-f]{4}/gi, function(h) {
|
|
3088
3091
|
return "%26%23" + parseInt(h.slice(2), 16) + "%3B";
|
|
3089
3092
|
});
|
|
3090
|
-
for (var
|
|
3093
|
+
for (var i = "", l = 0; l < n.length; l += Ot) {
|
|
3091
3094
|
for (var c = n.length >= Ot ? n.slice(l, l + Ot) : n, u = [], f = 0; f < c.length; ++f) {
|
|
3092
3095
|
var p = c.charCodeAt(f);
|
|
3093
|
-
if (p === 45 || p === 46 || p === 95 || p === 126 || p >= 48 && p <= 57 || p >= 65 && p <= 90 || p >= 97 && p <= 122 || a ===
|
|
3096
|
+
if (p === 45 || p === 46 || p === 95 || p === 126 || p >= 48 && p <= 57 || p >= 65 && p <= 90 || p >= 97 && p <= 122 || a === fs.RFC1738 && (p === 40 || p === 41)) {
|
|
3094
3097
|
u[u.length] = c.charAt(f);
|
|
3095
3098
|
continue;
|
|
3096
3099
|
}
|
|
@@ -3108,41 +3111,41 @@ var mn = Le, Ue = xi, Di = Ni, Yi = Ve, Xe = mn("%WeakMap%", !0), Ze = mn("%Map%
|
|
|
3108
3111
|
}
|
|
3109
3112
|
f += 1, p = 65536 + ((p & 1023) << 10 | c.charCodeAt(f) & 1023), u[u.length] = se[240 | p >> 18] + se[128 | p >> 12 & 63] + se[128 | p >> 6 & 63] + se[128 | p & 63];
|
|
3110
3113
|
}
|
|
3111
|
-
|
|
3114
|
+
i += u.join("");
|
|
3112
3115
|
}
|
|
3113
|
-
return
|
|
3114
|
-
},
|
|
3115
|
-
for (var r = [{ obj: { o: e }, prop: "o" }], o = [],
|
|
3116
|
-
for (var a = r[
|
|
3117
|
-
var c =
|
|
3116
|
+
return i;
|
|
3117
|
+
}, bs = function(e) {
|
|
3118
|
+
for (var r = [{ obj: { o: e }, prop: "o" }], o = [], s = 0; s < r.length; ++s)
|
|
3119
|
+
for (var a = r[s], n = a.obj[a.prop], i = Object.keys(n), l = 0; l < i.length; ++l) {
|
|
3120
|
+
var c = i[l], u = n[c];
|
|
3118
3121
|
typeof u == "object" && u !== null && o.indexOf(u) === -1 && (r.push({ obj: n, prop: c }), o.push(u));
|
|
3119
3122
|
}
|
|
3120
|
-
return
|
|
3121
|
-
},
|
|
3123
|
+
return ds(r), e;
|
|
3124
|
+
}, vs = function(e) {
|
|
3122
3125
|
return Object.prototype.toString.call(e) === "[object RegExp]";
|
|
3123
|
-
},
|
|
3126
|
+
}, xs = function(e) {
|
|
3124
3127
|
return !e || typeof e != "object" ? !1 : !!(e.constructor && e.constructor.isBuffer && e.constructor.isBuffer(e));
|
|
3125
|
-
},
|
|
3128
|
+
}, $s = function(e, r) {
|
|
3126
3129
|
return [].concat(e, r);
|
|
3127
|
-
},
|
|
3128
|
-
if (
|
|
3129
|
-
for (var o = [],
|
|
3130
|
-
o.push(r(e[
|
|
3130
|
+
}, js = function(e, r) {
|
|
3131
|
+
if (je(e)) {
|
|
3132
|
+
for (var o = [], s = 0; s < e.length; s += 1)
|
|
3133
|
+
o.push(r(e[s]));
|
|
3131
3134
|
return o;
|
|
3132
3135
|
}
|
|
3133
3136
|
return r(e);
|
|
3134
|
-
},
|
|
3135
|
-
arrayToObject:
|
|
3136
|
-
assign:
|
|
3137
|
-
combine:
|
|
3138
|
-
compact:
|
|
3139
|
-
decode:
|
|
3140
|
-
encode:
|
|
3141
|
-
isBuffer:
|
|
3142
|
-
isRegExp:
|
|
3143
|
-
maybeMap:
|
|
3144
|
-
merge:
|
|
3145
|
-
},
|
|
3137
|
+
}, vn = {
|
|
3138
|
+
arrayToObject: bn,
|
|
3139
|
+
assign: ys,
|
|
3140
|
+
combine: $s,
|
|
3141
|
+
compact: bs,
|
|
3142
|
+
decode: ms,
|
|
3143
|
+
encode: gs,
|
|
3144
|
+
isBuffer: xs,
|
|
3145
|
+
isRegExp: vs,
|
|
3146
|
+
maybeMap: js,
|
|
3147
|
+
merge: hs
|
|
3148
|
+
}, xn = cs, rt = vn, ze = Yt, ws = Object.prototype.hasOwnProperty, $n = {
|
|
3146
3149
|
brackets: function(e) {
|
|
3147
3150
|
return e + "[]";
|
|
3148
3151
|
},
|
|
@@ -3153,9 +3156,9 @@ var mn = Le, Ue = xi, Di = Ni, Yi = Ve, Xe = mn("%WeakMap%", !0), Ze = mn("%Map%
|
|
|
3153
3156
|
repeat: function(e) {
|
|
3154
3157
|
return e;
|
|
3155
3158
|
}
|
|
3156
|
-
}, le = Array.isArray,
|
|
3157
|
-
|
|
3158
|
-
},
|
|
3159
|
+
}, le = Array.isArray, Ss = Array.prototype.push, jn = function(t, e) {
|
|
3160
|
+
Ss.apply(t, le(e) ? e : [e]);
|
|
3161
|
+
}, Os = Date.prototype.toISOString, _r = ze.default, U = {
|
|
3159
3162
|
addQueryPrefix: !1,
|
|
3160
3163
|
allowDots: !1,
|
|
3161
3164
|
allowEmptyArrays: !1,
|
|
@@ -3172,21 +3175,21 @@ var mn = Le, Ue = xi, Di = Ni, Yi = Ve, Xe = mn("%WeakMap%", !0), Ze = mn("%Map%
|
|
|
3172
3175
|
// deprecated
|
|
3173
3176
|
indices: !1,
|
|
3174
3177
|
serializeDate: function(e) {
|
|
3175
|
-
return
|
|
3178
|
+
return Os.call(e);
|
|
3176
3179
|
},
|
|
3177
3180
|
skipNulls: !1,
|
|
3178
3181
|
strictNullHandling: !1
|
|
3179
|
-
},
|
|
3182
|
+
}, Ts = function(e) {
|
|
3180
3183
|
return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "symbol" || typeof e == "bigint";
|
|
3181
|
-
}, Tt = {},
|
|
3182
|
-
for (var v = e,
|
|
3183
|
-
var k =
|
|
3184
|
-
if (
|
|
3185
|
-
if (k ===
|
|
3184
|
+
}, Tt = {}, Cs = function t(e, r, o, s, a, n, i, l, c, u, f, p, h, y, g, b, x, m) {
|
|
3185
|
+
for (var v = e, w = m, j = 0, S = !1; (w = w.get(Tt)) !== void 0 && !S; ) {
|
|
3186
|
+
var k = w.get(e);
|
|
3187
|
+
if (j += 1, typeof k < "u") {
|
|
3188
|
+
if (k === j)
|
|
3186
3189
|
throw new RangeError("Cyclic object value");
|
|
3187
3190
|
S = !0;
|
|
3188
3191
|
}
|
|
3189
|
-
typeof
|
|
3192
|
+
typeof w.get(Tt) > "u" && (j = 0);
|
|
3190
3193
|
}
|
|
3191
3194
|
if (typeof u == "function" ? v = u(r, v) : v instanceof Date ? v = h(v) : o === "comma" && le(v) && (v = rt.maybeMap(v, function($) {
|
|
3192
3195
|
return $ instanceof Date ? h($) : $;
|
|
@@ -3195,7 +3198,7 @@ var mn = Le, Ue = xi, Di = Ni, Yi = Ve, Xe = mn("%WeakMap%", !0), Ze = mn("%Map%
|
|
|
3195
3198
|
return c && !b ? c(r, U.encoder, x, "key", y) : r;
|
|
3196
3199
|
v = "";
|
|
3197
3200
|
}
|
|
3198
|
-
if (
|
|
3201
|
+
if (Ts(v) || rt.isBuffer(v)) {
|
|
3199
3202
|
if (c) {
|
|
3200
3203
|
var E = b ? r : c(r, U.encoder, x, "key", y);
|
|
3201
3204
|
return [g(E) + "=" + g(c(v, U.encoder, x, "value", y))];
|
|
@@ -3214,23 +3217,23 @@ var mn = Le, Ue = xi, Di = Ni, Yi = Ve, Xe = mn("%WeakMap%", !0), Ze = mn("%Map%
|
|
|
3214
3217
|
var te = Object.keys(v);
|
|
3215
3218
|
F = f ? te.sort(f) : te;
|
|
3216
3219
|
}
|
|
3217
|
-
var re = l ? r.replace(/\./g, "%2E") : r, L =
|
|
3220
|
+
var re = l ? r.replace(/\./g, "%2E") : r, L = s && le(v) && v.length === 1 ? re + "[]" : re;
|
|
3218
3221
|
if (a && le(v) && v.length === 0)
|
|
3219
3222
|
return L + "[]";
|
|
3220
3223
|
for (var V = 0; V < F.length; ++V) {
|
|
3221
3224
|
var Q = F[V], Y = typeof Q == "object" && typeof Q.value < "u" ? Q.value : v[Q];
|
|
3222
|
-
if (!(
|
|
3225
|
+
if (!(i && Y === null)) {
|
|
3223
3226
|
var he = p && l ? Q.replace(/\./g, "%2E") : Q, ft = le(v) ? typeof o == "function" ? o(L, he) : L : L + (p ? "." + he : "[" + he + "]");
|
|
3224
|
-
m.set(e,
|
|
3225
|
-
var Ke =
|
|
3226
|
-
Ke.set(Tt, m),
|
|
3227
|
+
m.set(e, j);
|
|
3228
|
+
var Ke = xn();
|
|
3229
|
+
Ke.set(Tt, m), jn(R, t(
|
|
3227
3230
|
Y,
|
|
3228
3231
|
ft,
|
|
3229
3232
|
o,
|
|
3230
|
-
|
|
3233
|
+
s,
|
|
3231
3234
|
a,
|
|
3232
3235
|
n,
|
|
3233
|
-
|
|
3236
|
+
i,
|
|
3234
3237
|
l,
|
|
3235
3238
|
o === "comma" && b && le(v) ? null : c,
|
|
3236
3239
|
u,
|
|
@@ -3246,7 +3249,7 @@ var mn = Le, Ue = xi, Di = Ni, Yi = Ve, Xe = mn("%WeakMap%", !0), Ze = mn("%Map%
|
|
|
3246
3249
|
}
|
|
3247
3250
|
}
|
|
3248
3251
|
return R;
|
|
3249
|
-
},
|
|
3252
|
+
}, Ps = function(e) {
|
|
3250
3253
|
if (!e)
|
|
3251
3254
|
return U;
|
|
3252
3255
|
if (typeof e.allowEmptyArrays < "u" && typeof e.allowEmptyArrays != "boolean")
|
|
@@ -3260,19 +3263,19 @@ var mn = Le, Ue = xi, Di = Ni, Yi = Ve, Xe = mn("%WeakMap%", !0), Ze = mn("%Map%
|
|
|
3260
3263
|
throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
|
|
3261
3264
|
var o = ze.default;
|
|
3262
3265
|
if (typeof e.format < "u") {
|
|
3263
|
-
if (
|
|
3266
|
+
if (!ws.call(ze.formatters, e.format))
|
|
3264
3267
|
throw new TypeError("Unknown format option provided.");
|
|
3265
3268
|
o = e.format;
|
|
3266
3269
|
}
|
|
3267
|
-
var
|
|
3270
|
+
var s = ze.formatters[o], a = U.filter;
|
|
3268
3271
|
(typeof e.filter == "function" || le(e.filter)) && (a = e.filter);
|
|
3269
3272
|
var n;
|
|
3270
|
-
if (e.arrayFormat in
|
|
3273
|
+
if (e.arrayFormat in $n ? n = e.arrayFormat : "indices" in e ? n = e.indices ? "indices" : "repeat" : n = U.arrayFormat, "commaRoundTrip" in e && typeof e.commaRoundTrip != "boolean")
|
|
3271
3274
|
throw new TypeError("`commaRoundTrip` must be a boolean, or absent");
|
|
3272
|
-
var
|
|
3275
|
+
var i = typeof e.allowDots > "u" ? e.encodeDotInKeys === !0 ? !0 : U.allowDots : !!e.allowDots;
|
|
3273
3276
|
return {
|
|
3274
3277
|
addQueryPrefix: typeof e.addQueryPrefix == "boolean" ? e.addQueryPrefix : U.addQueryPrefix,
|
|
3275
|
-
allowDots:
|
|
3278
|
+
allowDots: i,
|
|
3276
3279
|
allowEmptyArrays: typeof e.allowEmptyArrays == "boolean" ? !!e.allowEmptyArrays : U.allowEmptyArrays,
|
|
3277
3280
|
arrayFormat: n,
|
|
3278
3281
|
charset: r,
|
|
@@ -3285,26 +3288,26 @@ var mn = Le, Ue = xi, Di = Ni, Yi = Ve, Xe = mn("%WeakMap%", !0), Ze = mn("%Map%
|
|
|
3285
3288
|
encodeValuesOnly: typeof e.encodeValuesOnly == "boolean" ? e.encodeValuesOnly : U.encodeValuesOnly,
|
|
3286
3289
|
filter: a,
|
|
3287
3290
|
format: o,
|
|
3288
|
-
formatter:
|
|
3291
|
+
formatter: s,
|
|
3289
3292
|
serializeDate: typeof e.serializeDate == "function" ? e.serializeDate : U.serializeDate,
|
|
3290
3293
|
skipNulls: typeof e.skipNulls == "boolean" ? e.skipNulls : U.skipNulls,
|
|
3291
3294
|
sort: typeof e.sort == "function" ? e.sort : null,
|
|
3292
3295
|
strictNullHandling: typeof e.strictNullHandling == "boolean" ? e.strictNullHandling : U.strictNullHandling
|
|
3293
3296
|
};
|
|
3294
|
-
},
|
|
3295
|
-
var r = t, o =
|
|
3296
|
-
typeof o.filter == "function" ? (a = o.filter, r = a("", r)) : le(o.filter) && (a = o.filter,
|
|
3297
|
+
}, ks = function(t, e) {
|
|
3298
|
+
var r = t, o = Ps(e), s, a;
|
|
3299
|
+
typeof o.filter == "function" ? (a = o.filter, r = a("", r)) : le(o.filter) && (a = o.filter, s = a);
|
|
3297
3300
|
var n = [];
|
|
3298
3301
|
if (typeof r != "object" || r === null)
|
|
3299
3302
|
return "";
|
|
3300
|
-
var
|
|
3301
|
-
|
|
3302
|
-
for (var c =
|
|
3303
|
-
var f =
|
|
3304
|
-
o.skipNulls && r[f] === null ||
|
|
3303
|
+
var i = $n[o.arrayFormat], l = i === "comma" && o.commaRoundTrip;
|
|
3304
|
+
s || (s = Object.keys(r)), o.sort && s.sort(o.sort);
|
|
3305
|
+
for (var c = xn(), u = 0; u < s.length; ++u) {
|
|
3306
|
+
var f = s[u];
|
|
3307
|
+
o.skipNulls && r[f] === null || jn(n, Cs(
|
|
3305
3308
|
r[f],
|
|
3306
3309
|
f,
|
|
3307
|
-
|
|
3310
|
+
i,
|
|
3308
3311
|
l,
|
|
3309
3312
|
o.allowEmptyArrays,
|
|
3310
3313
|
o.strictNullHandling,
|
|
@@ -3324,7 +3327,7 @@ var mn = Le, Ue = xi, Di = Ni, Yi = Ve, Xe = mn("%WeakMap%", !0), Ze = mn("%Map%
|
|
|
3324
3327
|
}
|
|
3325
3328
|
var p = n.join(o.delimiter), h = o.addQueryPrefix === !0 ? "?" : "";
|
|
3326
3329
|
return o.charsetSentinel && (o.charset === "iso-8859-1" ? h += "utf8=%26%2310003%3B&" : h += "utf8=%E2%9C%93&"), p.length > 0 ? h + p : "";
|
|
3327
|
-
}, Ie =
|
|
3330
|
+
}, Ie = vn, It = Object.prototype.hasOwnProperty, Es = Array.isArray, q = {
|
|
3328
3331
|
allowDots: !1,
|
|
3329
3332
|
allowEmptyArrays: !1,
|
|
3330
3333
|
allowPrototypes: !1,
|
|
@@ -3345,54 +3348,54 @@ var mn = Le, Ue = xi, Di = Ni, Yi = Ve, Xe = mn("%WeakMap%", !0), Ze = mn("%Map%
|
|
|
3345
3348
|
plainObjects: !1,
|
|
3346
3349
|
strictDepth: !1,
|
|
3347
3350
|
strictNullHandling: !1
|
|
3348
|
-
},
|
|
3351
|
+
}, Ns = function(t) {
|
|
3349
3352
|
return t.replace(/&#(\d+);/g, function(e, r) {
|
|
3350
3353
|
return String.fromCharCode(parseInt(r, 10));
|
|
3351
3354
|
});
|
|
3352
3355
|
}, wn = function(t, e) {
|
|
3353
3356
|
return t && typeof t == "string" && e.comma && t.indexOf(",") > -1 ? t.split(",") : t;
|
|
3354
|
-
},
|
|
3355
|
-
var o = { __proto__: null },
|
|
3356
|
-
|
|
3357
|
-
var a = r.parameterLimit === 1 / 0 ? void 0 : r.parameterLimit, n =
|
|
3357
|
+
}, Rs = "utf8=%26%2310003%3B", As = "utf8=%E2%9C%93", qs = function(e, r) {
|
|
3358
|
+
var o = { __proto__: null }, s = r.ignoreQueryPrefix ? e.replace(/^\?/, "") : e;
|
|
3359
|
+
s = s.replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
3360
|
+
var a = r.parameterLimit === 1 / 0 ? void 0 : r.parameterLimit, n = s.split(r.delimiter, a), i = -1, l, c = r.charset;
|
|
3358
3361
|
if (r.charsetSentinel)
|
|
3359
3362
|
for (l = 0; l < n.length; ++l)
|
|
3360
|
-
n[l].indexOf("utf8=") === 0 && (n[l] ===
|
|
3363
|
+
n[l].indexOf("utf8=") === 0 && (n[l] === As ? c = "utf-8" : n[l] === Rs && (c = "iso-8859-1"), i = l, l = n.length);
|
|
3361
3364
|
for (l = 0; l < n.length; ++l)
|
|
3362
|
-
if (l !==
|
|
3365
|
+
if (l !== i) {
|
|
3363
3366
|
var u = n[l], f = u.indexOf("]="), p = f === -1 ? u.indexOf("=") : f + 1, h, y;
|
|
3364
3367
|
p === -1 ? (h = r.decoder(u, q.decoder, c, "key"), y = r.strictNullHandling ? null : "") : (h = r.decoder(u.slice(0, p), q.decoder, c, "key"), y = Ie.maybeMap(
|
|
3365
3368
|
wn(u.slice(p + 1), r),
|
|
3366
3369
|
function(b) {
|
|
3367
3370
|
return r.decoder(b, q.decoder, c, "value");
|
|
3368
3371
|
}
|
|
3369
|
-
)), y && r.interpretNumericEntities && c === "iso-8859-1" && (y =
|
|
3372
|
+
)), y && r.interpretNumericEntities && c === "iso-8859-1" && (y = Ns(y)), u.indexOf("[]=") > -1 && (y = Es(y) ? [y] : y);
|
|
3370
3373
|
var g = It.call(o, h);
|
|
3371
3374
|
g && r.duplicates === "combine" ? o[h] = Ie.combine(o[h], y) : (!g || r.duplicates === "last") && (o[h] = y);
|
|
3372
3375
|
}
|
|
3373
3376
|
return o;
|
|
3374
|
-
},
|
|
3375
|
-
for (var
|
|
3376
|
-
var n,
|
|
3377
|
-
if (
|
|
3378
|
-
n = r.allowEmptyArrays && (
|
|
3377
|
+
}, Is = function(t, e, r, o) {
|
|
3378
|
+
for (var s = o ? e : wn(e, r), a = t.length - 1; a >= 0; --a) {
|
|
3379
|
+
var n, i = t[a];
|
|
3380
|
+
if (i === "[]" && r.parseArrays)
|
|
3381
|
+
n = r.allowEmptyArrays && (s === "" || r.strictNullHandling && s === null) ? [] : [].concat(s);
|
|
3379
3382
|
else {
|
|
3380
3383
|
n = r.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
|
|
3381
|
-
var l =
|
|
3382
|
-
!r.parseArrays && c === "" ? n = { 0:
|
|
3384
|
+
var l = i.charAt(0) === "[" && i.charAt(i.length - 1) === "]" ? i.slice(1, -1) : i, c = r.decodeDotInKeys ? l.replace(/%2E/g, ".") : l, u = parseInt(c, 10);
|
|
3385
|
+
!r.parseArrays && c === "" ? n = { 0: s } : !isNaN(u) && i !== c && String(u) === c && u >= 0 && r.parseArrays && u <= r.arrayLimit ? (n = [], n[u] = s) : c !== "__proto__" && (n[c] = s);
|
|
3383
3386
|
}
|
|
3384
|
-
|
|
3387
|
+
s = n;
|
|
3385
3388
|
}
|
|
3386
|
-
return
|
|
3387
|
-
},
|
|
3389
|
+
return s;
|
|
3390
|
+
}, Ls = function(e, r, o, s) {
|
|
3388
3391
|
if (e) {
|
|
3389
|
-
var a = o.allowDots ? e.replace(/\.([^.[]+)/g, "[$1]") : e, n = /(\[[^[\]]*])/,
|
|
3392
|
+
var a = o.allowDots ? e.replace(/\.([^.[]+)/g, "[$1]") : e, n = /(\[[^[\]]*])/, i = /(\[[^[\]]*])/g, l = o.depth > 0 && n.exec(a), c = l ? a.slice(0, l.index) : a, u = [];
|
|
3390
3393
|
if (c) {
|
|
3391
3394
|
if (!o.plainObjects && It.call(Object.prototype, c) && !o.allowPrototypes)
|
|
3392
3395
|
return;
|
|
3393
3396
|
u.push(c);
|
|
3394
3397
|
}
|
|
3395
|
-
for (var f = 0; o.depth > 0 && (l =
|
|
3398
|
+
for (var f = 0; o.depth > 0 && (l = i.exec(a)) !== null && f < o.depth; ) {
|
|
3396
3399
|
if (f += 1, !o.plainObjects && It.call(Object.prototype, l[1].slice(1, -1)) && !o.allowPrototypes)
|
|
3397
3400
|
return;
|
|
3398
3401
|
u.push(l[1]);
|
|
@@ -3402,9 +3405,9 @@ var mn = Le, Ue = xi, Di = Ni, Yi = Ve, Xe = mn("%WeakMap%", !0), Ze = mn("%Map%
|
|
|
3402
3405
|
throw new RangeError("Input depth exceeded depth option of " + o.depth + " and strictDepth is true");
|
|
3403
3406
|
u.push("[" + a.slice(l.index) + "]");
|
|
3404
3407
|
}
|
|
3405
|
-
return
|
|
3408
|
+
return Is(u, r, o, s);
|
|
3406
3409
|
}
|
|
3407
|
-
},
|
|
3410
|
+
}, Us = function(e) {
|
|
3408
3411
|
if (!e)
|
|
3409
3412
|
return q;
|
|
3410
3413
|
if (typeof e.allowEmptyArrays < "u" && typeof e.allowEmptyArrays != "boolean")
|
|
@@ -3418,9 +3421,9 @@ var mn = Le, Ue = xi, Di = Ni, Yi = Ve, Xe = mn("%WeakMap%", !0), Ze = mn("%Map%
|
|
|
3418
3421
|
var r = typeof e.charset > "u" ? q.charset : e.charset, o = typeof e.duplicates > "u" ? q.duplicates : e.duplicates;
|
|
3419
3422
|
if (o !== "combine" && o !== "first" && o !== "last")
|
|
3420
3423
|
throw new TypeError("The duplicates option must be either combine, first, or last");
|
|
3421
|
-
var
|
|
3424
|
+
var s = typeof e.allowDots > "u" ? e.decodeDotInKeys === !0 ? !0 : q.allowDots : !!e.allowDots;
|
|
3422
3425
|
return {
|
|
3423
|
-
allowDots:
|
|
3426
|
+
allowDots: s,
|
|
3424
3427
|
allowEmptyArrays: typeof e.allowEmptyArrays == "boolean" ? !!e.allowEmptyArrays : q.allowEmptyArrays,
|
|
3425
3428
|
allowPrototypes: typeof e.allowPrototypes == "boolean" ? e.allowPrototypes : q.allowPrototypes,
|
|
3426
3429
|
allowSparse: typeof e.allowSparse == "boolean" ? e.allowSparse : q.allowSparse,
|
|
@@ -3442,24 +3445,24 @@ var mn = Le, Ue = xi, Di = Ni, Yi = Ve, Xe = mn("%WeakMap%", !0), Ze = mn("%Map%
|
|
|
3442
3445
|
strictDepth: typeof e.strictDepth == "boolean" ? !!e.strictDepth : q.strictDepth,
|
|
3443
3446
|
strictNullHandling: typeof e.strictNullHandling == "boolean" ? e.strictNullHandling : q.strictNullHandling
|
|
3444
3447
|
};
|
|
3445
|
-
},
|
|
3446
|
-
var r =
|
|
3448
|
+
}, Fs = function(t, e) {
|
|
3449
|
+
var r = Us(e);
|
|
3447
3450
|
if (t === "" || t === null || typeof t > "u")
|
|
3448
3451
|
return r.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
|
|
3449
|
-
for (var o = typeof t == "string" ?
|
|
3450
|
-
var
|
|
3451
|
-
|
|
3452
|
-
}
|
|
3453
|
-
return r.allowSparse === !0 ?
|
|
3454
|
-
},
|
|
3455
|
-
formats:
|
|
3456
|
-
parse:
|
|
3457
|
-
stringify:
|
|
3458
|
-
},
|
|
3452
|
+
for (var o = typeof t == "string" ? qs(t, r) : t, s = r.plainObjects ? /* @__PURE__ */ Object.create(null) : {}, a = Object.keys(o), n = 0; n < a.length; ++n) {
|
|
3453
|
+
var i = a[n], l = Ls(i, o[i], r, typeof t == "string");
|
|
3454
|
+
s = Ie.merge(s, l, r);
|
|
3455
|
+
}
|
|
3456
|
+
return r.allowSparse === !0 ? s : Ie.compact(s);
|
|
3457
|
+
}, _s = ks, Hs = Fs, Bs = Yt, nt = {
|
|
3458
|
+
formats: Bs,
|
|
3459
|
+
parse: Hs,
|
|
3460
|
+
stringify: _s
|
|
3461
|
+
}, Ms = Ta;
|
|
3459
3462
|
function ae() {
|
|
3460
3463
|
this.protocol = null, this.slashes = null, this.auth = null, this.host = null, this.port = null, this.hostname = null, this.hash = null, this.search = null, this.query = null, this.pathname = null, this.path = null, this.href = null;
|
|
3461
3464
|
}
|
|
3462
|
-
var
|
|
3465
|
+
var zs = /^([a-z0-9.+-]+:)/i, Ws = /:[0-9]*$/, Js = /^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/, Gs = [
|
|
3463
3466
|
"<",
|
|
3464
3467
|
">",
|
|
3465
3468
|
'"',
|
|
@@ -3469,14 +3472,14 @@ var Bs = /^([a-z0-9.+-]+:)/i, Ms = /:[0-9]*$/, zs = /^(\/\/?(?!\/)[^?\s]*)(\?[^\
|
|
|
3469
3472
|
`
|
|
3470
3473
|
`,
|
|
3471
3474
|
" "
|
|
3472
|
-
],
|
|
3475
|
+
], Vs = [
|
|
3473
3476
|
"{",
|
|
3474
3477
|
"}",
|
|
3475
3478
|
"|",
|
|
3476
3479
|
"\\",
|
|
3477
3480
|
"^",
|
|
3478
3481
|
"`"
|
|
3479
|
-
].concat(
|
|
3482
|
+
].concat(Gs), Lt = ["'"].concat(Vs), Hr = [
|
|
3480
3483
|
"%",
|
|
3481
3484
|
"/",
|
|
3482
3485
|
"?",
|
|
@@ -3486,7 +3489,7 @@ var Bs = /^([a-z0-9.+-]+:)/i, Ms = /:[0-9]*$/, zs = /^(\/\/?(?!\/)[^?\s]*)(\?[^\
|
|
|
3486
3489
|
"/",
|
|
3487
3490
|
"?",
|
|
3488
3491
|
"#"
|
|
3489
|
-
],
|
|
3492
|
+
], Qs = 255, Mr = /^[+a-z0-9A-Z_-]{0,63}$/, Ks = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, Ds = {
|
|
3490
3493
|
javascript: !0,
|
|
3491
3494
|
"javascript:": !0
|
|
3492
3495
|
}, Ut = {
|
|
@@ -3513,86 +3516,86 @@ function Xt(t, e, r) {
|
|
|
3513
3516
|
ae.prototype.parse = function(t, e, r) {
|
|
3514
3517
|
if (typeof t != "string")
|
|
3515
3518
|
throw new TypeError("Parameter 'url' must be a string, not " + typeof t);
|
|
3516
|
-
var o = t.indexOf("?"),
|
|
3517
|
-
a[0] = a[0].replace(n, "/"), t = a.join(
|
|
3518
|
-
var
|
|
3519
|
-
if (
|
|
3520
|
-
var l =
|
|
3519
|
+
var o = t.indexOf("?"), s = o !== -1 && o < t.indexOf("#") ? "?" : "#", a = t.split(s), n = /\\/g;
|
|
3520
|
+
a[0] = a[0].replace(n, "/"), t = a.join(s);
|
|
3521
|
+
var i = t;
|
|
3522
|
+
if (i = i.trim(), !r && t.split("#").length === 1) {
|
|
3523
|
+
var l = Js.exec(i);
|
|
3521
3524
|
if (l)
|
|
3522
|
-
return this.path =
|
|
3525
|
+
return this.path = i, this.href = i, this.pathname = l[1], l[2] ? (this.search = l[2], e ? this.query = Ft.parse(this.search.substr(1)) : this.query = this.search.substr(1)) : e && (this.search = "", this.query = {}), this;
|
|
3523
3526
|
}
|
|
3524
|
-
var c =
|
|
3527
|
+
var c = zs.exec(i);
|
|
3525
3528
|
if (c) {
|
|
3526
3529
|
c = c[0];
|
|
3527
3530
|
var u = c.toLowerCase();
|
|
3528
|
-
this.protocol = u,
|
|
3531
|
+
this.protocol = u, i = i.substr(c.length);
|
|
3529
3532
|
}
|
|
3530
|
-
if (r || c ||
|
|
3531
|
-
var f =
|
|
3532
|
-
f && !(c && Ut[c]) && (
|
|
3533
|
+
if (r || c || i.match(/^\/\/[^@/]+@[^@/]+/)) {
|
|
3534
|
+
var f = i.substr(0, 2) === "//";
|
|
3535
|
+
f && !(c && Ut[c]) && (i = i.substr(2), this.slashes = !0);
|
|
3533
3536
|
}
|
|
3534
3537
|
if (!Ut[c] && (f || c && !Ne[c])) {
|
|
3535
3538
|
for (var p = -1, h = 0; h < Br.length; h++) {
|
|
3536
|
-
var y =
|
|
3539
|
+
var y = i.indexOf(Br[h]);
|
|
3537
3540
|
y !== -1 && (p === -1 || y < p) && (p = y);
|
|
3538
3541
|
}
|
|
3539
3542
|
var g, b;
|
|
3540
|
-
p === -1 ? b =
|
|
3543
|
+
p === -1 ? b = i.lastIndexOf("@") : b = i.lastIndexOf("@", p), b !== -1 && (g = i.slice(0, b), i = i.slice(b + 1), this.auth = decodeURIComponent(g)), p = -1;
|
|
3541
3544
|
for (var h = 0; h < Hr.length; h++) {
|
|
3542
|
-
var y =
|
|
3545
|
+
var y = i.indexOf(Hr[h]);
|
|
3543
3546
|
y !== -1 && (p === -1 || y < p) && (p = y);
|
|
3544
3547
|
}
|
|
3545
|
-
p === -1 && (p =
|
|
3548
|
+
p === -1 && (p = i.length), this.host = i.slice(0, p), i = i.slice(p), this.parseHost(), this.hostname = this.hostname || "";
|
|
3546
3549
|
var x = this.hostname[0] === "[" && this.hostname[this.hostname.length - 1] === "]";
|
|
3547
3550
|
if (!x)
|
|
3548
3551
|
for (var m = this.hostname.split(/\./), h = 0, v = m.length; h < v; h++) {
|
|
3549
|
-
var
|
|
3550
|
-
if (
|
|
3551
|
-
for (var
|
|
3552
|
-
|
|
3553
|
-
if (!
|
|
3554
|
-
var E = m.slice(0, h), R = m.slice(h + 1), F =
|
|
3555
|
-
F && (E.push(F[1]), R.unshift(F[2])), R.length && (
|
|
3552
|
+
var w = m[h];
|
|
3553
|
+
if (w && !w.match(Mr)) {
|
|
3554
|
+
for (var j = "", S = 0, k = w.length; S < k; S++)
|
|
3555
|
+
w.charCodeAt(S) > 127 ? j += "x" : j += w[S];
|
|
3556
|
+
if (!j.match(Mr)) {
|
|
3557
|
+
var E = m.slice(0, h), R = m.slice(h + 1), F = w.match(Ks);
|
|
3558
|
+
F && (E.push(F[1]), R.unshift(F[2])), R.length && (i = "/" + R.join(".") + i), this.hostname = E.join(".");
|
|
3556
3559
|
break;
|
|
3557
3560
|
}
|
|
3558
3561
|
}
|
|
3559
3562
|
}
|
|
3560
|
-
this.hostname.length >
|
|
3563
|
+
this.hostname.length > Qs ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(), x || (this.hostname = Ms.toASCII(this.hostname));
|
|
3561
3564
|
var te = this.port ? ":" + this.port : "", re = this.hostname || "";
|
|
3562
|
-
this.host = re + te, this.href += this.host, x && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
|
|
3565
|
+
this.host = re + te, this.href += this.host, x && (this.hostname = this.hostname.substr(1, this.hostname.length - 2), i[0] !== "/" && (i = "/" + i));
|
|
3563
3566
|
}
|
|
3564
|
-
if (!
|
|
3567
|
+
if (!Ds[u])
|
|
3565
3568
|
for (var h = 0, v = Lt.length; h < v; h++) {
|
|
3566
3569
|
var L = Lt[h];
|
|
3567
|
-
if (
|
|
3570
|
+
if (i.indexOf(L) !== -1) {
|
|
3568
3571
|
var V = encodeURIComponent(L);
|
|
3569
|
-
V === L && (V = escape(L)),
|
|
3572
|
+
V === L && (V = escape(L)), i = i.split(L).join(V);
|
|
3570
3573
|
}
|
|
3571
3574
|
}
|
|
3572
|
-
var Q =
|
|
3573
|
-
Q !== -1 && (this.hash =
|
|
3574
|
-
var Y =
|
|
3575
|
-
if (Y !== -1 ? (this.search =
|
|
3575
|
+
var Q = i.indexOf("#");
|
|
3576
|
+
Q !== -1 && (this.hash = i.substr(Q), i = i.slice(0, Q));
|
|
3577
|
+
var Y = i.indexOf("?");
|
|
3578
|
+
if (Y !== -1 ? (this.search = i.substr(Y), this.query = i.substr(Y + 1), e && (this.query = Ft.parse(this.query)), i = i.slice(0, Y)) : e && (this.search = "", this.query = {}), i && (this.pathname = i), Ne[u] && this.hostname && !this.pathname && (this.pathname = "/"), this.pathname || this.search) {
|
|
3576
3579
|
var te = this.pathname || "", he = this.search || "";
|
|
3577
3580
|
this.path = te + he;
|
|
3578
3581
|
}
|
|
3579
3582
|
return this.href = this.format(), this;
|
|
3580
3583
|
};
|
|
3581
|
-
function
|
|
3584
|
+
function Ys(t) {
|
|
3582
3585
|
return typeof t == "string" && (t = Xt(t)), t instanceof ae ? t.format() : ae.prototype.format.call(t);
|
|
3583
3586
|
}
|
|
3584
3587
|
ae.prototype.format = function() {
|
|
3585
3588
|
var t = this.auth || "";
|
|
3586
3589
|
t && (t = encodeURIComponent(t), t = t.replace(/%3A/i, ":"), t += "@");
|
|
3587
|
-
var e = this.protocol || "", r = this.pathname || "", o = this.hash || "",
|
|
3588
|
-
this.host ?
|
|
3590
|
+
var e = this.protocol || "", r = this.pathname || "", o = this.hash || "", s = !1, a = "";
|
|
3591
|
+
this.host ? s = t + this.host : this.hostname && (s = t + (this.hostname.indexOf(":") === -1 ? this.hostname : "[" + this.hostname + "]"), this.port && (s += ":" + this.port)), this.query && typeof this.query == "object" && Object.keys(this.query).length && (a = Ft.stringify(this.query, {
|
|
3589
3592
|
arrayFormat: "repeat",
|
|
3590
3593
|
addQueryPrefix: !1
|
|
3591
3594
|
}));
|
|
3592
3595
|
var n = this.search || a && "?" + a || "";
|
|
3593
|
-
return e && e.substr(-1) !== ":" && (e += ":"), this.slashes || (!e || Ne[e]) &&
|
|
3594
|
-
return encodeURIComponent(
|
|
3595
|
-
}), n = n.replace("#", "%23"), e +
|
|
3596
|
+
return e && e.substr(-1) !== ":" && (e += ":"), this.slashes || (!e || Ne[e]) && s !== !1 ? (s = "//" + (s || ""), r && r.charAt(0) !== "/" && (r = "/" + r)) : s || (s = ""), o && o.charAt(0) !== "#" && (o = "#" + o), n && n.charAt(0) !== "?" && (n = "?" + n), r = r.replace(/[?#]/g, function(i) {
|
|
3597
|
+
return encodeURIComponent(i);
|
|
3598
|
+
}), n = n.replace("#", "%23"), e + s + r + n + o;
|
|
3596
3599
|
};
|
|
3597
3600
|
ae.prototype.resolve = function(t) {
|
|
3598
3601
|
return this.resolveObject(Xt(t, !1, !0)).format();
|
|
@@ -3602,15 +3605,15 @@ ae.prototype.resolveObject = function(t) {
|
|
|
3602
3605
|
var e = new ae();
|
|
3603
3606
|
e.parse(t, !1, !0), t = e;
|
|
3604
3607
|
}
|
|
3605
|
-
for (var r = new ae(), o = Object.keys(this),
|
|
3606
|
-
var a = o[
|
|
3608
|
+
for (var r = new ae(), o = Object.keys(this), s = 0; s < o.length; s++) {
|
|
3609
|
+
var a = o[s];
|
|
3607
3610
|
r[a] = this[a];
|
|
3608
3611
|
}
|
|
3609
3612
|
if (r.hash = t.hash, t.href === "")
|
|
3610
3613
|
return r.href = r.format(), r;
|
|
3611
3614
|
if (t.slashes && !t.protocol) {
|
|
3612
|
-
for (var n = Object.keys(t),
|
|
3613
|
-
var l = n[
|
|
3615
|
+
for (var n = Object.keys(t), i = 0; i < n.length; i++) {
|
|
3616
|
+
var l = n[i];
|
|
3614
3617
|
l !== "protocol" && (r[l] = t[l]);
|
|
3615
3618
|
}
|
|
3616
3619
|
return Ne[r.protocol] && r.hostname && !r.pathname && (r.pathname = "/", r.path = r.pathname), r.href = r.format(), r;
|
|
@@ -3635,16 +3638,16 @@ ae.prototype.resolveObject = function(t) {
|
|
|
3635
3638
|
}
|
|
3636
3639
|
return r.slashes = r.slashes || t.slashes, r.href = r.format(), r;
|
|
3637
3640
|
}
|
|
3638
|
-
var y = r.pathname && r.pathname.charAt(0) === "/", g = t.host || t.pathname && t.pathname.charAt(0) === "/", b = g || y || r.host && t.pathname, x = b, m = r.pathname && r.pathname.split("/") || [], v = t.pathname && t.pathname.split("/") || [],
|
|
3639
|
-
if (
|
|
3641
|
+
var y = r.pathname && r.pathname.charAt(0) === "/", g = t.host || t.pathname && t.pathname.charAt(0) === "/", b = g || y || r.host && t.pathname, x = b, m = r.pathname && r.pathname.split("/") || [], v = t.pathname && t.pathname.split("/") || [], w = r.protocol && !Ne[r.protocol];
|
|
3642
|
+
if (w && (r.hostname = "", r.port = null, r.host && (m[0] === "" ? m[0] = r.host : m.unshift(r.host)), r.host = "", t.protocol && (t.hostname = null, t.port = null, t.host && (v[0] === "" ? v[0] = t.host : v.unshift(t.host)), t.host = null), b = b && (v[0] === "" || m[0] === "")), g)
|
|
3640
3643
|
r.host = t.host || t.host === "" ? t.host : r.host, r.hostname = t.hostname || t.hostname === "" ? t.hostname : r.hostname, r.search = t.search, r.query = t.query, m = v;
|
|
3641
3644
|
else if (v.length)
|
|
3642
3645
|
m || (m = []), m.pop(), m = m.concat(v), r.search = t.search, r.query = t.query;
|
|
3643
3646
|
else if (t.search != null) {
|
|
3644
|
-
if (
|
|
3647
|
+
if (w) {
|
|
3645
3648
|
r.host = m.shift(), r.hostname = r.host;
|
|
3646
|
-
var
|
|
3647
|
-
|
|
3649
|
+
var j = r.host && r.host.indexOf("@") > 0 ? r.host.split("@") : !1;
|
|
3650
|
+
j && (r.auth = j.shift(), r.hostname = j.shift(), r.host = r.hostname);
|
|
3648
3651
|
}
|
|
3649
3652
|
return r.search = t.search, r.query = t.query, (r.pathname !== null || r.search !== null) && (r.path = (r.pathname ? r.pathname : "") + (r.search ? r.search : "")), r.href = r.format(), r;
|
|
3650
3653
|
}
|
|
@@ -3657,23 +3660,23 @@ ae.prototype.resolveObject = function(t) {
|
|
|
3657
3660
|
m.unshift("..");
|
|
3658
3661
|
b && m[0] !== "" && (!m[0] || m[0].charAt(0) !== "/") && m.unshift(""), k && m.join("/").substr(-1) !== "/" && m.push("");
|
|
3659
3662
|
var F = m[0] === "" || m[0] && m[0].charAt(0) === "/";
|
|
3660
|
-
if (
|
|
3663
|
+
if (w) {
|
|
3661
3664
|
r.hostname = F ? "" : m.length ? m.shift() : "", r.host = r.hostname;
|
|
3662
|
-
var
|
|
3663
|
-
|
|
3665
|
+
var j = r.host && r.host.indexOf("@") > 0 ? r.host.split("@") : !1;
|
|
3666
|
+
j && (r.auth = j.shift(), r.hostname = j.shift(), r.host = r.hostname);
|
|
3664
3667
|
}
|
|
3665
3668
|
return b = b || r.host && m.length, b && !F && m.unshift(""), m.length > 0 ? r.pathname = m.join("/") : (r.pathname = null, r.path = null), (r.pathname !== null || r.search !== null) && (r.path = (r.pathname ? r.pathname : "") + (r.search ? r.search : "")), r.auth = t.auth || r.auth, r.slashes = r.slashes || t.slashes, r.href = r.format(), r;
|
|
3666
3669
|
};
|
|
3667
3670
|
ae.prototype.parseHost = function() {
|
|
3668
|
-
var t = this.host, e =
|
|
3671
|
+
var t = this.host, e = Ws.exec(t);
|
|
3669
3672
|
e && (e = e[0], e !== ":" && (this.port = e.substr(1)), t = t.substr(0, t.length - e.length)), t && (this.hostname = t);
|
|
3670
3673
|
};
|
|
3671
|
-
var
|
|
3674
|
+
var Xs = Xt, zr = Ys, Zs = (t) => typeof t == "object" && "log" in t && typeof t.log == "object" && "entries" in t.log && Array.isArray(t.log.entries), el = class {
|
|
3672
3675
|
constructor(t, e = {}) {
|
|
3673
3676
|
this.initCalled = !1, this.entries = [], this.requests = [], this.options = {}, this.options = {
|
|
3674
3677
|
harIsAlreadyEncoded: !1,
|
|
3675
3678
|
...e
|
|
3676
|
-
}, this.requests = [],
|
|
3679
|
+
}, this.requests = [], Zs(t) ? this.entries = t.log.entries : this.entries = [
|
|
3677
3680
|
{
|
|
3678
3681
|
request: t
|
|
3679
3682
|
}
|
|
@@ -3733,13 +3736,13 @@ var Ds = Xt, zr = Ks, Ys = (t) => typeof t == "object" && "log" in t && typeof t
|
|
|
3733
3736
|
case "multipart/alternative":
|
|
3734
3737
|
if (r.postData.text = "", r.postData.mimeType = "multipart/form-data", (f = r.postData) != null && f.params) {
|
|
3735
3738
|
const h = "---011000010111000001101001", y = `${h}--`, g = `\r
|
|
3736
|
-
`, b = (
|
|
3739
|
+
`, b = (w) => w.replace(/\n/g, "%0A").replace(/\r/g, "%0D").replace(/"/g, "%22"), x = (w) => w.replace(/\r?\n|\r/g, `\r
|
|
3737
3740
|
`), m = [`--${h}`];
|
|
3738
|
-
(p = r.postData) == null || p.params.forEach((
|
|
3739
|
-
const S =
|
|
3741
|
+
(p = r.postData) == null || p.params.forEach((w, j) => {
|
|
3742
|
+
const S = w.name, k = w.value || "", E = w.fileName || null, R = w.contentType || "application/octet-stream";
|
|
3740
3743
|
E ? (m.push(
|
|
3741
3744
|
`Content-Disposition: form-data; name="${b(x(S))}"; filename="${E}"`
|
|
3742
|
-
), m.push(`Content-Type: ${R}`)) : m.push(`Content-Disposition: form-data; name="${b(x(S))}"`), m.push(""), m.push(x(k)),
|
|
3745
|
+
), m.push(`Content-Type: ${R}`)) : m.push(`Content-Disposition: form-data; name="${b(x(S))}"`), m.push(""), m.push(x(k)), j !== r.postData.params.length - 1 && m.push(`--${h}`);
|
|
3743
3746
|
}), m.push(`--${y}`), r.postData.boundary = h, r.postData.text = m.join(g);
|
|
3744
3747
|
const v = J(r.headersObj, "content-type") || "content-type";
|
|
3745
3748
|
r.headersObj[v] = `multipart/form-data; boundary=${h}`;
|
|
@@ -3760,10 +3763,10 @@ var Ds = Xt, zr = Ks, Ys = (t) => typeof t == "object" && "log" in t && typeof t
|
|
|
3760
3763
|
}
|
|
3761
3764
|
break;
|
|
3762
3765
|
}
|
|
3763
|
-
const
|
|
3766
|
+
const s = {
|
|
3764
3767
|
...r.allHeaders,
|
|
3765
3768
|
...r.headersObj
|
|
3766
|
-
}, a =
|
|
3769
|
+
}, a = Xs(r.url, !0, !0);
|
|
3767
3770
|
r.queryObj = {
|
|
3768
3771
|
...r.queryObj,
|
|
3769
3772
|
...a.query
|
|
@@ -3775,7 +3778,7 @@ var Ds = Xt, zr = Ks, Ys = (t) => typeof t == "object" && "log" in t && typeof t
|
|
|
3775
3778
|
}) : n = nt.stringify(r.queryObj, {
|
|
3776
3779
|
indices: !1
|
|
3777
3780
|
});
|
|
3778
|
-
const
|
|
3781
|
+
const i = {
|
|
3779
3782
|
...a,
|
|
3780
3783
|
query: r.queryObj,
|
|
3781
3784
|
search: n,
|
|
@@ -3786,55 +3789,55 @@ var Ds = Xt, zr = Ks, Ys = (t) => typeof t == "object" && "log" in t && typeof t
|
|
|
3786
3789
|
search: null
|
|
3787
3790
|
}), c = zr({
|
|
3788
3791
|
...a,
|
|
3789
|
-
...
|
|
3792
|
+
...i
|
|
3790
3793
|
});
|
|
3791
3794
|
return {
|
|
3792
3795
|
...r,
|
|
3793
|
-
allHeaders:
|
|
3796
|
+
allHeaders: s,
|
|
3794
3797
|
fullUrl: c,
|
|
3795
3798
|
url: l,
|
|
3796
|
-
uriObj:
|
|
3799
|
+
uriObj: i
|
|
3797
3800
|
};
|
|
3798
3801
|
}
|
|
3799
3802
|
convert(t, e, r) {
|
|
3800
3803
|
this.initCalled || this.init(), !r && e && (r = e);
|
|
3801
|
-
const o =
|
|
3804
|
+
const o = Oa[t];
|
|
3802
3805
|
if (!o)
|
|
3803
3806
|
return !1;
|
|
3804
|
-
const { convert:
|
|
3805
|
-
return this.requests.map((n) =>
|
|
3807
|
+
const { convert: s } = o.clientsById[e || o.info.default];
|
|
3808
|
+
return this.requests.map((n) => s(n, r));
|
|
3806
3809
|
}
|
|
3807
3810
|
};
|
|
3808
|
-
const
|
|
3811
|
+
const tl = ({
|
|
3809
3812
|
rootMargin: t = "0px",
|
|
3810
3813
|
threshold: e
|
|
3811
3814
|
} = {}) => {
|
|
3812
|
-
const [r, o] = ve(!1),
|
|
3813
|
-
return
|
|
3815
|
+
const [r, o] = ve(!1), s = Vr(null);
|
|
3816
|
+
return Qr(() => {
|
|
3814
3817
|
const a = new IntersectionObserver(
|
|
3815
|
-
([
|
|
3816
|
-
|
|
3818
|
+
([i]) => {
|
|
3819
|
+
i && o(i.isIntersecting);
|
|
3817
3820
|
},
|
|
3818
3821
|
{ rootMargin: t, threshold: e }
|
|
3819
|
-
), n =
|
|
3822
|
+
), n = s.current;
|
|
3820
3823
|
if (n)
|
|
3821
3824
|
return a.observe(n), () => a.unobserve(n);
|
|
3822
|
-
}, [t, e]), [
|
|
3823
|
-
},
|
|
3825
|
+
}, [t, e]), [s, r];
|
|
3826
|
+
}, rl = ee.Root, Wr = ee.CollapsibleTrigger, nl = ee.CollapsibleContent, ol = typeof window < "u" ? Fn : Qr, Zt = ({
|
|
3824
3827
|
children: t,
|
|
3825
3828
|
maxHeight: e = 250
|
|
3826
3829
|
}) => {
|
|
3827
|
-
const r =
|
|
3828
|
-
return
|
|
3829
|
-
const
|
|
3830
|
-
if (!
|
|
3831
|
-
i
|
|
3830
|
+
const r = Vr(null), [o, s] = ve(!1), [a, n] = ve(!1);
|
|
3831
|
+
return ol(() => {
|
|
3832
|
+
const i = r.current;
|
|
3833
|
+
if (!i) return;
|
|
3834
|
+
s(i.scrollHeight > e);
|
|
3832
3835
|
const l = new ResizeObserver(() => {
|
|
3833
|
-
i
|
|
3836
|
+
s(i.scrollHeight > e);
|
|
3834
3837
|
});
|
|
3835
|
-
return l.observe(
|
|
3838
|
+
return l.observe(i), () => l.disconnect();
|
|
3836
3839
|
}, [e]), /* @__PURE__ */ d.jsxs(
|
|
3837
|
-
|
|
3840
|
+
rl,
|
|
3838
3841
|
{
|
|
3839
3842
|
className: "group",
|
|
3840
3843
|
open: a,
|
|
@@ -3842,7 +3845,7 @@ const Zs = ({
|
|
|
3842
3845
|
style: { "--max-height": `${e}px` },
|
|
3843
3846
|
children: [
|
|
3844
3847
|
/* @__PURE__ */ d.jsxs(
|
|
3845
|
-
|
|
3848
|
+
nl,
|
|
3846
3849
|
{
|
|
3847
3850
|
forceMount: !0,
|
|
3848
3851
|
className: D(
|
|
@@ -3873,32 +3876,32 @@ const Zs = ({
|
|
|
3873
3876
|
]
|
|
3874
3877
|
}
|
|
3875
3878
|
);
|
|
3876
|
-
},
|
|
3879
|
+
}, al = ({
|
|
3877
3880
|
server: t,
|
|
3878
3881
|
servers: e,
|
|
3879
3882
|
operation: r
|
|
3880
3883
|
}) => {
|
|
3881
|
-
var n,
|
|
3884
|
+
var n, i, l;
|
|
3882
3885
|
const o = (n = r.parameters) == null ? void 0 : n.filter((c) => c.in === "header").map((c) => {
|
|
3883
3886
|
var u, f;
|
|
3884
3887
|
return {
|
|
3885
3888
|
name: c.name,
|
|
3886
3889
|
defaultValue: ((f = (u = c.examples) == null ? void 0 : u.find((p) => p.value)) == null ? void 0 : f.value) ?? ""
|
|
3887
3890
|
};
|
|
3888
|
-
}),
|
|
3891
|
+
}), s = (i = r.parameters) == null ? void 0 : i.filter((c) => c.in === "query").sort((c, u) => c.required && !u.required ? -1 : 1).map((c) => ({
|
|
3889
3892
|
name: c.name,
|
|
3890
3893
|
defaultActive: c.required ?? !1,
|
|
3891
3894
|
isRequired: c.required ?? !1
|
|
3892
3895
|
})), a = (l = r.parameters) == null ? void 0 : l.filter((c) => c.in === "path").map((c) => ({ name: c.name }));
|
|
3893
3896
|
return /* @__PURE__ */ d.jsx(
|
|
3894
|
-
|
|
3897
|
+
zn,
|
|
3895
3898
|
{
|
|
3896
3899
|
server: t,
|
|
3897
3900
|
servers: e,
|
|
3898
3901
|
method: r.method,
|
|
3899
3902
|
url: r.path,
|
|
3900
3903
|
headers: o,
|
|
3901
|
-
queryParams:
|
|
3904
|
+
queryParams: s,
|
|
3902
3905
|
pathParams: a
|
|
3903
3906
|
}
|
|
3904
3907
|
);
|
|
@@ -3926,7 +3929,7 @@ const Zs = ({
|
|
|
3926
3929
|
className: D("bg-zinc-50 dark:bg-zinc-800 overflow-auto p-2", e),
|
|
3927
3930
|
children: t
|
|
3928
3931
|
}
|
|
3929
|
-
),
|
|
3932
|
+
), Sn = ({ children: t, className: e }) => /* @__PURE__ */ d.jsx(
|
|
3930
3933
|
"div",
|
|
3931
3934
|
{
|
|
3932
3935
|
className: D(
|
|
@@ -3945,8 +3948,8 @@ const Zs = ({
|
|
|
3945
3948
|
if (t.properties || t.type === "object") {
|
|
3946
3949
|
const r = {};
|
|
3947
3950
|
if (t.properties)
|
|
3948
|
-
for (const [o,
|
|
3949
|
-
r[o] = Re(
|
|
3951
|
+
for (const [o, s] of Object.entries(t.properties))
|
|
3952
|
+
r[o] = Re(s, o);
|
|
3950
3953
|
return r;
|
|
3951
3954
|
}
|
|
3952
3955
|
if (t.type === "array")
|
|
@@ -3969,10 +3972,10 @@ const Zs = ({
|
|
|
3969
3972
|
default:
|
|
3970
3973
|
return {};
|
|
3971
3974
|
}
|
|
3972
|
-
},
|
|
3973
|
-
var o,
|
|
3975
|
+
}, il = ({ content: t }) => {
|
|
3976
|
+
var o, s;
|
|
3974
3977
|
if (!t.length) return null;
|
|
3975
|
-
const e = t.at(0), r = ((
|
|
3978
|
+
const e = t.at(0), r = ((s = (o = e == null ? void 0 : e.examples) == null ? void 0 : o.at(0)) == null ? void 0 : s.value) ?? (e != null && e.schema ? Re(e.schema) : "");
|
|
3976
3979
|
return /* @__PURE__ */ d.jsx(d.Fragment, { children: /* @__PURE__ */ d.jsxs(er, { children: [
|
|
3977
3980
|
/* @__PURE__ */ d.jsx(tr, { className: "text-xs flex justify-between items-center", children: /* @__PURE__ */ d.jsx("span", { className: "font-mono", children: "Request Body Example" }) }),
|
|
3978
3981
|
/* @__PURE__ */ d.jsx(rr, { className: "p-0", children: /* @__PURE__ */ d.jsx(Zt, { children: /* @__PURE__ */ d.jsx(
|
|
@@ -3986,7 +3989,7 @@ const Zs = ({
|
|
|
3986
3989
|
}
|
|
3987
3990
|
) }) })
|
|
3988
3991
|
] }) });
|
|
3989
|
-
},
|
|
3992
|
+
}, sl = ({
|
|
3990
3993
|
responses: t,
|
|
3991
3994
|
selectedResponse: e,
|
|
3992
3995
|
onSelectResponse: r
|
|
@@ -3997,28 +4000,28 @@ const Zs = ({
|
|
|
3997
4000
|
{
|
|
3998
4001
|
defaultValue: (o = t[0]) == null ? void 0 : o.statusCode,
|
|
3999
4002
|
value: e,
|
|
4000
|
-
onValueChange: (
|
|
4003
|
+
onValueChange: (s) => r(s),
|
|
4001
4004
|
children: [
|
|
4002
4005
|
/* @__PURE__ */ d.jsxs(tr, { className: "text-xs flex flex-col gap-2 pb-0", children: [
|
|
4003
4006
|
/* @__PURE__ */ d.jsx("span", { className: "font-mono", children: "Example Responses" }),
|
|
4004
|
-
/* @__PURE__ */ d.jsx(De.List, { className: "flex gap-2", children: t.map((
|
|
4007
|
+
/* @__PURE__ */ d.jsx(De.List, { className: "flex gap-2", children: t.map((s) => /* @__PURE__ */ d.jsx(
|
|
4005
4008
|
De.Trigger,
|
|
4006
4009
|
{
|
|
4007
|
-
value:
|
|
4010
|
+
value: s.statusCode,
|
|
4008
4011
|
className: D(
|
|
4009
4012
|
"text-xs font-mono px-1.5 py-1 pb-px translate-y-px border-b-2 border-transparent rounded-t cursor-pointer",
|
|
4010
4013
|
"data-[state=active]:text-primary data-[state=active]:dark:text-inherit data-[state=active]:border-primary",
|
|
4011
4014
|
"hover:border-accent-foreground/25"
|
|
4012
4015
|
),
|
|
4013
|
-
children:
|
|
4016
|
+
children: s.statusCode
|
|
4014
4017
|
},
|
|
4015
|
-
|
|
4018
|
+
s.statusCode
|
|
4016
4019
|
)) })
|
|
4017
4020
|
] }),
|
|
4018
|
-
t.map((
|
|
4019
|
-
var
|
|
4020
|
-
const a = (
|
|
4021
|
-
return /* @__PURE__ */ d.jsxs(De.Content, { value:
|
|
4021
|
+
t.map((s) => {
|
|
4022
|
+
var i, l, c;
|
|
4023
|
+
const a = (i = s.content) == null ? void 0 : i.at(0), n = ((c = (l = a == null ? void 0 : a.examples) == null ? void 0 : l.at(0)) == null ? void 0 : c.value) ?? (a != null && a.schema ? Re(a.schema) : "");
|
|
4024
|
+
return /* @__PURE__ */ d.jsxs(De.Content, { value: s.statusCode, children: [
|
|
4022
4025
|
/* @__PURE__ */ d.jsx(rr, { className: "p-0", children: /* @__PURE__ */ d.jsx(Zt, { children: /* @__PURE__ */ d.jsx(
|
|
4023
4026
|
Mt,
|
|
4024
4027
|
{
|
|
@@ -4028,13 +4031,13 @@ const Zs = ({
|
|
|
4028
4031
|
code: n ? JSON.stringify(n, null, 2) : "Empty response"
|
|
4029
4032
|
}
|
|
4030
4033
|
) }) }),
|
|
4031
|
-
/* @__PURE__ */ d.jsx(
|
|
4032
|
-
] },
|
|
4034
|
+
/* @__PURE__ */ d.jsx(Sn, { className: "flex justify-end text-xs", children: s.description })
|
|
4035
|
+
] }, s.statusCode);
|
|
4033
4036
|
})
|
|
4034
4037
|
]
|
|
4035
4038
|
}
|
|
4036
4039
|
) });
|
|
4037
|
-
},
|
|
4040
|
+
}, ll = (t, e) => {
|
|
4038
4041
|
let r;
|
|
4039
4042
|
switch (e) {
|
|
4040
4043
|
case "shell":
|
|
@@ -4075,7 +4078,7 @@ const Zs = ({
|
|
|
4075
4078
|
break;
|
|
4076
4079
|
}
|
|
4077
4080
|
return r ? r[0] : "";
|
|
4078
|
-
},
|
|
4081
|
+
}, cl = ut(
|
|
4079
4082
|
/* GraphQL */
|
|
4080
4083
|
`
|
|
4081
4084
|
query getServerQuery($input: JSON!, $type: SchemaType!) {
|
|
@@ -4087,7 +4090,7 @@ const Zs = ({
|
|
|
4087
4090
|
}
|
|
4088
4091
|
}
|
|
4089
4092
|
`
|
|
4090
|
-
),
|
|
4093
|
+
), ul = {
|
|
4091
4094
|
get: fe.green,
|
|
4092
4095
|
post: fe.blue,
|
|
4093
4096
|
put: fe.yellow,
|
|
@@ -4096,7 +4099,7 @@ const Zs = ({
|
|
|
4096
4099
|
options: fe.indigo,
|
|
4097
4100
|
head: fe.gray,
|
|
4098
4101
|
trace: fe.gray
|
|
4099
|
-
},
|
|
4102
|
+
}, pl = [
|
|
4100
4103
|
{ value: "shell", label: "cURL" },
|
|
4101
4104
|
{ value: "js", label: "JavaScript" },
|
|
4102
4105
|
{ value: "python", label: "Python" },
|
|
@@ -4108,19 +4111,19 @@ const Zs = ({
|
|
|
4108
4111
|
{ value: "php", label: "PHP" },
|
|
4109
4112
|
{ value: "ruby", label: "Ruby" },
|
|
4110
4113
|
{ value: "swift", label: "Swift" }
|
|
4111
|
-
],
|
|
4114
|
+
], fl = ({
|
|
4112
4115
|
operation: t,
|
|
4113
4116
|
selectedResponse: e,
|
|
4114
4117
|
onSelectResponse: r
|
|
4115
4118
|
}) => {
|
|
4116
4119
|
var m;
|
|
4117
|
-
const { input: o, type:
|
|
4120
|
+
const { input: o, type: s } = Bt(), a = zt(cl, { input: o, type: s }), n = Ht(a), i = ul[t.method.toLocaleLowerCase()] ?? fe.gray, [l, c] = to(), [, u] = Gr(), f = l.get("lang") ?? "shell", p = (m = t.requestBody) == null ? void 0 : m.content, h = t.path.split("/").map((v, w, j) => {
|
|
4118
4121
|
const k = v.startsWith("{") && v.endsWith("}") || v.startsWith(":") ? v.replace(/[:{}]/g, "") : void 0;
|
|
4119
4122
|
return (
|
|
4120
4123
|
// eslint-disable-next-line react/no-array-index-key
|
|
4121
|
-
/* @__PURE__ */ d.jsxs(
|
|
4124
|
+
/* @__PURE__ */ d.jsxs(_n, { children: [
|
|
4122
4125
|
k ? /* @__PURE__ */ d.jsx(
|
|
4123
|
-
|
|
4126
|
+
Xr,
|
|
4124
4127
|
{
|
|
4125
4128
|
name: k,
|
|
4126
4129
|
backgroundOpacity: "0",
|
|
@@ -4128,13 +4131,13 @@ const Zs = ({
|
|
|
4128
4131
|
children: v
|
|
4129
4132
|
}
|
|
4130
4133
|
) : v,
|
|
4131
|
-
|
|
4134
|
+
w < j.length - 1 ? "/" : null,
|
|
4132
4135
|
/* @__PURE__ */ d.jsx("wbr", {})
|
|
4133
|
-
] }, v +
|
|
4136
|
+
] }, v + w)
|
|
4134
4137
|
);
|
|
4135
|
-
}), { selectedServer: y } =
|
|
4136
|
-
var
|
|
4137
|
-
const v = (
|
|
4138
|
+
}), { selectedServer: y } = Kr(), g = Jr(() => {
|
|
4139
|
+
var j;
|
|
4140
|
+
const v = (j = p == null ? void 0 : p[0]) != null && j.schema ? Re(p[0].schema) : void 0, w = new el({
|
|
4138
4141
|
method: t.method.toLocaleUpperCase(),
|
|
4139
4142
|
url: (y ?? n.data.schema.url ?? "") + t.path.replaceAll("{", ":").replaceAll("}", ""),
|
|
4140
4143
|
postData: v ? {
|
|
@@ -4148,7 +4151,7 @@ const Zs = ({
|
|
|
4148
4151
|
headersSize: 0,
|
|
4149
4152
|
bodySize: 0
|
|
4150
4153
|
});
|
|
4151
|
-
return
|
|
4154
|
+
return ll(w, f);
|
|
4152
4155
|
}, [
|
|
4153
4156
|
p,
|
|
4154
4157
|
t.method,
|
|
@@ -4156,7 +4159,7 @@ const Zs = ({
|
|
|
4156
4159
|
y,
|
|
4157
4160
|
n.data.schema.url,
|
|
4158
4161
|
f
|
|
4159
|
-
]), [b, x] =
|
|
4162
|
+
]), [b, x] = tl({ rootMargin: "200px 0px 200px 0px" });
|
|
4160
4163
|
return /* @__PURE__ */ d.jsxs(
|
|
4161
4164
|
"aside",
|
|
4162
4165
|
{
|
|
@@ -4166,12 +4169,12 @@ const Zs = ({
|
|
|
4166
4169
|
/* @__PURE__ */ d.jsxs(er, { children: [
|
|
4167
4170
|
/* @__PURE__ */ d.jsxs(tr, { className: "flex justify-between items-center flex-nowrap py-3 gap-2 text-xs", children: [
|
|
4168
4171
|
/* @__PURE__ */ d.jsxs("span", { className: "font-mono break-words", children: [
|
|
4169
|
-
/* @__PURE__ */ d.jsx("span", { className: D("font-semibold",
|
|
4172
|
+
/* @__PURE__ */ d.jsx("span", { className: D("font-semibold", i), children: t.method.toLocaleUpperCase() }),
|
|
4170
4173
|
" ",
|
|
4171
4174
|
h
|
|
4172
4175
|
] }),
|
|
4173
4176
|
x && /* @__PURE__ */ d.jsx(
|
|
4174
|
-
|
|
4177
|
+
al,
|
|
4175
4178
|
{
|
|
4176
4179
|
server: n.data.schema.url ?? "",
|
|
4177
4180
|
servers: n.data.schema.servers.map((v) => v.url) ?? [],
|
|
@@ -4189,27 +4192,27 @@ const Zs = ({
|
|
|
4189
4192
|
code: g
|
|
4190
4193
|
}
|
|
4191
4194
|
) }) }),
|
|
4192
|
-
/* @__PURE__ */ d.jsxs(
|
|
4195
|
+
/* @__PURE__ */ d.jsxs(Sn, { className: "flex items-center text-xs gap-2 justify-end py-1", children: [
|
|
4193
4196
|
/* @__PURE__ */ d.jsx("span", { children: "Show example in" }),
|
|
4194
4197
|
/* @__PURE__ */ d.jsx(
|
|
4195
|
-
|
|
4198
|
+
Yr,
|
|
4196
4199
|
{
|
|
4197
4200
|
className: "self-start max-w-[150px]",
|
|
4198
4201
|
value: f,
|
|
4199
4202
|
onChange: (v) => {
|
|
4200
4203
|
u(() => {
|
|
4201
|
-
c((
|
|
4204
|
+
c((w) => (w.set("lang", v.target.value), w));
|
|
4202
4205
|
});
|
|
4203
4206
|
},
|
|
4204
|
-
options:
|
|
4207
|
+
options: pl
|
|
4205
4208
|
}
|
|
4206
4209
|
)
|
|
4207
4210
|
] })
|
|
4208
4211
|
] })
|
|
4209
4212
|
] }),
|
|
4210
|
-
x && p && /* @__PURE__ */ d.jsx(
|
|
4213
|
+
x && p && /* @__PURE__ */ d.jsx(il, { content: p }),
|
|
4211
4214
|
x && t.responses.length > 0 && /* @__PURE__ */ d.jsx(
|
|
4212
|
-
|
|
4215
|
+
sl,
|
|
4213
4216
|
{
|
|
4214
4217
|
selectedResponse: e,
|
|
4215
4218
|
onSelectResponse: r,
|
|
@@ -4219,15 +4222,15 @@ const Zs = ({
|
|
|
4219
4222
|
]
|
|
4220
4223
|
}
|
|
4221
4224
|
);
|
|
4222
|
-
},
|
|
4223
|
-
AND: /* @__PURE__ */ d.jsx(
|
|
4224
|
-
OR: /* @__PURE__ */ d.jsx(
|
|
4225
|
-
ONE: /* @__PURE__ */ d.jsx(
|
|
4226
|
-
},
|
|
4225
|
+
}, dl = (t) => Object.entries(t), hl = {
|
|
4226
|
+
AND: /* @__PURE__ */ d.jsx(Nn, { size: 16, className: "fill-card" }),
|
|
4227
|
+
OR: /* @__PURE__ */ d.jsx(Rn, { size: 16, className: "fill-card" }),
|
|
4228
|
+
ONE: /* @__PURE__ */ d.jsx(An, { size: 14, className: "fill-card" })
|
|
4229
|
+
}, yl = {
|
|
4227
4230
|
AND: "text-green-500 dark:text-green-300/60",
|
|
4228
4231
|
OR: "text-blue-400 dark:text-blue-500",
|
|
4229
4232
|
ONE: "text-purple-500 dark:text-purple-300/60"
|
|
4230
|
-
},
|
|
4233
|
+
}, ml = ({
|
|
4231
4234
|
type: t,
|
|
4232
4235
|
isOpen: e,
|
|
4233
4236
|
className: r
|
|
@@ -4235,13 +4238,13 @@ const Zs = ({
|
|
|
4235
4238
|
"div",
|
|
4236
4239
|
{
|
|
4237
4240
|
className: D(
|
|
4238
|
-
|
|
4241
|
+
yl[t],
|
|
4239
4242
|
"relative text-sm flex py-2",
|
|
4240
4243
|
"before:border-l before:absolute before:-top-2 before:-bottom-2 before:border-border before:border-dashed before:content-['']",
|
|
4241
4244
|
r
|
|
4242
4245
|
),
|
|
4243
4246
|
children: /* @__PURE__ */ d.jsxs("div", { className: "-translate-x-[7px] flex gap-1 items-center", children: [
|
|
4244
|
-
|
|
4247
|
+
hl[t],
|
|
4245
4248
|
/* @__PURE__ */ d.jsx(
|
|
4246
4249
|
"div",
|
|
4247
4250
|
{
|
|
@@ -4249,12 +4252,12 @@ const Zs = ({
|
|
|
4249
4252
|
"translate-y-px mx-px opacity-0 group-hover:opacity-100 transition",
|
|
4250
4253
|
!e && "-rotate-90"
|
|
4251
4254
|
),
|
|
4252
|
-
children: /* @__PURE__ */ d.jsx(
|
|
4255
|
+
children: /* @__PURE__ */ d.jsx(En, { size: 16 })
|
|
4253
4256
|
}
|
|
4254
4257
|
)
|
|
4255
4258
|
] })
|
|
4256
4259
|
}
|
|
4257
|
-
),
|
|
4260
|
+
), gl = (t) => {
|
|
4258
4261
|
const [e, r] = ve(!0);
|
|
4259
4262
|
return /* @__PURE__ */ d.jsxs(
|
|
4260
4263
|
ee.Root,
|
|
@@ -4263,31 +4266,31 @@ const Zs = ({
|
|
|
4263
4266
|
onOpenChange: () => r((o) => !o),
|
|
4264
4267
|
className: "group",
|
|
4265
4268
|
children: [
|
|
4266
|
-
/* @__PURE__ */ d.jsx(ee.Trigger, { children: /* @__PURE__ */ d.jsx(
|
|
4269
|
+
/* @__PURE__ */ d.jsx(ee.Trigger, { children: /* @__PURE__ */ d.jsx(ml, { type: t.type, isOpen: e }) }),
|
|
4267
4270
|
!e && /* @__PURE__ */ d.jsx("div", { className: "wavy-line bg-border translate-y-1" }),
|
|
4268
4271
|
/* @__PURE__ */ d.jsx(ee.Content, { children: /* @__PURE__ */ d.jsx(Ge, { schema: t.schema, level: t.level + 1 }) })
|
|
4269
4272
|
]
|
|
4270
4273
|
}
|
|
4271
4274
|
);
|
|
4272
|
-
},
|
|
4275
|
+
}, bl = {
|
|
4273
4276
|
AND: "All of",
|
|
4274
4277
|
OR: "Any of",
|
|
4275
4278
|
ONE: "One of"
|
|
4276
|
-
},
|
|
4279
|
+
}, vl = ({
|
|
4277
4280
|
schemas: t,
|
|
4278
4281
|
type: e,
|
|
4279
4282
|
isOpen: r,
|
|
4280
4283
|
level: o,
|
|
4281
|
-
toggleOpen:
|
|
4282
|
-
}) => /* @__PURE__ */ d.jsx(ee.Root, { open: r, onOpenChange:
|
|
4284
|
+
toggleOpen: s
|
|
4285
|
+
}) => /* @__PURE__ */ d.jsx(ee.Root, { open: r, onOpenChange: s, asChild: !0, children: /* @__PURE__ */ d.jsxs(de, { className: "px-6", children: [
|
|
4283
4286
|
/* @__PURE__ */ d.jsxs(ee.Trigger, { className: "flex gap-2 items-center py-2 w-full text-sm text-muted-foreground -translate-x-1.5", children: [
|
|
4284
|
-
r ? /* @__PURE__ */ d.jsx(
|
|
4285
|
-
/* @__PURE__ */ d.jsx("span", { children:
|
|
4287
|
+
r ? /* @__PURE__ */ d.jsx(qn, { size: 14 }) : /* @__PURE__ */ d.jsx(In, { size: 14 }),
|
|
4288
|
+
/* @__PURE__ */ d.jsx("span", { children: bl[e] })
|
|
4286
4289
|
] }),
|
|
4287
4290
|
/* @__PURE__ */ d.jsx(ee.Content, { className: "pb-4", children: t.map((a, n) => (
|
|
4288
4291
|
// eslint-disable-next-line react/no-array-index-key
|
|
4289
4292
|
/* @__PURE__ */ d.jsx(
|
|
4290
|
-
|
|
4293
|
+
gl,
|
|
4291
4294
|
{
|
|
4292
4295
|
type: e,
|
|
4293
4296
|
schema: a,
|
|
@@ -4296,36 +4299,36 @@ const Zs = ({
|
|
|
4296
4299
|
n
|
|
4297
4300
|
)
|
|
4298
4301
|
)) })
|
|
4299
|
-
] }) }),
|
|
4302
|
+
] }) }), xl = (t) => t.type === "object" || t.type === "array" && typeof t.items == "object" && (!t.items.type || t.items.type === "object"), _t = (t) => !!(t.oneOf ?? t.allOf ?? t.anyOf), $l = {
|
|
4300
4303
|
allOf: "AND",
|
|
4301
4304
|
anyOf: "OR",
|
|
4302
4305
|
oneOf: "ONE"
|
|
4303
|
-
},
|
|
4306
|
+
}, On = ({
|
|
4304
4307
|
schema: t,
|
|
4305
4308
|
level: e
|
|
4306
4309
|
}) => {
|
|
4307
|
-
const [r, o] = ve(!0),
|
|
4308
|
-
for (const [a, n] of
|
|
4310
|
+
const [r, o] = ve(!0), s = Hn(() => o((a) => !a), []);
|
|
4311
|
+
for (const [a, n] of dl($l))
|
|
4309
4312
|
if (t[a])
|
|
4310
4313
|
return /* @__PURE__ */ d.jsx(
|
|
4311
|
-
|
|
4314
|
+
vl,
|
|
4312
4315
|
{
|
|
4313
4316
|
schemas: t[a],
|
|
4314
4317
|
type: n,
|
|
4315
4318
|
isOpen: r,
|
|
4316
|
-
toggleOpen:
|
|
4319
|
+
toggleOpen: s,
|
|
4317
4320
|
level: e
|
|
4318
4321
|
}
|
|
4319
4322
|
);
|
|
4320
|
-
},
|
|
4323
|
+
}, jl = ({
|
|
4321
4324
|
name: t,
|
|
4322
4325
|
schema: e,
|
|
4323
4326
|
group: r,
|
|
4324
4327
|
level: o,
|
|
4325
|
-
defaultOpen:
|
|
4328
|
+
defaultOpen: s = !1,
|
|
4326
4329
|
showCollapseButton: a = !0
|
|
4327
4330
|
}) => {
|
|
4328
|
-
const [n,
|
|
4331
|
+
const [n, i] = ve(s);
|
|
4329
4332
|
return /* @__PURE__ */ d.jsx("li", { className: "p-4 bg-border/20 hover:bg-border/30", children: /* @__PURE__ */ d.jsxs("div", { className: "flex flex-col gap-1 justify-between text-sm", children: [
|
|
4330
4333
|
/* @__PURE__ */ d.jsxs("div", { className: "flex gap-2 items-center", children: [
|
|
4331
4334
|
/* @__PURE__ */ d.jsx("code", { children: t }),
|
|
@@ -4338,30 +4341,30 @@ const Zs = ({
|
|
|
4338
4341
|
e.description && /* @__PURE__ */ d.jsx(
|
|
4339
4342
|
be,
|
|
4340
4343
|
{
|
|
4341
|
-
className: D(
|
|
4344
|
+
className: D(we, "text-sm leading-normal line-clamp-4"),
|
|
4342
4345
|
content: e.description
|
|
4343
4346
|
}
|
|
4344
4347
|
),
|
|
4345
|
-
(_t(e) ||
|
|
4348
|
+
(_t(e) || xl(e)) && /* @__PURE__ */ d.jsxs(
|
|
4346
4349
|
ee.Root,
|
|
4347
4350
|
{
|
|
4348
|
-
defaultOpen:
|
|
4351
|
+
defaultOpen: s,
|
|
4349
4352
|
open: n,
|
|
4350
|
-
onOpenChange: () =>
|
|
4353
|
+
onOpenChange: () => i(!n),
|
|
4351
4354
|
children: [
|
|
4352
4355
|
a && /* @__PURE__ */ d.jsx(ee.Trigger, { asChild: !0, children: /* @__PURE__ */ d.jsxs(
|
|
4353
|
-
|
|
4356
|
+
Dr,
|
|
4354
4357
|
{
|
|
4355
4358
|
variant: "outline",
|
|
4356
4359
|
size: "sm",
|
|
4357
4360
|
className: "mt-2 flex gap-1.5",
|
|
4358
4361
|
children: [
|
|
4359
|
-
/* @__PURE__ */ d.jsx(
|
|
4362
|
+
/* @__PURE__ */ d.jsx(Ln, { size: 18 }),
|
|
4360
4363
|
n ? "Hide nested properties" : "Show nested properties"
|
|
4361
4364
|
]
|
|
4362
4365
|
}
|
|
4363
4366
|
) }),
|
|
4364
|
-
/* @__PURE__ */ d.jsx(ee.Content, { children: /* @__PURE__ */ d.jsx("div", { className: "mt-2", children: _t(e) ? /* @__PURE__ */ d.jsx(
|
|
4367
|
+
/* @__PURE__ */ d.jsx(ee.Content, { children: /* @__PURE__ */ d.jsx("div", { className: "mt-2", children: _t(e) ? /* @__PURE__ */ d.jsx(On, { schema: e, level: o + 1 }) : e.type === "object" ? /* @__PURE__ */ d.jsx(Ge, { schema: e, level: o + 1 }) : e.type === "array" && typeof e.items == "object" && /* @__PURE__ */ d.jsx(Ge, { schema: e.items, level: o + 1 }) }) })
|
|
4365
4368
|
]
|
|
4366
4369
|
}
|
|
4367
4370
|
)
|
|
@@ -4373,24 +4376,24 @@ const Zs = ({
|
|
|
4373
4376
|
}) => {
|
|
4374
4377
|
if (!t || Object.keys(t).length === 0)
|
|
4375
4378
|
return /* @__PURE__ */ d.jsx(de, { className: "p-4", children: /* @__PURE__ */ d.jsx("span", { className: "text-sm text-muted-foreground italic", children: "No response specified" }) });
|
|
4376
|
-
const o = (
|
|
4377
|
-
if (_t(
|
|
4378
|
-
return /* @__PURE__ */ d.jsx(
|
|
4379
|
-
if (
|
|
4380
|
-
const n =
|
|
4379
|
+
const o = (s, a) => {
|
|
4380
|
+
if (_t(s))
|
|
4381
|
+
return /* @__PURE__ */ d.jsx(On, { schema: s, level: a });
|
|
4382
|
+
if (s.type === "array" && s.items) {
|
|
4383
|
+
const n = s.items;
|
|
4381
4384
|
return typeof n.type == "string" && ["string", "number", "boolean", "integer"].includes(n.type) ? /* @__PURE__ */ d.jsxs(de, { className: "p-4", children: [
|
|
4382
4385
|
/* @__PURE__ */ d.jsxs("span", { className: "text-sm text-muted-foreground", children: [
|
|
4383
4386
|
n.type,
|
|
4384
4387
|
"[]"
|
|
4385
4388
|
] }),
|
|
4386
|
-
|
|
4389
|
+
s.description && /* @__PURE__ */ d.jsx(
|
|
4387
4390
|
be,
|
|
4388
4391
|
{
|
|
4389
4392
|
className: D(
|
|
4390
|
-
|
|
4393
|
+
we,
|
|
4391
4394
|
"text-sm leading-normal line-clamp-4"
|
|
4392
4395
|
),
|
|
4393
|
-
content:
|
|
4396
|
+
content: s.description
|
|
4394
4397
|
}
|
|
4395
4398
|
)
|
|
4396
4399
|
] }) : n.type === "object" ? /* @__PURE__ */ d.jsxs(de, { className: "flex flex-col gap-2 bg-border/30 p-4", children: [
|
|
@@ -4398,32 +4401,32 @@ const Zs = ({
|
|
|
4398
4401
|
o(n, a + 1)
|
|
4399
4402
|
] }) : o(n, a + 1);
|
|
4400
4403
|
}
|
|
4401
|
-
if (
|
|
4404
|
+
if (s.type === "object" && (!s.properties || Object.keys(s.properties).length === 0))
|
|
4402
4405
|
return /* @__PURE__ */ d.jsxs(de, { className: "p-4 flex gap-2 items-center", children: [
|
|
4403
|
-
"name" in
|
|
4406
|
+
"name" in s && /* @__PURE__ */ d.jsx(d.Fragment, { children: s.name }),
|
|
4404
4407
|
/* @__PURE__ */ d.jsx("span", { className: "text-sm text-muted-foreground", children: "object" }),
|
|
4405
|
-
|
|
4408
|
+
s.description && /* @__PURE__ */ d.jsx(
|
|
4406
4409
|
be,
|
|
4407
4410
|
{
|
|
4408
4411
|
className: D(
|
|
4409
|
-
|
|
4412
|
+
we,
|
|
4410
4413
|
"text-sm leading-normal line-clamp-4"
|
|
4411
4414
|
),
|
|
4412
|
-
content:
|
|
4415
|
+
content: s.description
|
|
4413
4416
|
}
|
|
4414
4417
|
)
|
|
4415
4418
|
] });
|
|
4416
|
-
if (
|
|
4417
|
-
const n =
|
|
4418
|
-
Object.entries(
|
|
4419
|
+
if (s.properties) {
|
|
4420
|
+
const n = Zr(
|
|
4421
|
+
Object.entries(s.properties),
|
|
4419
4422
|
([l, c]) => {
|
|
4420
4423
|
var u;
|
|
4421
|
-
return c.deprecated ? "deprecated" : (u =
|
|
4424
|
+
return c.deprecated ? "deprecated" : (u = s.required) != null && u.includes(l) ? "required" : "optional";
|
|
4422
4425
|
}
|
|
4423
|
-
),
|
|
4424
|
-
return /* @__PURE__ */ d.jsx(de, { className: "divide-y overflow-hidden", children:
|
|
4426
|
+
), i = ["required", "optional", "deprecated"];
|
|
4427
|
+
return /* @__PURE__ */ d.jsx(de, { className: "divide-y overflow-hidden", children: i.map(
|
|
4425
4428
|
(l) => n[l] && /* @__PURE__ */ d.jsx("ul", { className: "divide-y", children: n[l].map(([c, u]) => /* @__PURE__ */ d.jsx(
|
|
4426
|
-
|
|
4429
|
+
jl,
|
|
4427
4430
|
{
|
|
4428
4431
|
name: c,
|
|
4429
4432
|
schema: u,
|
|
@@ -4435,35 +4438,35 @@ const Zs = ({
|
|
|
4435
4438
|
)) }, l)
|
|
4436
4439
|
) });
|
|
4437
4440
|
}
|
|
4438
|
-
return typeof
|
|
4439
|
-
/* @__PURE__ */ d.jsx("span", { className: "text-sm text-muted-foreground", children:
|
|
4440
|
-
|
|
4441
|
+
return typeof s.type == "string" && ["string", "number", "boolean", "integer", "null"].includes(s.type) ? /* @__PURE__ */ d.jsxs(de, { className: "p-4", children: [
|
|
4442
|
+
/* @__PURE__ */ d.jsx("span", { className: "text-sm text-muted-foreground", children: s.type }),
|
|
4443
|
+
s.description && /* @__PURE__ */ d.jsx(
|
|
4441
4444
|
be,
|
|
4442
4445
|
{
|
|
4443
4446
|
className: D(
|
|
4444
|
-
|
|
4447
|
+
we,
|
|
4445
4448
|
"text-sm leading-normal line-clamp-4"
|
|
4446
4449
|
),
|
|
4447
|
-
content:
|
|
4450
|
+
content: s.description
|
|
4448
4451
|
}
|
|
4449
4452
|
)
|
|
4450
|
-
] }) :
|
|
4451
|
-
/* @__PURE__ */ d.jsx(
|
|
4452
|
-
/* @__PURE__ */ d.jsx(
|
|
4453
|
-
|
|
4453
|
+
] }) : s.additionalProperties ? /* @__PURE__ */ d.jsxs(de, { className: "my-2", children: [
|
|
4454
|
+
/* @__PURE__ */ d.jsx(Kn, { children: /* @__PURE__ */ d.jsx(Dn, { children: "Additional Properties:" }) }),
|
|
4455
|
+
/* @__PURE__ */ d.jsx(Yn, { children: o(
|
|
4456
|
+
s.additionalProperties,
|
|
4454
4457
|
a + 1
|
|
4455
4458
|
) })
|
|
4456
4459
|
] }) : null;
|
|
4457
4460
|
};
|
|
4458
4461
|
return o(t, e);
|
|
4459
|
-
},
|
|
4462
|
+
}, wl = ["path", "query", "header", "cookie"], Sl = ({
|
|
4460
4463
|
operationFragment: t
|
|
4461
4464
|
}) => {
|
|
4462
|
-
var n,
|
|
4463
|
-
const e =
|
|
4465
|
+
var n, i, l;
|
|
4466
|
+
const e = ro(Ol, t), r = Zr(
|
|
4464
4467
|
e.parameters ?? [],
|
|
4465
4468
|
(c) => c.in
|
|
4466
|
-
), o = e.responses.at(0), [
|
|
4469
|
+
), o = e.responses.at(0), [s, a] = ve(o == null ? void 0 : o.statusCode);
|
|
4467
4470
|
return /* @__PURE__ */ d.jsxs(
|
|
4468
4471
|
"div",
|
|
4469
4472
|
{
|
|
@@ -4474,15 +4477,15 @@ const Zs = ({
|
|
|
4474
4477
|
e.description && /* @__PURE__ */ d.jsx(
|
|
4475
4478
|
be,
|
|
4476
4479
|
{
|
|
4477
|
-
className: `${
|
|
4480
|
+
className: `${we} max-w-full prose-img:max-w-prose`,
|
|
4478
4481
|
content: e.description
|
|
4479
4482
|
}
|
|
4480
4483
|
),
|
|
4481
|
-
e.parameters && e.parameters.length > 0 && /* @__PURE__ */ d.jsx(d.Fragment, { children:
|
|
4484
|
+
e.parameters && e.parameters.length > 0 && /* @__PURE__ */ d.jsx(d.Fragment, { children: wl.flatMap(
|
|
4482
4485
|
(c) => {
|
|
4483
4486
|
var u;
|
|
4484
4487
|
return (u = r[c]) != null && u.length ? /* @__PURE__ */ d.jsx(
|
|
4485
|
-
|
|
4488
|
+
lo,
|
|
4486
4489
|
{
|
|
4487
4490
|
id: e.slug,
|
|
4488
4491
|
parameters: r[c],
|
|
@@ -4492,7 +4495,7 @@ const Zs = ({
|
|
|
4492
4495
|
) : [];
|
|
4493
4496
|
}
|
|
4494
4497
|
) }),
|
|
4495
|
-
|
|
4498
|
+
ao((l = (i = (n = e.requestBody) == null ? void 0 : n.content) == null ? void 0 : i.at(0)) == null ? void 0 : l.schema, (c) => /* @__PURE__ */ d.jsxs("div", { className: "mt-4 flex flex-col gap-4", children: [
|
|
4496
4499
|
/* @__PURE__ */ d.jsx(
|
|
4497
4500
|
_e,
|
|
4498
4501
|
{
|
|
@@ -4517,13 +4520,13 @@ const Zs = ({
|
|
|
4517
4520
|
}
|
|
4518
4521
|
),
|
|
4519
4522
|
/* @__PURE__ */ d.jsxs(
|
|
4520
|
-
|
|
4523
|
+
Wn,
|
|
4521
4524
|
{
|
|
4522
4525
|
onValueChange: (c) => a(c),
|
|
4523
|
-
value:
|
|
4526
|
+
value: s,
|
|
4524
4527
|
children: [
|
|
4525
|
-
e.responses.length > 1 && /* @__PURE__ */ d.jsx(
|
|
4526
|
-
|
|
4528
|
+
e.responses.length > 1 && /* @__PURE__ */ d.jsx(Jn, { children: e.responses.map((c) => /* @__PURE__ */ d.jsx(
|
|
4529
|
+
Gn,
|
|
4527
4530
|
{
|
|
4528
4531
|
value: c.statusCode,
|
|
4529
4532
|
title: c.description ?? void 0,
|
|
@@ -4534,7 +4537,7 @@ const Zs = ({
|
|
|
4534
4537
|
/* @__PURE__ */ d.jsx("ul", { className: "list-none m-0 px-0", children: e.responses.map((c) => {
|
|
4535
4538
|
var u, f;
|
|
4536
4539
|
return /* @__PURE__ */ d.jsx(
|
|
4537
|
-
|
|
4540
|
+
Vn,
|
|
4538
4541
|
{
|
|
4539
4542
|
value: c.statusCode,
|
|
4540
4543
|
children: /* @__PURE__ */ d.jsx(
|
|
@@ -4553,9 +4556,9 @@ const Zs = ({
|
|
|
4553
4556
|
] })
|
|
4554
4557
|
] }),
|
|
4555
4558
|
/* @__PURE__ */ d.jsx(
|
|
4556
|
-
|
|
4559
|
+
fl,
|
|
4557
4560
|
{
|
|
4558
|
-
selectedResponse:
|
|
4561
|
+
selectedResponse: s,
|
|
4559
4562
|
onSelectResponse: a,
|
|
4560
4563
|
operation: e
|
|
4561
4564
|
}
|
|
@@ -4564,7 +4567,7 @@ const Zs = ({
|
|
|
4564
4567
|
},
|
|
4565
4568
|
e.operationId
|
|
4566
4569
|
);
|
|
4567
|
-
},
|
|
4570
|
+
}, Ol = ut(
|
|
4568
4571
|
/* GraphQL */
|
|
4569
4572
|
`
|
|
4570
4573
|
fragment OperationsFragment on OperationItem {
|
|
@@ -4629,12 +4632,13 @@ const Zs = ({
|
|
|
4629
4632
|
}
|
|
4630
4633
|
}
|
|
4631
4634
|
`
|
|
4632
|
-
),
|
|
4635
|
+
), Tl = ut(
|
|
4633
4636
|
/* GraphQL */
|
|
4634
4637
|
`
|
|
4635
4638
|
query AllOperations($input: JSON!, $type: SchemaType!) {
|
|
4636
4639
|
schema(input: $input, type: $type) {
|
|
4637
4640
|
description
|
|
4641
|
+
summary
|
|
4638
4642
|
title
|
|
4639
4643
|
url
|
|
4640
4644
|
version
|
|
@@ -4649,43 +4653,54 @@ const Zs = ({
|
|
|
4649
4653
|
}
|
|
4650
4654
|
}
|
|
4651
4655
|
`
|
|
4652
|
-
)
|
|
4653
|
-
|
|
4656
|
+
);
|
|
4657
|
+
function Cl(t, e = 160) {
|
|
4658
|
+
return t ? (t = t.replace(/\[([^\]]+)\]\([^)]+\)/g, "$1"), t = t.replace(/!\[.*?\]\(.*?\)/g, ""), t = t.replace(/[_*`~]/g, ""), t = t.replace(/^(?:>|\s*#+|-{3,}|\*{3,})/gm, ""), t = t.replace(/[|>{}[\]]/g, ""), t = t.replace(/\s+/g, " ").trim(), t = t.substring(0, e), t.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'")) : "";
|
|
4659
|
+
}
|
|
4660
|
+
const Kl = () => {
|
|
4661
|
+
const { input: t, type: e } = Bt(), r = zt(Tl, { input: t, type: e }), o = Ht(r), s = o.data.schema.title, a = o.data.schema.summary, n = o.data.schema.description, i = a || (n ? Cl(n) : void 0);
|
|
4654
4662
|
return /* @__PURE__ */ d.jsxs("div", { className: "pt-[--padding-content-top]", children: [
|
|
4663
|
+
/* @__PURE__ */ d.jsxs(Tn, { children: [
|
|
4664
|
+
/* @__PURE__ */ d.jsx("title", { children: s }),
|
|
4665
|
+
i && /* @__PURE__ */ d.jsx("meta", { name: "description", content: i })
|
|
4666
|
+
] }),
|
|
4655
4667
|
/* @__PURE__ */ d.jsxs(
|
|
4656
4668
|
"div",
|
|
4657
4669
|
{
|
|
4658
|
-
className: D(
|
|
4670
|
+
className: D(we, "mb-16 max-w-full prose-img:max-w-prose"),
|
|
4659
4671
|
children: [
|
|
4660
4672
|
/* @__PURE__ */ d.jsx(nr, { children: "Overview" }),
|
|
4661
|
-
/* @__PURE__ */ d.jsx(_e, { level: 1, id: "description", registerSidebarAnchor: !0, children:
|
|
4673
|
+
/* @__PURE__ */ d.jsx(_e, { level: 1, id: "description", registerSidebarAnchor: !0, children: s }),
|
|
4662
4674
|
/* @__PURE__ */ d.jsx(be, { content: o.data.schema.description ?? "" })
|
|
4663
4675
|
]
|
|
4664
4676
|
}
|
|
4665
4677
|
),
|
|
4666
4678
|
/* @__PURE__ */ d.jsx("hr", {}),
|
|
4667
|
-
/* @__PURE__ */ d.jsx("div", { className: "my-4 flex justify-end", children: /* @__PURE__ */ d.jsx(
|
|
4668
|
-
o.data.schema.tags.filter((
|
|
4669
|
-
|
|
4670
|
-
|
|
4671
|
-
|
|
4672
|
-
|
|
4673
|
-
|
|
4674
|
-
|
|
4675
|
-
|
|
4676
|
-
|
|
4677
|
-
|
|
4678
|
-
|
|
4679
|
-
{
|
|
4680
|
-
|
|
4681
|
-
|
|
4682
|
-
|
|
4683
|
-
|
|
4684
|
-
|
|
4679
|
+
/* @__PURE__ */ d.jsx("div", { className: "my-4 flex justify-end", children: /* @__PURE__ */ d.jsx(oo, {}) }),
|
|
4680
|
+
o.data.schema.tags.filter((l) => l.operations.length > 0).map((l) => (
|
|
4681
|
+
// px, -mx is so that `content-visibility` doesn't cut off overflown heading anchor links '#'
|
|
4682
|
+
/* @__PURE__ */ d.jsxs("div", { className: "px-6 -mx-6 [content-visibility:auto]", children: [
|
|
4683
|
+
l.name && /* @__PURE__ */ d.jsx(nr, { children: l.name }),
|
|
4684
|
+
l.description && /* @__PURE__ */ d.jsx(
|
|
4685
|
+
be,
|
|
4686
|
+
{
|
|
4687
|
+
className: `${we} max-w-full prose-img:max-w-prose w-full mt-2 mb-12`,
|
|
4688
|
+
content: l.description
|
|
4689
|
+
}
|
|
4690
|
+
),
|
|
4691
|
+
/* @__PURE__ */ d.jsx("div", { className: "operation mb-12", children: /* @__PURE__ */ d.jsx(Qn, { children: l.operations.map((c) => /* @__PURE__ */ d.jsx(
|
|
4692
|
+
Sl,
|
|
4693
|
+
{
|
|
4694
|
+
operationFragment: c
|
|
4695
|
+
},
|
|
4696
|
+
c.slug
|
|
4697
|
+
)) }) })
|
|
4698
|
+
] }, l.name)
|
|
4699
|
+
))
|
|
4685
4700
|
] });
|
|
4686
4701
|
};
|
|
4687
4702
|
export {
|
|
4688
|
-
|
|
4689
|
-
|
|
4703
|
+
Kl as OperationList,
|
|
4704
|
+
Ol as OperationsFragment
|
|
4690
4705
|
};
|
|
4691
|
-
//# sourceMappingURL=OperationList-
|
|
4706
|
+
//# sourceMappingURL=OperationList-u8xHU9-b.js.map
|