zudoku 0.23.4 → 0.23.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/validators/common.d.ts +37 -37
- package/dist/config/validators/common.js +4 -1
- package/dist/config/validators/common.js.map +1 -1
- package/dist/config/validators/validate.d.ts +14 -14
- package/dist/lib/plugins/openapi/OperationList.js +7 -33
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/Route.d.ts +4 -2
- package/dist/lib/plugins/openapi/Route.js +25 -2
- package/dist/lib/plugins/openapi/Route.js.map +1 -1
- package/dist/lib/plugins/openapi/context.d.ts +3 -3
- package/dist/lib/plugins/openapi/index.js +12 -12
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/interfaces.d.ts +19 -0
- package/dist/lib/plugins/openapi/util/sanitizeMarkdownForMetatag.d.ts +1 -0
- package/dist/lib/plugins/openapi/util/sanitizeMarkdownForMetatag.js +27 -0
- package/dist/lib/plugins/openapi/util/sanitizeMarkdownForMetatag.js.map +1 -0
- package/dist/vite/config.js +2 -1
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/plugin-api.js +35 -14
- package/dist/vite/plugin-api.js.map +1 -1
- package/lib/{OperationList-C7ac3kR5.js → OperationList-wvY-BrxS.js} +1173 -1157
- package/lib/OperationList-wvY-BrxS.js.map +1 -0
- package/lib/Route-C8nwd9A2.js +37 -0
- package/lib/Route-C8nwd9A2.js.map +1 -0
- package/lib/context-h_UkBLvr.js.map +1 -1
- package/lib/{index-C8ubT49C.js → index-C_ul-2fb.js} +442 -437
- package/lib/{index-C8ubT49C.js.map → index-C_ul-2fb.js.map} +1 -1
- package/lib/zudoku.plugin-openapi.js +1 -1
- package/package.json +1 -1
- package/src/lib/plugins/openapi/OperationList.tsx +42 -50
- package/src/lib/plugins/openapi/Route.tsx +45 -9
- package/src/lib/plugins/openapi/context.tsx +2 -2
- package/src/lib/plugins/openapi/index.tsx +35 -28
- package/src/lib/plugins/openapi/interfaces.ts +22 -1
- package/src/lib/plugins/openapi/util/sanitizeMarkdownForMetatag.tsx +32 -0
- package/lib/OperationList-C7ac3kR5.js.map +0 -1
- package/lib/Route-C9cYcP-j.js +0 -11
- package/lib/Route-C9cYcP-j.js.map +0 -1
|
@@ -1,39 +1,40 @@
|
|
|
1
1
|
import { j as b } from "./jsx-runtime-Dx-03ztt.js";
|
|
2
2
|
import { u as mr } from "./utils-B4O1uet5.js";
|
|
3
3
|
import { H as To } from "./index.esm-BSV1C092.js";
|
|
4
|
+
import { b as Po, a as Co } from "./chunk-D52XG6IA-Dl7HLe6j.js";
|
|
5
|
+
import { S as Ro, a as qo, b as ko, c as Eo, e as No } from "./Select-D3XuKKuH.js";
|
|
4
6
|
import { C as Ur } from "./CategoryHeading-CBconmtI.js";
|
|
5
|
-
import { I as
|
|
7
|
+
import { I as Ao, M as we, H as He, P as qe } from "./Markdown-CZDLNOFc.js";
|
|
6
8
|
import { c as pe } from "./cn-qaFjX9_3.js";
|
|
7
|
-
import { CheckIcon as
|
|
8
|
-
import { useContext as
|
|
9
|
+
import { CheckIcon as Io, CopyIcon as Lo, ChevronDownIcon as Uo, CircleFadingPlusIcon as Fo, CircleDotIcon as _o, CircleIcon as Bo, SquareMinusIcon as Ho, SquarePlusIcon as Mo, ListPlusIcon as zo } from "lucide-react";
|
|
10
|
+
import { useContext as Go, useMemo as Xn, useTransition as Zn, useState as Se, useRef as eo, useEffect as to, useLayoutEffect as Wo, Fragment as Jo, useCallback as Vo } from "react";
|
|
9
11
|
import { a as ro } from "./state-CFQsUZUP.js";
|
|
10
12
|
import { Button as no } from "./ui/Button.js";
|
|
11
|
-
import { h as
|
|
12
|
-
import { a as
|
|
13
|
-
import { g as tt, S as oo, C as ao, P as
|
|
14
|
-
import { Tabs as
|
|
15
|
-
import { T as be, b as
|
|
16
|
-
import { Card as xe, CardHeader as
|
|
17
|
-
import { g as
|
|
18
|
-
import { _ as
|
|
19
|
-
import { b as ta } from "./chunk-D52XG6IA-Dl7HLe6j.js";
|
|
13
|
+
import { h as Do } from "./object_hash-BNWPnMN9.js";
|
|
14
|
+
import { a as Qo, u as gr } from "./context-h_UkBLvr.js";
|
|
15
|
+
import { g as tt, S as oo, C as ao, P as Ko } from "./index-C_ul-2fb.js";
|
|
16
|
+
import { Tabs as Yo, TabsList as Xo, TabsTrigger as Zo, TabsContent as ea } from "./ui/Tabs.js";
|
|
17
|
+
import { T as be, b as ta } from "./SidebarBadge-Bm793GDY.js";
|
|
18
|
+
import { Card as xe, CardHeader as ra, CardTitle as na, CardContent as oa } from "./ui/Card.js";
|
|
19
|
+
import { g as aa, c as Ze, a as ia } from "./_commonjsHelpers-BkfeUUK-.js";
|
|
20
|
+
import { _ as sa } from "./__vite-browser-external-BYRIRx8p.js";
|
|
20
21
|
import { S as vr } from "./SyntaxHighlight-Bz-lOJtH.js";
|
|
21
22
|
import { B as Fr } from "./Button-DeAoTouo.js";
|
|
22
23
|
import * as ye from "@radix-ui/react-collapsible";
|
|
23
24
|
import * as Ke from "@radix-ui/react-tabs";
|
|
24
|
-
function
|
|
25
|
+
function ca(e, t) {
|
|
25
26
|
return t;
|
|
26
27
|
}
|
|
27
28
|
const br = (e, ...t) => {
|
|
28
|
-
const n =
|
|
29
|
+
const n = Go(Qo);
|
|
29
30
|
if (n === void 0)
|
|
30
31
|
throw new Error("useGraphQL must be used within a GraphQLProvider");
|
|
31
|
-
const o = Xn(() =>
|
|
32
|
+
const o = Xn(() => Do(t[0] ?? {}), [t]);
|
|
32
33
|
return {
|
|
33
34
|
queryFn: () => n.fetch(e, ...t),
|
|
34
35
|
queryKey: [e, o]
|
|
35
36
|
};
|
|
36
|
-
},
|
|
37
|
+
}, la = tt(
|
|
37
38
|
/* GraphQL */
|
|
38
39
|
`
|
|
39
40
|
query ServersQuery($input: JSON!, $type: SchemaType!) {
|
|
@@ -57,14 +58,14 @@ const br = (e, ...t) => {
|
|
|
57
58
|
},
|
|
58
59
|
variant: "ghost",
|
|
59
60
|
size: "icon",
|
|
60
|
-
children: t ? /* @__PURE__ */ b.jsx(
|
|
61
|
+
children: t ? /* @__PURE__ */ b.jsx(Io, { className: "text-green-600", size: 14 }) : /* @__PURE__ */ b.jsx(Lo, { size: 14, strokeWidth: 1.3 })
|
|
61
62
|
}
|
|
62
63
|
);
|
|
63
|
-
},
|
|
64
|
-
const { input: e, type: t } = gr(), n = br(
|
|
64
|
+
}, ua = () => {
|
|
65
|
+
const { input: e, type: t } = gr(), n = br(la, { input: e, type: t }), o = mr(n), [, s] = Zn(), { selectedServer: c, setSelectedServer: r } = ro(), { servers: a } = o.data.schema;
|
|
65
66
|
return a.length === 1 ? /* @__PURE__ */ b.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
66
67
|
/* @__PURE__ */ b.jsx("span", { className: "font-medium text-sm", children: "Endpoint:" }),
|
|
67
|
-
/* @__PURE__ */ b.jsx(
|
|
68
|
+
/* @__PURE__ */ b.jsx(Ao, { className: "text-xs px-2 py-1.5", selectOnClick: !0, children: a[0].url }),
|
|
68
69
|
/* @__PURE__ */ b.jsx(_r, { url: a[0].url })
|
|
69
70
|
] }) : /* @__PURE__ */ b.jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
70
71
|
/* @__PURE__ */ b.jsxs("span", { className: "font-medium text-sm", children: [
|
|
@@ -78,7 +79,7 @@ const br = (e, ...t) => {
|
|
|
78
79
|
onChange: (i) => s(() => {
|
|
79
80
|
r(i.target.value);
|
|
80
81
|
}),
|
|
81
|
-
value:
|
|
82
|
+
value: c ?? o.data.schema.url,
|
|
82
83
|
showChevrons: a.length > 1,
|
|
83
84
|
options: a.map((i) => ({
|
|
84
85
|
value: i.url,
|
|
@@ -86,7 +87,7 @@ const br = (e, ...t) => {
|
|
|
86
87
|
}))
|
|
87
88
|
}
|
|
88
89
|
),
|
|
89
|
-
/* @__PURE__ */ b.jsx(_r, { url:
|
|
90
|
+
/* @__PURE__ */ b.jsx(_r, { url: c ?? o.data.schema.url })
|
|
90
91
|
] });
|
|
91
92
|
}, io = (e, t) => e.reduce(
|
|
92
93
|
(n, o) => {
|
|
@@ -94,14 +95,14 @@ const br = (e, ...t) => {
|
|
|
94
95
|
return n[s] || (n[s] = []), n[s].push(o), n;
|
|
95
96
|
},
|
|
96
97
|
{}
|
|
97
|
-
),
|
|
98
|
+
), fa = (e, t) => e ? t(e) : void 0, pa = (e) => e.schema != null && typeof e.schema == "object" ? e.schema : {
|
|
98
99
|
type: "string"
|
|
99
|
-
},
|
|
100
|
+
}, da = ({
|
|
100
101
|
parameter: e,
|
|
101
102
|
group: t,
|
|
102
103
|
id: n
|
|
103
104
|
}) => {
|
|
104
|
-
const o =
|
|
105
|
+
const o = pa(e);
|
|
105
106
|
return /* @__PURE__ */ b.jsxs("li", { className: "p-4 bg-border/20 text-sm flex flex-col gap-1", children: [
|
|
106
107
|
/* @__PURE__ */ b.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
107
108
|
/* @__PURE__ */ b.jsx("code", { children: t === "path" ? /* @__PURE__ */ b.jsx(
|
|
@@ -123,14 +124,14 @@ const br = (e, ...t) => {
|
|
|
123
124
|
}
|
|
124
125
|
)
|
|
125
126
|
] });
|
|
126
|
-
},
|
|
127
|
+
}, ha = ({
|
|
127
128
|
group: e,
|
|
128
129
|
parameters: t,
|
|
129
130
|
id: n
|
|
130
131
|
}) => /* @__PURE__ */ b.jsxs(b.Fragment, { children: [
|
|
131
132
|
/* @__PURE__ */ b.jsx(He, { level: 3, id: `${n}/${e}-parameters`, className: "capitalize", children: e === "header" ? "Headers" : `${e} Parameters` }),
|
|
132
133
|
/* @__PURE__ */ b.jsx(xe, { children: /* @__PURE__ */ b.jsx("ul", { className: "list-none m-0 px-0 divide-y ", children: t.sort((o, s) => o.required === s.required ? 0 : o.required ? -1 : 1).map((o) => /* @__PURE__ */ b.jsx(
|
|
133
|
-
|
|
134
|
+
da,
|
|
134
135
|
{
|
|
135
136
|
parameter: o,
|
|
136
137
|
id: n,
|
|
@@ -159,57 +160,57 @@ var Br = (e, t) => {
|
|
|
159
160
|
this.code.push("");
|
|
160
161
|
}, this.join = () => {
|
|
161
162
|
const n = this.code.join(this.lineJoin);
|
|
162
|
-
return this.postProcessors.reduce((s,
|
|
163
|
+
return this.postProcessors.reduce((s, c) => c(s), n);
|
|
163
164
|
}, this.addPostProcessor = (n) => {
|
|
164
165
|
this.postProcessors = [...this.postProcessors, n];
|
|
165
166
|
}, this.indentationCharacter = e || Hr, this.lineJoin = t ?? Mr;
|
|
166
167
|
}
|
|
167
168
|
}, ht, zr;
|
|
168
|
-
function
|
|
169
|
+
function ya() {
|
|
169
170
|
return zr || (zr = 1, ht = function(e) {
|
|
170
171
|
return Object.prototype.toString.call(e) === "[object RegExp]";
|
|
171
172
|
}), ht;
|
|
172
173
|
}
|
|
173
174
|
var yt, Gr;
|
|
174
|
-
function
|
|
175
|
+
function ma() {
|
|
175
176
|
return Gr || (Gr = 1, yt = function(e) {
|
|
176
177
|
var t = typeof e;
|
|
177
178
|
return e !== null && (t === "object" || t === "function");
|
|
178
179
|
}), yt;
|
|
179
180
|
}
|
|
180
181
|
var Ye = {}, Wr;
|
|
181
|
-
function
|
|
182
|
+
function ga() {
|
|
182
183
|
return Wr || (Wr = 1, Object.defineProperty(Ye, "__esModule", { value: !0 }), Ye.default = (e) => Object.getOwnPropertySymbols(e).filter((t) => Object.prototype.propertyIsEnumerable.call(e, t))), Ye;
|
|
183
184
|
}
|
|
184
185
|
var mt, Jr;
|
|
185
|
-
function
|
|
186
|
+
function va() {
|
|
186
187
|
if (Jr) return mt;
|
|
187
188
|
Jr = 1;
|
|
188
|
-
const e =
|
|
189
|
-
return mt = (o, s,
|
|
189
|
+
const e = ya(), t = ma(), n = ga().default;
|
|
190
|
+
return mt = (o, s, c) => {
|
|
190
191
|
const r = [];
|
|
191
|
-
return function a(i,
|
|
192
|
-
|
|
193
|
-
let
|
|
194
|
-
|
|
192
|
+
return function a(i, l, f) {
|
|
193
|
+
l = l || {}, l.indent = l.indent || " ", f = f || "";
|
|
194
|
+
let d;
|
|
195
|
+
l.inlineCharacterLimit === void 0 ? d = {
|
|
195
196
|
newLine: `
|
|
196
197
|
`,
|
|
197
198
|
newLineOrSpace: `
|
|
198
199
|
`,
|
|
199
|
-
pad:
|
|
200
|
-
indent:
|
|
201
|
-
} :
|
|
200
|
+
pad: f,
|
|
201
|
+
indent: f + l.indent
|
|
202
|
+
} : d = {
|
|
202
203
|
newLine: "@@__STRINGIFY_OBJECT_NEW_LINE__@@",
|
|
203
204
|
newLineOrSpace: "@@__STRINGIFY_OBJECT_NEW_LINE_OR_SPACE__@@",
|
|
204
205
|
pad: "@@__STRINGIFY_OBJECT_PAD__@@",
|
|
205
206
|
indent: "@@__STRINGIFY_OBJECT_INDENT__@@"
|
|
206
207
|
};
|
|
207
|
-
const
|
|
208
|
-
if (
|
|
208
|
+
const y = (g) => {
|
|
209
|
+
if (l.inlineCharacterLimit === void 0)
|
|
209
210
|
return g;
|
|
210
|
-
const x = g.replace(new RegExp(
|
|
211
|
-
return x.length <=
|
|
212
|
-
`).replace(new RegExp(
|
|
211
|
+
const x = g.replace(new RegExp(d.newLine, "g"), "").replace(new RegExp(d.newLineOrSpace, "g"), " ").replace(new RegExp(d.pad + "|" + d.indent, "g"), "");
|
|
212
|
+
return x.length <= l.inlineCharacterLimit ? x : g.replace(new RegExp(d.newLine + "|" + d.newLineOrSpace, "g"), `
|
|
213
|
+
`).replace(new RegExp(d.pad, "g"), f).replace(new RegExp(d.indent, "g"), f + l.indent);
|
|
213
214
|
};
|
|
214
215
|
if (r.indexOf(i) !== -1)
|
|
215
216
|
return '"[Circular]"';
|
|
@@ -221,38 +222,38 @@ function pa() {
|
|
|
221
222
|
if (i.length === 0)
|
|
222
223
|
return "[]";
|
|
223
224
|
r.push(i);
|
|
224
|
-
const g = "[" +
|
|
225
|
-
const
|
|
226
|
-
let
|
|
227
|
-
return
|
|
228
|
-
}).join("") +
|
|
229
|
-
return r.pop(),
|
|
225
|
+
const g = "[" + d.newLine + i.map((x, $) => {
|
|
226
|
+
const p = i.length - 1 === $ ? d.newLine : "," + d.newLineOrSpace;
|
|
227
|
+
let h = a(x, l, f + l.indent);
|
|
228
|
+
return l.transform && (h = l.transform(i, $, h)), d.indent + h + p;
|
|
229
|
+
}).join("") + d.pad + "]";
|
|
230
|
+
return r.pop(), y(g);
|
|
230
231
|
}
|
|
231
232
|
if (t(i)) {
|
|
232
233
|
let g = Object.keys(i).concat(n(i));
|
|
233
|
-
if (
|
|
234
|
+
if (l.filter && (g = g.filter(($) => l.filter(i, $))), g.length === 0)
|
|
234
235
|
return "{}";
|
|
235
236
|
r.push(i);
|
|
236
|
-
const x = "{" +
|
|
237
|
-
const
|
|
238
|
-
let u = a(i[$],
|
|
239
|
-
return
|
|
240
|
-
}).join("") +
|
|
241
|
-
return r.pop(),
|
|
237
|
+
const x = "{" + d.newLine + g.map(($, p) => {
|
|
238
|
+
const h = g.length - 1 === p ? d.newLine : "," + d.newLineOrSpace, m = typeof $ == "symbol", w = !m && /^[a-z$_][a-z$_0-9]*$/i.test($), T = m || w ? $ : a($, l);
|
|
239
|
+
let u = a(i[$], l, f + l.indent);
|
|
240
|
+
return l.transform && (u = l.transform(i, $, u)), d.indent + String(T) + ": " + u + h;
|
|
241
|
+
}).join("") + d.pad + "}";
|
|
242
|
+
return r.pop(), y(x);
|
|
242
243
|
}
|
|
243
244
|
return i = String(i).replace(/[\r\n]/g, (g) => g === `
|
|
244
|
-
` ? "\\n" : "\\r"),
|
|
245
|
-
}(o, s,
|
|
245
|
+
` ? "\\n" : "\\r"), l.singleQuotes === !1 ? (i = i.replace(/"/g, '\\"'), `"${i}"`) : (i = i.replace(/\\?'/g, "\\'"), `'${i}'`);
|
|
246
|
+
}(o, s, c);
|
|
246
247
|
}, mt;
|
|
247
248
|
}
|
|
248
|
-
var
|
|
249
|
-
const ue = /* @__PURE__ */
|
|
249
|
+
var ba = va();
|
|
250
|
+
const ue = /* @__PURE__ */ aa(ba);
|
|
250
251
|
function Me(e, t = {}) {
|
|
251
252
|
const { delimiter: n = '"', escapeChar: o = "\\", escapeNewlines: s = !0 } = t;
|
|
252
253
|
return [...e.toString()].map((r) => r === "\b" ? `${o}b` : r === " " ? `${o}t` : r === `
|
|
253
254
|
` ? s ? `${o}n` : r : r === "\f" ? `${o}f` : r === "\r" ? s ? `${o}r` : r : r === o ? o + o : r === n ? o + n : r < " " || r > "~" ? JSON.stringify(r).slice(1, -1) : r).join("");
|
|
254
255
|
}
|
|
255
|
-
var ze = (e) => Me(e, { delimiter: "'" }), ce = (e) => Me(e, { delimiter: '"' }),
|
|
256
|
+
var ze = (e) => Me(e, { delimiter: "'" }), ce = (e) => Me(e, { delimiter: '"' }), xa = {
|
|
256
257
|
info: {
|
|
257
258
|
key: "libcurl",
|
|
258
259
|
title: "Libcurl",
|
|
@@ -261,14 +262,14 @@ var ze = (e) => Me(e, { delimiter: "'" }), ce = (e) => Me(e, { delimiter: '"' })
|
|
|
261
262
|
extname: ".c"
|
|
262
263
|
},
|
|
263
264
|
convert: ({ method: e, fullUrl: t, headersObj: n, allHeaders: o, postData: s }) => {
|
|
264
|
-
const { push:
|
|
265
|
-
|
|
265
|
+
const { push: c, blank: r, join: a } = new V();
|
|
266
|
+
c("CURL *hnd = curl_easy_init();"), r(), c(`curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "${e.toUpperCase()}");`), c("curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);"), c(`curl_easy_setopt(hnd, CURLOPT_URL, "${t}");`);
|
|
266
267
|
const i = Object.keys(n);
|
|
267
|
-
return i.length && (r(),
|
|
268
|
-
|
|
269
|
-
}),
|
|
268
|
+
return i.length && (r(), c("struct curl_slist *headers = NULL;"), i.forEach((l) => {
|
|
269
|
+
c(`headers = curl_slist_append(headers, "${l}: ${ce(n[l])}");`);
|
|
270
|
+
}), c("curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);")), o.cookie && (r(), c(`curl_easy_setopt(hnd, CURLOPT_COOKIE, "${o.cookie}");`)), s.text && (r(), c(`curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, ${JSON.stringify(s.text)});`)), r(), c("CURLcode ret = curl_easy_perform(hnd);"), a();
|
|
270
271
|
}
|
|
271
|
-
},
|
|
272
|
+
}, $a = {
|
|
272
273
|
info: {
|
|
273
274
|
key: "c",
|
|
274
275
|
title: "C",
|
|
@@ -276,19 +277,19 @@ var ze = (e) => Me(e, { delimiter: "'" }), ce = (e) => Me(e, { delimiter: '"' })
|
|
|
276
277
|
cli: "c"
|
|
277
278
|
},
|
|
278
279
|
clientsById: {
|
|
279
|
-
libcurl:
|
|
280
|
+
libcurl: xa
|
|
280
281
|
}
|
|
281
282
|
}, fe = (e, t) => Object.keys(e).find((n) => n.toLowerCase() === t.toLowerCase()), ve = (e, t) => {
|
|
282
283
|
const n = fe(e, t);
|
|
283
284
|
if (n)
|
|
284
285
|
return e[n];
|
|
285
|
-
}, rt = (e, t) => !!fe(e, t),
|
|
286
|
+
}, rt = (e, t) => !!fe(e, t), ja = (e) => ["application/json", "application/x-json", "text/json", "text/x-json", "+json"].some(
|
|
286
287
|
(t) => e.indexOf(t) > -1
|
|
287
288
|
), Vr = class {
|
|
288
289
|
constructor(e) {
|
|
289
290
|
this.name = "", this.toString = () => `:${this.name}`, this.name = e;
|
|
290
291
|
}
|
|
291
|
-
},
|
|
292
|
+
}, wa = class {
|
|
292
293
|
constructor(e) {
|
|
293
294
|
this.path = "", this.toString = () => `(clojure.java.io/file "${this.path}")`, this.path = e;
|
|
294
295
|
}
|
|
@@ -325,7 +326,7 @@ ${n}`);
|
|
|
325
326
|
default:
|
|
326
327
|
return e.toString();
|
|
327
328
|
}
|
|
328
|
-
},
|
|
329
|
+
}, Sa = {
|
|
329
330
|
info: {
|
|
330
331
|
key: "clj_http",
|
|
331
332
|
title: "clj-http",
|
|
@@ -333,79 +334,79 @@ ${n}`);
|
|
|
333
334
|
description: "An idiomatic clojure http client wrapping the apache client.",
|
|
334
335
|
extname: ".clj"
|
|
335
336
|
},
|
|
336
|
-
convert: ({ queryObj: e, method: t, postData: n, url: o, allHeaders: s },
|
|
337
|
-
const { push: r, join: a } = new V({ indent:
|
|
337
|
+
convert: ({ queryObj: e, method: t, postData: n, url: o, allHeaders: s }, c) => {
|
|
338
|
+
const { push: r, join: a } = new V({ indent: c == null ? void 0 : c.indent }), i = ["get", "post", "put", "delete", "patch", "head", "options"];
|
|
338
339
|
if (t = t.toLowerCase(), !i.includes(t))
|
|
339
340
|
return r("Method not supported"), a();
|
|
340
|
-
const
|
|
341
|
+
const l = {
|
|
341
342
|
headers: s,
|
|
342
343
|
"query-params": e
|
|
343
344
|
};
|
|
344
345
|
switch (n.mimeType) {
|
|
345
346
|
case "application/json":
|
|
346
347
|
{
|
|
347
|
-
|
|
348
|
-
const
|
|
349
|
-
|
|
348
|
+
l["content-type"] = new Vr("json"), l["form-params"] = n.jsonObj;
|
|
349
|
+
const f = fe(l.headers, "content-type");
|
|
350
|
+
f && delete l.headers[f];
|
|
350
351
|
}
|
|
351
352
|
break;
|
|
352
353
|
case "application/x-www-form-urlencoded":
|
|
353
354
|
{
|
|
354
|
-
|
|
355
|
-
const
|
|
356
|
-
|
|
355
|
+
l["form-params"] = n.paramsObj;
|
|
356
|
+
const f = fe(l.headers, "content-type");
|
|
357
|
+
f && delete l.headers[f];
|
|
357
358
|
}
|
|
358
359
|
break;
|
|
359
360
|
case "text/plain":
|
|
360
361
|
{
|
|
361
|
-
|
|
362
|
-
const
|
|
363
|
-
|
|
362
|
+
l.body = n.text;
|
|
363
|
+
const f = fe(l.headers, "content-type");
|
|
364
|
+
f && delete l.headers[f];
|
|
364
365
|
}
|
|
365
366
|
break;
|
|
366
367
|
case "multipart/form-data": {
|
|
367
368
|
if (n.params) {
|
|
368
|
-
|
|
369
|
-
name:
|
|
370
|
-
content: new
|
|
369
|
+
l.multipart = n.params.map((d) => d.fileName && !d.value ? {
|
|
370
|
+
name: d.name,
|
|
371
|
+
content: new wa(d.fileName)
|
|
371
372
|
} : {
|
|
372
|
-
name:
|
|
373
|
-
content:
|
|
373
|
+
name: d.name,
|
|
374
|
+
content: d.value
|
|
374
375
|
});
|
|
375
|
-
const
|
|
376
|
-
|
|
376
|
+
const f = fe(l.headers, "content-type");
|
|
377
|
+
f && delete l.headers[f];
|
|
377
378
|
}
|
|
378
379
|
break;
|
|
379
380
|
}
|
|
380
381
|
}
|
|
381
|
-
switch (ve(
|
|
382
|
+
switch (ve(l.headers, "accept")) {
|
|
382
383
|
case "application/json":
|
|
383
384
|
{
|
|
384
|
-
|
|
385
|
-
const
|
|
386
|
-
|
|
385
|
+
l.accept = new Vr("json");
|
|
386
|
+
const f = fe(l.headers, "accept");
|
|
387
|
+
f && delete l.headers[f];
|
|
387
388
|
}
|
|
388
389
|
break;
|
|
389
390
|
}
|
|
390
391
|
if (r(`(require '[clj-http.client :as client])
|
|
391
|
-
`), co(Dr(
|
|
392
|
+
`), co(Dr(l)))
|
|
392
393
|
r(`(client/${t} "${o}")`);
|
|
393
394
|
else {
|
|
394
|
-
const
|
|
395
|
-
r(`(client/${t} "${o}" ${
|
|
395
|
+
const f = 11 + t.length + o.length, d = Xe(f, dr(Dr(l)));
|
|
396
|
+
r(`(client/${t} "${o}" ${d})`);
|
|
396
397
|
}
|
|
397
398
|
return a();
|
|
398
399
|
}
|
|
399
|
-
},
|
|
400
|
+
}, Oa = {
|
|
400
401
|
info: {
|
|
401
402
|
key: "clojure",
|
|
402
403
|
title: "Clojure",
|
|
403
404
|
default: "clj_http"
|
|
404
405
|
},
|
|
405
406
|
clientsById: {
|
|
406
|
-
clj_http:
|
|
407
|
+
clj_http: Sa
|
|
407
408
|
}
|
|
408
|
-
},
|
|
409
|
+
}, Ta = (e) => {
|
|
409
410
|
let t = ve(e, "accept-encoding");
|
|
410
411
|
if (!t)
|
|
411
412
|
return [];
|
|
@@ -414,15 +415,15 @@ ${n}`);
|
|
|
414
415
|
deflate: "DecompressionMethods.Deflate"
|
|
415
416
|
}, o = [];
|
|
416
417
|
return typeof t == "string" && (t = [t]), t.forEach((s) => {
|
|
417
|
-
s.split(",").forEach((
|
|
418
|
-
const r = /\s*([^;\s]+)/.exec(
|
|
418
|
+
s.split(",").forEach((c) => {
|
|
419
|
+
const r = /\s*([^;\s]+)/.exec(c);
|
|
419
420
|
if (r) {
|
|
420
421
|
const a = n[r[1]];
|
|
421
422
|
a && o.push(a);
|
|
422
423
|
}
|
|
423
424
|
});
|
|
424
425
|
}), o;
|
|
425
|
-
},
|
|
426
|
+
}, Pa = {
|
|
426
427
|
info: {
|
|
427
428
|
key: "httpclient",
|
|
428
429
|
title: "HttpClient",
|
|
@@ -432,17 +433,17 @@ ${n}`);
|
|
|
432
433
|
},
|
|
433
434
|
convert: ({ allHeaders: e, postData: t, method: n, fullUrl: o }, s) => {
|
|
434
435
|
var g, x;
|
|
435
|
-
const
|
|
436
|
+
const c = {
|
|
436
437
|
indent: " ",
|
|
437
438
|
...s
|
|
438
|
-
}, { push: r, join: a } = new V({ indent:
|
|
439
|
+
}, { push: r, join: a } = new V({ indent: c.indent });
|
|
439
440
|
r("using System.Net.Http.Headers;");
|
|
440
441
|
let i = "";
|
|
441
|
-
const
|
|
442
|
-
(
|
|
443
|
-
const
|
|
444
|
-
n = n.toUpperCase(), n &&
|
|
445
|
-
const
|
|
442
|
+
const l = !!e.cookie, f = Ta(e);
|
|
443
|
+
(l || f.length) && (i = "clientHandler", r("var clientHandler = new HttpClientHandler"), r("{"), l && r("UseCookies = false,", 1), f.length && r(`AutomaticDecompression = ${f.join(" | ")},`, 1), r("};")), r(`var client = new HttpClient(${i});`), r("var request = new HttpRequestMessage"), r("{");
|
|
444
|
+
const d = ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS", "TRACE"];
|
|
445
|
+
n = n.toUpperCase(), n && d.includes(n) ? n = `HttpMethod.${n[0]}${n.substring(1).toLowerCase()}` : n = `new HttpMethod("${n}")`, r(`Method = ${n},`, 1), r(`RequestUri = new Uri("${o}"),`, 1);
|
|
446
|
+
const y = Object.keys(e).filter(($) => {
|
|
446
447
|
switch ($.toLowerCase()) {
|
|
447
448
|
case "content-type":
|
|
448
449
|
case "content-length":
|
|
@@ -452,19 +453,19 @@ ${n}`);
|
|
|
452
453
|
return !0;
|
|
453
454
|
}
|
|
454
455
|
});
|
|
455
|
-
if (
|
|
456
|
+
if (y.length && (r("Headers =", 1), r("{", 1), y.forEach(($) => {
|
|
456
457
|
r(`{ "${$}", "${ce(e[$])}" },`, 2);
|
|
457
458
|
}), r("},", 1)), t.text) {
|
|
458
459
|
const $ = t.mimeType;
|
|
459
460
|
switch ($) {
|
|
460
461
|
case "application/x-www-form-urlencoded":
|
|
461
|
-
r("Content = new FormUrlEncodedContent(new Dictionary<string, string>", 1), r("{", 1), (g = t.params) == null || g.forEach((
|
|
462
|
-
r(`{ "${
|
|
462
|
+
r("Content = new FormUrlEncodedContent(new Dictionary<string, string>", 1), r("{", 1), (g = t.params) == null || g.forEach((p) => {
|
|
463
|
+
r(`{ "${p.name}", "${p.value}" },`, 2);
|
|
463
464
|
}), r("}),", 1);
|
|
464
465
|
break;
|
|
465
466
|
case "multipart/form-data":
|
|
466
|
-
r("Content = new MultipartFormDataContent", 1), r("{", 1), (x = t.params) == null || x.forEach((
|
|
467
|
-
r(`new StringContent(${JSON.stringify(
|
|
467
|
+
r("Content = new MultipartFormDataContent", 1), r("{", 1), (x = t.params) == null || x.forEach((p) => {
|
|
468
|
+
r(`new StringContent(${JSON.stringify(p.value || "")})`, 2), r("{", 2), r("Headers =", 3), r("{", 3), p.contentType && r(`ContentType = new MediaTypeHeaderValue("${p.contentType}"),`, 4), r('ContentDisposition = new ContentDispositionHeaderValue("form-data")', 4), r("{", 4), r(`Name = "${p.name}",`, 5), p.fileName && r(`FileName = "${p.fileName}",`, 5), r("}", 4), r("}", 3), r("},", 2);
|
|
468
469
|
}), r("},", 1);
|
|
469
470
|
break;
|
|
470
471
|
default:
|
|
@@ -475,10 +476,10 @@ ${n}`);
|
|
|
475
476
|
return r("};"), r("using (var response = await client.SendAsync(request))"), r("{"), r("response.EnsureSuccessStatusCode();", 1), r("var body = await response.Content.ReadAsStringAsync();", 1), r("Console.WriteLine(body);", 1), r("}"), a();
|
|
476
477
|
}
|
|
477
478
|
};
|
|
478
|
-
function
|
|
479
|
+
function Ca(e) {
|
|
479
480
|
return e[0].toUpperCase() + e.slice(1).toLowerCase();
|
|
480
481
|
}
|
|
481
|
-
var
|
|
482
|
+
var Ra = {
|
|
482
483
|
info: {
|
|
483
484
|
key: "restsharp",
|
|
484
485
|
title: "RestSharp",
|
|
@@ -487,7 +488,7 @@ var wa = {
|
|
|
487
488
|
extname: ".cs",
|
|
488
489
|
installation: "dotnet add package RestSharp"
|
|
489
490
|
},
|
|
490
|
-
convert: ({ method: e, fullUrl: t, headersObj: n, cookies: o, postData: s, uriObj:
|
|
491
|
+
convert: ({ method: e, fullUrl: t, headersObj: n, cookies: o, postData: s, uriObj: c }) => {
|
|
491
492
|
const { push: r, join: a } = new V();
|
|
492
493
|
if (!["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"].includes(
|
|
493
494
|
e.toUpperCase()
|
|
@@ -496,43 +497,43 @@ var wa = {
|
|
|
496
497
|
r(`using RestSharp;
|
|
497
498
|
|
|
498
499
|
`), r(`var options = new RestClientOptions("${t}");`), r("var client = new RestClient(options);"), r('var request = new RestRequest("");');
|
|
499
|
-
const
|
|
500
|
-
switch (
|
|
501
|
-
if (s.mimeType &&
|
|
502
|
-
|
|
500
|
+
const l = s.mimeType && s.mimeType === "multipart/form-data";
|
|
501
|
+
switch (l && r("request.AlwaysMultipartFormData = true;"), Object.keys(n).forEach((f) => {
|
|
502
|
+
if (s.mimeType && f.toLowerCase() === "content-type" && s.text) {
|
|
503
|
+
l && s.boundary && r(`request.FormBoundary = "${s.boundary}";`);
|
|
503
504
|
return;
|
|
504
505
|
}
|
|
505
|
-
r(`request.AddHeader("${
|
|
506
|
-
}), o.forEach(({ name:
|
|
507
|
-
r(`request.AddCookie("${
|
|
506
|
+
r(`request.AddHeader("${f}", "${ce(n[f])}");`);
|
|
507
|
+
}), o.forEach(({ name: f, value: d }) => {
|
|
508
|
+
r(`request.AddCookie("${f}", "${ce(d)}", "${c.pathname}", "${c.host}");`);
|
|
508
509
|
}), s.mimeType) {
|
|
509
510
|
case "multipart/form-data":
|
|
510
511
|
if (!s.params) break;
|
|
511
|
-
s.params.forEach((
|
|
512
|
-
|
|
512
|
+
s.params.forEach((f) => {
|
|
513
|
+
f.fileName ? r(`request.AddFile("${f.name}", "${f.fileName}");`) : r(`request.AddParameter("${f.name}", "${f.value}");`);
|
|
513
514
|
});
|
|
514
515
|
break;
|
|
515
516
|
case "application/x-www-form-urlencoded":
|
|
516
517
|
if (!s.params) break;
|
|
517
|
-
s.params.forEach((
|
|
518
|
-
r(`request.AddParameter("${
|
|
518
|
+
s.params.forEach((f) => {
|
|
519
|
+
r(`request.AddParameter("${f.name}", "${f.value}");`);
|
|
519
520
|
});
|
|
520
521
|
break;
|
|
521
522
|
case "application/json": {
|
|
522
523
|
if (!s.text) break;
|
|
523
|
-
const
|
|
524
|
-
r(`request.AddJsonBody(${
|
|
524
|
+
const f = JSON.stringify(s.text);
|
|
525
|
+
r(`request.AddJsonBody(${f}, false);`);
|
|
525
526
|
break;
|
|
526
527
|
}
|
|
527
528
|
default:
|
|
528
529
|
if (!s.text) break;
|
|
529
530
|
r(`request.AddStringBody("${s.text}", "${s.mimeType}");`);
|
|
530
531
|
}
|
|
531
|
-
return r(`var response = await client.${
|
|
532
|
+
return r(`var response = await client.${Ca(e)}Async(request);
|
|
532
533
|
`), r(`Console.WriteLine("{0}", response.Content);
|
|
533
534
|
`), a();
|
|
534
535
|
}
|
|
535
|
-
},
|
|
536
|
+
}, qa = {
|
|
536
537
|
info: {
|
|
537
538
|
key: "csharp",
|
|
538
539
|
title: "C#",
|
|
@@ -540,10 +541,10 @@ var wa = {
|
|
|
540
541
|
cli: "dotnet"
|
|
541
542
|
},
|
|
542
543
|
clientsById: {
|
|
543
|
-
httpclient:
|
|
544
|
-
restsharp:
|
|
544
|
+
httpclient: Pa,
|
|
545
|
+
restsharp: Ra
|
|
545
546
|
}
|
|
546
|
-
},
|
|
547
|
+
}, ka = {
|
|
547
548
|
info: {
|
|
548
549
|
key: "native",
|
|
549
550
|
title: "NewRequest",
|
|
@@ -552,16 +553,16 @@ var wa = {
|
|
|
552
553
|
extname: ".go"
|
|
553
554
|
},
|
|
554
555
|
convert: ({ postData: e, method: t, allHeaders: n, fullUrl: o }, s = {}) => {
|
|
555
|
-
const { blank:
|
|
556
|
-
|
|
556
|
+
const { blank: c, push: r, join: a } = new V({ indent: " " }), { showBoilerplate: i = !0, checkErrors: l = !1, printBody: f = !0, timeout: d = -1 } = s, y = l ? "err" : "_", g = i ? 1 : 0, x = () => {
|
|
557
|
+
l && (r("if err != nil {", g), r("panic(err)", g + 1), r("}", g));
|
|
557
558
|
};
|
|
558
|
-
i && (r("package main"),
|
|
559
|
-
const $ =
|
|
560
|
-
return
|
|
561
|
-
r(`req.Header.Add("${
|
|
562
|
-
}),
|
|
559
|
+
i && (r("package main"), c(), r("import ("), r('"fmt"', g), d > 0 && r('"time"', g), e.text && r('"strings"', g), r('"net/http"', g), f && r('"io"', g), r(")"), c(), r("func main() {"), c());
|
|
560
|
+
const $ = d > 0, p = $, h = p ? "client" : "http.DefaultClient";
|
|
561
|
+
return p && (r("client := http.Client{", g), $ && r(`Timeout: time.Duration(${d} * time.Second),`, g + 1), r("}", g), c()), r(`url := "${o}"`, g), c(), e.text ? (r(`payload := strings.NewReader(${JSON.stringify(e.text)})`, g), c(), r(`req, ${y} := http.NewRequest("${t}", url, payload)`, g), c()) : (r(`req, ${y} := http.NewRequest("${t}", url, nil)`, g), c()), x(), Object.keys(n).length && (Object.keys(n).forEach((m) => {
|
|
562
|
+
r(`req.Header.Add("${m}", "${ce(n[m])}")`, g);
|
|
563
|
+
}), c()), r(`res, ${y} := ${h}.Do(req)`, g), x(), f && (c(), r("defer res.Body.Close()", g), r(`body, ${y} := io.ReadAll(res.Body)`, g), x()), c(), f && r("fmt.Println(string(body))", g), i && (c(), r("}")), a();
|
|
563
564
|
}
|
|
564
|
-
},
|
|
565
|
+
}, Ea = {
|
|
565
566
|
info: {
|
|
566
567
|
key: "go",
|
|
567
568
|
title: "Go",
|
|
@@ -569,10 +570,10 @@ var wa = {
|
|
|
569
570
|
cli: "go"
|
|
570
571
|
},
|
|
571
572
|
clientsById: {
|
|
572
|
-
native:
|
|
573
|
+
native: ka
|
|
573
574
|
}
|
|
574
575
|
}, Qr = `\r
|
|
575
|
-
`,
|
|
576
|
+
`, Na = {
|
|
576
577
|
info: {
|
|
577
578
|
key: "http1.1",
|
|
578
579
|
title: "HTTP/1.1",
|
|
@@ -580,36 +581,36 @@ var wa = {
|
|
|
580
581
|
description: "HTTP/1.1 request string in accordance with RFC 7230",
|
|
581
582
|
extname: null
|
|
582
583
|
},
|
|
583
|
-
convert: ({ method: e, fullUrl: t, uriObj: n, httpVersion: o, allHeaders: s, postData:
|
|
584
|
+
convert: ({ method: e, fullUrl: t, uriObj: n, httpVersion: o, allHeaders: s, postData: c }, r) => {
|
|
584
585
|
const a = {
|
|
585
586
|
absoluteURI: !1,
|
|
586
587
|
autoContentLength: !0,
|
|
587
588
|
autoHost: !0,
|
|
588
589
|
...r
|
|
589
|
-
}, { blank: i, push:
|
|
590
|
-
|
|
591
|
-
const
|
|
592
|
-
if (
|
|
593
|
-
const
|
|
594
|
-
|
|
595
|
-
}), a.autoHost && !
|
|
596
|
-
const
|
|
597
|
-
|
|
590
|
+
}, { blank: i, push: l, join: f } = new V({ indent: "", join: Qr }), d = a.absoluteURI ? t : n.path;
|
|
591
|
+
l(`${e} ${d} ${o}`);
|
|
592
|
+
const y = Object.keys(s);
|
|
593
|
+
if (y.forEach(($) => {
|
|
594
|
+
const p = $.toLowerCase().replace(/(^|-)(\w)/g, (h) => h.toUpperCase());
|
|
595
|
+
l(`${p}: ${s[$]}`);
|
|
596
|
+
}), a.autoHost && !y.includes("host") && l(`Host: ${n.host}`), a.autoContentLength && c.text && !y.includes("content-length")) {
|
|
597
|
+
const p = new TextEncoder().encode(c.text).length.toString();
|
|
598
|
+
l(`Content-Length: ${p}`);
|
|
598
599
|
}
|
|
599
600
|
i();
|
|
600
|
-
const g =
|
|
601
|
+
const g = f(), x = c.text || "";
|
|
601
602
|
return `${g}${Qr}${x}`;
|
|
602
603
|
}
|
|
603
|
-
},
|
|
604
|
+
}, Aa = {
|
|
604
605
|
info: {
|
|
605
606
|
key: "http",
|
|
606
607
|
title: "HTTP",
|
|
607
608
|
default: "http1.1"
|
|
608
609
|
},
|
|
609
610
|
clientsById: {
|
|
610
|
-
"http1.1":
|
|
611
|
+
"http1.1": Na
|
|
611
612
|
}
|
|
612
|
-
},
|
|
613
|
+
}, Ia = {
|
|
613
614
|
info: {
|
|
614
615
|
key: "asynchttp",
|
|
615
616
|
title: "AsyncHttp",
|
|
@@ -618,15 +619,15 @@ var wa = {
|
|
|
618
619
|
extname: ".java"
|
|
619
620
|
},
|
|
620
621
|
convert: ({ method: e, allHeaders: t, postData: n, fullUrl: o }, s) => {
|
|
621
|
-
const
|
|
622
|
+
const c = {
|
|
622
623
|
indent: " ",
|
|
623
624
|
...s
|
|
624
|
-
}, { blank: r, push: a, join: i } = new V({ indent:
|
|
625
|
-
return a("AsyncHttpClient client = new DefaultAsyncHttpClient();"), a(`client.prepare("${e.toUpperCase()}", "${o}")`), Object.keys(t).forEach((
|
|
626
|
-
a(`.setHeader("${
|
|
625
|
+
}, { blank: r, push: a, join: i } = new V({ indent: c.indent });
|
|
626
|
+
return a("AsyncHttpClient client = new DefaultAsyncHttpClient();"), a(`client.prepare("${e.toUpperCase()}", "${o}")`), Object.keys(t).forEach((l) => {
|
|
627
|
+
a(`.setHeader("${l}", "${ce(t[l])}")`, 1);
|
|
627
628
|
}), n.text && a(`.setBody(${JSON.stringify(n.text)})`, 1), a(".execute()", 1), a(".toCompletableFuture()", 1), a(".thenAccept(System.out::println)", 1), a(".join();", 1), r(), a("client.close();"), i();
|
|
628
629
|
}
|
|
629
|
-
},
|
|
630
|
+
}, La = {
|
|
630
631
|
info: {
|
|
631
632
|
key: "nethttp",
|
|
632
633
|
title: "java.net.http",
|
|
@@ -635,10 +636,10 @@ var wa = {
|
|
|
635
636
|
extname: ".java"
|
|
636
637
|
},
|
|
637
638
|
convert: ({ allHeaders: e, fullUrl: t, method: n, postData: o }, s) => {
|
|
638
|
-
const
|
|
639
|
+
const c = {
|
|
639
640
|
indent: " ",
|
|
640
641
|
...s
|
|
641
|
-
}, { push: r, join: a } = new V({ indent:
|
|
642
|
+
}, { push: r, join: a } = new V({ indent: c.indent });
|
|
642
643
|
return r("HttpRequest request = HttpRequest.newBuilder()"), r(`.uri(URI.create("${t}"))`, 2), Object.keys(e).forEach((i) => {
|
|
643
644
|
r(`.header("${i}", "${ce(e[i])}")`, 2);
|
|
644
645
|
}), o.text ? r(
|
|
@@ -648,7 +649,7 @@ var wa = {
|
|
|
648
649
|
"HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());"
|
|
649
650
|
), r("System.out.println(response.body());"), a();
|
|
650
651
|
}
|
|
651
|
-
},
|
|
652
|
+
}, Ua = {
|
|
652
653
|
info: {
|
|
653
654
|
key: "okhttp",
|
|
654
655
|
title: "OkHttp",
|
|
@@ -657,15 +658,15 @@ var wa = {
|
|
|
657
658
|
extname: ".java"
|
|
658
659
|
},
|
|
659
660
|
convert: ({ postData: e, method: t, fullUrl: n, allHeaders: o }, s) => {
|
|
660
|
-
const
|
|
661
|
+
const c = {
|
|
661
662
|
indent: " ",
|
|
662
663
|
...s
|
|
663
|
-
}, { push: r, blank: a, join: i } = new V({ indent:
|
|
664
|
-
return r("OkHttpClient client = new OkHttpClient();"), a(), e.text && (e.boundary ? r(`MediaType mediaType = MediaType.parse("${e.mimeType}; boundary=${e.boundary}");`) : r(`MediaType mediaType = MediaType.parse("${e.mimeType}");`), r(`RequestBody body = RequestBody.create(mediaType, ${JSON.stringify(e.text)});`)), r("Request request = new Request.Builder()"), r(`.url("${n}")`, 1),
|
|
665
|
-
r(`.addHeader("${
|
|
664
|
+
}, { push: r, blank: a, join: i } = new V({ indent: c.indent }), l = ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD"], f = ["POST", "PUT", "DELETE", "PATCH"];
|
|
665
|
+
return r("OkHttpClient client = new OkHttpClient();"), a(), e.text && (e.boundary ? r(`MediaType mediaType = MediaType.parse("${e.mimeType}; boundary=${e.boundary}");`) : r(`MediaType mediaType = MediaType.parse("${e.mimeType}");`), r(`RequestBody body = RequestBody.create(mediaType, ${JSON.stringify(e.text)});`)), r("Request request = new Request.Builder()"), r(`.url("${n}")`, 1), l.includes(t.toUpperCase()) ? f.includes(t.toUpperCase()) ? e.text ? r(`.${t.toLowerCase()}(body)`, 1) : r(`.${t.toLowerCase()}(null)`, 1) : r(`.${t.toLowerCase()}()`, 1) : e.text ? r(`.method("${t.toUpperCase()}", body)`, 1) : r(`.method("${t.toUpperCase()}", null)`, 1), Object.keys(o).forEach((d) => {
|
|
666
|
+
r(`.addHeader("${d}", "${ce(o[d])}")`, 1);
|
|
666
667
|
}), r(".build();", 1), a(), r("Response response = client.newCall(request).execute();"), i();
|
|
667
668
|
}
|
|
668
|
-
},
|
|
669
|
+
}, Fa = {
|
|
669
670
|
info: {
|
|
670
671
|
key: "unirest",
|
|
671
672
|
title: "Unirest",
|
|
@@ -674,27 +675,27 @@ var wa = {
|
|
|
674
675
|
extname: ".java"
|
|
675
676
|
},
|
|
676
677
|
convert: ({ method: e, allHeaders: t, postData: n, fullUrl: o }, s) => {
|
|
677
|
-
const
|
|
678
|
+
const c = {
|
|
678
679
|
indent: " ",
|
|
679
680
|
...s
|
|
680
|
-
}, { join: r, push: a } = new V({ indent:
|
|
681
|
-
return ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"].includes(e.toUpperCase()) ? a(`HttpResponse<String> response = Unirest.${e.toLowerCase()}("${o}")`) : a(`HttpResponse<String> response = Unirest.customMethod("${e.toUpperCase()}","${o}")`), Object.keys(t).forEach((
|
|
682
|
-
a(`.header("${
|
|
681
|
+
}, { join: r, push: a } = new V({ indent: c.indent });
|
|
682
|
+
return ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"].includes(e.toUpperCase()) ? a(`HttpResponse<String> response = Unirest.${e.toLowerCase()}("${o}")`) : a(`HttpResponse<String> response = Unirest.customMethod("${e.toUpperCase()}","${o}")`), Object.keys(t).forEach((l) => {
|
|
683
|
+
a(`.header("${l}", "${ce(t[l])}")`, 1);
|
|
683
684
|
}), n.text && a(`.body(${JSON.stringify(n.text)})`, 1), a(".asString();", 1), r();
|
|
684
685
|
}
|
|
685
|
-
},
|
|
686
|
+
}, _a = {
|
|
686
687
|
info: {
|
|
687
688
|
key: "java",
|
|
688
689
|
title: "Java",
|
|
689
690
|
default: "unirest"
|
|
690
691
|
},
|
|
691
692
|
clientsById: {
|
|
692
|
-
asynchttp:
|
|
693
|
-
nethttp:
|
|
694
|
-
okhttp:
|
|
695
|
-
unirest:
|
|
693
|
+
asynchttp: Ia,
|
|
694
|
+
nethttp: La,
|
|
695
|
+
okhttp: Ua,
|
|
696
|
+
unirest: Fa
|
|
696
697
|
}
|
|
697
|
-
},
|
|
698
|
+
}, Ba = {
|
|
698
699
|
info: {
|
|
699
700
|
key: "axios",
|
|
700
701
|
title: "Axios",
|
|
@@ -703,42 +704,42 @@ var wa = {
|
|
|
703
704
|
extname: ".js",
|
|
704
705
|
installation: "npm install axios --save"
|
|
705
706
|
},
|
|
706
|
-
convert: ({ allHeaders: e, method: t, url: n, queryObj: o, postData: s },
|
|
707
|
+
convert: ({ allHeaders: e, method: t, url: n, queryObj: o, postData: s }, c) => {
|
|
707
708
|
const r = {
|
|
708
709
|
indent: " ",
|
|
709
|
-
...
|
|
710
|
-
}, { blank: a, push: i, join:
|
|
710
|
+
...c
|
|
711
|
+
}, { blank: a, push: i, join: l, addPostProcessor: f } = new V({ indent: r.indent });
|
|
711
712
|
i("import axios from 'axios';"), a();
|
|
712
|
-
const
|
|
713
|
+
const d = {
|
|
713
714
|
method: t,
|
|
714
715
|
url: n
|
|
715
716
|
};
|
|
716
|
-
switch (Object.keys(o).length && (
|
|
717
|
+
switch (Object.keys(o).length && (d.params = o), Object.keys(e).length && (d.headers = e), s.mimeType) {
|
|
717
718
|
case "application/x-www-form-urlencoded":
|
|
718
719
|
s.params && (i("const encodedParams = new URLSearchParams();"), s.params.forEach((g) => {
|
|
719
720
|
i(`encodedParams.set('${g.name}', '${g.value}');`);
|
|
720
|
-
}), a(),
|
|
721
|
+
}), a(), d.data = "encodedParams,", f((g) => g.replace(/'encodedParams,'/, "encodedParams,")));
|
|
721
722
|
break;
|
|
722
723
|
case "application/json":
|
|
723
|
-
s.jsonObj && (
|
|
724
|
+
s.jsonObj && (d.data = s.jsonObj);
|
|
724
725
|
break;
|
|
725
726
|
case "multipart/form-data":
|
|
726
727
|
if (!s.params)
|
|
727
728
|
break;
|
|
728
729
|
i("const form = new FormData();"), s.params.forEach((g) => {
|
|
729
730
|
i(`form.append('${g.name}', '${g.value || g.fileName || ""}');`);
|
|
730
|
-
}), a(),
|
|
731
|
+
}), a(), d.data = "[form]";
|
|
731
732
|
break;
|
|
732
733
|
default:
|
|
733
|
-
s.text && (
|
|
734
|
+
s.text && (d.data = s.text);
|
|
734
735
|
}
|
|
735
|
-
const
|
|
736
|
+
const y = ue(d, {
|
|
736
737
|
indent: " ",
|
|
737
738
|
inlineCharacterLimit: 80
|
|
738
739
|
}).replace('"[form]"', "form");
|
|
739
|
-
return i(`const options = ${
|
|
740
|
+
return i(`const options = ${y};`), a(), i("axios"), i(".request(options)", 1), i(".then(function (response) {", 1), i("console.log(response.data);", 2), i("})", 1), i(".catch(function (error) {", 1), i("console.error(error);", 2), i("});", 1), l();
|
|
740
741
|
}
|
|
741
|
-
},
|
|
742
|
+
}, Ha = {
|
|
742
743
|
info: {
|
|
743
744
|
key: "fetch",
|
|
744
745
|
title: "fetch",
|
|
@@ -747,51 +748,51 @@ var wa = {
|
|
|
747
748
|
extname: ".js"
|
|
748
749
|
},
|
|
749
750
|
convert: ({ method: e, allHeaders: t, postData: n, fullUrl: o }, s) => {
|
|
750
|
-
const
|
|
751
|
+
const c = {
|
|
751
752
|
indent: " ",
|
|
752
753
|
credentials: null,
|
|
753
754
|
...s
|
|
754
|
-
}, { blank: r, join: a, push: i } = new V({ indent:
|
|
755
|
+
}, { blank: r, join: a, push: i } = new V({ indent: c.indent }), l = {
|
|
755
756
|
method: e
|
|
756
757
|
};
|
|
757
|
-
switch (Object.keys(t).length && (
|
|
758
|
+
switch (Object.keys(t).length && (l.headers = t), c.credentials !== null && (l.credentials = c.credentials), n.mimeType) {
|
|
758
759
|
case "application/x-www-form-urlencoded":
|
|
759
|
-
|
|
760
|
+
l.body = n.paramsObj ? n.paramsObj : n.text;
|
|
760
761
|
break;
|
|
761
762
|
case "application/json":
|
|
762
|
-
n.jsonObj && (
|
|
763
|
+
n.jsonObj && (l.body = n.jsonObj);
|
|
763
764
|
break;
|
|
764
765
|
case "multipart/form-data":
|
|
765
766
|
if (!n.params)
|
|
766
767
|
break;
|
|
767
|
-
const
|
|
768
|
-
|
|
769
|
-
i(`form.append('${
|
|
768
|
+
const f = fe(t, "content-type");
|
|
769
|
+
f && delete t[f], i("const form = new FormData();"), n.params.forEach((d) => {
|
|
770
|
+
i(`form.append('${d.name}', '${d.value || d.fileName || ""}');`);
|
|
770
771
|
}), r();
|
|
771
772
|
break;
|
|
772
773
|
default:
|
|
773
|
-
n.text && (
|
|
774
|
+
n.text && (l.body = n.text);
|
|
774
775
|
}
|
|
775
|
-
return
|
|
776
|
-
`const options = ${ue(
|
|
777
|
-
indent:
|
|
776
|
+
return l.headers && !Object.keys(l.headers).length && delete l.headers, i(
|
|
777
|
+
`const options = ${ue(l, {
|
|
778
|
+
indent: c.indent,
|
|
778
779
|
inlineCharacterLimit: 80,
|
|
779
780
|
// The Fetch API body only accepts string parameters, but stringified JSON can be difficult
|
|
780
781
|
// to read, so we keep the object as a literal and use this transform function to wrap the
|
|
781
782
|
// literal in a `JSON.stringify` call.
|
|
782
|
-
transform: (
|
|
783
|
-
if (
|
|
783
|
+
transform: (f, d, y) => {
|
|
784
|
+
if (d === "body") {
|
|
784
785
|
if (n.mimeType === "application/x-www-form-urlencoded")
|
|
785
|
-
return `new URLSearchParams(${
|
|
786
|
+
return `new URLSearchParams(${y})`;
|
|
786
787
|
if (n.mimeType === "application/json")
|
|
787
|
-
return `JSON.stringify(${
|
|
788
|
+
return `JSON.stringify(${y})`;
|
|
788
789
|
}
|
|
789
|
-
return
|
|
790
|
+
return y;
|
|
790
791
|
}
|
|
791
792
|
})};`
|
|
792
793
|
), r(), n.params && n.mimeType === "multipart/form-data" && (i("options.body = form;"), r()), i(`fetch('${o}', options)`), i(".then(response => response.json())", 1), i(".then(response => console.log(response))", 1), i(".catch(err => console.error(err));", 1), a();
|
|
793
794
|
}
|
|
794
|
-
},
|
|
795
|
+
}, Ma = {
|
|
795
796
|
info: {
|
|
796
797
|
key: "jquery",
|
|
797
798
|
title: "jQuery",
|
|
@@ -800,11 +801,11 @@ var wa = {
|
|
|
800
801
|
extname: ".js"
|
|
801
802
|
},
|
|
802
803
|
convert: ({ fullUrl: e, method: t, allHeaders: n, postData: o }, s) => {
|
|
803
|
-
var
|
|
804
|
-
const
|
|
804
|
+
var d;
|
|
805
|
+
const c = {
|
|
805
806
|
indent: " ",
|
|
806
807
|
...s
|
|
807
|
-
}, { blank: r, push: a, join: i } = new V({ indent:
|
|
808
|
+
}, { blank: r, push: a, join: i } = new V({ indent: c.indent }), l = {
|
|
808
809
|
async: !0,
|
|
809
810
|
crossDomain: !0,
|
|
810
811
|
url: e,
|
|
@@ -813,29 +814,29 @@ var wa = {
|
|
|
813
814
|
};
|
|
814
815
|
switch (o.mimeType) {
|
|
815
816
|
case "application/x-www-form-urlencoded":
|
|
816
|
-
|
|
817
|
+
l.data = o.paramsObj ? o.paramsObj : o.text;
|
|
817
818
|
break;
|
|
818
819
|
case "application/json":
|
|
819
|
-
|
|
820
|
+
l.processData = !1, l.data = o.text;
|
|
820
821
|
break;
|
|
821
822
|
case "multipart/form-data":
|
|
822
823
|
if (!o.params)
|
|
823
824
|
break;
|
|
824
|
-
if (a("const form = new FormData();"), o.params.forEach((
|
|
825
|
-
a(`form.append('${
|
|
826
|
-
}),
|
|
827
|
-
const
|
|
828
|
-
|
|
825
|
+
if (a("const form = new FormData();"), o.params.forEach((y) => {
|
|
826
|
+
a(`form.append('${y.name}', '${y.value || y.fileName || ""}');`);
|
|
827
|
+
}), l.processData = !1, l.contentType = !1, l.mimeType = "multipart/form-data", l.data = "[form]", rt(n, "content-type") && (d = ve(n, "content-type")) != null && d.includes("boundary")) {
|
|
828
|
+
const y = fe(n, "content-type");
|
|
829
|
+
y && delete l.headers[y];
|
|
829
830
|
}
|
|
830
831
|
r();
|
|
831
832
|
break;
|
|
832
833
|
default:
|
|
833
|
-
o.text && (
|
|
834
|
+
o.text && (l.data = o.text);
|
|
834
835
|
}
|
|
835
|
-
const
|
|
836
|
-
return a(`const settings = ${
|
|
836
|
+
const f = ue(l, { indent: c.indent }).replace("'[form]'", "form");
|
|
837
|
+
return a(`const settings = ${f};`), r(), a("$.ajax(settings).done(function (response) {"), a("console.log(response);", 1), a("});"), i();
|
|
837
838
|
}
|
|
838
|
-
},
|
|
839
|
+
}, za = {
|
|
839
840
|
info: {
|
|
840
841
|
key: "xhr",
|
|
841
842
|
title: "XMLHttpRequest",
|
|
@@ -844,51 +845,51 @@ var wa = {
|
|
|
844
845
|
extname: ".js"
|
|
845
846
|
},
|
|
846
847
|
convert: ({ postData: e, allHeaders: t, method: n, fullUrl: o }, s) => {
|
|
847
|
-
var
|
|
848
|
-
const
|
|
848
|
+
var l;
|
|
849
|
+
const c = {
|
|
849
850
|
indent: " ",
|
|
850
851
|
cors: !0,
|
|
851
852
|
...s
|
|
852
|
-
}, { blank: r, push: a, join: i } = new V({ indent:
|
|
853
|
+
}, { blank: r, push: a, join: i } = new V({ indent: c.indent });
|
|
853
854
|
switch (e.mimeType) {
|
|
854
855
|
case "application/json":
|
|
855
856
|
a(
|
|
856
857
|
`const data = JSON.stringify(${ue(e.jsonObj, {
|
|
857
|
-
indent:
|
|
858
|
+
indent: c.indent
|
|
858
859
|
})});`
|
|
859
860
|
), r();
|
|
860
861
|
break;
|
|
861
862
|
case "multipart/form-data":
|
|
862
863
|
if (!e.params)
|
|
863
864
|
break;
|
|
864
|
-
if (a("const data = new FormData();"), e.params.forEach((
|
|
865
|
-
a(`data.append('${
|
|
866
|
-
}), rt(t, "content-type") && (
|
|
867
|
-
const
|
|
868
|
-
|
|
865
|
+
if (a("const data = new FormData();"), e.params.forEach((f) => {
|
|
866
|
+
a(`data.append('${f.name}', '${f.value || f.fileName || ""}');`);
|
|
867
|
+
}), rt(t, "content-type") && (l = ve(t, "content-type")) != null && l.includes("boundary")) {
|
|
868
|
+
const f = fe(t, "content-type");
|
|
869
|
+
f && delete t[f];
|
|
869
870
|
}
|
|
870
871
|
r();
|
|
871
872
|
break;
|
|
872
873
|
default:
|
|
873
874
|
a(`const data = ${e.text ? `'${e.text}'` : "null"};`), r();
|
|
874
875
|
}
|
|
875
|
-
return a("const xhr = new XMLHttpRequest();"),
|
|
876
|
-
a(`xhr.setRequestHeader('${
|
|
876
|
+
return a("const xhr = new XMLHttpRequest();"), c.cors && a("xhr.withCredentials = true;"), r(), a("xhr.addEventListener('readystatechange', function () {"), a("if (this.readyState === this.DONE) {", 1), a("console.log(this.responseText);", 2), a("}", 1), a("});"), r(), a(`xhr.open('${n}', '${o}');`), Object.keys(t).forEach((f) => {
|
|
877
|
+
a(`xhr.setRequestHeader('${f}', '${ze(t[f])}');`);
|
|
877
878
|
}), r(), a("xhr.send(data);"), i();
|
|
878
879
|
}
|
|
879
|
-
},
|
|
880
|
+
}, Ga = {
|
|
880
881
|
info: {
|
|
881
882
|
key: "javascript",
|
|
882
883
|
title: "JavaScript",
|
|
883
884
|
default: "xhr"
|
|
884
885
|
},
|
|
885
886
|
clientsById: {
|
|
886
|
-
xhr:
|
|
887
|
-
axios:
|
|
888
|
-
fetch:
|
|
889
|
-
jquery:
|
|
887
|
+
xhr: za,
|
|
888
|
+
axios: Ba,
|
|
889
|
+
fetch: Ha,
|
|
890
|
+
jquery: Ma
|
|
890
891
|
}
|
|
891
|
-
},
|
|
892
|
+
}, Wa = {
|
|
892
893
|
info: {
|
|
893
894
|
key: "native",
|
|
894
895
|
title: "Native JSON",
|
|
@@ -913,8 +914,8 @@ var wa = {
|
|
|
913
914
|
if (!e.params)
|
|
914
915
|
break;
|
|
915
916
|
const s = {};
|
|
916
|
-
e.params.forEach((
|
|
917
|
-
s[
|
|
917
|
+
e.params.forEach((c) => {
|
|
918
|
+
s[c.name] = c.value;
|
|
918
919
|
}), o = s;
|
|
919
920
|
break;
|
|
920
921
|
default:
|
|
@@ -922,16 +923,16 @@ var wa = {
|
|
|
922
923
|
}
|
|
923
924
|
return typeof o > "u" || o === "" ? "No JSON body" : JSON.stringify(o, null, n.indent);
|
|
924
925
|
}
|
|
925
|
-
},
|
|
926
|
+
}, Ja = {
|
|
926
927
|
info: {
|
|
927
928
|
key: "json",
|
|
928
929
|
title: "JSON",
|
|
929
930
|
default: "native"
|
|
930
931
|
},
|
|
931
932
|
clientsById: {
|
|
932
|
-
native:
|
|
933
|
+
native: Wa
|
|
933
934
|
}
|
|
934
|
-
},
|
|
935
|
+
}, Va = {
|
|
935
936
|
info: {
|
|
936
937
|
key: "okhttp",
|
|
937
938
|
title: "OkHttp",
|
|
@@ -940,24 +941,24 @@ var wa = {
|
|
|
940
941
|
extname: ".kt"
|
|
941
942
|
},
|
|
942
943
|
convert: ({ postData: e, fullUrl: t, method: n, allHeaders: o }, s) => {
|
|
943
|
-
const
|
|
944
|
+
const c = {
|
|
944
945
|
indent: " ",
|
|
945
946
|
...s
|
|
946
|
-
}, { blank: r, join: a, push: i } = new V({ indent:
|
|
947
|
-
return i("val client = OkHttpClient()"), r(), e.text && (e.boundary ? i(`val mediaType = MediaType.parse("${e.mimeType}; boundary=${e.boundary}")`) : i(`val mediaType = MediaType.parse("${e.mimeType}")`), i(`val body = RequestBody.create(mediaType, ${JSON.stringify(e.text)})`)), i("val request = Request.Builder()"), i(`.url("${t}")`, 1),
|
|
948
|
-
i(`.addHeader("${
|
|
947
|
+
}, { blank: r, join: a, push: i } = new V({ indent: c.indent }), l = ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD"], f = ["POST", "PUT", "DELETE", "PATCH"];
|
|
948
|
+
return i("val client = OkHttpClient()"), r(), e.text && (e.boundary ? i(`val mediaType = MediaType.parse("${e.mimeType}; boundary=${e.boundary}")`) : i(`val mediaType = MediaType.parse("${e.mimeType}")`), i(`val body = RequestBody.create(mediaType, ${JSON.stringify(e.text)})`)), i("val request = Request.Builder()"), i(`.url("${t}")`, 1), l.includes(n.toUpperCase()) ? f.includes(n.toUpperCase()) ? e.text ? i(`.${n.toLowerCase()}(body)`, 1) : i(`.${n.toLowerCase()}(null)`, 1) : i(`.${n.toLowerCase()}()`, 1) : e.text ? i(`.method("${n.toUpperCase()}", body)`, 1) : i(`.method("${n.toUpperCase()}", null)`, 1), Object.keys(o).forEach((d) => {
|
|
949
|
+
i(`.addHeader("${d}", "${ce(o[d])}")`, 1);
|
|
949
950
|
}), i(".build()", 1), r(), i("val response = client.newCall(request).execute()"), a();
|
|
950
951
|
}
|
|
951
|
-
},
|
|
952
|
+
}, Da = {
|
|
952
953
|
info: {
|
|
953
954
|
key: "kotlin",
|
|
954
955
|
title: "Kotlin",
|
|
955
956
|
default: "okhttp"
|
|
956
957
|
},
|
|
957
958
|
clientsById: {
|
|
958
|
-
okhttp:
|
|
959
|
+
okhttp: Va
|
|
959
960
|
}
|
|
960
|
-
},
|
|
961
|
+
}, Qa = {
|
|
961
962
|
info: {
|
|
962
963
|
key: "axios",
|
|
963
964
|
title: "Axios",
|
|
@@ -967,31 +968,31 @@ var wa = {
|
|
|
967
968
|
installation: "npm install axios --save"
|
|
968
969
|
},
|
|
969
970
|
convert: ({ method: e, fullUrl: t, allHeaders: n, postData: o }, s) => {
|
|
970
|
-
const
|
|
971
|
+
const c = {
|
|
971
972
|
indent: " ",
|
|
972
973
|
...s
|
|
973
|
-
}, { blank: r, join: a, push: i, addPostProcessor:
|
|
974
|
+
}, { blank: r, join: a, push: i, addPostProcessor: l } = new V({ indent: c.indent });
|
|
974
975
|
i("const axios = require('axios');");
|
|
975
|
-
const
|
|
976
|
+
const f = {
|
|
976
977
|
method: e,
|
|
977
978
|
url: t
|
|
978
979
|
};
|
|
979
|
-
switch (Object.keys(n).length && (
|
|
980
|
+
switch (Object.keys(n).length && (f.headers = n), o.mimeType) {
|
|
980
981
|
case "application/x-www-form-urlencoded":
|
|
981
|
-
o.params && (i("const { URLSearchParams } = require('url');"), r(), i("const encodedParams = new URLSearchParams();"), o.params.forEach((
|
|
982
|
-
i(`encodedParams.set('${
|
|
983
|
-
}), r(),
|
|
982
|
+
o.params && (i("const { URLSearchParams } = require('url');"), r(), i("const encodedParams = new URLSearchParams();"), o.params.forEach((y) => {
|
|
983
|
+
i(`encodedParams.set('${y.name}', '${y.value}');`);
|
|
984
|
+
}), r(), f.data = "encodedParams,", l((y) => y.replace(/'encodedParams,'/, "encodedParams,")));
|
|
984
985
|
break;
|
|
985
986
|
case "application/json":
|
|
986
|
-
r(), o.jsonObj && (
|
|
987
|
+
r(), o.jsonObj && (f.data = o.jsonObj);
|
|
987
988
|
break;
|
|
988
989
|
default:
|
|
989
|
-
r(), o.text && (
|
|
990
|
+
r(), o.text && (f.data = o.text);
|
|
990
991
|
}
|
|
991
|
-
const
|
|
992
|
-
return i(`const options = ${
|
|
992
|
+
const d = ue(f, { indent: " ", inlineCharacterLimit: 80 });
|
|
993
|
+
return i(`const options = ${d};`), r(), i("axios"), i(".request(options)", 1), i(".then(function (response) {", 1), i("console.log(response.data);", 2), i("})", 1), i(".catch(function (error) {", 1), i("console.error(error);", 2), i("});", 1), a();
|
|
993
994
|
}
|
|
994
|
-
},
|
|
995
|
+
}, Ka = {
|
|
995
996
|
info: {
|
|
996
997
|
key: "fetch",
|
|
997
998
|
title: "Fetch",
|
|
@@ -1000,22 +1001,22 @@ var wa = {
|
|
|
1000
1001
|
extname: ".cjs",
|
|
1001
1002
|
installation: "npm install node-fetch@2 --save"
|
|
1002
1003
|
},
|
|
1003
|
-
convert: ({ method: e, fullUrl: t, postData: n, headersObj: o, cookies: s },
|
|
1004
|
+
convert: ({ method: e, fullUrl: t, postData: n, headersObj: o, cookies: s }, c) => {
|
|
1004
1005
|
var $;
|
|
1005
1006
|
const r = {
|
|
1006
1007
|
indent: " ",
|
|
1007
|
-
...
|
|
1008
|
+
...c
|
|
1008
1009
|
};
|
|
1009
1010
|
let a = !1;
|
|
1010
|
-
const { blank: i, push:
|
|
1011
|
-
|
|
1012
|
-
const
|
|
1011
|
+
const { blank: i, push: l, join: f, unshift: d } = new V({ indent: r.indent });
|
|
1012
|
+
l("const fetch = require('node-fetch');");
|
|
1013
|
+
const y = t, g = {
|
|
1013
1014
|
method: e
|
|
1014
1015
|
};
|
|
1015
1016
|
switch (Object.keys(o).length && (g.headers = o), n.mimeType) {
|
|
1016
1017
|
case "application/x-www-form-urlencoded":
|
|
1017
|
-
|
|
1018
|
-
|
|
1018
|
+
d("const { URLSearchParams } = require('url');"), l("const encodedParams = new URLSearchParams();"), i(), ($ = n.params) == null || $.forEach((h) => {
|
|
1019
|
+
l(`encodedParams.set('${h.name}', '${h.value}');`);
|
|
1019
1020
|
}), g.body = "encodedParams";
|
|
1020
1021
|
break;
|
|
1021
1022
|
case "application/json":
|
|
@@ -1024,34 +1025,34 @@ var wa = {
|
|
|
1024
1025
|
case "multipart/form-data":
|
|
1025
1026
|
if (!n.params)
|
|
1026
1027
|
break;
|
|
1027
|
-
const
|
|
1028
|
-
|
|
1029
|
-
if (!
|
|
1030
|
-
|
|
1028
|
+
const p = fe(o, "content-type");
|
|
1029
|
+
p && delete o[p], d("const FormData = require('form-data');"), l("const formData = new FormData();"), i(), n.params.forEach((h) => {
|
|
1030
|
+
if (!h.fileName && !h.fileName && !h.contentType) {
|
|
1031
|
+
l(`formData.append('${h.name}', '${h.value}');`);
|
|
1031
1032
|
return;
|
|
1032
1033
|
}
|
|
1033
|
-
|
|
1034
|
+
h.fileName && (a = !0, l(`formData.append('${h.name}', fs.createReadStream('${h.fileName}'));`));
|
|
1034
1035
|
});
|
|
1035
1036
|
break;
|
|
1036
1037
|
default:
|
|
1037
1038
|
n.text && (g.body = n.text);
|
|
1038
1039
|
}
|
|
1039
1040
|
if (s.length) {
|
|
1040
|
-
const
|
|
1041
|
-
g.headers || (g.headers = {}), g.headers.cookie =
|
|
1041
|
+
const p = s.map(({ name: h, value: m }) => `${encodeURIComponent(h)}=${encodeURIComponent(m)}`).join("; ");
|
|
1042
|
+
g.headers || (g.headers = {}), g.headers.cookie = p;
|
|
1042
1043
|
}
|
|
1043
|
-
i(),
|
|
1044
|
+
i(), l(`const url = '${y}';`), g.headers && !Object.keys(g.headers).length && delete g.headers;
|
|
1044
1045
|
const x = ue(g, {
|
|
1045
1046
|
indent: " ",
|
|
1046
1047
|
inlineCharacterLimit: 80,
|
|
1047
1048
|
// The Fetch API body only accepts string parameters, but stringified JSON can be difficult to
|
|
1048
1049
|
// read, so we keep the object as a literal and use this transform function to wrap the literal
|
|
1049
1050
|
// in a `JSON.stringify` call.
|
|
1050
|
-
transform: (
|
|
1051
|
+
transform: (p, h, m) => h === "body" && n.mimeType === "application/json" ? `JSON.stringify(${m})` : m
|
|
1051
1052
|
});
|
|
1052
|
-
return
|
|
1053
|
+
return l(`const options = ${x};`), i(), a && d("const fs = require('fs');"), n.params && n.mimeType === "multipart/form-data" && (l("options.body = formData;"), i()), l("fetch(url, options)"), l(".then(res => res.json())", 1), l(".then(json => console.log(json))", 1), l(".catch(err => console.error('error:' + err));", 1), f().replace(/'encodedParams'/, "encodedParams").replace(/"fs\.createReadStream\(\\"(.+)\\"\)"/, 'fs.createReadStream("$1")');
|
|
1053
1054
|
}
|
|
1054
|
-
},
|
|
1055
|
+
}, Ya = {
|
|
1055
1056
|
info: {
|
|
1056
1057
|
key: "native",
|
|
1057
1058
|
title: "HTTP",
|
|
@@ -1060,17 +1061,17 @@ var wa = {
|
|
|
1060
1061
|
extname: ".cjs"
|
|
1061
1062
|
},
|
|
1062
1063
|
convert: ({ uriObj: e, method: t, allHeaders: n, postData: o }, s = {}) => {
|
|
1063
|
-
var
|
|
1064
|
-
const { indent:
|
|
1064
|
+
var d;
|
|
1065
|
+
const { indent: c = " " } = s, { blank: r, join: a, push: i, unshift: l } = new V({ indent: c }), f = {
|
|
1065
1066
|
method: t,
|
|
1066
1067
|
hostname: e.hostname,
|
|
1067
1068
|
port: e.port,
|
|
1068
1069
|
path: e.path,
|
|
1069
1070
|
headers: n
|
|
1070
1071
|
};
|
|
1071
|
-
switch (i(`const http = require('${(
|
|
1072
|
+
switch (i(`const http = require('${(d = e.protocol) == null ? void 0 : d.replace(":", "")}');`), r(), i(`const options = ${ue(f, { indent: c })};`), r(), i("const req = http.request(options, function (res) {"), i("const chunks = [];", 1), r(), i("res.on('data', function (chunk) {", 1), i("chunks.push(chunk);", 2), i("});", 1), r(), i("res.on('end', function () {", 1), i("const body = Buffer.concat(chunks);", 2), i("console.log(body.toString());", 2), i("});", 1), i("});"), r(), o.mimeType) {
|
|
1072
1073
|
case "application/x-www-form-urlencoded":
|
|
1073
|
-
o.paramsObj && (
|
|
1074
|
+
o.paramsObj && (l("const qs = require('querystring');"), i(
|
|
1074
1075
|
`req.write(qs.stringify(${ue(o.paramsObj, {
|
|
1075
1076
|
indent: " ",
|
|
1076
1077
|
inlineCharacterLimit: 80
|
|
@@ -1086,11 +1087,11 @@ var wa = {
|
|
|
1086
1087
|
);
|
|
1087
1088
|
break;
|
|
1088
1089
|
default:
|
|
1089
|
-
o.text && i(`req.write(${ue(o.text, { indent:
|
|
1090
|
+
o.text && i(`req.write(${ue(o.text, { indent: c })});`);
|
|
1090
1091
|
}
|
|
1091
1092
|
return i("req.end();"), a();
|
|
1092
1093
|
}
|
|
1093
|
-
},
|
|
1094
|
+
}, Xa = {
|
|
1094
1095
|
info: {
|
|
1095
1096
|
key: "request",
|
|
1096
1097
|
title: "Request",
|
|
@@ -1099,14 +1100,14 @@ var wa = {
|
|
|
1099
1100
|
extname: ".cjs",
|
|
1100
1101
|
installation: "npm install request --save"
|
|
1101
1102
|
},
|
|
1102
|
-
convert: ({ method: e, url: t, fullUrl: n, postData: o, headersObj: s, cookies:
|
|
1103
|
+
convert: ({ method: e, url: t, fullUrl: n, postData: o, headersObj: s, cookies: c }, r) => {
|
|
1103
1104
|
const a = {
|
|
1104
1105
|
indent: " ",
|
|
1105
1106
|
...r
|
|
1106
1107
|
};
|
|
1107
1108
|
let i = !1;
|
|
1108
|
-
const { push:
|
|
1109
|
-
|
|
1109
|
+
const { push: l, blank: f, join: d, unshift: y, addPostProcessor: g } = new V({ indent: a.indent });
|
|
1110
|
+
l("const request = require('request');"), f();
|
|
1110
1111
|
const x = {
|
|
1111
1112
|
method: e,
|
|
1112
1113
|
url: n
|
|
@@ -1126,24 +1127,24 @@ var wa = {
|
|
|
1126
1127
|
x.formData[$.name] = $.value;
|
|
1127
1128
|
return;
|
|
1128
1129
|
}
|
|
1129
|
-
let
|
|
1130
|
-
$.fileName ? (i = !0,
|
|
1130
|
+
let p = {};
|
|
1131
|
+
$.fileName ? (i = !0, p = {
|
|
1131
1132
|
value: `fs.createReadStream(${$.fileName})`,
|
|
1132
1133
|
options: {
|
|
1133
1134
|
filename: $.fileName,
|
|
1134
1135
|
contentType: $.contentType ? $.contentType : null
|
|
1135
1136
|
}
|
|
1136
|
-
}) : $.value && (
|
|
1137
|
+
}) : $.value && (p.value = $.value), x.formData[$.name] = p;
|
|
1137
1138
|
}), g(($) => $.replace(/'fs\.createReadStream\((.*)\)'/, "fs.createReadStream('$1')"));
|
|
1138
1139
|
break;
|
|
1139
1140
|
default:
|
|
1140
1141
|
o.text && (x.body = o.text);
|
|
1141
1142
|
}
|
|
1142
|
-
return
|
|
1143
|
-
|
|
1144
|
-
}),
|
|
1143
|
+
return c.length && (x.jar = "JAR", l("const jar = request.jar();"), c.forEach(({ name: $, value: p }) => {
|
|
1144
|
+
l(`jar.setCookie(request.cookie('${encodeURIComponent($)}=${encodeURIComponent(p)}'), '${t}');`);
|
|
1145
|
+
}), f(), g(($) => $.replace(/'JAR'/, "jar"))), i && y("const fs = require('fs');"), l(`const options = ${ue(x, { indent: " ", inlineCharacterLimit: 80 })};`), f(), l("request(options, function (error, response, body) {"), l("if (error) throw new Error(error);", 1), f(), l("console.log(body);", 1), l("});"), d();
|
|
1145
1146
|
}
|
|
1146
|
-
},
|
|
1147
|
+
}, Za = {
|
|
1147
1148
|
info: {
|
|
1148
1149
|
key: "unirest",
|
|
1149
1150
|
title: "Unirest",
|
|
@@ -1151,40 +1152,40 @@ var wa = {
|
|
|
1151
1152
|
description: "Lightweight HTTP Request Client Library",
|
|
1152
1153
|
extname: ".cjs"
|
|
1153
1154
|
},
|
|
1154
|
-
convert: ({ method: e, url: t, cookies: n, queryObj: o, postData: s, headersObj:
|
|
1155
|
+
convert: ({ method: e, url: t, cookies: n, queryObj: o, postData: s, headersObj: c }, r) => {
|
|
1155
1156
|
const a = {
|
|
1156
1157
|
indent: " ",
|
|
1157
1158
|
...r
|
|
1158
1159
|
};
|
|
1159
1160
|
let i = !1;
|
|
1160
|
-
const { addPostProcessor:
|
|
1161
|
+
const { addPostProcessor: l, blank: f, join: d, push: y, unshift: g } = new V({
|
|
1161
1162
|
indent: a.indent
|
|
1162
1163
|
});
|
|
1163
|
-
switch (
|
|
1164
|
-
|
|
1165
|
-
}),
|
|
1164
|
+
switch (y("const unirest = require('unirest');"), f(), y(`const req = unirest('${e}', '${t}');`), f(), n.length && (y("const CookieJar = unirest.jar();"), n.forEach((x) => {
|
|
1165
|
+
y(`CookieJar.add('${encodeURIComponent(x.name)}=${encodeURIComponent(x.value)}', '${t}');`);
|
|
1166
|
+
}), y("req.jar(CookieJar);"), f()), Object.keys(o).length && (y(`req.query(${ue(o, { indent: a.indent })});`), f()), Object.keys(c).length && (y(`req.headers(${ue(c, { indent: a.indent })});`), f()), s.mimeType) {
|
|
1166
1167
|
case "application/x-www-form-urlencoded":
|
|
1167
|
-
s.paramsObj && (
|
|
1168
|
+
s.paramsObj && (y(`req.form(${ue(s.paramsObj, { indent: a.indent })});`), f());
|
|
1168
1169
|
break;
|
|
1169
1170
|
case "application/json":
|
|
1170
|
-
s.jsonObj && (
|
|
1171
|
+
s.jsonObj && (y("req.type('json');"), y(`req.send(${ue(s.jsonObj, { indent: a.indent })});`), f());
|
|
1171
1172
|
break;
|
|
1172
1173
|
case "multipart/form-data": {
|
|
1173
1174
|
if (!s.params)
|
|
1174
1175
|
break;
|
|
1175
1176
|
const x = [];
|
|
1176
1177
|
s.params.forEach(($) => {
|
|
1177
|
-
const
|
|
1178
|
-
$.fileName && !$.value ? (i = !0,
|
|
1179
|
-
}),
|
|
1178
|
+
const p = {};
|
|
1179
|
+
$.fileName && !$.value ? (i = !0, p.body = `fs.createReadStream('${$.fileName}')`, l((h) => h.replace(/'fs\.createReadStream\(\\'(.+)\\'\)'/, "fs.createReadStream('$1')"))) : $.value && (p.body = $.value), p.body && ($.contentType && (p["content-type"] = $.contentType), x.push(p));
|
|
1180
|
+
}), y(`req.multipart(${ue(x, { indent: a.indent })});`), f();
|
|
1180
1181
|
break;
|
|
1181
1182
|
}
|
|
1182
1183
|
default:
|
|
1183
|
-
s.text && (
|
|
1184
|
+
s.text && (y(`req.send(${ue(s.text, { indent: a.indent })});`), f());
|
|
1184
1185
|
}
|
|
1185
|
-
return i && g("const fs = require('fs');"),
|
|
1186
|
+
return i && g("const fs = require('fs');"), y("req.end(function (res) {"), y("if (res.error) throw new Error(res.error);", 1), f(), y("console.log(res.body);", 1), y("});"), d();
|
|
1186
1187
|
}
|
|
1187
|
-
},
|
|
1188
|
+
}, ei = {
|
|
1188
1189
|
info: {
|
|
1189
1190
|
key: "node",
|
|
1190
1191
|
title: "Node.js",
|
|
@@ -1192,15 +1193,15 @@ var wa = {
|
|
|
1192
1193
|
cli: "node %s"
|
|
1193
1194
|
},
|
|
1194
1195
|
clientsById: {
|
|
1195
|
-
native:
|
|
1196
|
-
request:
|
|
1197
|
-
unirest:
|
|
1198
|
-
axios:
|
|
1199
|
-
fetch:
|
|
1196
|
+
native: Ya,
|
|
1197
|
+
request: Xa,
|
|
1198
|
+
unirest: Za,
|
|
1199
|
+
axios: Qa,
|
|
1200
|
+
fetch: Ka
|
|
1200
1201
|
}
|
|
1201
1202
|
}, gt = (e, t, n, o) => {
|
|
1202
|
-
const s = `${e} *${t} = `,
|
|
1203
|
-
return `${s}${
|
|
1203
|
+
const s = `${e} *${t} = `, c = hr(n, o ? s.length : void 0);
|
|
1204
|
+
return `${s}${c};`;
|
|
1204
1205
|
}, hr = (e, t) => {
|
|
1205
1206
|
const n = t === void 0 ? ", " : `,
|
|
1206
1207
|
${" ".repeat(t)}`;
|
|
@@ -1220,7 +1221,7 @@ var wa = {
|
|
|
1220
1221
|
default:
|
|
1221
1222
|
return e == null ? "" : `@"${e.toString().replace(/"/g, '\\"')}"`;
|
|
1222
1223
|
}
|
|
1223
|
-
},
|
|
1224
|
+
}, ti = {
|
|
1224
1225
|
info: {
|
|
1225
1226
|
key: "nsurlsession",
|
|
1226
1227
|
title: "NSURLSession",
|
|
@@ -1229,35 +1230,35 @@ var wa = {
|
|
|
1229
1230
|
extname: ".m"
|
|
1230
1231
|
},
|
|
1231
1232
|
convert: ({ allHeaders: e, postData: t, method: n, fullUrl: o }, s) => {
|
|
1232
|
-
var
|
|
1233
|
-
const
|
|
1233
|
+
var f;
|
|
1234
|
+
const c = {
|
|
1234
1235
|
indent: " ",
|
|
1235
1236
|
pretty: !0,
|
|
1236
1237
|
timeout: 10,
|
|
1237
1238
|
...s
|
|
1238
|
-
}, { push: r, join: a, blank: i } = new V({ indent:
|
|
1239
|
+
}, { push: r, join: a, blank: i } = new V({ indent: c.indent }), l = {
|
|
1239
1240
|
hasHeaders: !1,
|
|
1240
1241
|
hasBody: !1
|
|
1241
1242
|
};
|
|
1242
|
-
if (r("#import <Foundation/Foundation.h>"), Object.keys(e).length && (
|
|
1243
|
-
switch (
|
|
1243
|
+
if (r("#import <Foundation/Foundation.h>"), Object.keys(e).length && (l.hasHeaders = !0, i(), r(gt("NSDictionary", "headers", e, c.pretty))), t.text || t.jsonObj || t.params)
|
|
1244
|
+
switch (l.hasBody = !0, t.mimeType) {
|
|
1244
1245
|
case "application/x-www-form-urlencoded":
|
|
1245
|
-
if ((
|
|
1246
|
+
if ((f = t.params) != null && f.length) {
|
|
1246
1247
|
i();
|
|
1247
|
-
const [
|
|
1248
|
+
const [d, ...y] = t.params;
|
|
1248
1249
|
r(
|
|
1249
|
-
`NSMutableData *postData = [[NSMutableData alloc] initWithData:[@"${
|
|
1250
|
-
),
|
|
1250
|
+
`NSMutableData *postData = [[NSMutableData alloc] initWithData:[@"${d.name}=${d.value}" dataUsingEncoding:NSUTF8StringEncoding]];`
|
|
1251
|
+
), y.forEach(({ name: g, value: x }) => {
|
|
1251
1252
|
r(`[postData appendData:[@"&${g}=${x}" dataUsingEncoding:NSUTF8StringEncoding]];`);
|
|
1252
1253
|
});
|
|
1253
1254
|
} else
|
|
1254
|
-
|
|
1255
|
+
l.hasBody = !1;
|
|
1255
1256
|
break;
|
|
1256
1257
|
case "application/json":
|
|
1257
|
-
t.jsonObj && (r(gt("NSDictionary", "parameters", t.jsonObj,
|
|
1258
|
+
t.jsonObj && (r(gt("NSDictionary", "parameters", t.jsonObj, c.pretty)), i(), r("NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];"));
|
|
1258
1259
|
break;
|
|
1259
1260
|
case "multipart/form-data":
|
|
1260
|
-
r(gt("NSArray", "parameters", t.params || [],
|
|
1261
|
+
r(gt("NSArray", "parameters", t.params || [], c.pretty)), r(`NSString *boundary = @"${t.boundary}";`), i(), r("NSError *error;"), r("NSMutableString *body = [NSMutableString string];"), r("for (NSDictionary *param in parameters) {"), r('[body appendFormat:@"--%@\\r\\n", boundary];', 1), r('if (param[@"fileName"]) {', 1), r(
|
|
1261
1262
|
'[body appendFormat:@"Content-Disposition:form-data; name=\\"%@\\"; filename=\\"%@\\"\\r\\n", param[@"name"], param[@"fileName"]];',
|
|
1262
1263
|
2
|
|
1263
1264
|
), r('[body appendFormat:@"Content-Type: %@\\r\\n\\r\\n", param[@"contentType"]];', 2), r(
|
|
@@ -1270,23 +1271,23 @@ var wa = {
|
|
|
1270
1271
|
`NSData *postData = [[NSData alloc] initWithData:[@"${t.text}" dataUsingEncoding:NSUTF8StringEncoding]];`
|
|
1271
1272
|
);
|
|
1272
1273
|
}
|
|
1273
|
-
return i(), r(`NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"${o}"]`), r(" cachePolicy:NSURLRequestUseProtocolCachePolicy"), r(` timeoutInterval:${
|
|
1274
|
+
return i(), r(`NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"${o}"]`), r(" cachePolicy:NSURLRequestUseProtocolCachePolicy"), r(` timeoutInterval:${c.timeout.toFixed(1)}];`), r(`[request setHTTPMethod:@"${n}"];`), l.hasHeaders && r("[request setAllHTTPHeaderFields:headers];"), l.hasBody && r("[request setHTTPBody:postData];"), i(), r("NSURLSession *session = [NSURLSession sharedSession];"), r("NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request"), r(
|
|
1274
1275
|
" completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {"
|
|
1275
1276
|
), r(" if (error) {", 1), r(' NSLog(@"%@", error);', 2), r(" } else {", 1), r(
|
|
1276
1277
|
" NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;",
|
|
1277
1278
|
2
|
|
1278
1279
|
), r(' NSLog(@"%@", httpResponse);', 2), r(" }", 1), r(" }];"), r("[dataTask resume];"), a();
|
|
1279
1280
|
}
|
|
1280
|
-
},
|
|
1281
|
+
}, ri = {
|
|
1281
1282
|
info: {
|
|
1282
1283
|
key: "objc",
|
|
1283
1284
|
title: "Objective-C",
|
|
1284
1285
|
default: "nsurlsession"
|
|
1285
1286
|
},
|
|
1286
1287
|
clientsById: {
|
|
1287
|
-
nsurlsession:
|
|
1288
|
+
nsurlsession: ti
|
|
1288
1289
|
}
|
|
1289
|
-
},
|
|
1290
|
+
}, ni = {
|
|
1290
1291
|
info: {
|
|
1291
1292
|
key: "cohttp",
|
|
1292
1293
|
title: "CoHTTP",
|
|
@@ -1296,30 +1297,30 @@ var wa = {
|
|
|
1296
1297
|
installation: "opam install cohttp-lwt-unix cohttp-async"
|
|
1297
1298
|
},
|
|
1298
1299
|
convert: ({ fullUrl: e, allHeaders: t, postData: n, method: o }, s) => {
|
|
1299
|
-
const
|
|
1300
|
+
const c = {
|
|
1300
1301
|
indent: " ",
|
|
1301
1302
|
...s
|
|
1302
|
-
}, r = ["get", "post", "head", "delete", "patch", "put", "options"], { push: a, blank: i, join:
|
|
1303
|
+
}, r = ["get", "post", "head", "delete", "patch", "put", "options"], { push: a, blank: i, join: l } = new V({ indent: c.indent });
|
|
1303
1304
|
a("open Cohttp_lwt_unix"), a("open Cohttp"), a("open Lwt"), i(), a(`let uri = Uri.of_string "${e}" in`);
|
|
1304
|
-
const
|
|
1305
|
-
|
|
1306
|
-
`let headers = Header.add (Header.init ()) "${
|
|
1307
|
-
t[
|
|
1305
|
+
const f = Object.keys(t);
|
|
1306
|
+
f.length === 1 ? a(
|
|
1307
|
+
`let headers = Header.add (Header.init ()) "${f[0]}" "${ce(
|
|
1308
|
+
t[f[0]]
|
|
1308
1309
|
)}" in`
|
|
1309
|
-
) :
|
|
1310
|
+
) : f.length > 1 && (a("let headers = Header.add_list (Header.init ()) ["), f.forEach((x) => {
|
|
1310
1311
|
a(`("${x}", "${ce(t[x])}");`, 1);
|
|
1311
1312
|
}), a("] in")), n.text && a(`let body = Cohttp_lwt_body.of_string ${JSON.stringify(n.text)} in`), i();
|
|
1312
|
-
const
|
|
1313
|
-
return a(`Client.call ${
|
|
1313
|
+
const d = f.length ? "~headers " : "", y = n.text ? "~body " : "", g = r.includes(o.toLowerCase()) ? `\`${o.toUpperCase()}` : `(Code.method_of_string "${o}")`;
|
|
1314
|
+
return a(`Client.call ${d}${y}${g} uri`), a(">>= fun (res, body_stream) ->"), a("(* Do stuff with the result *)", 1), l();
|
|
1314
1315
|
}
|
|
1315
|
-
},
|
|
1316
|
+
}, oi = {
|
|
1316
1317
|
info: {
|
|
1317
1318
|
key: "ocaml",
|
|
1318
1319
|
title: "OCaml",
|
|
1319
1320
|
default: "cohttp"
|
|
1320
1321
|
},
|
|
1321
1322
|
clientsById: {
|
|
1322
|
-
cohttp:
|
|
1323
|
+
cohttp: ni
|
|
1323
1324
|
}
|
|
1324
1325
|
}, te = (e, t, n) => {
|
|
1325
1326
|
switch (n = n || "", t = t || "", Object.prototype.toString.call(e)) {
|
|
@@ -1380,7 +1381,7 @@ ${n}]`;
|
|
|
1380
1381
|
"UNLOCK",
|
|
1381
1382
|
"UPDATE",
|
|
1382
1383
|
"VERSION_CONTROL"
|
|
1383
|
-
],
|
|
1384
|
+
], ai = {
|
|
1384
1385
|
info: {
|
|
1385
1386
|
key: "curl",
|
|
1386
1387
|
title: "cURL",
|
|
@@ -1388,18 +1389,18 @@ ${n}]`;
|
|
|
1388
1389
|
description: "PHP with ext-curl",
|
|
1389
1390
|
extname: ".php"
|
|
1390
1391
|
},
|
|
1391
|
-
convert: ({ uriObj: e, postData: t, fullUrl: n, method: o, httpVersion: s, cookies:
|
|
1392
|
+
convert: ({ uriObj: e, postData: t, fullUrl: n, method: o, httpVersion: s, cookies: c, headersObj: r }, a = {}) => {
|
|
1392
1393
|
const {
|
|
1393
1394
|
closingTag: i = !1,
|
|
1394
|
-
indent:
|
|
1395
|
-
maxRedirects:
|
|
1396
|
-
namedErrors:
|
|
1397
|
-
noTags:
|
|
1395
|
+
indent: l = " ",
|
|
1396
|
+
maxRedirects: f = 10,
|
|
1397
|
+
namedErrors: d = !1,
|
|
1398
|
+
noTags: y = !1,
|
|
1398
1399
|
shortTags: g = !1,
|
|
1399
1400
|
timeout: x = 30
|
|
1400
|
-
} = a, { push: $, blank:
|
|
1401
|
-
|
|
1402
|
-
const
|
|
1401
|
+
} = a, { push: $, blank: p, join: h } = new V({ indent: l });
|
|
1402
|
+
y || ($(g ? "<?" : "<?php"), p()), $("$curl = curl_init();"), p();
|
|
1403
|
+
const m = [
|
|
1403
1404
|
{
|
|
1404
1405
|
escape: !0,
|
|
1405
1406
|
name: "CURLOPT_PORT",
|
|
@@ -1423,7 +1424,7 @@ ${n}]`;
|
|
|
1423
1424
|
{
|
|
1424
1425
|
escape: !1,
|
|
1425
1426
|
name: "CURLOPT_MAXREDIRS",
|
|
1426
|
-
value:
|
|
1427
|
+
value: f
|
|
1427
1428
|
},
|
|
1428
1429
|
{
|
|
1429
1430
|
escape: !1,
|
|
@@ -1443,22 +1444,22 @@ ${n}]`;
|
|
|
1443
1444
|
{
|
|
1444
1445
|
escape: !t.jsonObj,
|
|
1445
1446
|
name: "CURLOPT_POSTFIELDS",
|
|
1446
|
-
value: t ? t.jsonObj ? `json_encode(${te(t.jsonObj,
|
|
1447
|
+
value: t ? t.jsonObj ? `json_encode(${te(t.jsonObj, l.repeat(2), l)})` : t.text : void 0
|
|
1447
1448
|
}
|
|
1448
1449
|
];
|
|
1449
1450
|
$("curl_setopt_array($curl, [");
|
|
1450
|
-
const w = new V({ indent:
|
|
1451
|
-
${
|
|
1452
|
-
|
|
1451
|
+
const w = new V({ indent: l, join: `
|
|
1452
|
+
${l}` });
|
|
1453
|
+
m.forEach(({ value: O, name: v, escape: q }) => {
|
|
1453
1454
|
O != null && w.push(`${v} => ${q ? JSON.stringify(O) : O},`);
|
|
1454
1455
|
});
|
|
1455
|
-
const T =
|
|
1456
|
+
const T = c.map((O) => `${encodeURIComponent(O.name)}=${encodeURIComponent(O.value)}`);
|
|
1456
1457
|
T.length && w.push(`CURLOPT_COOKIE => "${T.join("; ")}",`);
|
|
1457
1458
|
const u = Object.keys(r).sort().map((O) => `"${O}: ${ce(r[O])}"`);
|
|
1458
1459
|
return u.length && (w.push("CURLOPT_HTTPHEADER => ["), w.push(u.join(`,
|
|
1459
|
-
${
|
|
1460
|
+
${l}${l}`), 1), w.push("],")), $(w.join(), 1), $("]);"), p(), $("$response = curl_exec($curl);"), $("$err = curl_error($curl);"), p(), $("curl_close($curl);"), p(), $("if ($err) {"), $(d ? 'echo array_flip(get_defined_constants(true)["curl"])[$err];' : 'echo "cURL Error #:" . $err;', 1), $("} else {"), $("echo $response;", 1), $("}"), !y && i && (p(), $("?>")), h();
|
|
1460
1461
|
}
|
|
1461
|
-
},
|
|
1462
|
+
}, ii = {
|
|
1462
1463
|
info: {
|
|
1463
1464
|
key: "guzzle",
|
|
1464
1465
|
title: "Guzzle",
|
|
@@ -1467,49 +1468,49 @@ ${c}${c}`), 1), w.push("],")), $(w.join(), 1), $("]);"), f(), $("$response = cur
|
|
|
1467
1468
|
extname: ".php",
|
|
1468
1469
|
installation: "composer require guzzlehttp/guzzle"
|
|
1469
1470
|
},
|
|
1470
|
-
convert: ({ postData: e, fullUrl: t, method: n, cookies: o, headersObj: s },
|
|
1471
|
+
convert: ({ postData: e, fullUrl: t, method: n, cookies: o, headersObj: s }, c) => {
|
|
1471
1472
|
var $;
|
|
1472
1473
|
const r = {
|
|
1473
1474
|
closingTag: !1,
|
|
1474
1475
|
indent: " ",
|
|
1475
1476
|
noTags: !1,
|
|
1476
1477
|
shortTags: !1,
|
|
1477
|
-
...
|
|
1478
|
-
}, { push: a, blank: i, join:
|
|
1478
|
+
...c
|
|
1479
|
+
}, { push: a, blank: i, join: l } = new V({ indent: r.indent }), { code: f, push: d, join: y } = new V({ indent: r.indent });
|
|
1479
1480
|
switch (r.noTags || a(r.shortTags ? "<?" : "<?php"), a("require_once('vendor/autoload.php');"), i(), e.mimeType) {
|
|
1480
1481
|
case "application/x-www-form-urlencoded":
|
|
1481
|
-
|
|
1482
|
+
d(`'form_params' => ${te(e.paramsObj, r.indent + r.indent, r.indent)},`, 1);
|
|
1482
1483
|
break;
|
|
1483
1484
|
case "multipart/form-data": {
|
|
1484
|
-
const
|
|
1485
|
-
if (e.params && e.params.forEach((
|
|
1486
|
-
if (
|
|
1487
|
-
const
|
|
1488
|
-
name:
|
|
1489
|
-
filename:
|
|
1490
|
-
contents:
|
|
1485
|
+
const p = [];
|
|
1486
|
+
if (e.params && e.params.forEach((h) => {
|
|
1487
|
+
if (h.fileName) {
|
|
1488
|
+
const m = {
|
|
1489
|
+
name: h.name,
|
|
1490
|
+
filename: h.fileName,
|
|
1491
|
+
contents: h.value
|
|
1491
1492
|
};
|
|
1492
|
-
|
|
1493
|
-
} else
|
|
1494
|
-
name:
|
|
1495
|
-
contents:
|
|
1493
|
+
h.contentType && (m.headers = { "Content-Type": h.contentType }), p.push(m);
|
|
1494
|
+
} else h.value && p.push({
|
|
1495
|
+
name: h.name,
|
|
1496
|
+
contents: h.value
|
|
1496
1497
|
});
|
|
1497
|
-
}),
|
|
1498
|
-
const
|
|
1499
|
-
|
|
1498
|
+
}), p.length && (d(`'multipart' => ${te(p, r.indent + r.indent, r.indent)}`, 1), rt(s, "content-type") && ($ = ve(s, "content-type")) != null && $.indexOf("boundary"))) {
|
|
1499
|
+
const h = fe(s, "content-type");
|
|
1500
|
+
h && delete s[h];
|
|
1500
1501
|
}
|
|
1501
1502
|
break;
|
|
1502
1503
|
}
|
|
1503
1504
|
default:
|
|
1504
|
-
e.text &&
|
|
1505
|
+
e.text && d(`'body' => ${te(e.text)},`, 1);
|
|
1505
1506
|
}
|
|
1506
|
-
const g = Object.keys(s).sort().map(function(
|
|
1507
|
-
return `${r.indent}${r.indent}'${
|
|
1508
|
-
}), x = o.map((
|
|
1509
|
-
return x.length && g.push(`${r.indent}${r.indent}'cookie' => '${ze(x)}',`), g.length && (
|
|
1510
|
-
`)),
|
|
1507
|
+
const g = Object.keys(s).sort().map(function(p) {
|
|
1508
|
+
return `${r.indent}${r.indent}'${p}' => '${ze(s[p])}',`;
|
|
1509
|
+
}), x = o.map((p) => `${encodeURIComponent(p.name)}=${encodeURIComponent(p.value)}`).join("; ");
|
|
1510
|
+
return x.length && g.push(`${r.indent}${r.indent}'cookie' => '${ze(x)}',`), g.length && (d("'headers' => [", 1), d(g.join(`
|
|
1511
|
+
`)), d("],", 1)), a("$client = new \\GuzzleHttp\\Client();"), i(), f.length ? (a(`$response = $client->request('${n}', '${t}', [`), a(y()), a("]);")) : a(`$response = $client->request('${n}', '${t}');`), i(), a("echo $response->getBody();"), !r.noTags && r.closingTag && (i(), a("?>")), l();
|
|
1511
1512
|
}
|
|
1512
|
-
},
|
|
1513
|
+
}, si = {
|
|
1513
1514
|
info: {
|
|
1514
1515
|
key: "http1",
|
|
1515
1516
|
title: "HTTP v1",
|
|
@@ -1517,21 +1518,21 @@ ${c}${c}`), 1), w.push("],")), $(w.join(), 1), $("]);"), f(), $("$response = cur
|
|
|
1517
1518
|
description: "PHP with pecl/http v1",
|
|
1518
1519
|
extname: ".php"
|
|
1519
1520
|
},
|
|
1520
|
-
convert: ({ method: e, url: t, postData: n, queryObj: o, headersObj: s, cookiesObj:
|
|
1521
|
-
const { closingTag: a = !1, indent: i = " ", noTags:
|
|
1522
|
-
switch (
|
|
1521
|
+
convert: ({ method: e, url: t, postData: n, queryObj: o, headersObj: s, cookiesObj: c }, r = {}) => {
|
|
1522
|
+
const { closingTag: a = !1, indent: i = " ", noTags: l = !1, shortTags: f = !1 } = r, { push: d, blank: y, join: g } = new V({ indent: i });
|
|
1523
|
+
switch (l || (d(f ? "<?" : "<?php"), y()), Kr.includes(e.toUpperCase()) || d(`HttpRequest::methodRegister('${e}');`), d("$request = new HttpRequest();"), d(`$request->setUrl(${te(t)});`), Kr.includes(e.toUpperCase()) ? d(`$request->setMethod(HTTP_METH_${e.toUpperCase()});`) : d(`$request->setMethod(HttpRequest::HTTP_METH_${e.toUpperCase()});`), y(), Object.keys(o).length && (d(`$request->setQueryData(${te(o, i)});`), y()), Object.keys(s).length && (d(`$request->setHeaders(${te(s, i)});`), y()), Object.keys(c).length && (d(`$request->setCookies(${te(c, i)});`), y()), n.mimeType) {
|
|
1523
1524
|
case "application/x-www-form-urlencoded":
|
|
1524
|
-
|
|
1525
|
+
d(`$request->setContentType(${te(n.mimeType)});`), d(`$request->setPostFields(${te(n.paramsObj, i)});`), y();
|
|
1525
1526
|
break;
|
|
1526
1527
|
case "application/json":
|
|
1527
|
-
|
|
1528
|
+
d(`$request->setContentType(${te(n.mimeType)});`), d(`$request->setBody(json_encode(${te(n.jsonObj, i)}));`), y();
|
|
1528
1529
|
break;
|
|
1529
1530
|
default:
|
|
1530
|
-
n.text && (
|
|
1531
|
+
n.text && (d(`$request->setBody(${te(n.text)});`), y());
|
|
1531
1532
|
}
|
|
1532
|
-
return
|
|
1533
|
+
return d("try {"), d("$response = $request->send();", 1), y(), d("echo $response->getBody();", 1), d("} catch (HttpException $ex) {"), d("echo $ex;", 1), d("}"), !l && a && (y(), d("?>")), g();
|
|
1533
1534
|
}
|
|
1534
|
-
},
|
|
1535
|
+
}, ci = {
|
|
1535
1536
|
info: {
|
|
1536
1537
|
key: "http2",
|
|
1537
1538
|
title: "HTTP v2",
|
|
@@ -1539,21 +1540,21 @@ ${c}${c}`), 1), w.push("],")), $(w.join(), 1), $("]);"), f(), $("$response = cur
|
|
|
1539
1540
|
description: "PHP with pecl/http v2",
|
|
1540
1541
|
extname: ".php"
|
|
1541
1542
|
},
|
|
1542
|
-
convert: ({ postData: e, headersObj: t, method: n, queryObj: o, cookiesObj: s, url:
|
|
1543
|
+
convert: ({ postData: e, headersObj: t, method: n, queryObj: o, cookiesObj: s, url: c }, r = {}) => {
|
|
1543
1544
|
var $;
|
|
1544
|
-
const { closingTag: a = !1, indent: i = " ", noTags:
|
|
1545
|
+
const { closingTag: a = !1, indent: i = " ", noTags: l = !1, shortTags: f = !1 } = r, { push: d, blank: y, join: g } = new V({ indent: i });
|
|
1545
1546
|
let x = !1;
|
|
1546
|
-
switch (
|
|
1547
|
+
switch (l || (d(f ? "<?" : "<?php"), y()), d("$client = new http\\Client;"), d("$request = new http\\Client\\Request;"), y(), e.mimeType) {
|
|
1547
1548
|
case "application/x-www-form-urlencoded":
|
|
1548
|
-
|
|
1549
|
+
d("$body = new http\\Message\\Body;"), d(`$body->append(new http\\QueryString(${te(e.paramsObj, i)}));`), y(), x = !0;
|
|
1549
1550
|
break;
|
|
1550
1551
|
case "multipart/form-data": {
|
|
1551
1552
|
if (!e.params)
|
|
1552
1553
|
break;
|
|
1553
|
-
const
|
|
1554
|
+
const p = [], h = {};
|
|
1554
1555
|
e.params.forEach(({ name: T, fileName: u, value: O, contentType: v }) => {
|
|
1555
1556
|
if (u) {
|
|
1556
|
-
|
|
1557
|
+
p.push({
|
|
1557
1558
|
name: T,
|
|
1558
1559
|
type: v,
|
|
1559
1560
|
file: u,
|
|
@@ -1561,25 +1562,25 @@ ${c}${c}`), 1), w.push("],")), $(w.join(), 1), $("]);"), f(), $("$response = cur
|
|
|
1561
1562
|
});
|
|
1562
1563
|
return;
|
|
1563
1564
|
}
|
|
1564
|
-
O && (
|
|
1565
|
+
O && (h[T] = O);
|
|
1565
1566
|
});
|
|
1566
|
-
const
|
|
1567
|
-
if (
|
|
1567
|
+
const m = Object.keys(h).length ? te(h, i) : "null", w = p.length ? te(p, i) : "null";
|
|
1568
|
+
if (d("$body = new http\\Message\\Body;"), d(`$body->addForm(${m}, ${w});`), rt(t, "content-type") && ($ = ve(t, "content-type")) != null && $.indexOf("boundary")) {
|
|
1568
1569
|
const T = fe(t, "content-type");
|
|
1569
1570
|
T && delete t[T];
|
|
1570
1571
|
}
|
|
1571
|
-
|
|
1572
|
+
y(), x = !0;
|
|
1572
1573
|
break;
|
|
1573
1574
|
}
|
|
1574
1575
|
case "application/json":
|
|
1575
|
-
|
|
1576
|
+
d("$body = new http\\Message\\Body;"), d(`$body->append(json_encode(${te(e.jsonObj, i)}));`), x = !0;
|
|
1576
1577
|
break;
|
|
1577
1578
|
default:
|
|
1578
|
-
e.text && (
|
|
1579
|
+
e.text && (d("$body = new http\\Message\\Body;"), d(`$body->append(${te(e.text)});`), y(), x = !0);
|
|
1579
1580
|
}
|
|
1580
|
-
return
|
|
1581
|
+
return d(`$request->setRequestUrl(${te(c)});`), d(`$request->setRequestMethod(${te(n)});`), x && (d("$request->setBody($body);"), y()), Object.keys(o).length && (d(`$request->setQuery(new http\\QueryString(${te(o, i)}));`), y()), Object.keys(t).length && (d(`$request->setHeaders(${te(t, i)});`), y()), Object.keys(s).length && (y(), d(`$client->setCookies(${te(s, i)});`), y()), d("$client->enqueue($request)->send();"), d("$response = $client->getResponse();"), y(), d("echo $response->getBody();"), !l && a && (y(), d("?>")), g();
|
|
1581
1582
|
}
|
|
1582
|
-
},
|
|
1583
|
+
}, li = {
|
|
1583
1584
|
info: {
|
|
1584
1585
|
key: "php",
|
|
1585
1586
|
title: "PHP",
|
|
@@ -1587,24 +1588,24 @@ ${c}${c}`), 1), w.push("],")), $(w.join(), 1), $("]);"), f(), $("$response = cur
|
|
|
1587
1588
|
cli: "php %s"
|
|
1588
1589
|
},
|
|
1589
1590
|
clientsById: {
|
|
1590
|
-
curl:
|
|
1591
|
-
guzzle:
|
|
1592
|
-
http1:
|
|
1593
|
-
http2:
|
|
1591
|
+
curl: ai,
|
|
1592
|
+
guzzle: ii,
|
|
1593
|
+
http1: si,
|
|
1594
|
+
http2: ci
|
|
1594
1595
|
}
|
|
1595
|
-
}, lo = (e) => ({ method: n, headersObj: o, cookies: s, uriObj:
|
|
1596
|
-
const { push:
|
|
1596
|
+
}, lo = (e) => ({ method: n, headersObj: o, cookies: s, uriObj: c, fullUrl: r, postData: a, allHeaders: i }) => {
|
|
1597
|
+
const { push: l, join: f } = new V();
|
|
1597
1598
|
if (!["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"].includes(n.toUpperCase()))
|
|
1598
1599
|
return "Method not supported";
|
|
1599
|
-
const
|
|
1600
|
-
return g.length && (
|
|
1601
|
-
x !== "connection" &&
|
|
1602
|
-
}),
|
|
1603
|
-
|
|
1604
|
-
}),
|
|
1600
|
+
const y = [], g = Object.keys(o);
|
|
1601
|
+
return g.length && (l("$headers=@{}"), g.forEach((x) => {
|
|
1602
|
+
x !== "connection" && l(`$headers.Add("${x}", "${Me(o[x], { escapeChar: "`" })}")`);
|
|
1603
|
+
}), y.push("-Headers $headers")), s.length && (l("$session = New-Object Microsoft.PowerShell.Commands.WebRequestSession"), s.forEach((x) => {
|
|
1604
|
+
l("$cookie = New-Object System.Net.Cookie"), l(`$cookie.Name = '${x.name}'`), l(`$cookie.Value = '${x.value}'`), l(`$cookie.Domain = '${c.host}'`), l("$session.Cookies.Add($cookie)");
|
|
1605
|
+
}), y.push("-WebSession $session")), a.text && (y.push(
|
|
1605
1606
|
`-ContentType '${Me(ve(i, "content-type"), { delimiter: "'", escapeChar: "`" })}'`
|
|
1606
|
-
),
|
|
1607
|
-
},
|
|
1607
|
+
), y.push(`-Body '${a.text}'`)), l(`$response = ${e} -Uri '${r}' -Method ${n} ${y.join(" ")}`.trim()), f();
|
|
1608
|
+
}, ui = {
|
|
1608
1609
|
info: {
|
|
1609
1610
|
key: "restmethod",
|
|
1610
1611
|
title: "Invoke-RestMethod",
|
|
@@ -1613,7 +1614,7 @@ ${c}${c}`), 1), w.push("],")), $(w.join(), 1), $("]);"), f(), $("$response = cur
|
|
|
1613
1614
|
extname: ".ps1"
|
|
1614
1615
|
},
|
|
1615
1616
|
convert: lo("Invoke-RestMethod")
|
|
1616
|
-
},
|
|
1617
|
+
}, fi = {
|
|
1617
1618
|
info: {
|
|
1618
1619
|
key: "webrequest",
|
|
1619
1620
|
title: "Invoke-WebRequest",
|
|
@@ -1622,23 +1623,23 @@ ${c}${c}`), 1), w.push("],")), $(w.join(), 1), $("]);"), f(), $("$response = cur
|
|
|
1622
1623
|
extname: ".ps1"
|
|
1623
1624
|
},
|
|
1624
1625
|
convert: lo("Invoke-WebRequest")
|
|
1625
|
-
},
|
|
1626
|
+
}, pi = {
|
|
1626
1627
|
info: {
|
|
1627
1628
|
key: "powershell",
|
|
1628
1629
|
title: "Powershell",
|
|
1629
1630
|
default: "webrequest"
|
|
1630
1631
|
},
|
|
1631
1632
|
clientsById: {
|
|
1632
|
-
webrequest:
|
|
1633
|
-
restmethod:
|
|
1633
|
+
webrequest: fi,
|
|
1634
|
+
restmethod: ui
|
|
1634
1635
|
}
|
|
1635
1636
|
};
|
|
1636
1637
|
function Yr(e, t, n, o, s) {
|
|
1637
|
-
const
|
|
1638
|
-
${
|
|
1638
|
+
const c = o.repeat(s), r = o.repeat(s - 1), a = n ? `,
|
|
1639
|
+
${c}` : ", ", i = e === "object" ? "{" : "[", l = e === "object" ? "}" : "]";
|
|
1639
1640
|
return n ? `${i}
|
|
1640
|
-
${
|
|
1641
|
-
${r}${
|
|
1641
|
+
${c}${t.join(a)}
|
|
1642
|
+
${r}${l}` : e === "object" && t.length > 0 ? `${i} ${t.join(a)} ${l}` : `${i}${t.join(a)}${l}`;
|
|
1642
1643
|
}
|
|
1643
1644
|
var Le = (e, t, n) => {
|
|
1644
1645
|
switch (n = n === void 0 ? 1 : n + 1, Object.prototype.toString.call(e)) {
|
|
@@ -1646,7 +1647,7 @@ var Le = (e, t, n) => {
|
|
|
1646
1647
|
return e;
|
|
1647
1648
|
case "[object Array]": {
|
|
1648
1649
|
let o = !1;
|
|
1649
|
-
const s = e.map((
|
|
1650
|
+
const s = e.map((c) => (Object.prototype.toString.call(c) === "[object Object]" && (o = Object.keys(c).length > 1), Le(c, t, n)));
|
|
1650
1651
|
return Yr("array", s, o, t.indent, n);
|
|
1651
1652
|
}
|
|
1652
1653
|
case "[object Object]": {
|
|
@@ -1662,7 +1663,7 @@ var Le = (e, t, n) => {
|
|
|
1662
1663
|
default:
|
|
1663
1664
|
return e == null ? "" : `"${e.toString().replace(/"/g, '\\"')}"`;
|
|
1664
1665
|
}
|
|
1665
|
-
},
|
|
1666
|
+
}, di = ["HEAD", "GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"], hi = {
|
|
1666
1667
|
info: {
|
|
1667
1668
|
key: "requests",
|
|
1668
1669
|
title: "Requests",
|
|
@@ -1672,63 +1673,63 @@ var Le = (e, t, n) => {
|
|
|
1672
1673
|
installation: "python -m pip install requests"
|
|
1673
1674
|
},
|
|
1674
1675
|
convert: ({ fullUrl: e, postData: t, allHeaders: n, method: o }, s) => {
|
|
1675
|
-
const
|
|
1676
|
+
const c = {
|
|
1676
1677
|
indent: " ",
|
|
1677
1678
|
pretty: !0,
|
|
1678
1679
|
...s
|
|
1679
|
-
}, { push: r, blank: a, join: i, addPostProcessor:
|
|
1680
|
+
}, { push: r, blank: a, join: i, addPostProcessor: l } = new V({ indent: c.indent });
|
|
1680
1681
|
r("import requests"), a(), r(`url = "${e}"`), a();
|
|
1681
|
-
const
|
|
1682
|
-
let
|
|
1683
|
-
const
|
|
1682
|
+
const f = n;
|
|
1683
|
+
let d = {};
|
|
1684
|
+
const y = {};
|
|
1684
1685
|
let g = !1, x = !1, $ = !1;
|
|
1685
1686
|
switch (t.mimeType) {
|
|
1686
1687
|
case "application/json":
|
|
1687
|
-
t.jsonObj && (r(`payload = ${Le(t.jsonObj,
|
|
1688
|
+
t.jsonObj && (r(`payload = ${Le(t.jsonObj, c)}`), $ = !0, x = !0);
|
|
1688
1689
|
break;
|
|
1689
1690
|
case "multipart/form-data":
|
|
1690
1691
|
if (!t.params)
|
|
1691
1692
|
break;
|
|
1692
|
-
if (
|
|
1693
|
-
|
|
1693
|
+
if (d = {}, t.params.forEach((m) => {
|
|
1694
|
+
m.fileName ? (m.contentType ? y[m.name] = `('${m.fileName}', open('${m.fileName}', 'rb'), '${m.contentType}')` : y[m.name] = `('${m.fileName}', open('${m.fileName}', 'rb'))`, g = !0) : (d[m.name] = m.value, x = !0);
|
|
1694
1695
|
}), g) {
|
|
1695
|
-
r(`files = ${Le(
|
|
1696
|
-
const
|
|
1697
|
-
|
|
1696
|
+
r(`files = ${Le(y, c)}`), x && r(`payload = ${Le(d, c)}`);
|
|
1697
|
+
const m = fe(f, "content-type");
|
|
1698
|
+
m && delete f[m];
|
|
1698
1699
|
} else {
|
|
1699
|
-
const
|
|
1700
|
-
|
|
1700
|
+
const m = JSON.stringify(t.text);
|
|
1701
|
+
m && (r(`payload = ${m}`), x = !0);
|
|
1701
1702
|
}
|
|
1702
|
-
|
|
1703
|
-
(
|
|
1703
|
+
l(
|
|
1704
|
+
(m) => m.replace(/"\('(.+)', open\('(.+)', 'rb'\)\)"/g, '("$1", open("$2", "rb"))').replace(/"\('(.+)', open\('(.+)', 'rb'\), '(.+)'\)"/g, '("$1", open("$2", "rb"), "$3")')
|
|
1704
1705
|
);
|
|
1705
1706
|
break;
|
|
1706
1707
|
default: {
|
|
1707
1708
|
if (t.mimeType === "application/x-www-form-urlencoded" && t.paramsObj) {
|
|
1708
|
-
r(`payload = ${Le(t.paramsObj,
|
|
1709
|
+
r(`payload = ${Le(t.paramsObj, c)}`), x = !0;
|
|
1709
1710
|
break;
|
|
1710
1711
|
}
|
|
1711
|
-
const
|
|
1712
|
-
|
|
1712
|
+
const m = JSON.stringify(t.text);
|
|
1713
|
+
m && (r(`payload = ${m}`), x = !0);
|
|
1713
1714
|
}
|
|
1714
1715
|
}
|
|
1715
|
-
const
|
|
1716
|
-
if (
|
|
1716
|
+
const p = Object.keys(f).length;
|
|
1717
|
+
if (p === 0 && (x || g))
|
|
1717
1718
|
a();
|
|
1718
|
-
else if (
|
|
1719
|
-
Object.keys(
|
|
1720
|
-
r(`headers = {"${
|
|
1719
|
+
else if (p === 1)
|
|
1720
|
+
Object.keys(f).forEach((m) => {
|
|
1721
|
+
r(`headers = {"${m}": "${ce(f[m])}"}`), a();
|
|
1721
1722
|
});
|
|
1722
|
-
else if (
|
|
1723
|
-
let
|
|
1724
|
-
r("headers = {"), Object.keys(
|
|
1725
|
-
r(
|
|
1723
|
+
else if (p > 1) {
|
|
1724
|
+
let m = 1;
|
|
1725
|
+
r("headers = {"), Object.keys(f).forEach((w) => {
|
|
1726
|
+
r(m !== p ? `"${w}": "${ce(f[w])}",` : `"${w}": "${ce(f[w])}"`, 1), m += 1;
|
|
1726
1727
|
}), r("}"), a();
|
|
1727
1728
|
}
|
|
1728
|
-
let
|
|
1729
|
-
return x && ($ ?
|
|
1729
|
+
let h = di.includes(o) ? `response = requests.${o.toLowerCase()}(url` : `response = requests.request("${o}", url`;
|
|
1730
|
+
return x && ($ ? h += ", json=payload" : h += ", data=payload"), g && (h += ", files=files"), p > 0 && (h += ", headers=headers"), h += ")", r(h), a(), r("print(response.text)"), i();
|
|
1730
1731
|
}
|
|
1731
|
-
},
|
|
1732
|
+
}, yi = {
|
|
1732
1733
|
info: {
|
|
1733
1734
|
key: "python",
|
|
1734
1735
|
title: "Python",
|
|
@@ -1736,9 +1737,9 @@ var Le = (e, t, n) => {
|
|
|
1736
1737
|
cli: "python3 %s"
|
|
1737
1738
|
},
|
|
1738
1739
|
clientsById: {
|
|
1739
|
-
requests:
|
|
1740
|
+
requests: hi
|
|
1740
1741
|
}
|
|
1741
|
-
},
|
|
1742
|
+
}, mi = {
|
|
1742
1743
|
info: {
|
|
1743
1744
|
key: "httr",
|
|
1744
1745
|
title: "httr",
|
|
@@ -1746,17 +1747,17 @@ var Le = (e, t, n) => {
|
|
|
1746
1747
|
description: "httr: Tools for Working with URLs and HTTP",
|
|
1747
1748
|
extname: ".r"
|
|
1748
1749
|
},
|
|
1749
|
-
convert: ({ url: e, queryObj: t, queryString: n, postData: o, allHeaders: s, method:
|
|
1750
|
+
convert: ({ url: e, queryObj: t, queryString: n, postData: o, allHeaders: s, method: c }) => {
|
|
1750
1751
|
const { push: r, blank: a, join: i } = new V();
|
|
1751
1752
|
r("library(httr)"), a(), r(`url <- "${e}"`), a();
|
|
1752
|
-
const
|
|
1753
|
+
const l = t;
|
|
1753
1754
|
delete t.key;
|
|
1754
|
-
const
|
|
1755
|
-
n.length === 1 ? (r(`queryString <- list(${Object.keys(
|
|
1756
|
-
O !==
|
|
1755
|
+
const f = Object.keys(l).length;
|
|
1756
|
+
n.length === 1 ? (r(`queryString <- list(${Object.keys(l)} = "${Object.values(l).toString()}")`), a()) : n.length > 1 && (r("queryString <- list("), Object.keys(l).forEach((u, O) => {
|
|
1757
|
+
O !== f - 1 ? r(` ${u} = "${l[u].toString()}",`) : r(` ${u} = "${l[u].toString()}"`);
|
|
1757
1758
|
}), r(")"), a());
|
|
1758
|
-
const
|
|
1759
|
-
if (
|
|
1759
|
+
const d = JSON.stringify(o.text);
|
|
1760
|
+
if (d && (r(`payload <- ${d}`), a()), o.text || o.jsonObj || o.params)
|
|
1760
1761
|
switch (o.mimeType) {
|
|
1761
1762
|
case "application/x-www-form-urlencoded":
|
|
1762
1763
|
r('encode <- "form"'), a();
|
|
@@ -1771,22 +1772,22 @@ var Le = (e, t, n) => {
|
|
|
1771
1772
|
r('encode <- "raw"'), a();
|
|
1772
1773
|
break;
|
|
1773
1774
|
}
|
|
1774
|
-
const
|
|
1775
|
-
let w = `response <- VERB("${
|
|
1776
|
-
|
|
1777
|
-
const T = [
|
|
1775
|
+
const y = ve(s, "cookie"), g = ve(s, "accept"), x = y ? `set_cookies(\`${String(y).replace(/;/g, '", `').replace(/` /g, "`").replace(/[=]/g, '` = "')}")` : void 0, $ = g ? `accept("${ce(g)}")` : void 0, p = `content_type("${ce(o.mimeType)}")`, h = Object.entries(s).filter(([u]) => !["cookie", "accept", "content-type"].includes(u.toLowerCase())).map(([u, O]) => `'${u}' = '${ze(O)}'`).join(", "), m = h ? `add_headers(${h})` : void 0;
|
|
1776
|
+
let w = `response <- VERB("${c}", url`;
|
|
1777
|
+
d && (w += ", body = payload"), n.length && (w += ", query = queryString");
|
|
1778
|
+
const T = [m, p, $, x].filter((u) => !!u).join(", ");
|
|
1778
1779
|
return T && (w += `, ${T}`), (o.text || o.jsonObj || o.params) && (w += ", encode = encode"), w += ")", r(w), a(), r('content(response, "text")'), i();
|
|
1779
1780
|
}
|
|
1780
|
-
},
|
|
1781
|
+
}, gi = {
|
|
1781
1782
|
info: {
|
|
1782
1783
|
key: "r",
|
|
1783
1784
|
title: "R",
|
|
1784
1785
|
default: "httr"
|
|
1785
1786
|
},
|
|
1786
1787
|
clientsById: {
|
|
1787
|
-
httr:
|
|
1788
|
+
httr: mi
|
|
1788
1789
|
}
|
|
1789
|
-
},
|
|
1790
|
+
}, vi = {
|
|
1790
1791
|
info: {
|
|
1791
1792
|
key: "native",
|
|
1792
1793
|
title: "net::http",
|
|
@@ -1795,9 +1796,9 @@ var Le = (e, t, n) => {
|
|
|
1795
1796
|
extname: ".rb"
|
|
1796
1797
|
},
|
|
1797
1798
|
convert: ({ uriObj: e, method: t, fullUrl: n, postData: o, allHeaders: s }) => {
|
|
1798
|
-
const { push:
|
|
1799
|
-
|
|
1800
|
-
const i = t.toUpperCase(),
|
|
1799
|
+
const { push: c, blank: r, join: a } = new V();
|
|
1800
|
+
c("require 'uri'"), c("require 'net/http'"), r();
|
|
1801
|
+
const i = t.toUpperCase(), l = [
|
|
1801
1802
|
"GET",
|
|
1802
1803
|
"POST",
|
|
1803
1804
|
"HEAD",
|
|
@@ -1810,23 +1811,23 @@ var Le = (e, t, n) => {
|
|
|
1810
1811
|
"UNLOCK",
|
|
1811
1812
|
"MOVE",
|
|
1812
1813
|
"TRACE"
|
|
1813
|
-
],
|
|
1814
|
-
|
|
1815
|
-
const
|
|
1816
|
-
return
|
|
1817
|
-
|
|
1818
|
-
}), o.text &&
|
|
1814
|
+
], f = i.charAt(0) + i.substring(1).toLowerCase();
|
|
1815
|
+
l.includes(i) || (c(`class Net::HTTP::${f} < Net::HTTPRequest`), c(` METHOD = '${i.toUpperCase()}'`), c(` REQUEST_HAS_BODY = '${o.text ? "true" : "false"}'`), c(" RESPONSE_HAS_BODY = true"), c("end"), r()), c(`url = URI("${n}")`), r(), c("http = Net::HTTP.new(url.host, url.port)"), e.protocol === "https:" && c("http.use_ssl = true"), r(), c(`request = Net::HTTP::${f}.new(url)`);
|
|
1816
|
+
const d = Object.keys(s);
|
|
1817
|
+
return d.length && d.forEach((y) => {
|
|
1818
|
+
c(`request["${y}"] = '${ze(s[y])}'`);
|
|
1819
|
+
}), o.text && c(`request.body = ${JSON.stringify(o.text)}`), r(), c("response = http.request(request)"), c("puts response.read_body"), a();
|
|
1819
1820
|
}
|
|
1820
|
-
},
|
|
1821
|
+
}, bi = {
|
|
1821
1822
|
info: {
|
|
1822
1823
|
key: "ruby",
|
|
1823
1824
|
title: "Ruby",
|
|
1824
1825
|
default: "native"
|
|
1825
1826
|
},
|
|
1826
1827
|
clientsById: {
|
|
1827
|
-
native:
|
|
1828
|
+
native: vi
|
|
1828
1829
|
}
|
|
1829
|
-
}, le = (e = "") => /^[a-z0-9-_/.@%^=:]+$/i.test(e) ? e : `'${e.replace(/'/g, "'\\''")}'`,
|
|
1830
|
+
}, le = (e = "") => /^[a-z0-9-_/.@%^=:]+$/i.test(e) ? e : `'${e.replace(/'/g, "'\\''")}'`, xi = (e) => e.replace(/\r/g, "\\r").replace(/\n/g, "\\n"), $i = {
|
|
1830
1831
|
"http1.0": "0",
|
|
1831
1832
|
"url ": "",
|
|
1832
1833
|
cookie: "b",
|
|
@@ -1836,13 +1837,13 @@ var Le = (e, t, n) => {
|
|
|
1836
1837
|
header: "H",
|
|
1837
1838
|
insecure: "k",
|
|
1838
1839
|
request: "X"
|
|
1839
|
-
},
|
|
1840
|
+
}, ji = (e) => (t) => {
|
|
1840
1841
|
if (e) {
|
|
1841
|
-
const n =
|
|
1842
|
+
const n = $i[t];
|
|
1842
1843
|
return n ? `-${n}` : "";
|
|
1843
1844
|
}
|
|
1844
1845
|
return `--${t}`;
|
|
1845
|
-
},
|
|
1846
|
+
}, wi = {
|
|
1846
1847
|
info: {
|
|
1847
1848
|
key: "curl",
|
|
1848
1849
|
title: "cURL",
|
|
@@ -1850,67 +1851,67 @@ var Le = (e, t, n) => {
|
|
|
1850
1851
|
description: "cURL is a command line tool and library for transferring data with URL syntax",
|
|
1851
1852
|
extname: ".sh"
|
|
1852
1853
|
},
|
|
1853
|
-
convert: ({ fullUrl: e, method: t, httpVersion: n, headersObj: o, allHeaders: s, postData:
|
|
1854
|
-
var
|
|
1855
|
-
const { indent: a = " ", short: i = !1, binary:
|
|
1854
|
+
convert: ({ fullUrl: e, method: t, httpVersion: n, headersObj: o, allHeaders: s, postData: c }, r = {}) => {
|
|
1855
|
+
var p;
|
|
1856
|
+
const { indent: a = " ", short: i = !1, binary: l = !1, globOff: f = !1 } = r, d = " ", { push: y, join: g } = new V({
|
|
1856
1857
|
...typeof a == "string" ? { indent: a } : {},
|
|
1857
1858
|
join: a !== !1 ? ` \\
|
|
1858
1859
|
${a}` : " "
|
|
1859
|
-
}), x =
|
|
1860
|
+
}), x = ji(i);
|
|
1860
1861
|
let $ = le(e);
|
|
1861
|
-
if (
|
|
1862
|
-
const
|
|
1863
|
-
if (
|
|
1864
|
-
const
|
|
1865
|
-
if (
|
|
1866
|
-
const w = String(
|
|
1867
|
-
o[
|
|
1862
|
+
if (y(`curl ${x("request")} ${t}`), f && ($ = unescape($), y(x("globoff"))), y(`${x("url ")}${$}`), n === "HTTP/1.0" && y(x("http1.0")), ve(s, "accept-encoding") && y("--compressed"), c.mimeType === "multipart/form-data") {
|
|
1863
|
+
const h = fe(o, "content-type");
|
|
1864
|
+
if (h) {
|
|
1865
|
+
const m = o[h];
|
|
1866
|
+
if (h && m) {
|
|
1867
|
+
const w = String(m).replace(/; boundary.+?(?=(;|$))/, "");
|
|
1868
|
+
o[h] = w, s[h] = w;
|
|
1868
1869
|
}
|
|
1869
1870
|
}
|
|
1870
1871
|
}
|
|
1871
|
-
switch (Object.keys(o).sort().forEach((
|
|
1872
|
-
const
|
|
1873
|
-
|
|
1874
|
-
}), s.cookie &&
|
|
1872
|
+
switch (Object.keys(o).sort().forEach((h) => {
|
|
1873
|
+
const m = `${h}: ${o[h]}`;
|
|
1874
|
+
y(`${x("header")} ${le(m)}`);
|
|
1875
|
+
}), s.cookie && y(`${x("cookie")} ${le(s.cookie)}`), c.mimeType) {
|
|
1875
1876
|
case "multipart/form-data":
|
|
1876
|
-
(
|
|
1877
|
+
(p = c.params) == null || p.forEach((m) => {
|
|
1877
1878
|
let w = "";
|
|
1878
|
-
|
|
1879
|
+
m.fileName ? w = `${m.name}='@${m.fileName}'` : w = le(`${m.name}=${m.value}`), y(`${x("form")} ${w}`);
|
|
1879
1880
|
});
|
|
1880
1881
|
break;
|
|
1881
1882
|
case "application/x-www-form-urlencoded":
|
|
1882
|
-
|
|
1883
|
-
const w =
|
|
1884
|
-
|
|
1885
|
-
}) :
|
|
1883
|
+
c.params ? c.params.forEach((m) => {
|
|
1884
|
+
const w = m.name, T = encodeURIComponent(m.name), u = T !== w, O = u ? T : w, v = l ? "--data-binary" : u ? "--data-urlencode" : x("data");
|
|
1885
|
+
y(`${v} ${le(`${O}=${m.value}`)}`);
|
|
1886
|
+
}) : y(`${l ? "--data-binary" : x("data")} ${le(c.text)}`);
|
|
1886
1887
|
break;
|
|
1887
1888
|
default:
|
|
1888
|
-
if (!
|
|
1889
|
+
if (!c.text)
|
|
1889
1890
|
break;
|
|
1890
|
-
let
|
|
1891
|
-
if (
|
|
1891
|
+
let h = !1;
|
|
1892
|
+
if (ja(c.mimeType) && c.text.length > 20)
|
|
1892
1893
|
try {
|
|
1893
|
-
const
|
|
1894
|
-
|
|
1895
|
-
`${
|
|
1894
|
+
const m = JSON.parse(c.text);
|
|
1895
|
+
h = !0, c.text.indexOf("'") > 0 ? y(
|
|
1896
|
+
`${l ? "--data-binary" : x("data")} @- <<EOF
|
|
1896
1897
|
${JSON.stringify(
|
|
1897
|
-
|
|
1898
|
+
m,
|
|
1898
1899
|
null,
|
|
1899
|
-
|
|
1900
|
+
d
|
|
1900
1901
|
)}
|
|
1901
1902
|
EOF`
|
|
1902
|
-
) :
|
|
1903
|
-
`${
|
|
1904
|
-
${JSON.stringify(
|
|
1903
|
+
) : y(
|
|
1904
|
+
`${l ? "--data-binary" : x("data")} '
|
|
1905
|
+
${JSON.stringify(m, null, d)}
|
|
1905
1906
|
'`
|
|
1906
1907
|
);
|
|
1907
1908
|
} catch {
|
|
1908
1909
|
}
|
|
1909
|
-
|
|
1910
|
+
h || y(`${l ? "--data-binary" : x("data")} ${le(c.text)}`);
|
|
1910
1911
|
}
|
|
1911
1912
|
return g();
|
|
1912
1913
|
}
|
|
1913
|
-
},
|
|
1914
|
+
}, Si = {
|
|
1914
1915
|
info: {
|
|
1915
1916
|
key: "httpie",
|
|
1916
1917
|
title: "HTTPie",
|
|
@@ -1919,7 +1920,7 @@ ${JSON.stringify(y, null, m)}
|
|
|
1919
1920
|
extname: ".sh",
|
|
1920
1921
|
installation: "brew install httpie"
|
|
1921
1922
|
},
|
|
1922
|
-
convert: ({ allHeaders: e, postData: t, queryObj: n, fullUrl: o, method: s, url:
|
|
1923
|
+
convert: ({ allHeaders: e, postData: t, queryObj: n, fullUrl: o, method: s, url: c }, r) => {
|
|
1923
1924
|
const a = {
|
|
1924
1925
|
body: !1,
|
|
1925
1926
|
cert: !1,
|
|
@@ -1934,32 +1935,32 @@ ${JSON.stringify(y, null, m)}
|
|
|
1934
1935
|
verbose: !1,
|
|
1935
1936
|
verify: !1,
|
|
1936
1937
|
...r
|
|
1937
|
-
}, { push: i, join:
|
|
1938
|
+
}, { push: i, join: l, unshift: f } = new V({
|
|
1938
1939
|
indent: a.indent,
|
|
1939
1940
|
// @ts-expect-error SEEMS LEGIT
|
|
1940
1941
|
join: a.indent !== !1 ? ` \\
|
|
1941
1942
|
${a.indent}` : " "
|
|
1942
1943
|
});
|
|
1943
|
-
let
|
|
1944
|
-
const
|
|
1945
|
-
a.headers &&
|
|
1944
|
+
let d = !1;
|
|
1945
|
+
const y = [];
|
|
1946
|
+
a.headers && y.push(a.short ? "-h" : "--headers"), a.body && y.push(a.short ? "-b" : "--body"), a.verbose && y.push(a.short ? "-v" : "--verbose"), a.print && y.push(`${a.short ? "-p" : "--print"}=${a.print}`), a.verify && y.push(`--verify=${a.verify}`), a.cert && y.push(`--cert=${a.cert}`), a.pretty && y.push(`--pretty=${a.pretty}`), a.style && y.push(`--style=${a.style}`), a.timeout && y.push(`--timeout=${a.timeout}`), a.queryParams && Object.keys(n).forEach((x) => {
|
|
1946
1947
|
const $ = n[x];
|
|
1947
|
-
Array.isArray($) ? $.forEach((
|
|
1948
|
-
i(`${x}==${le(
|
|
1948
|
+
Array.isArray($) ? $.forEach((p) => {
|
|
1949
|
+
i(`${x}==${le(p)}`);
|
|
1949
1950
|
}) : i(`${x}==${le($)}`);
|
|
1950
1951
|
}), Object.keys(e).sort().forEach((x) => {
|
|
1951
1952
|
i(`${x}:${le(e[x])}`);
|
|
1952
|
-
}), t.mimeType === "application/x-www-form-urlencoded" ? t.params && t.params.length && (
|
|
1953
|
+
}), t.mimeType === "application/x-www-form-urlencoded" ? t.params && t.params.length && (y.push(a.short ? "-f" : "--form"), t.params.forEach((x) => {
|
|
1953
1954
|
i(`${x.name}=${le(x.value)}`);
|
|
1954
|
-
})) :
|
|
1955
|
-
const g =
|
|
1956
|
-
if (
|
|
1955
|
+
})) : d = !0;
|
|
1956
|
+
const g = y.length ? `${y.join(" ")} ` : "";
|
|
1957
|
+
if (c = le(a.queryParams ? c : o), f(`http ${g}${s} ${c}`), d && t.text) {
|
|
1957
1958
|
const x = le(t.text);
|
|
1958
|
-
|
|
1959
|
+
f(`echo ${x} | `);
|
|
1959
1960
|
}
|
|
1960
|
-
return
|
|
1961
|
+
return l();
|
|
1961
1962
|
}
|
|
1962
|
-
},
|
|
1963
|
+
}, Oi = {
|
|
1963
1964
|
info: {
|
|
1964
1965
|
key: "wget",
|
|
1965
1966
|
title: "Wget",
|
|
@@ -1968,22 +1969,22 @@ ${a.indent}` : " "
|
|
|
1968
1969
|
extname: ".sh"
|
|
1969
1970
|
},
|
|
1970
1971
|
convert: ({ method: e, postData: t, allHeaders: n, fullUrl: o }, s) => {
|
|
1971
|
-
const
|
|
1972
|
+
const c = {
|
|
1972
1973
|
indent: " ",
|
|
1973
1974
|
short: !1,
|
|
1974
1975
|
verbose: !1,
|
|
1975
1976
|
...s
|
|
1976
1977
|
}, { push: r, join: a } = new V({
|
|
1977
|
-
...typeof
|
|
1978
|
-
join:
|
|
1979
|
-
${
|
|
1978
|
+
...typeof c.indent == "string" ? { indent: c.indent } : {},
|
|
1979
|
+
join: c.indent !== !1 ? ` \\
|
|
1980
|
+
${c.indent}` : " "
|
|
1980
1981
|
});
|
|
1981
|
-
return
|
|
1982
|
-
const
|
|
1983
|
-
r(`--header ${le(
|
|
1984
|
-
}), t.text && r(`--body-data ${
|
|
1982
|
+
return c.verbose ? r(`wget ${c.short ? "-v" : "--verbose"}`) : r(`wget ${c.short ? "-q" : "--quiet"}`), r(`--method ${le(e)}`), Object.keys(n).forEach((i) => {
|
|
1983
|
+
const l = `${i}: ${n[i]}`;
|
|
1984
|
+
r(`--header ${le(l)}`);
|
|
1985
|
+
}), t.text && r(`--body-data ${xi(le(t.text))}`), r(c.short ? "-O" : "--output-document"), r(`- ${le(o)}`), a();
|
|
1985
1986
|
}
|
|
1986
|
-
},
|
|
1987
|
+
}, Ti = {
|
|
1987
1988
|
info: {
|
|
1988
1989
|
key: "shell",
|
|
1989
1990
|
title: "Shell",
|
|
@@ -1991,23 +1992,23 @@ ${l.indent}` : " "
|
|
|
1991
1992
|
cli: "%s"
|
|
1992
1993
|
},
|
|
1993
1994
|
clientsById: {
|
|
1994
|
-
curl:
|
|
1995
|
-
httpie:
|
|
1996
|
-
wget:
|
|
1995
|
+
curl: wi,
|
|
1996
|
+
httpie: Si,
|
|
1997
|
+
wget: Oi
|
|
1997
1998
|
}
|
|
1998
1999
|
}, Xr = (e, t) => t.repeat(e), Zr = (e, t, n, o) => {
|
|
1999
|
-
const s = Xr(o, n),
|
|
2000
|
+
const s = Xr(o, n), c = Xr(o - 1, n), r = t ? `,
|
|
2000
2001
|
${s}` : ", ";
|
|
2001
2002
|
return t ? `[
|
|
2002
2003
|
${s}${e.join(r)}
|
|
2003
|
-
${
|
|
2004
|
+
${c}]` : `[${e.join(r)}]`;
|
|
2004
2005
|
}, en = (e, t, n) => `let ${e} = ${et(t, n)}`, et = (e, t, n) => {
|
|
2005
2006
|
switch (n = n === void 0 ? 1 : n + 1, Object.prototype.toString.call(e)) {
|
|
2006
2007
|
case "[object Number]":
|
|
2007
2008
|
return e;
|
|
2008
2009
|
case "[object Array]": {
|
|
2009
2010
|
let o = !1;
|
|
2010
|
-
const s = e.map((
|
|
2011
|
+
const s = e.map((c) => (Object.prototype.toString.call(c) === "[object Object]" && (o = Object.keys(c).length > 1), et(c, t, n)));
|
|
2011
2012
|
return Zr(s, o, t.indent, n);
|
|
2012
2013
|
}
|
|
2013
2014
|
case "[object Object]": {
|
|
@@ -2028,7 +2029,7 @@ ${l}]` : `[${e.join(r)}]`;
|
|
|
2028
2029
|
default:
|
|
2029
2030
|
return e == null ? "nil" : `"${e.toString().replace(/"/g, '\\"')}"`;
|
|
2030
2031
|
}
|
|
2031
|
-
},
|
|
2032
|
+
}, Pi = {
|
|
2032
2033
|
info: {
|
|
2033
2034
|
key: "urlsession",
|
|
2034
2035
|
title: "URLSession",
|
|
@@ -2036,20 +2037,20 @@ ${l}]` : `[${e.join(r)}]`;
|
|
|
2036
2037
|
description: "Foundation's URLSession request",
|
|
2037
2038
|
extname: ".swift"
|
|
2038
2039
|
},
|
|
2039
|
-
convert: ({ allHeaders: e, postData: t, uriObj: n, queryObj: o, method: s },
|
|
2040
|
-
var
|
|
2040
|
+
convert: ({ allHeaders: e, postData: t, uriObj: n, queryObj: o, method: s }, c) => {
|
|
2041
|
+
var y;
|
|
2041
2042
|
const r = {
|
|
2042
2043
|
indent: " ",
|
|
2043
2044
|
pretty: !0,
|
|
2044
2045
|
timeout: 10,
|
|
2045
|
-
...
|
|
2046
|
-
}, { push: a, blank: i, join:
|
|
2046
|
+
...c
|
|
2047
|
+
}, { push: a, blank: i, join: l } = new V({ indent: r.indent });
|
|
2047
2048
|
a("import Foundation"), i();
|
|
2048
|
-
const
|
|
2049
|
-
if (
|
|
2049
|
+
const f = t.text || t.jsonObj || t.params;
|
|
2050
|
+
if (f)
|
|
2050
2051
|
switch (t.mimeType) {
|
|
2051
2052
|
case "application/x-www-form-urlencoded":
|
|
2052
|
-
if ((
|
|
2053
|
+
if ((y = t.params) != null && y.length) {
|
|
2053
2054
|
const g = t.params.map((x) => `"${x.name}": "${x.value}"`);
|
|
2054
2055
|
r.pretty ? (a("let parameters = ["), g.forEach((x) => a(`${x},`, 1)), a("]")) : a(`let parameters = [${g.join(", ")}]`), a('let joinedParameters = parameters.map { "\\($0.key)=\\($0.value)" }.joined(separator: "&")'), a("let postData = Data(joinedParameters.utf8)"), i();
|
|
2055
2056
|
}
|
|
@@ -2064,63 +2065,63 @@ ${l}]` : `[${e.join(r)}]`;
|
|
|
2064
2065
|
a(`let postData = Data("${t.text}".utf8)`), i();
|
|
2065
2066
|
}
|
|
2066
2067
|
a(`let url = URL(string: "${n.href}")!`);
|
|
2067
|
-
const
|
|
2068
|
-
return
|
|
2068
|
+
const d = o ? Object.entries(o) : [];
|
|
2069
|
+
return d.length < 1 ? a("var request = URLRequest(url: url)") : (a("var components = URLComponents(url: url, resolvingAgainstBaseURL: true)!"), a("let queryItems: [URLQueryItem] = ["), d.forEach((g) => {
|
|
2069
2070
|
const x = g[0], $ = g[1];
|
|
2070
2071
|
switch (Object.prototype.toString.call($)) {
|
|
2071
2072
|
case "[object String]":
|
|
2072
2073
|
a(`URLQueryItem(name: "${x}", value: "${$}"),`, 1);
|
|
2073
2074
|
break;
|
|
2074
2075
|
case "[object Array]":
|
|
2075
|
-
$.forEach((
|
|
2076
|
-
a(`URLQueryItem(name: "${x}", value: "${
|
|
2076
|
+
$.forEach((p) => {
|
|
2077
|
+
a(`URLQueryItem(name: "${x}", value: "${p}"),`, 1);
|
|
2077
2078
|
});
|
|
2078
2079
|
break;
|
|
2079
2080
|
}
|
|
2080
|
-
}), a("]"), a("components.queryItems = components.queryItems.map { $0 + queryItems } ?? queryItems"), i(), a("var request = URLRequest(url: components.url!)")), a(`request.httpMethod = "${s}"`), a(`request.timeoutInterval = ${r.timeout}`), Object.keys(e).length && a(`request.allHTTPHeaderFields = ${et(e, r)}`),
|
|
2081
|
+
}), a("]"), a("components.queryItems = components.queryItems.map { $0 + queryItems } ?? queryItems"), i(), a("var request = URLRequest(url: components.url!)")), a(`request.httpMethod = "${s}"`), a(`request.timeoutInterval = ${r.timeout}`), Object.keys(e).length && a(`request.allHTTPHeaderFields = ${et(e, r)}`), f && a("request.httpBody = postData"), i(), a("let (data, _) = try await URLSession.shared.data(for: request)"), a("print(String(decoding: data, as: UTF8.self))"), l();
|
|
2081
2082
|
}
|
|
2082
|
-
},
|
|
2083
|
+
}, Ci = {
|
|
2083
2084
|
info: {
|
|
2084
2085
|
key: "swift",
|
|
2085
2086
|
title: "Swift",
|
|
2086
2087
|
default: "urlsession"
|
|
2087
2088
|
},
|
|
2088
2089
|
clientsById: {
|
|
2089
|
-
urlsession:
|
|
2090
|
+
urlsession: Pi
|
|
2090
2091
|
}
|
|
2091
|
-
},
|
|
2092
|
-
c:
|
|
2093
|
-
clojure:
|
|
2094
|
-
csharp:
|
|
2095
|
-
go:
|
|
2096
|
-
http:
|
|
2097
|
-
java:
|
|
2098
|
-
javascript:
|
|
2099
|
-
json:
|
|
2100
|
-
kotlin:
|
|
2101
|
-
node:
|
|
2102
|
-
objc:
|
|
2103
|
-
ocaml:
|
|
2104
|
-
php:
|
|
2105
|
-
powershell:
|
|
2106
|
-
python:
|
|
2107
|
-
r:
|
|
2108
|
-
ruby:
|
|
2109
|
-
shell:
|
|
2110
|
-
swift:
|
|
2092
|
+
}, Ri = {
|
|
2093
|
+
c: $a,
|
|
2094
|
+
clojure: Oa,
|
|
2095
|
+
csharp: qa,
|
|
2096
|
+
go: Ea,
|
|
2097
|
+
http: Aa,
|
|
2098
|
+
java: _a,
|
|
2099
|
+
javascript: Ga,
|
|
2100
|
+
json: Ja,
|
|
2101
|
+
kotlin: Da,
|
|
2102
|
+
node: ei,
|
|
2103
|
+
objc: ri,
|
|
2104
|
+
ocaml: oi,
|
|
2105
|
+
php: li,
|
|
2106
|
+
powershell: pi,
|
|
2107
|
+
python: yi,
|
|
2108
|
+
r: gi,
|
|
2109
|
+
ruby: bi,
|
|
2110
|
+
shell: Ti,
|
|
2111
|
+
swift: Ci
|
|
2111
2112
|
}, Re = {}, Be = { exports: {} };
|
|
2112
2113
|
/*! https://mths.be/punycode v1.4.1 by @mathias */
|
|
2113
|
-
var
|
|
2114
|
-
function
|
|
2114
|
+
var qi = Be.exports, tn;
|
|
2115
|
+
function ki() {
|
|
2115
2116
|
return tn || (tn = 1, function(e, t) {
|
|
2116
2117
|
(function(n) {
|
|
2117
|
-
var o = t && !t.nodeType && t, s = e && !e.nodeType && e,
|
|
2118
|
-
(
|
|
2119
|
-
var r, a = 2147483647, i = 36,
|
|
2118
|
+
var o = t && !t.nodeType && t, s = e && !e.nodeType && e, c = typeof Ze == "object" && Ze;
|
|
2119
|
+
(c.global === c || c.window === c || c.self === c) && (n = c);
|
|
2120
|
+
var r, a = 2147483647, i = 36, l = 1, f = 26, d = 38, y = 700, g = 72, x = 128, $ = "-", p = /^xn--/, h = /[^\x20-\x7E]/, m = /[\x2E\u3002\uFF0E\uFF61]/g, w = {
|
|
2120
2121
|
overflow: "Overflow: input needs wider integers to process",
|
|
2121
2122
|
"not-basic": "Illegal input >= 0x80 (not a basic code point)",
|
|
2122
2123
|
"invalid-input": "Invalid input"
|
|
2123
|
-
}, T = i -
|
|
2124
|
+
}, T = i - l, u = Math.floor, O = String.fromCharCode, v;
|
|
2124
2125
|
function q(R) {
|
|
2125
2126
|
throw new RangeError(w[R]);
|
|
2126
2127
|
}
|
|
@@ -2131,7 +2132,7 @@ function Oi() {
|
|
|
2131
2132
|
}
|
|
2132
2133
|
function N(R, k) {
|
|
2133
2134
|
var U = R.split("@"), C = "";
|
|
2134
|
-
U.length > 1 && (C = U[0] + "@", R = U[1]), R = R.replace(
|
|
2135
|
+
U.length > 1 && (C = U[0] + "@", R = U[1]), R = R.replace(m, ".");
|
|
2135
2136
|
var I = R.split("."), W = L(I, k).join(".");
|
|
2136
2137
|
return C + W;
|
|
2137
2138
|
}
|
|
@@ -2154,16 +2155,16 @@ function Oi() {
|
|
|
2154
2155
|
}
|
|
2155
2156
|
function D(R, k, U) {
|
|
2156
2157
|
var C = 0;
|
|
2157
|
-
for (R = U ? u(R /
|
|
2158
|
+
for (R = U ? u(R / y) : R >> 1, R += u(R / k); R > T * f >> 1; C += i)
|
|
2158
2159
|
R = u(R / T);
|
|
2159
|
-
return u(C + (T + 1) * R / (R +
|
|
2160
|
+
return u(C + (T + 1) * R / (R + d));
|
|
2160
2161
|
}
|
|
2161
2162
|
function se(R) {
|
|
2162
2163
|
var k = [], U = R.length, C, I = 0, W = x, z = g, K, ne, J, A, F, _, Q, G, Y;
|
|
2163
2164
|
for (K = R.lastIndexOf($), K < 0 && (K = 0), ne = 0; ne < K; ++ne)
|
|
2164
2165
|
R.charCodeAt(ne) >= 128 && q("not-basic"), k.push(R.charCodeAt(ne));
|
|
2165
2166
|
for (J = K > 0 ? K + 1 : 0; J < U; ) {
|
|
2166
|
-
for (A = I, F = 1, _ = i; J >= U && q("invalid-input"), Q = ae(R.charCodeAt(J++)), (Q >= i || Q > u((a - I) / F)) && q("overflow"), I += Q * F, G = _ <= z ?
|
|
2167
|
+
for (A = I, F = 1, _ = i; J >= U && q("invalid-input"), Q = ae(R.charCodeAt(J++)), (Q >= i || Q > u((a - I) / F)) && q("overflow"), I += Q * F, G = _ <= z ? l : _ >= z + f ? f : _ - z, !(Q < G); _ += i)
|
|
2167
2168
|
Y = i - G, F > u(a / Y) && q("overflow"), F *= Y;
|
|
2168
2169
|
C = k.length + 1, z = D(I - A, C, A == 0), u(I / C) > a - W && q("overflow"), W += u(I / C), I %= C, k.splice(I++, 0, W);
|
|
2169
2170
|
}
|
|
@@ -2178,7 +2179,7 @@ function Oi() {
|
|
|
2178
2179
|
F = R[z], F >= k && F < K && (K = F);
|
|
2179
2180
|
for (G = C + 1, K - k > u((a - U) / G) && q("overflow"), U += (K - k) * G, k = K, z = 0; z < Q; ++z)
|
|
2180
2181
|
if (F = R[z], F < k && ++U > a && q("overflow"), F == k) {
|
|
2181
|
-
for (ne = U, J = i; A = J <= W ?
|
|
2182
|
+
for (ne = U, J = i; A = J <= W ? l : J >= W + f ? f : J - W, !(ne < A); J += i)
|
|
2182
2183
|
oe = ne - A, Y = i - A, _.push(
|
|
2183
2184
|
O(H(A + oe % Y, 0))
|
|
2184
2185
|
), ne = u(oe / Y);
|
|
@@ -2190,12 +2191,12 @@ function Oi() {
|
|
|
2190
2191
|
}
|
|
2191
2192
|
function E(R) {
|
|
2192
2193
|
return N(R, function(k) {
|
|
2193
|
-
return
|
|
2194
|
+
return p.test(k) ? se(k.slice(4).toLowerCase()) : k;
|
|
2194
2195
|
});
|
|
2195
2196
|
}
|
|
2196
2197
|
function re(R) {
|
|
2197
2198
|
return N(R, function(k) {
|
|
2198
|
-
return
|
|
2199
|
+
return h.test(k) ? "xn--" + Z(k) : k;
|
|
2199
2200
|
});
|
|
2200
2201
|
}
|
|
2201
2202
|
if (r = {
|
|
@@ -2228,7 +2229,7 @@ function Oi() {
|
|
|
2228
2229
|
r.hasOwnProperty(v) && (o[v] = r[v]);
|
|
2229
2230
|
else
|
|
2230
2231
|
n.punycode = r;
|
|
2231
|
-
})(
|
|
2232
|
+
})(qi);
|
|
2232
2233
|
}(Be, Be.exports)), Be.exports;
|
|
2233
2234
|
}
|
|
2234
2235
|
var vt, rn;
|
|
@@ -2236,19 +2237,19 @@ function uo() {
|
|
|
2236
2237
|
return rn || (rn = 1, vt = Object), vt;
|
|
2237
2238
|
}
|
|
2238
2239
|
var bt, nn;
|
|
2239
|
-
function
|
|
2240
|
+
function Ei() {
|
|
2240
2241
|
return nn || (nn = 1, bt = Error), bt;
|
|
2241
2242
|
}
|
|
2242
2243
|
var xt, on;
|
|
2243
|
-
function
|
|
2244
|
+
function Ni() {
|
|
2244
2245
|
return on || (on = 1, xt = EvalError), xt;
|
|
2245
2246
|
}
|
|
2246
2247
|
var $t, an;
|
|
2247
|
-
function
|
|
2248
|
+
function Ai() {
|
|
2248
2249
|
return an || (an = 1, $t = RangeError), $t;
|
|
2249
2250
|
}
|
|
2250
2251
|
var jt, sn;
|
|
2251
|
-
function
|
|
2252
|
+
function Ii() {
|
|
2252
2253
|
return sn || (sn = 1, jt = ReferenceError), jt;
|
|
2253
2254
|
}
|
|
2254
2255
|
var wt, cn;
|
|
@@ -2260,57 +2261,57 @@ function We() {
|
|
|
2260
2261
|
return ln || (ln = 1, St = TypeError), St;
|
|
2261
2262
|
}
|
|
2262
2263
|
var Ot, un;
|
|
2263
|
-
function
|
|
2264
|
+
function Li() {
|
|
2264
2265
|
return un || (un = 1, Ot = URIError), Ot;
|
|
2265
2266
|
}
|
|
2266
2267
|
var Tt, fn;
|
|
2267
|
-
function
|
|
2268
|
+
function Ui() {
|
|
2268
2269
|
return fn || (fn = 1, Tt = Math.abs), Tt;
|
|
2269
2270
|
}
|
|
2270
2271
|
var Pt, pn;
|
|
2271
|
-
function
|
|
2272
|
+
function Fi() {
|
|
2272
2273
|
return pn || (pn = 1, Pt = Math.floor), Pt;
|
|
2273
2274
|
}
|
|
2274
2275
|
var Ct, dn;
|
|
2275
|
-
function
|
|
2276
|
+
function _i() {
|
|
2276
2277
|
return dn || (dn = 1, Ct = Math.max), Ct;
|
|
2277
2278
|
}
|
|
2278
2279
|
var Rt, hn;
|
|
2279
|
-
function
|
|
2280
|
+
function Bi() {
|
|
2280
2281
|
return hn || (hn = 1, Rt = Math.min), Rt;
|
|
2281
2282
|
}
|
|
2282
2283
|
var qt, yn;
|
|
2283
|
-
function
|
|
2284
|
+
function Hi() {
|
|
2284
2285
|
return yn || (yn = 1, qt = Math.pow), qt;
|
|
2285
2286
|
}
|
|
2286
2287
|
var kt, mn;
|
|
2287
|
-
function
|
|
2288
|
+
function Mi() {
|
|
2288
2289
|
return mn || (mn = 1, kt = Math.round), kt;
|
|
2289
2290
|
}
|
|
2290
2291
|
var Et, gn;
|
|
2291
|
-
function
|
|
2292
|
+
function zi() {
|
|
2292
2293
|
return gn || (gn = 1, Et = Number.isNaN || function(t) {
|
|
2293
2294
|
return t !== t;
|
|
2294
2295
|
}), Et;
|
|
2295
2296
|
}
|
|
2296
2297
|
var Nt, vn;
|
|
2297
|
-
function
|
|
2298
|
+
function Gi() {
|
|
2298
2299
|
if (vn) return Nt;
|
|
2299
2300
|
vn = 1;
|
|
2300
|
-
var e = /* @__PURE__ */
|
|
2301
|
+
var e = /* @__PURE__ */ zi();
|
|
2301
2302
|
return Nt = function(n) {
|
|
2302
2303
|
return e(n) || n === 0 ? n : n < 0 ? -1 : 1;
|
|
2303
2304
|
}, Nt;
|
|
2304
2305
|
}
|
|
2305
2306
|
var At, bn;
|
|
2306
|
-
function
|
|
2307
|
+
function Wi() {
|
|
2307
2308
|
return bn || (bn = 1, At = Object.getOwnPropertyDescriptor), At;
|
|
2308
2309
|
}
|
|
2309
2310
|
var It, xn;
|
|
2310
2311
|
function nt() {
|
|
2311
2312
|
if (xn) return It;
|
|
2312
2313
|
xn = 1;
|
|
2313
|
-
var e = /* @__PURE__ */
|
|
2314
|
+
var e = /* @__PURE__ */ Wi();
|
|
2314
2315
|
if (e)
|
|
2315
2316
|
try {
|
|
2316
2317
|
e([], "length");
|
|
@@ -2333,7 +2334,7 @@ function ot() {
|
|
|
2333
2334
|
return Lt = e, Lt;
|
|
2334
2335
|
}
|
|
2335
2336
|
var Ut, jn;
|
|
2336
|
-
function
|
|
2337
|
+
function Ji() {
|
|
2337
2338
|
return jn || (jn = 1, Ut = function() {
|
|
2338
2339
|
if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function")
|
|
2339
2340
|
return !1;
|
|
@@ -2344,7 +2345,7 @@ function Bi() {
|
|
|
2344
2345
|
return !1;
|
|
2345
2346
|
var s = 42;
|
|
2346
2347
|
t[n] = s;
|
|
2347
|
-
for (var
|
|
2348
|
+
for (var c in t)
|
|
2348
2349
|
return !1;
|
|
2349
2350
|
if (typeof Object.keys == "function" && Object.keys(t).length !== 0 || typeof Object.getOwnPropertyNames == "function" && Object.getOwnPropertyNames(t).length !== 0)
|
|
2350
2351
|
return !1;
|
|
@@ -2363,10 +2364,10 @@ function Bi() {
|
|
|
2363
2364
|
}), Ut;
|
|
2364
2365
|
}
|
|
2365
2366
|
var Ft, wn;
|
|
2366
|
-
function
|
|
2367
|
+
function Vi() {
|
|
2367
2368
|
if (wn) return Ft;
|
|
2368
2369
|
wn = 1;
|
|
2369
|
-
var e = typeof Symbol < "u" && Symbol, t =
|
|
2370
|
+
var e = typeof Symbol < "u" && Symbol, t = Ji();
|
|
2370
2371
|
return Ft = function() {
|
|
2371
2372
|
return typeof e != "function" || typeof Symbol != "function" || typeof e("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : t();
|
|
2372
2373
|
}, Ft;
|
|
@@ -2383,55 +2384,55 @@ function ho() {
|
|
|
2383
2384
|
return Bt = e.getPrototypeOf || null, Bt;
|
|
2384
2385
|
}
|
|
2385
2386
|
var Ht, Tn;
|
|
2386
|
-
function
|
|
2387
|
+
function Di() {
|
|
2387
2388
|
if (Tn) return Ht;
|
|
2388
2389
|
Tn = 1;
|
|
2389
|
-
var e = "Function.prototype.bind called on incompatible ", t = Object.prototype.toString, n = Math.max, o = "[object Function]", s = function(i,
|
|
2390
|
-
for (var
|
|
2391
|
-
|
|
2392
|
-
for (var
|
|
2393
|
-
|
|
2394
|
-
return
|
|
2395
|
-
},
|
|
2396
|
-
for (var
|
|
2397
|
-
|
|
2398
|
-
return
|
|
2390
|
+
var e = "Function.prototype.bind called on incompatible ", t = Object.prototype.toString, n = Math.max, o = "[object Function]", s = function(i, l) {
|
|
2391
|
+
for (var f = [], d = 0; d < i.length; d += 1)
|
|
2392
|
+
f[d] = i[d];
|
|
2393
|
+
for (var y = 0; y < l.length; y += 1)
|
|
2394
|
+
f[y + i.length] = l[y];
|
|
2395
|
+
return f;
|
|
2396
|
+
}, c = function(i, l) {
|
|
2397
|
+
for (var f = [], d = l, y = 0; d < i.length; d += 1, y += 1)
|
|
2398
|
+
f[y] = i[d];
|
|
2399
|
+
return f;
|
|
2399
2400
|
}, r = function(a, i) {
|
|
2400
|
-
for (var
|
|
2401
|
-
|
|
2402
|
-
return
|
|
2401
|
+
for (var l = "", f = 0; f < a.length; f += 1)
|
|
2402
|
+
l += a[f], f + 1 < a.length && (l += i);
|
|
2403
|
+
return l;
|
|
2403
2404
|
};
|
|
2404
2405
|
return Ht = function(i) {
|
|
2405
|
-
var
|
|
2406
|
-
if (typeof
|
|
2407
|
-
throw new TypeError(e +
|
|
2408
|
-
for (var
|
|
2409
|
-
if (this instanceof
|
|
2410
|
-
var
|
|
2406
|
+
var l = this;
|
|
2407
|
+
if (typeof l != "function" || t.apply(l) !== o)
|
|
2408
|
+
throw new TypeError(e + l);
|
|
2409
|
+
for (var f = c(arguments, 1), d, y = function() {
|
|
2410
|
+
if (this instanceof d) {
|
|
2411
|
+
var h = l.apply(
|
|
2411
2412
|
this,
|
|
2412
|
-
s(
|
|
2413
|
+
s(f, arguments)
|
|
2413
2414
|
);
|
|
2414
|
-
return Object(
|
|
2415
|
+
return Object(h) === h ? h : this;
|
|
2415
2416
|
}
|
|
2416
|
-
return
|
|
2417
|
+
return l.apply(
|
|
2417
2418
|
i,
|
|
2418
|
-
s(
|
|
2419
|
+
s(f, arguments)
|
|
2419
2420
|
);
|
|
2420
|
-
}, g = n(0,
|
|
2421
|
+
}, g = n(0, l.length - f.length), x = [], $ = 0; $ < g; $++)
|
|
2421
2422
|
x[$] = "$" + $;
|
|
2422
|
-
if (
|
|
2423
|
-
var
|
|
2423
|
+
if (d = Function("binder", "return function (" + r(x, ",") + "){ return binder.apply(this,arguments); }")(y), l.prototype) {
|
|
2424
|
+
var p = function() {
|
|
2424
2425
|
};
|
|
2425
|
-
|
|
2426
|
+
p.prototype = l.prototype, d.prototype = new p(), p.prototype = null;
|
|
2426
2427
|
}
|
|
2427
|
-
return
|
|
2428
|
+
return d;
|
|
2428
2429
|
}, Ht;
|
|
2429
2430
|
}
|
|
2430
2431
|
var Mt, Pn;
|
|
2431
2432
|
function Je() {
|
|
2432
2433
|
if (Pn) return Mt;
|
|
2433
2434
|
Pn = 1;
|
|
2434
|
-
var e =
|
|
2435
|
+
var e = Di();
|
|
2435
2436
|
return Mt = Function.prototype.bind || e, Mt;
|
|
2436
2437
|
}
|
|
2437
2438
|
var zt, Cn;
|
|
@@ -2443,14 +2444,14 @@ function $r() {
|
|
|
2443
2444
|
return Rn || (Rn = 1, Gt = Function.prototype.apply), Gt;
|
|
2444
2445
|
}
|
|
2445
2446
|
var Wt, qn;
|
|
2446
|
-
function
|
|
2447
|
+
function Qi() {
|
|
2447
2448
|
return qn || (qn = 1, Wt = typeof Reflect < "u" && Reflect && Reflect.apply), Wt;
|
|
2448
2449
|
}
|
|
2449
2450
|
var Jt, kn;
|
|
2450
2451
|
function yo() {
|
|
2451
2452
|
if (kn) return Jt;
|
|
2452
2453
|
kn = 1;
|
|
2453
|
-
var e = Je(), t = $r(), n = xr(), o =
|
|
2454
|
+
var e = Je(), t = $r(), n = xr(), o = Qi();
|
|
2454
2455
|
return Jt = o || e.call(n, t), Jt;
|
|
2455
2456
|
}
|
|
2456
2457
|
var Vt, En;
|
|
@@ -2458,14 +2459,14 @@ function mo() {
|
|
|
2458
2459
|
if (En) return Vt;
|
|
2459
2460
|
En = 1;
|
|
2460
2461
|
var e = Je(), t = /* @__PURE__ */ We(), n = xr(), o = yo();
|
|
2461
|
-
return Vt = function(
|
|
2462
|
-
if (
|
|
2462
|
+
return Vt = function(c) {
|
|
2463
|
+
if (c.length < 1 || typeof c[0] != "function")
|
|
2463
2464
|
throw new t("a function is required");
|
|
2464
|
-
return o(e, n,
|
|
2465
|
+
return o(e, n, c);
|
|
2465
2466
|
}, Vt;
|
|
2466
2467
|
}
|
|
2467
2468
|
var Dt, Nn;
|
|
2468
|
-
function
|
|
2469
|
+
function Ki() {
|
|
2469
2470
|
if (Nn) return Dt;
|
|
2470
2471
|
Nn = 1;
|
|
2471
2472
|
var e = mo(), t = /* @__PURE__ */ nt(), n;
|
|
@@ -2480,19 +2481,19 @@ function Gi() {
|
|
|
2480
2481
|
Object.prototype,
|
|
2481
2482
|
/** @type {keyof typeof Object.prototype} */
|
|
2482
2483
|
"__proto__"
|
|
2483
|
-
), s = Object,
|
|
2484
|
-
return Dt = o && typeof o.get == "function" ? e([o.get]) : typeof
|
|
2484
|
+
), s = Object, c = s.getPrototypeOf;
|
|
2485
|
+
return Dt = o && typeof o.get == "function" ? e([o.get]) : typeof c == "function" ? (
|
|
2485
2486
|
/** @type {import('./get')} */
|
|
2486
2487
|
function(a) {
|
|
2487
|
-
return
|
|
2488
|
+
return c(a == null ? a : s(a));
|
|
2488
2489
|
}
|
|
2489
2490
|
) : !1, Dt;
|
|
2490
2491
|
}
|
|
2491
2492
|
var Qt, An;
|
|
2492
|
-
function
|
|
2493
|
+
function Yi() {
|
|
2493
2494
|
if (An) return Qt;
|
|
2494
2495
|
An = 1;
|
|
2495
|
-
var e = po(), t = ho(), n = /* @__PURE__ */
|
|
2496
|
+
var e = po(), t = ho(), n = /* @__PURE__ */ Ki();
|
|
2496
2497
|
return Qt = e ? function(s) {
|
|
2497
2498
|
return e(s);
|
|
2498
2499
|
} : t ? function(s) {
|
|
@@ -2504,7 +2505,7 @@ function Wi() {
|
|
|
2504
2505
|
} : null, Qt;
|
|
2505
2506
|
}
|
|
2506
2507
|
var Kt, In;
|
|
2507
|
-
function
|
|
2508
|
+
function Xi() {
|
|
2508
2509
|
if (In) return Kt;
|
|
2509
2510
|
In = 1;
|
|
2510
2511
|
var e = Function.prototype.call, t = Object.prototype.hasOwnProperty, n = Je();
|
|
@@ -2514,24 +2515,24 @@ var Yt, Ln;
|
|
|
2514
2515
|
function jr() {
|
|
2515
2516
|
if (Ln) return Yt;
|
|
2516
2517
|
Ln = 1;
|
|
2517
|
-
var e, t = /* @__PURE__ */ uo(), n = /* @__PURE__ */
|
|
2518
|
+
var e, t = /* @__PURE__ */ uo(), n = /* @__PURE__ */ Ei(), o = /* @__PURE__ */ Ni(), s = /* @__PURE__ */ Ai(), c = /* @__PURE__ */ Ii(), r = /* @__PURE__ */ fo(), a = /* @__PURE__ */ We(), i = /* @__PURE__ */ Li(), l = /* @__PURE__ */ Ui(), f = /* @__PURE__ */ Fi(), d = /* @__PURE__ */ _i(), y = /* @__PURE__ */ Bi(), g = /* @__PURE__ */ Hi(), x = /* @__PURE__ */ Mi(), $ = /* @__PURE__ */ Gi(), p = Function, h = function(J) {
|
|
2518
2519
|
try {
|
|
2519
|
-
return
|
|
2520
|
+
return p('"use strict"; return (' + J + ").constructor;")();
|
|
2520
2521
|
} catch {
|
|
2521
2522
|
}
|
|
2522
|
-
},
|
|
2523
|
+
}, m = /* @__PURE__ */ nt(), w = /* @__PURE__ */ ot(), T = function() {
|
|
2523
2524
|
throw new a();
|
|
2524
|
-
}, u =
|
|
2525
|
+
}, u = m ? function() {
|
|
2525
2526
|
try {
|
|
2526
2527
|
return arguments.callee, T;
|
|
2527
2528
|
} catch {
|
|
2528
2529
|
try {
|
|
2529
|
-
return
|
|
2530
|
+
return m(arguments, "callee").get;
|
|
2530
2531
|
} catch {
|
|
2531
2532
|
return T;
|
|
2532
2533
|
}
|
|
2533
2534
|
}
|
|
2534
|
-
}() : T, O =
|
|
2535
|
+
}() : T, O = Vi()(), v = Yi(), q = ho(), L = po(), N = $r(), B = xr(), P = {}, ae = typeof Uint8Array > "u" || !v ? e : v(Uint8Array), H = {
|
|
2535
2536
|
__proto__: null,
|
|
2536
2537
|
"%AggregateError%": typeof AggregateError > "u" ? e : AggregateError,
|
|
2537
2538
|
"%Array%": Array,
|
|
@@ -2560,7 +2561,7 @@ function jr() {
|
|
|
2560
2561
|
"%Float32Array%": typeof Float32Array > "u" ? e : Float32Array,
|
|
2561
2562
|
"%Float64Array%": typeof Float64Array > "u" ? e : Float64Array,
|
|
2562
2563
|
"%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? e : FinalizationRegistry,
|
|
2563
|
-
"%Function%":
|
|
2564
|
+
"%Function%": p,
|
|
2564
2565
|
"%GeneratorFunction%": P,
|
|
2565
2566
|
"%Int8Array%": typeof Int8Array > "u" ? e : Int8Array,
|
|
2566
2567
|
"%Int16Array%": typeof Int16Array > "u" ? e : Int16Array,
|
|
@@ -2574,13 +2575,13 @@ function jr() {
|
|
|
2574
2575
|
"%Math%": Math,
|
|
2575
2576
|
"%Number%": Number,
|
|
2576
2577
|
"%Object%": t,
|
|
2577
|
-
"%Object.getOwnPropertyDescriptor%":
|
|
2578
|
+
"%Object.getOwnPropertyDescriptor%": m,
|
|
2578
2579
|
"%parseFloat%": parseFloat,
|
|
2579
2580
|
"%parseInt%": parseInt,
|
|
2580
2581
|
"%Promise%": typeof Promise > "u" ? e : Promise,
|
|
2581
2582
|
"%Proxy%": typeof Proxy > "u" ? e : Proxy,
|
|
2582
2583
|
"%RangeError%": s,
|
|
2583
|
-
"%ReferenceError%":
|
|
2584
|
+
"%ReferenceError%": c,
|
|
2584
2585
|
"%Reflect%": typeof Reflect > "u" ? e : Reflect,
|
|
2585
2586
|
"%RegExp%": RegExp,
|
|
2586
2587
|
"%Set%": typeof Set > "u" ? e : Set,
|
|
@@ -2605,10 +2606,10 @@ function jr() {
|
|
|
2605
2606
|
"%Function.prototype.apply%": N,
|
|
2606
2607
|
"%Object.defineProperty%": w,
|
|
2607
2608
|
"%Object.getPrototypeOf%": q,
|
|
2608
|
-
"%Math.abs%":
|
|
2609
|
-
"%Math.floor%":
|
|
2610
|
-
"%Math.max%":
|
|
2611
|
-
"%Math.min%":
|
|
2609
|
+
"%Math.abs%": l,
|
|
2610
|
+
"%Math.floor%": f,
|
|
2611
|
+
"%Math.max%": d,
|
|
2612
|
+
"%Math.min%": y,
|
|
2612
2613
|
"%Math.pow%": g,
|
|
2613
2614
|
"%Math.round%": x,
|
|
2614
2615
|
"%Math.sign%": $,
|
|
@@ -2624,11 +2625,11 @@ function jr() {
|
|
|
2624
2625
|
var se = function J(A) {
|
|
2625
2626
|
var F;
|
|
2626
2627
|
if (A === "%AsyncFunction%")
|
|
2627
|
-
F =
|
|
2628
|
+
F = h("async function () {}");
|
|
2628
2629
|
else if (A === "%GeneratorFunction%")
|
|
2629
|
-
F =
|
|
2630
|
+
F = h("function* () {}");
|
|
2630
2631
|
else if (A === "%AsyncGeneratorFunction%")
|
|
2631
|
-
F =
|
|
2632
|
+
F = h("async function* () {}");
|
|
2632
2633
|
else if (A === "%AsyncGenerator%") {
|
|
2633
2634
|
var _ = J("%AsyncGeneratorFunction%");
|
|
2634
2635
|
_ && (F = _.prototype);
|
|
@@ -2690,7 +2691,7 @@ function jr() {
|
|
|
2690
2691
|
"%URIErrorPrototype%": ["URIError", "prototype"],
|
|
2691
2692
|
"%WeakMapPrototype%": ["WeakMap", "prototype"],
|
|
2692
2693
|
"%WeakSetPrototype%": ["WeakSet", "prototype"]
|
|
2693
|
-
}, E = Je(), re = /* @__PURE__ */
|
|
2694
|
+
}, E = Je(), re = /* @__PURE__ */ Xi(), R = E.call(B, Array.prototype.concat), k = E.call(N, Array.prototype.splice), U = E.call(B, String.prototype.replace), C = E.call(B, String.prototype.slice), I = E.call(B, RegExp.prototype.exec), W = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, z = /\\(\\)?/g, K = function(A) {
|
|
2694
2695
|
var F = C(A, 0, 1), _ = C(A, -1);
|
|
2695
2696
|
if (F === "%" && _ !== "%")
|
|
2696
2697
|
throw new r("invalid intrinsic syntax, expected closing `%`");
|
|
@@ -2735,8 +2736,8 @@ function jr() {
|
|
|
2735
2736
|
throw new a("base intrinsic for " + A + " exists, but the property is not available.");
|
|
2736
2737
|
return;
|
|
2737
2738
|
}
|
|
2738
|
-
if (
|
|
2739
|
-
var Pe =
|
|
2739
|
+
if (m && ke + 1 >= _.length) {
|
|
2740
|
+
var Pe = m(oe, me);
|
|
2740
2741
|
Te = !!Pe, Te && "get" in Pe && !("originalValue" in Pe.get) ? oe = Pe.get : oe = oe[me];
|
|
2741
2742
|
} else
|
|
2742
2743
|
Te = re(oe, me), oe = oe[me];
|
|
@@ -2747,12 +2748,12 @@ function jr() {
|
|
|
2747
2748
|
}, Yt;
|
|
2748
2749
|
}
|
|
2749
2750
|
var Xt = { exports: {} }, Zt, Un;
|
|
2750
|
-
function
|
|
2751
|
+
function Zi() {
|
|
2751
2752
|
if (Un) return Zt;
|
|
2752
2753
|
Un = 1;
|
|
2753
2754
|
var e = /* @__PURE__ */ ot(), t = /* @__PURE__ */ fo(), n = /* @__PURE__ */ We(), o = /* @__PURE__ */ nt();
|
|
2754
|
-
return Zt = function(
|
|
2755
|
-
if (!
|
|
2755
|
+
return Zt = function(c, r, a) {
|
|
2756
|
+
if (!c || typeof c != "object" && typeof c != "function")
|
|
2756
2757
|
throw new n("`obj` must be an object or a function`");
|
|
2757
2758
|
if (typeof r != "string" && typeof r != "symbol")
|
|
2758
2759
|
throw new n("`property` must be a string or a symbol`");
|
|
@@ -2764,22 +2765,22 @@ function Vi() {
|
|
|
2764
2765
|
throw new n("`nonConfigurable`, if provided, must be a boolean or null");
|
|
2765
2766
|
if (arguments.length > 6 && typeof arguments[6] != "boolean")
|
|
2766
2767
|
throw new n("`loose`, if provided, must be a boolean");
|
|
2767
|
-
var i = arguments.length > 3 ? arguments[3] : null,
|
|
2768
|
+
var i = arguments.length > 3 ? arguments[3] : null, l = arguments.length > 4 ? arguments[4] : null, f = arguments.length > 5 ? arguments[5] : null, d = arguments.length > 6 ? arguments[6] : !1, y = !!o && o(c, r);
|
|
2768
2769
|
if (e)
|
|
2769
|
-
e(
|
|
2770
|
-
configurable:
|
|
2771
|
-
enumerable: i === null &&
|
|
2770
|
+
e(c, r, {
|
|
2771
|
+
configurable: f === null && y ? y.configurable : !f,
|
|
2772
|
+
enumerable: i === null && y ? y.enumerable : !i,
|
|
2772
2773
|
value: a,
|
|
2773
|
-
writable:
|
|
2774
|
+
writable: l === null && y ? y.writable : !l
|
|
2774
2775
|
});
|
|
2775
|
-
else if (
|
|
2776
|
-
|
|
2776
|
+
else if (d || !i && !l && !f)
|
|
2777
|
+
c[r] = a;
|
|
2777
2778
|
else
|
|
2778
2779
|
throw new t("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");
|
|
2779
2780
|
}, Zt;
|
|
2780
2781
|
}
|
|
2781
2782
|
var er, Fn;
|
|
2782
|
-
function
|
|
2783
|
+
function es() {
|
|
2783
2784
|
if (Fn) return er;
|
|
2784
2785
|
Fn = 1;
|
|
2785
2786
|
var e = /* @__PURE__ */ ot(), t = function() {
|
|
@@ -2796,21 +2797,21 @@ function Di() {
|
|
|
2796
2797
|
}, er = t, er;
|
|
2797
2798
|
}
|
|
2798
2799
|
var tr, _n;
|
|
2799
|
-
function
|
|
2800
|
+
function ts() {
|
|
2800
2801
|
if (_n) return tr;
|
|
2801
2802
|
_n = 1;
|
|
2802
|
-
var e = /* @__PURE__ */ jr(), t = /* @__PURE__ */
|
|
2803
|
+
var e = /* @__PURE__ */ jr(), t = /* @__PURE__ */ Zi(), n = /* @__PURE__ */ es()(), o = /* @__PURE__ */ nt(), s = /* @__PURE__ */ We(), c = e("%Math.floor%");
|
|
2803
2804
|
return tr = function(a, i) {
|
|
2804
2805
|
if (typeof a != "function")
|
|
2805
2806
|
throw new s("`fn` is not a function");
|
|
2806
|
-
if (typeof i != "number" || i < 0 || i > 4294967295 ||
|
|
2807
|
+
if (typeof i != "number" || i < 0 || i > 4294967295 || c(i) !== i)
|
|
2807
2808
|
throw new s("`length` must be a positive 32-bit integer");
|
|
2808
|
-
var
|
|
2809
|
+
var l = arguments.length > 2 && !!arguments[2], f = !0, d = !0;
|
|
2809
2810
|
if ("length" in a && o) {
|
|
2810
|
-
var
|
|
2811
|
-
|
|
2811
|
+
var y = o(a, "length");
|
|
2812
|
+
y && !y.configurable && (f = !1), y && !y.writable && (d = !1);
|
|
2812
2813
|
}
|
|
2813
|
-
return (
|
|
2814
|
+
return (f || d || !l) && (n ? t(
|
|
2814
2815
|
/** @type {Parameters<define>[0]} */
|
|
2815
2816
|
a,
|
|
2816
2817
|
"length",
|
|
@@ -2826,7 +2827,7 @@ function Qi() {
|
|
|
2826
2827
|
}, tr;
|
|
2827
2828
|
}
|
|
2828
2829
|
var rr, Bn;
|
|
2829
|
-
function
|
|
2830
|
+
function rs() {
|
|
2830
2831
|
if (Bn) return rr;
|
|
2831
2832
|
Bn = 1;
|
|
2832
2833
|
var e = Je(), t = $r(), n = yo();
|
|
@@ -2835,9 +2836,9 @@ function Ki() {
|
|
|
2835
2836
|
}, rr;
|
|
2836
2837
|
}
|
|
2837
2838
|
var Hn;
|
|
2838
|
-
function
|
|
2839
|
+
function ns() {
|
|
2839
2840
|
return Hn || (Hn = 1, function(e) {
|
|
2840
|
-
var t = /* @__PURE__ */
|
|
2841
|
+
var t = /* @__PURE__ */ ts(), n = /* @__PURE__ */ ot(), o = mo(), s = rs();
|
|
2841
2842
|
e.exports = function(r) {
|
|
2842
2843
|
var a = o(arguments), i = r.length - (arguments.length - 1);
|
|
2843
2844
|
return t(
|
|
@@ -2849,21 +2850,21 @@ function Yi() {
|
|
|
2849
2850
|
}(Xt)), Xt.exports;
|
|
2850
2851
|
}
|
|
2851
2852
|
var nr, Mn;
|
|
2852
|
-
function
|
|
2853
|
+
function os() {
|
|
2853
2854
|
if (Mn) return nr;
|
|
2854
2855
|
Mn = 1;
|
|
2855
|
-
var e = /* @__PURE__ */ jr(), t =
|
|
2856
|
-
return nr = function(s,
|
|
2857
|
-
var r = e(s, !!
|
|
2856
|
+
var e = /* @__PURE__ */ jr(), t = ns(), n = t(e("String.prototype.indexOf"));
|
|
2857
|
+
return nr = function(s, c) {
|
|
2858
|
+
var r = e(s, !!c);
|
|
2858
2859
|
return typeof r == "function" && n(s, ".prototype.") > -1 ? t(r) : r;
|
|
2859
2860
|
}, nr;
|
|
2860
2861
|
}
|
|
2861
|
-
const
|
|
2862
|
+
const as = /* @__PURE__ */ ia(sa);
|
|
2862
2863
|
var or, zn;
|
|
2863
|
-
function
|
|
2864
|
+
function is() {
|
|
2864
2865
|
if (zn) return or;
|
|
2865
2866
|
zn = 1;
|
|
2866
|
-
var e = typeof Map == "function" && Map.prototype, t = Object.getOwnPropertyDescriptor && e ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null, n = e && t && typeof t.get == "function" ? t.get : null, o = e && Map.prototype.forEach, s = typeof Set == "function" && Set.prototype,
|
|
2867
|
+
var e = typeof Map == "function" && Map.prototype, t = Object.getOwnPropertyDescriptor && e ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null, n = e && t && typeof t.get == "function" ? t.get : null, o = e && Map.prototype.forEach, s = typeof Set == "function" && Set.prototype, c = Object.getOwnPropertyDescriptor && s ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null, r = s && c && typeof c.get == "function" ? c.get : null, a = s && Set.prototype.forEach, i = typeof WeakMap == "function" && WeakMap.prototype, l = i ? WeakMap.prototype.has : null, f = typeof WeakSet == "function" && WeakSet.prototype, d = f ? WeakSet.prototype.has : null, y = typeof WeakRef == "function" && WeakRef.prototype, g = y ? WeakRef.prototype.deref : null, x = Boolean.prototype.valueOf, $ = Object.prototype.toString, p = Function.prototype.toString, h = String.prototype.match, m = String.prototype.slice, w = String.prototype.replace, T = String.prototype.toUpperCase, u = String.prototype.toLowerCase, O = RegExp.prototype.test, v = Array.prototype.concat, q = Array.prototype.join, L = Array.prototype.slice, N = Math.floor, B = typeof BigInt == "function" ? BigInt.prototype.valueOf : null, P = Object.getOwnPropertySymbols, ae = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Symbol.prototype.toString : null, H = typeof Symbol == "function" && typeof Symbol.iterator == "object", D = typeof Symbol == "function" && Symbol.toStringTag && (typeof Symbol.toStringTag === H || !0) ? Symbol.toStringTag : null, se = Object.prototype.propertyIsEnumerable, Z = (typeof Reflect == "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(j) {
|
|
2867
2868
|
return j.__proto__;
|
|
2868
2869
|
} : null);
|
|
2869
2870
|
function E(j, S) {
|
|
@@ -2873,13 +2874,13 @@ function es() {
|
|
|
2873
2874
|
if (typeof j == "number") {
|
|
2874
2875
|
var ee = j < 0 ? -N(-j) : N(j);
|
|
2875
2876
|
if (ee !== j) {
|
|
2876
|
-
var ie = String(ee), M =
|
|
2877
|
+
var ie = String(ee), M = m.call(S, ie.length + 1);
|
|
2877
2878
|
return w.call(ie, X, "$&_") + "." + w.call(w.call(M, /([0-9]{3})/g, "$&_"), /_$/, "");
|
|
2878
2879
|
}
|
|
2879
2880
|
}
|
|
2880
2881
|
return w.call(S, X, "$&_");
|
|
2881
2882
|
}
|
|
2882
|
-
var re =
|
|
2883
|
+
var re = as, R = re.custom, k = F(R) ? R : null;
|
|
2883
2884
|
or = function j(S, X, ee, ie) {
|
|
2884
2885
|
var M = X || {};
|
|
2885
2886
|
if (G(M, "quoteStyle") && M.quoteStyle !== "single" && M.quoteStyle !== "double")
|
|
@@ -2989,7 +2990,7 @@ function es() {
|
|
|
2989
2990
|
if (typeof globalThis < "u" && S === globalThis || typeof Ze < "u" && S === Ze)
|
|
2990
2991
|
return "{ [object globalThis] }";
|
|
2991
2992
|
if (!W(S) && !z(S)) {
|
|
2992
|
-
var ft = Ve(S, ge), Ar = Z ? Z(S) === Object.prototype : S instanceof Object || S.constructor === Object, pt = S instanceof Object ? "" : "null prototype", Ir = !Ar && D && Object(S) === S && D in S ?
|
|
2993
|
+
var ft = Ve(S, ge), Ar = Z ? Z(S) === Object.prototype : S instanceof Object || S.constructor === Object, pt = S instanceof Object ? "" : "null prototype", Ir = !Ar && D && Object(S) === S && D in S ? m.call(Y(S), 8, -1) : pt ? "Object" : "", So = Ar || typeof S.constructor != "function" ? "" : S.constructor.name ? S.constructor.name + " " : "", dt = So + (Ir || pt ? "[" + q.call(v.call([], Ir || [], pt || []), ": ") + "] " : "");
|
|
2993
2994
|
return ft.length === 0 ? dt + "{}" : Ae ? dt + "{" + it(ft, Ae) + "}" : dt + "{ " + q.call(ft, ", ") + " }";
|
|
2994
2995
|
}
|
|
2995
2996
|
return String(S);
|
|
@@ -3056,7 +3057,7 @@ function es() {
|
|
|
3056
3057
|
function oe(j) {
|
|
3057
3058
|
if (j.name)
|
|
3058
3059
|
return j.name;
|
|
3059
|
-
var S =
|
|
3060
|
+
var S = h.call(p.call(j), /^function\s*([\w$]+)/);
|
|
3060
3061
|
return S ? S[1] : null;
|
|
3061
3062
|
}
|
|
3062
3063
|
function he(j, S) {
|
|
@@ -3083,12 +3084,12 @@ function es() {
|
|
|
3083
3084
|
return !1;
|
|
3084
3085
|
}
|
|
3085
3086
|
function ke(j) {
|
|
3086
|
-
if (!
|
|
3087
|
+
if (!l || !j || typeof j != "object")
|
|
3087
3088
|
return !1;
|
|
3088
3089
|
try {
|
|
3089
|
-
|
|
3090
|
+
l.call(j, l);
|
|
3090
3091
|
try {
|
|
3091
|
-
|
|
3092
|
+
d.call(j, d);
|
|
3092
3093
|
} catch {
|
|
3093
3094
|
return !0;
|
|
3094
3095
|
}
|
|
@@ -3122,12 +3123,12 @@ function es() {
|
|
|
3122
3123
|
return !1;
|
|
3123
3124
|
}
|
|
3124
3125
|
function Ee(j) {
|
|
3125
|
-
if (!
|
|
3126
|
+
if (!d || !j || typeof j != "object")
|
|
3126
3127
|
return !1;
|
|
3127
3128
|
try {
|
|
3128
|
-
|
|
3129
|
+
d.call(j, d);
|
|
3129
3130
|
try {
|
|
3130
|
-
|
|
3131
|
+
l.call(j, l);
|
|
3131
3132
|
} catch {
|
|
3132
3133
|
return !0;
|
|
3133
3134
|
}
|
|
@@ -3142,7 +3143,7 @@ function es() {
|
|
|
3142
3143
|
function Pe(j, S) {
|
|
3143
3144
|
if (j.length > S.maxStringLength) {
|
|
3144
3145
|
var X = j.length - S.maxStringLength, ee = "... " + X + " more character" + (X > 1 ? "s" : "");
|
|
3145
|
-
return Pe(
|
|
3146
|
+
return Pe(m.call(j, 0, S.maxStringLength), S) + ee;
|
|
3146
3147
|
}
|
|
3147
3148
|
var ie = w.call(w.call(j, /(['\\])/g, "\\$1"), /[\x00-\x1f]/g, $o);
|
|
3148
3149
|
return U(ie, "single", S);
|
|
@@ -3218,58 +3219,58 @@ function es() {
|
|
|
3218
3219
|
return or;
|
|
3219
3220
|
}
|
|
3220
3221
|
var ar, Gn;
|
|
3221
|
-
function
|
|
3222
|
+
function ss() {
|
|
3222
3223
|
if (Gn) return ar;
|
|
3223
3224
|
Gn = 1;
|
|
3224
|
-
var e = /* @__PURE__ */ jr(), t =
|
|
3225
|
-
for (var
|
|
3226
|
-
if (w.key ===
|
|
3227
|
-
return
|
|
3228
|
-
|
|
3229
|
-
}, g = function(
|
|
3230
|
-
var
|
|
3231
|
-
return
|
|
3232
|
-
}, x = function(
|
|
3233
|
-
var w =
|
|
3234
|
-
w ? w.value =
|
|
3225
|
+
var e = /* @__PURE__ */ jr(), t = os(), n = /* @__PURE__ */ is(), o = /* @__PURE__ */ We(), s = e("%WeakMap%", !0), c = e("%Map%", !0), r = t("WeakMap.prototype.get", !0), a = t("WeakMap.prototype.set", !0), i = t("WeakMap.prototype.has", !0), l = t("Map.prototype.get", !0), f = t("Map.prototype.set", !0), d = t("Map.prototype.has", !0), y = function(p, h) {
|
|
3226
|
+
for (var m = p, w; (w = m.next) !== null; m = w)
|
|
3227
|
+
if (w.key === h)
|
|
3228
|
+
return m.next = w.next, w.next = /** @type {NonNullable<typeof list.next>} */
|
|
3229
|
+
p.next, p.next = w, w;
|
|
3230
|
+
}, g = function(p, h) {
|
|
3231
|
+
var m = y(p, h);
|
|
3232
|
+
return m && m.value;
|
|
3233
|
+
}, x = function(p, h, m) {
|
|
3234
|
+
var w = y(p, h);
|
|
3235
|
+
w ? w.value = m : p.next = /** @type {import('.').ListNode<typeof value>} */
|
|
3235
3236
|
{
|
|
3236
3237
|
// eslint-disable-line no-param-reassign, no-extra-parens
|
|
3237
|
-
key:
|
|
3238
|
-
next:
|
|
3239
|
-
value:
|
|
3238
|
+
key: h,
|
|
3239
|
+
next: p.next,
|
|
3240
|
+
value: m
|
|
3240
3241
|
};
|
|
3241
|
-
}, $ = function(
|
|
3242
|
-
return !!
|
|
3242
|
+
}, $ = function(p, h) {
|
|
3243
|
+
return !!y(p, h);
|
|
3243
3244
|
};
|
|
3244
3245
|
return ar = function() {
|
|
3245
|
-
var
|
|
3246
|
+
var h, m, w, T = {
|
|
3246
3247
|
assert: function(u) {
|
|
3247
3248
|
if (!T.has(u))
|
|
3248
3249
|
throw new o("Side channel does not contain " + n(u));
|
|
3249
3250
|
},
|
|
3250
3251
|
get: function(u) {
|
|
3251
3252
|
if (s && u && (typeof u == "object" || typeof u == "function")) {
|
|
3252
|
-
if (
|
|
3253
|
-
return r(
|
|
3254
|
-
} else if (
|
|
3255
|
-
if (
|
|
3256
|
-
return
|
|
3253
|
+
if (h)
|
|
3254
|
+
return r(h, u);
|
|
3255
|
+
} else if (c) {
|
|
3256
|
+
if (m)
|
|
3257
|
+
return l(m, u);
|
|
3257
3258
|
} else if (w)
|
|
3258
3259
|
return g(w, u);
|
|
3259
3260
|
},
|
|
3260
3261
|
has: function(u) {
|
|
3261
3262
|
if (s && u && (typeof u == "object" || typeof u == "function")) {
|
|
3262
|
-
if (
|
|
3263
|
-
return i(
|
|
3264
|
-
} else if (
|
|
3265
|
-
if (
|
|
3266
|
-
return m
|
|
3263
|
+
if (h)
|
|
3264
|
+
return i(h, u);
|
|
3265
|
+
} else if (c) {
|
|
3266
|
+
if (m)
|
|
3267
|
+
return d(m, u);
|
|
3267
3268
|
} else if (w)
|
|
3268
3269
|
return $(w, u);
|
|
3269
3270
|
return !1;
|
|
3270
3271
|
},
|
|
3271
3272
|
set: function(u, O) {
|
|
3272
|
-
s && u && (typeof u == "object" || typeof u == "function") ? (
|
|
3273
|
+
s && u && (typeof u == "object" || typeof u == "function") ? (h || (h = new s()), a(h, u, O)) : c ? (m || (m = new c()), f(m, u, O)) : (w || (w = { key: {}, next: null }), x(w, u, O));
|
|
3273
3274
|
}
|
|
3274
3275
|
};
|
|
3275
3276
|
return T;
|
|
@@ -3302,70 +3303,70 @@ function go() {
|
|
|
3302
3303
|
if (Jn) return sr;
|
|
3303
3304
|
Jn = 1;
|
|
3304
3305
|
var e = /* @__PURE__ */ wr(), t = Object.prototype.hasOwnProperty, n = Array.isArray, o = function() {
|
|
3305
|
-
for (var
|
|
3306
|
-
|
|
3307
|
-
return
|
|
3308
|
-
}(), s = function(
|
|
3309
|
-
for (;
|
|
3310
|
-
var
|
|
3306
|
+
for (var p = [], h = 0; h < 256; ++h)
|
|
3307
|
+
p.push("%" + ((h < 16 ? "0" : "") + h.toString(16)).toUpperCase());
|
|
3308
|
+
return p;
|
|
3309
|
+
}(), s = function(h) {
|
|
3310
|
+
for (; h.length > 1; ) {
|
|
3311
|
+
var m = h.pop(), w = m.obj[m.prop];
|
|
3311
3312
|
if (n(w)) {
|
|
3312
3313
|
for (var T = [], u = 0; u < w.length; ++u)
|
|
3313
3314
|
typeof w[u] < "u" && T.push(w[u]);
|
|
3314
|
-
|
|
3315
|
+
m.obj[m.prop] = T;
|
|
3315
3316
|
}
|
|
3316
3317
|
}
|
|
3317
|
-
},
|
|
3318
|
-
for (var w =
|
|
3319
|
-
typeof
|
|
3318
|
+
}, c = function(h, m) {
|
|
3319
|
+
for (var w = m && m.plainObjects ? /* @__PURE__ */ Object.create(null) : {}, T = 0; T < h.length; ++T)
|
|
3320
|
+
typeof h[T] < "u" && (w[T] = h[T]);
|
|
3320
3321
|
return w;
|
|
3321
|
-
}, r = function
|
|
3322
|
-
if (!
|
|
3323
|
-
return
|
|
3324
|
-
if (typeof
|
|
3325
|
-
if (n(
|
|
3326
|
-
|
|
3327
|
-
else if (
|
|
3328
|
-
(w && (w.plainObjects || w.allowPrototypes) || !t.call(Object.prototype,
|
|
3322
|
+
}, r = function p(h, m, w) {
|
|
3323
|
+
if (!m)
|
|
3324
|
+
return h;
|
|
3325
|
+
if (typeof m != "object") {
|
|
3326
|
+
if (n(h))
|
|
3327
|
+
h.push(m);
|
|
3328
|
+
else if (h && typeof h == "object")
|
|
3329
|
+
(w && (w.plainObjects || w.allowPrototypes) || !t.call(Object.prototype, m)) && (h[m] = !0);
|
|
3329
3330
|
else
|
|
3330
|
-
return [
|
|
3331
|
-
return
|
|
3331
|
+
return [h, m];
|
|
3332
|
+
return h;
|
|
3332
3333
|
}
|
|
3333
|
-
if (!
|
|
3334
|
-
return [
|
|
3335
|
-
var T =
|
|
3336
|
-
return n(
|
|
3337
|
-
if (t.call(
|
|
3338
|
-
var v =
|
|
3339
|
-
v && typeof v == "object" && u && typeof u == "object" ?
|
|
3334
|
+
if (!h || typeof h != "object")
|
|
3335
|
+
return [h].concat(m);
|
|
3336
|
+
var T = h;
|
|
3337
|
+
return n(h) && !n(m) && (T = c(h, w)), n(h) && n(m) ? (m.forEach(function(u, O) {
|
|
3338
|
+
if (t.call(h, O)) {
|
|
3339
|
+
var v = h[O];
|
|
3340
|
+
v && typeof v == "object" && u && typeof u == "object" ? h[O] = p(v, u, w) : h.push(u);
|
|
3340
3341
|
} else
|
|
3341
|
-
|
|
3342
|
-
}),
|
|
3343
|
-
var v =
|
|
3344
|
-
return t.call(u, O) ? u[O] =
|
|
3342
|
+
h[O] = u;
|
|
3343
|
+
}), h) : Object.keys(m).reduce(function(u, O) {
|
|
3344
|
+
var v = m[O];
|
|
3345
|
+
return t.call(u, O) ? u[O] = p(u[O], v, w) : u[O] = v, u;
|
|
3345
3346
|
}, T);
|
|
3346
|
-
}, a = function(
|
|
3347
|
-
return Object.keys(
|
|
3348
|
-
return w[T] =
|
|
3349
|
-
},
|
|
3350
|
-
}, i = function(
|
|
3351
|
-
var w =
|
|
3352
|
-
if (
|
|
3347
|
+
}, a = function(h, m) {
|
|
3348
|
+
return Object.keys(m).reduce(function(w, T) {
|
|
3349
|
+
return w[T] = m[T], w;
|
|
3350
|
+
}, h);
|
|
3351
|
+
}, i = function(p, h, m) {
|
|
3352
|
+
var w = p.replace(/\+/g, " ");
|
|
3353
|
+
if (m === "iso-8859-1")
|
|
3353
3354
|
return w.replace(/%[0-9a-f]{2}/gi, unescape);
|
|
3354
3355
|
try {
|
|
3355
3356
|
return decodeURIComponent(w);
|
|
3356
3357
|
} catch {
|
|
3357
3358
|
return w;
|
|
3358
3359
|
}
|
|
3359
|
-
},
|
|
3360
|
-
if (
|
|
3361
|
-
return
|
|
3362
|
-
var O =
|
|
3363
|
-
if (typeof
|
|
3360
|
+
}, l = 1024, f = function(h, m, w, T, u) {
|
|
3361
|
+
if (h.length === 0)
|
|
3362
|
+
return h;
|
|
3363
|
+
var O = h;
|
|
3364
|
+
if (typeof h == "symbol" ? O = Symbol.prototype.toString.call(h) : typeof h != "string" && (O = String(h)), w === "iso-8859-1")
|
|
3364
3365
|
return escape(O).replace(/%u[0-9a-f]{4}/gi, function(ae) {
|
|
3365
3366
|
return "%26%23" + parseInt(ae.slice(2), 16) + "%3B";
|
|
3366
3367
|
});
|
|
3367
|
-
for (var v = "", q = 0; q < O.length; q +=
|
|
3368
|
-
for (var L = O.length >=
|
|
3368
|
+
for (var v = "", q = 0; q < O.length; q += l) {
|
|
3369
|
+
for (var L = O.length >= l ? O.slice(q, q + l) : O, N = [], B = 0; B < L.length; ++B) {
|
|
3369
3370
|
var P = L.charCodeAt(B);
|
|
3370
3371
|
if (P === 45 || P === 46 || P === 95 || P === 126 || P >= 48 && P <= 57 || P >= 65 && P <= 90 || P >= 97 && P <= 122 || u === e.RFC1738 && (P === 40 || P === 41)) {
|
|
3371
3372
|
N[N.length] = L.charAt(B);
|
|
@@ -3388,58 +3389,58 @@ function go() {
|
|
|
3388
3389
|
v += N.join("");
|
|
3389
3390
|
}
|
|
3390
3391
|
return v;
|
|
3391
|
-
},
|
|
3392
|
-
for (var
|
|
3393
|
-
for (var u =
|
|
3392
|
+
}, d = function(h) {
|
|
3393
|
+
for (var m = [{ obj: { o: h }, prop: "o" }], w = [], T = 0; T < m.length; ++T)
|
|
3394
|
+
for (var u = m[T], O = u.obj[u.prop], v = Object.keys(O), q = 0; q < v.length; ++q) {
|
|
3394
3395
|
var L = v[q], N = O[L];
|
|
3395
|
-
typeof N == "object" && N !== null && w.indexOf(N) === -1 && (
|
|
3396
|
+
typeof N == "object" && N !== null && w.indexOf(N) === -1 && (m.push({ obj: O, prop: L }), w.push(N));
|
|
3396
3397
|
}
|
|
3397
|
-
return s(
|
|
3398
|
-
},
|
|
3399
|
-
return Object.prototype.toString.call(
|
|
3400
|
-
}, g = function(
|
|
3401
|
-
return !
|
|
3402
|
-
}, x = function(
|
|
3403
|
-
return [].concat(
|
|
3404
|
-
}, $ = function(
|
|
3405
|
-
if (n(
|
|
3406
|
-
for (var w = [], T = 0; T <
|
|
3407
|
-
w.push(
|
|
3398
|
+
return s(m), h;
|
|
3399
|
+
}, y = function(h) {
|
|
3400
|
+
return Object.prototype.toString.call(h) === "[object RegExp]";
|
|
3401
|
+
}, g = function(h) {
|
|
3402
|
+
return !h || typeof h != "object" ? !1 : !!(h.constructor && h.constructor.isBuffer && h.constructor.isBuffer(h));
|
|
3403
|
+
}, x = function(h, m) {
|
|
3404
|
+
return [].concat(h, m);
|
|
3405
|
+
}, $ = function(h, m) {
|
|
3406
|
+
if (n(h)) {
|
|
3407
|
+
for (var w = [], T = 0; T < h.length; T += 1)
|
|
3408
|
+
w.push(m(h[T]));
|
|
3408
3409
|
return w;
|
|
3409
3410
|
}
|
|
3410
|
-
return
|
|
3411
|
+
return m(h);
|
|
3411
3412
|
};
|
|
3412
3413
|
return sr = {
|
|
3413
|
-
arrayToObject:
|
|
3414
|
+
arrayToObject: c,
|
|
3414
3415
|
assign: a,
|
|
3415
3416
|
combine: x,
|
|
3416
|
-
compact:
|
|
3417
|
+
compact: d,
|
|
3417
3418
|
decode: i,
|
|
3418
|
-
encode:
|
|
3419
|
+
encode: f,
|
|
3419
3420
|
isBuffer: g,
|
|
3420
|
-
isRegExp:
|
|
3421
|
+
isRegExp: y,
|
|
3421
3422
|
maybeMap: $,
|
|
3422
3423
|
merge: r
|
|
3423
3424
|
}, sr;
|
|
3424
3425
|
}
|
|
3425
3426
|
var cr, Vn;
|
|
3426
|
-
function
|
|
3427
|
+
function cs() {
|
|
3427
3428
|
if (Vn) return cr;
|
|
3428
3429
|
Vn = 1;
|
|
3429
|
-
var e =
|
|
3430
|
-
brackets: function(
|
|
3431
|
-
return
|
|
3430
|
+
var e = ss(), t = /* @__PURE__ */ go(), n = /* @__PURE__ */ wr(), o = Object.prototype.hasOwnProperty, s = {
|
|
3431
|
+
brackets: function(p) {
|
|
3432
|
+
return p + "[]";
|
|
3432
3433
|
},
|
|
3433
3434
|
comma: "comma",
|
|
3434
|
-
indices: function(
|
|
3435
|
-
return
|
|
3435
|
+
indices: function(p, h) {
|
|
3436
|
+
return p + "[" + h + "]";
|
|
3436
3437
|
},
|
|
3437
|
-
repeat: function(
|
|
3438
|
-
return
|
|
3438
|
+
repeat: function(p) {
|
|
3439
|
+
return p;
|
|
3439
3440
|
}
|
|
3440
|
-
},
|
|
3441
|
-
r.apply($,
|
|
3442
|
-
}, i = Date.prototype.toISOString,
|
|
3441
|
+
}, c = Array.isArray, r = Array.prototype.push, a = function($, p) {
|
|
3442
|
+
r.apply($, c(p) ? p : [p]);
|
|
3443
|
+
}, i = Date.prototype.toISOString, l = n.default, f = {
|
|
3443
3444
|
addQueryPrefix: !1,
|
|
3444
3445
|
allowDots: !1,
|
|
3445
3446
|
allowEmptyArrays: !1,
|
|
@@ -3451,72 +3452,72 @@ function rs() {
|
|
|
3451
3452
|
encodeDotInKeys: !1,
|
|
3452
3453
|
encoder: t.encode,
|
|
3453
3454
|
encodeValuesOnly: !1,
|
|
3454
|
-
format:
|
|
3455
|
-
formatter: n.formatters[
|
|
3455
|
+
format: l,
|
|
3456
|
+
formatter: n.formatters[l],
|
|
3456
3457
|
// deprecated
|
|
3457
3458
|
indices: !1,
|
|
3458
|
-
serializeDate: function(
|
|
3459
|
-
return i.call(
|
|
3459
|
+
serializeDate: function(p) {
|
|
3460
|
+
return i.call(p);
|
|
3460
3461
|
},
|
|
3461
3462
|
skipNulls: !1,
|
|
3462
3463
|
strictNullHandling: !1
|
|
3463
|
-
},
|
|
3464
|
-
return typeof
|
|
3465
|
-
},
|
|
3466
|
-
for (var E =
|
|
3467
|
-
var U = re.get(
|
|
3464
|
+
}, d = function(p) {
|
|
3465
|
+
return typeof p == "string" || typeof p == "number" || typeof p == "boolean" || typeof p == "symbol" || typeof p == "bigint";
|
|
3466
|
+
}, y = {}, g = function $(p, h, m, w, T, u, O, v, q, L, N, B, P, ae, H, D, se, Z) {
|
|
3467
|
+
for (var E = p, re = Z, R = 0, k = !1; (re = re.get(y)) !== void 0 && !k; ) {
|
|
3468
|
+
var U = re.get(p);
|
|
3468
3469
|
if (R += 1, typeof U < "u") {
|
|
3469
3470
|
if (U === R)
|
|
3470
3471
|
throw new RangeError("Cyclic object value");
|
|
3471
3472
|
k = !0;
|
|
3472
3473
|
}
|
|
3473
|
-
typeof re.get(
|
|
3474
|
+
typeof re.get(y) > "u" && (R = 0);
|
|
3474
3475
|
}
|
|
3475
|
-
if (typeof L == "function" ? E = L(
|
|
3476
|
+
if (typeof L == "function" ? E = L(h, E) : E instanceof Date ? E = P(E) : m === "comma" && c(E) && (E = t.maybeMap(E, function(Y) {
|
|
3476
3477
|
return Y instanceof Date ? P(Y) : Y;
|
|
3477
3478
|
})), E === null) {
|
|
3478
3479
|
if (u)
|
|
3479
|
-
return q && !D ? q(
|
|
3480
|
+
return q && !D ? q(h, f.encoder, se, "key", ae) : h;
|
|
3480
3481
|
E = "";
|
|
3481
3482
|
}
|
|
3482
|
-
if (
|
|
3483
|
+
if (d(E) || t.isBuffer(E)) {
|
|
3483
3484
|
if (q) {
|
|
3484
|
-
var C = D ?
|
|
3485
|
-
return [H(C) + "=" + H(q(E,
|
|
3485
|
+
var C = D ? h : q(h, f.encoder, se, "key", ae);
|
|
3486
|
+
return [H(C) + "=" + H(q(E, f.encoder, se, "value", ae))];
|
|
3486
3487
|
}
|
|
3487
|
-
return [H(
|
|
3488
|
+
return [H(h) + "=" + H(String(E))];
|
|
3488
3489
|
}
|
|
3489
3490
|
var I = [];
|
|
3490
3491
|
if (typeof E > "u")
|
|
3491
3492
|
return I;
|
|
3492
3493
|
var W;
|
|
3493
|
-
if (
|
|
3494
|
+
if (m === "comma" && c(E))
|
|
3494
3495
|
D && q && (E = t.maybeMap(E, q)), W = [{ value: E.length > 0 ? E.join(",") || null : void 0 }];
|
|
3495
|
-
else if (
|
|
3496
|
+
else if (c(L))
|
|
3496
3497
|
W = L;
|
|
3497
3498
|
else {
|
|
3498
3499
|
var z = Object.keys(E);
|
|
3499
3500
|
W = N ? z.sort(N) : z;
|
|
3500
3501
|
}
|
|
3501
|
-
var K = v ?
|
|
3502
|
-
if (T &&
|
|
3502
|
+
var K = v ? h.replace(/\./g, "%2E") : h, ne = w && c(E) && E.length === 1 ? K + "[]" : K;
|
|
3503
|
+
if (T && c(E) && E.length === 0)
|
|
3503
3504
|
return ne + "[]";
|
|
3504
3505
|
for (var J = 0; J < W.length; ++J) {
|
|
3505
3506
|
var A = W[J], F = typeof A == "object" && typeof A.value < "u" ? A.value : E[A];
|
|
3506
3507
|
if (!(O && F === null)) {
|
|
3507
|
-
var _ = B && v ? A.replace(/\./g, "%2E") : A, Q =
|
|
3508
|
-
Z.set(
|
|
3508
|
+
var _ = B && v ? A.replace(/\./g, "%2E") : A, Q = c(E) ? typeof m == "function" ? m(ne, _) : ne : ne + (B ? "." + _ : "[" + _ + "]");
|
|
3509
|
+
Z.set(p, R);
|
|
3509
3510
|
var G = e();
|
|
3510
|
-
G.set(
|
|
3511
|
+
G.set(y, Z), a(I, $(
|
|
3511
3512
|
F,
|
|
3512
3513
|
Q,
|
|
3513
|
-
|
|
3514
|
+
m,
|
|
3514
3515
|
w,
|
|
3515
3516
|
T,
|
|
3516
3517
|
u,
|
|
3517
3518
|
O,
|
|
3518
3519
|
v,
|
|
3519
|
-
|
|
3520
|
+
m === "comma" && D && c(E) ? null : q,
|
|
3520
3521
|
L,
|
|
3521
3522
|
N,
|
|
3522
3523
|
B,
|
|
@@ -3530,89 +3531,89 @@ function rs() {
|
|
|
3530
3531
|
}
|
|
3531
3532
|
}
|
|
3532
3533
|
return I;
|
|
3533
|
-
}, x = function(
|
|
3534
|
-
if (!
|
|
3535
|
-
return
|
|
3536
|
-
if (typeof
|
|
3534
|
+
}, x = function(p) {
|
|
3535
|
+
if (!p)
|
|
3536
|
+
return f;
|
|
3537
|
+
if (typeof p.allowEmptyArrays < "u" && typeof p.allowEmptyArrays != "boolean")
|
|
3537
3538
|
throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
|
|
3538
|
-
if (typeof
|
|
3539
|
+
if (typeof p.encodeDotInKeys < "u" && typeof p.encodeDotInKeys != "boolean")
|
|
3539
3540
|
throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");
|
|
3540
|
-
if (
|
|
3541
|
+
if (p.encoder !== null && typeof p.encoder < "u" && typeof p.encoder != "function")
|
|
3541
3542
|
throw new TypeError("Encoder has to be a function.");
|
|
3542
|
-
var
|
|
3543
|
-
if (typeof
|
|
3543
|
+
var h = p.charset || f.charset;
|
|
3544
|
+
if (typeof p.charset < "u" && p.charset !== "utf-8" && p.charset !== "iso-8859-1")
|
|
3544
3545
|
throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
|
|
3545
|
-
var
|
|
3546
|
-
if (typeof
|
|
3547
|
-
if (!o.call(n.formatters,
|
|
3546
|
+
var m = n.default;
|
|
3547
|
+
if (typeof p.format < "u") {
|
|
3548
|
+
if (!o.call(n.formatters, p.format))
|
|
3548
3549
|
throw new TypeError("Unknown format option provided.");
|
|
3549
|
-
|
|
3550
|
+
m = p.format;
|
|
3550
3551
|
}
|
|
3551
|
-
var w = n.formatters[
|
|
3552
|
-
(typeof
|
|
3552
|
+
var w = n.formatters[m], T = f.filter;
|
|
3553
|
+
(typeof p.filter == "function" || c(p.filter)) && (T = p.filter);
|
|
3553
3554
|
var u;
|
|
3554
|
-
if (
|
|
3555
|
+
if (p.arrayFormat in s ? u = p.arrayFormat : "indices" in p ? u = p.indices ? "indices" : "repeat" : u = f.arrayFormat, "commaRoundTrip" in p && typeof p.commaRoundTrip != "boolean")
|
|
3555
3556
|
throw new TypeError("`commaRoundTrip` must be a boolean, or absent");
|
|
3556
|
-
var O = typeof
|
|
3557
|
+
var O = typeof p.allowDots > "u" ? p.encodeDotInKeys === !0 ? !0 : f.allowDots : !!p.allowDots;
|
|
3557
3558
|
return {
|
|
3558
|
-
addQueryPrefix: typeof
|
|
3559
|
+
addQueryPrefix: typeof p.addQueryPrefix == "boolean" ? p.addQueryPrefix : f.addQueryPrefix,
|
|
3559
3560
|
allowDots: O,
|
|
3560
|
-
allowEmptyArrays: typeof
|
|
3561
|
+
allowEmptyArrays: typeof p.allowEmptyArrays == "boolean" ? !!p.allowEmptyArrays : f.allowEmptyArrays,
|
|
3561
3562
|
arrayFormat: u,
|
|
3562
|
-
charset:
|
|
3563
|
-
charsetSentinel: typeof
|
|
3564
|
-
commaRoundTrip:
|
|
3565
|
-
delimiter: typeof
|
|
3566
|
-
encode: typeof
|
|
3567
|
-
encodeDotInKeys: typeof
|
|
3568
|
-
encoder: typeof
|
|
3569
|
-
encodeValuesOnly: typeof
|
|
3563
|
+
charset: h,
|
|
3564
|
+
charsetSentinel: typeof p.charsetSentinel == "boolean" ? p.charsetSentinel : f.charsetSentinel,
|
|
3565
|
+
commaRoundTrip: p.commaRoundTrip,
|
|
3566
|
+
delimiter: typeof p.delimiter > "u" ? f.delimiter : p.delimiter,
|
|
3567
|
+
encode: typeof p.encode == "boolean" ? p.encode : f.encode,
|
|
3568
|
+
encodeDotInKeys: typeof p.encodeDotInKeys == "boolean" ? p.encodeDotInKeys : f.encodeDotInKeys,
|
|
3569
|
+
encoder: typeof p.encoder == "function" ? p.encoder : f.encoder,
|
|
3570
|
+
encodeValuesOnly: typeof p.encodeValuesOnly == "boolean" ? p.encodeValuesOnly : f.encodeValuesOnly,
|
|
3570
3571
|
filter: T,
|
|
3571
|
-
format:
|
|
3572
|
+
format: m,
|
|
3572
3573
|
formatter: w,
|
|
3573
|
-
serializeDate: typeof
|
|
3574
|
-
skipNulls: typeof
|
|
3575
|
-
sort: typeof
|
|
3576
|
-
strictNullHandling: typeof
|
|
3574
|
+
serializeDate: typeof p.serializeDate == "function" ? p.serializeDate : f.serializeDate,
|
|
3575
|
+
skipNulls: typeof p.skipNulls == "boolean" ? p.skipNulls : f.skipNulls,
|
|
3576
|
+
sort: typeof p.sort == "function" ? p.sort : null,
|
|
3577
|
+
strictNullHandling: typeof p.strictNullHandling == "boolean" ? p.strictNullHandling : f.strictNullHandling
|
|
3577
3578
|
};
|
|
3578
3579
|
};
|
|
3579
|
-
return cr = function($,
|
|
3580
|
-
var
|
|
3581
|
-
typeof
|
|
3580
|
+
return cr = function($, p) {
|
|
3581
|
+
var h = $, m = x(p), w, T;
|
|
3582
|
+
typeof m.filter == "function" ? (T = m.filter, h = T("", h)) : c(m.filter) && (T = m.filter, w = T);
|
|
3582
3583
|
var u = [];
|
|
3583
|
-
if (typeof
|
|
3584
|
+
if (typeof h != "object" || h === null)
|
|
3584
3585
|
return "";
|
|
3585
|
-
var O = s[
|
|
3586
|
-
w || (w = Object.keys(
|
|
3586
|
+
var O = s[m.arrayFormat], v = O === "comma" && m.commaRoundTrip;
|
|
3587
|
+
w || (w = Object.keys(h)), m.sort && w.sort(m.sort);
|
|
3587
3588
|
for (var q = e(), L = 0; L < w.length; ++L) {
|
|
3588
3589
|
var N = w[L];
|
|
3589
|
-
|
|
3590
|
-
|
|
3590
|
+
m.skipNulls && h[N] === null || a(u, g(
|
|
3591
|
+
h[N],
|
|
3591
3592
|
N,
|
|
3592
3593
|
O,
|
|
3593
3594
|
v,
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3595
|
+
m.allowEmptyArrays,
|
|
3596
|
+
m.strictNullHandling,
|
|
3597
|
+
m.skipNulls,
|
|
3598
|
+
m.encodeDotInKeys,
|
|
3599
|
+
m.encode ? m.encoder : null,
|
|
3600
|
+
m.filter,
|
|
3601
|
+
m.sort,
|
|
3602
|
+
m.allowDots,
|
|
3603
|
+
m.serializeDate,
|
|
3604
|
+
m.format,
|
|
3605
|
+
m.formatter,
|
|
3606
|
+
m.encodeValuesOnly,
|
|
3607
|
+
m.charset,
|
|
3607
3608
|
q
|
|
3608
3609
|
));
|
|
3609
3610
|
}
|
|
3610
|
-
var B = u.join(
|
|
3611
|
-
return
|
|
3611
|
+
var B = u.join(m.delimiter), P = m.addQueryPrefix === !0 ? "?" : "";
|
|
3612
|
+
return m.charsetSentinel && (m.charset === "iso-8859-1" ? P += "utf8=%26%2310003%3B&" : P += "utf8=%E2%9C%93&"), B.length > 0 ? P + B : "";
|
|
3612
3613
|
}, cr;
|
|
3613
3614
|
}
|
|
3614
3615
|
var lr, Dn;
|
|
3615
|
-
function
|
|
3616
|
+
function ls() {
|
|
3616
3617
|
if (Dn) return lr;
|
|
3617
3618
|
Dn = 1;
|
|
3618
3619
|
var e = /* @__PURE__ */ go(), t = Object.prototype.hasOwnProperty, n = Array.isArray, o = {
|
|
@@ -3636,24 +3637,24 @@ function ns() {
|
|
|
3636
3637
|
plainObjects: !1,
|
|
3637
3638
|
strictDepth: !1,
|
|
3638
3639
|
strictNullHandling: !1
|
|
3639
|
-
}, s = function(
|
|
3640
|
-
return
|
|
3640
|
+
}, s = function(y) {
|
|
3641
|
+
return y.replace(/&#(\d+);/g, function(g, x) {
|
|
3641
3642
|
return String.fromCharCode(parseInt(x, 10));
|
|
3642
3643
|
});
|
|
3643
|
-
},
|
|
3644
|
-
return
|
|
3644
|
+
}, c = function(y, g) {
|
|
3645
|
+
return y && typeof y == "string" && g.comma && y.indexOf(",") > -1 ? y.split(",") : y;
|
|
3645
3646
|
}, r = "utf8=%26%2310003%3B", a = "utf8=%E2%9C%93", i = function(g, x) {
|
|
3646
|
-
var $ = { __proto__: null },
|
|
3647
|
-
|
|
3648
|
-
var
|
|
3647
|
+
var $ = { __proto__: null }, p = x.ignoreQueryPrefix ? g.replace(/^\?/, "") : g;
|
|
3648
|
+
p = p.replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
3649
|
+
var h = x.parameterLimit === 1 / 0 ? void 0 : x.parameterLimit, m = p.split(x.delimiter, h), w = -1, T, u = x.charset;
|
|
3649
3650
|
if (x.charsetSentinel)
|
|
3650
|
-
for (T = 0; T <
|
|
3651
|
-
|
|
3652
|
-
for (T = 0; T <
|
|
3651
|
+
for (T = 0; T < m.length; ++T)
|
|
3652
|
+
m[T].indexOf("utf8=") === 0 && (m[T] === a ? u = "utf-8" : m[T] === r && (u = "iso-8859-1"), w = T, T = m.length);
|
|
3653
|
+
for (T = 0; T < m.length; ++T)
|
|
3653
3654
|
if (T !== w) {
|
|
3654
|
-
var O =
|
|
3655
|
+
var O = m[T], v = O.indexOf("]="), q = v === -1 ? O.indexOf("=") : v + 1, L, N;
|
|
3655
3656
|
q === -1 ? (L = x.decoder(O, o.decoder, u, "key"), N = x.strictNullHandling ? null : "") : (L = x.decoder(O.slice(0, q), o.decoder, u, "key"), N = e.maybeMap(
|
|
3656
|
-
|
|
3657
|
+
c(O.slice(q + 1), x),
|
|
3657
3658
|
function(P) {
|
|
3658
3659
|
return x.decoder(P, o.decoder, u, "value");
|
|
3659
3660
|
}
|
|
@@ -3662,28 +3663,28 @@ function ns() {
|
|
|
3662
3663
|
B && x.duplicates === "combine" ? $[L] = e.combine($[L], N) : (!B || x.duplicates === "last") && ($[L] = N);
|
|
3663
3664
|
}
|
|
3664
3665
|
return $;
|
|
3665
|
-
},
|
|
3666
|
-
for (var
|
|
3667
|
-
var
|
|
3666
|
+
}, l = function(y, g, x, $) {
|
|
3667
|
+
for (var p = $ ? g : c(g, x), h = y.length - 1; h >= 0; --h) {
|
|
3668
|
+
var m, w = y[h];
|
|
3668
3669
|
if (w === "[]" && x.parseArrays)
|
|
3669
|
-
|
|
3670
|
+
m = x.allowEmptyArrays && (p === "" || x.strictNullHandling && p === null) ? [] : [].concat(p);
|
|
3670
3671
|
else {
|
|
3671
|
-
|
|
3672
|
+
m = x.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
|
|
3672
3673
|
var T = w.charAt(0) === "[" && w.charAt(w.length - 1) === "]" ? w.slice(1, -1) : w, u = x.decodeDotInKeys ? T.replace(/%2E/g, ".") : T, O = parseInt(u, 10);
|
|
3673
|
-
!x.parseArrays && u === "" ?
|
|
3674
|
+
!x.parseArrays && u === "" ? m = { 0: p } : !isNaN(O) && w !== u && String(O) === u && O >= 0 && x.parseArrays && O <= x.arrayLimit ? (m = [], m[O] = p) : u !== "__proto__" && (m[u] = p);
|
|
3674
3675
|
}
|
|
3675
|
-
|
|
3676
|
+
p = m;
|
|
3676
3677
|
}
|
|
3677
|
-
return
|
|
3678
|
-
},
|
|
3678
|
+
return p;
|
|
3679
|
+
}, f = function(g, x, $, p) {
|
|
3679
3680
|
if (g) {
|
|
3680
|
-
var
|
|
3681
|
+
var h = $.allowDots ? g.replace(/\.([^.[]+)/g, "[$1]") : g, m = /(\[[^[\]]*])/, w = /(\[[^[\]]*])/g, T = $.depth > 0 && m.exec(h), u = T ? h.slice(0, T.index) : h, O = [];
|
|
3681
3682
|
if (u) {
|
|
3682
3683
|
if (!$.plainObjects && t.call(Object.prototype, u) && !$.allowPrototypes)
|
|
3683
3684
|
return;
|
|
3684
3685
|
O.push(u);
|
|
3685
3686
|
}
|
|
3686
|
-
for (var v = 0; $.depth > 0 && (T = w.exec(
|
|
3687
|
+
for (var v = 0; $.depth > 0 && (T = w.exec(h)) !== null && v < $.depth; ) {
|
|
3687
3688
|
if (v += 1, !$.plainObjects && t.call(Object.prototype, T[1].slice(1, -1)) && !$.allowPrototypes)
|
|
3688
3689
|
return;
|
|
3689
3690
|
O.push(T[1]);
|
|
@@ -3691,11 +3692,11 @@ function ns() {
|
|
|
3691
3692
|
if (T) {
|
|
3692
3693
|
if ($.strictDepth === !0)
|
|
3693
3694
|
throw new RangeError("Input depth exceeded depth option of " + $.depth + " and strictDepth is true");
|
|
3694
|
-
O.push("[" +
|
|
3695
|
+
O.push("[" + h.slice(T.index) + "]");
|
|
3695
3696
|
}
|
|
3696
|
-
return
|
|
3697
|
+
return l(O, x, $, p);
|
|
3697
3698
|
}
|
|
3698
|
-
},
|
|
3699
|
+
}, d = function(g) {
|
|
3699
3700
|
if (!g)
|
|
3700
3701
|
return o;
|
|
3701
3702
|
if (typeof g.allowEmptyArrays < "u" && typeof g.allowEmptyArrays != "boolean")
|
|
@@ -3709,9 +3710,9 @@ function ns() {
|
|
|
3709
3710
|
var x = typeof g.charset > "u" ? o.charset : g.charset, $ = typeof g.duplicates > "u" ? o.duplicates : g.duplicates;
|
|
3710
3711
|
if ($ !== "combine" && $ !== "first" && $ !== "last")
|
|
3711
3712
|
throw new TypeError("The duplicates option must be either combine, first, or last");
|
|
3712
|
-
var
|
|
3713
|
+
var p = typeof g.allowDots > "u" ? g.decodeDotInKeys === !0 ? !0 : o.allowDots : !!g.allowDots;
|
|
3713
3714
|
return {
|
|
3714
|
-
allowDots:
|
|
3715
|
+
allowDots: p,
|
|
3715
3716
|
allowEmptyArrays: typeof g.allowEmptyArrays == "boolean" ? !!g.allowEmptyArrays : o.allowEmptyArrays,
|
|
3716
3717
|
allowPrototypes: typeof g.allowPrototypes == "boolean" ? g.allowPrototypes : o.allowPrototypes,
|
|
3717
3718
|
allowSparse: typeof g.allowSparse == "boolean" ? g.allowSparse : o.allowSparse,
|
|
@@ -3734,22 +3735,22 @@ function ns() {
|
|
|
3734
3735
|
strictNullHandling: typeof g.strictNullHandling == "boolean" ? g.strictNullHandling : o.strictNullHandling
|
|
3735
3736
|
};
|
|
3736
3737
|
};
|
|
3737
|
-
return lr = function(
|
|
3738
|
-
var x =
|
|
3739
|
-
if (
|
|
3738
|
+
return lr = function(y, g) {
|
|
3739
|
+
var x = d(g);
|
|
3740
|
+
if (y === "" || y === null || typeof y > "u")
|
|
3740
3741
|
return x.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
|
|
3741
|
-
for (var $ = typeof
|
|
3742
|
-
var w =
|
|
3743
|
-
|
|
3742
|
+
for (var $ = typeof y == "string" ? i(y, x) : y, p = x.plainObjects ? /* @__PURE__ */ Object.create(null) : {}, h = Object.keys($), m = 0; m < h.length; ++m) {
|
|
3743
|
+
var w = h[m], T = f(w, $[w], x, typeof y == "string");
|
|
3744
|
+
p = e.merge(p, T, x);
|
|
3744
3745
|
}
|
|
3745
|
-
return x.allowSparse === !0 ?
|
|
3746
|
+
return x.allowSparse === !0 ? p : e.compact(p);
|
|
3746
3747
|
}, lr;
|
|
3747
3748
|
}
|
|
3748
3749
|
var ur, Qn;
|
|
3749
3750
|
function vo() {
|
|
3750
3751
|
if (Qn) return ur;
|
|
3751
3752
|
Qn = 1;
|
|
3752
|
-
var e = /* @__PURE__ */
|
|
3753
|
+
var e = /* @__PURE__ */ cs(), t = /* @__PURE__ */ ls(), n = /* @__PURE__ */ wr();
|
|
3753
3754
|
return ur = {
|
|
3754
3755
|
formats: n,
|
|
3755
3756
|
parse: t,
|
|
@@ -3757,14 +3758,14 @@ function vo() {
|
|
|
3757
3758
|
}, ur;
|
|
3758
3759
|
}
|
|
3759
3760
|
var Kn;
|
|
3760
|
-
function
|
|
3761
|
+
function us() {
|
|
3761
3762
|
if (Kn) return Re;
|
|
3762
3763
|
Kn = 1;
|
|
3763
|
-
var e =
|
|
3764
|
+
var e = ki();
|
|
3764
3765
|
function t() {
|
|
3765
3766
|
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;
|
|
3766
3767
|
}
|
|
3767
|
-
var n = /^([a-z0-9.+-]+:)/i, o = /:[0-9]*$/, s = /^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,
|
|
3768
|
+
var n = /^([a-z0-9.+-]+:)/i, o = /:[0-9]*$/, s = /^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/, c = [
|
|
3768
3769
|
"<",
|
|
3769
3770
|
">",
|
|
3770
3771
|
'"',
|
|
@@ -3781,17 +3782,17 @@ function os() {
|
|
|
3781
3782
|
"\\",
|
|
3782
3783
|
"^",
|
|
3783
3784
|
"`"
|
|
3784
|
-
].concat(
|
|
3785
|
+
].concat(c), a = ["'"].concat(r), i = [
|
|
3785
3786
|
"%",
|
|
3786
3787
|
"/",
|
|
3787
3788
|
"?",
|
|
3788
3789
|
";",
|
|
3789
3790
|
"#"
|
|
3790
|
-
].concat(a),
|
|
3791
|
+
].concat(a), l = [
|
|
3791
3792
|
"/",
|
|
3792
3793
|
"?",
|
|
3793
3794
|
"#"
|
|
3794
|
-
],
|
|
3795
|
+
], f = 255, d = /^[+a-z0-9A-Z_-]{0,63}$/, y = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, g = {
|
|
3795
3796
|
javascript: !0,
|
|
3796
3797
|
"javascript:": !0
|
|
3797
3798
|
}, x = {
|
|
@@ -3808,8 +3809,8 @@ function os() {
|
|
|
3808
3809
|
"ftp:": !0,
|
|
3809
3810
|
"gopher:": !0,
|
|
3810
3811
|
"file:": !0
|
|
3811
|
-
},
|
|
3812
|
-
function
|
|
3812
|
+
}, p = /* @__PURE__ */ vo();
|
|
3813
|
+
function h(u, O, v) {
|
|
3813
3814
|
if (u && typeof u == "object" && u instanceof t)
|
|
3814
3815
|
return u;
|
|
3815
3816
|
var q = new t();
|
|
@@ -3824,7 +3825,7 @@ function os() {
|
|
|
3824
3825
|
if (P = P.trim(), !v && u.split("#").length === 1) {
|
|
3825
3826
|
var ae = s.exec(P);
|
|
3826
3827
|
if (ae)
|
|
3827
|
-
return this.path = P, this.href = P, this.pathname = ae[1], ae[2] ? (this.search = ae[2], O ? this.query =
|
|
3828
|
+
return this.path = P, this.href = P, this.pathname = ae[1], ae[2] ? (this.search = ae[2], O ? this.query = p.parse(this.search.substr(1)) : this.query = this.search.substr(1)) : O && (this.search = "", this.query = {}), this;
|
|
3828
3829
|
}
|
|
3829
3830
|
var H = n.exec(P);
|
|
3830
3831
|
if (H) {
|
|
@@ -3837,8 +3838,8 @@ function os() {
|
|
|
3837
3838
|
se && !(H && x[H]) && (P = P.substr(2), this.slashes = !0);
|
|
3838
3839
|
}
|
|
3839
3840
|
if (!x[H] && (se || H && !$[H])) {
|
|
3840
|
-
for (var Z = -1, E = 0; E <
|
|
3841
|
-
var re = P.indexOf(
|
|
3841
|
+
for (var Z = -1, E = 0; E < l.length; E++) {
|
|
3842
|
+
var re = P.indexOf(l[E]);
|
|
3842
3843
|
re !== -1 && (Z === -1 || re < Z) && (Z = re);
|
|
3843
3844
|
}
|
|
3844
3845
|
var R, k;
|
|
@@ -3852,17 +3853,17 @@ function os() {
|
|
|
3852
3853
|
if (!U)
|
|
3853
3854
|
for (var C = this.hostname.split(/\./), E = 0, I = C.length; E < I; E++) {
|
|
3854
3855
|
var W = C[E];
|
|
3855
|
-
if (W && !W.match(
|
|
3856
|
+
if (W && !W.match(d)) {
|
|
3856
3857
|
for (var z = "", K = 0, ne = W.length; K < ne; K++)
|
|
3857
3858
|
W.charCodeAt(K) > 127 ? z += "x" : z += W[K];
|
|
3858
|
-
if (!z.match(
|
|
3859
|
-
var J = C.slice(0, E), A = C.slice(E + 1), F = W.match(
|
|
3859
|
+
if (!z.match(d)) {
|
|
3860
|
+
var J = C.slice(0, E), A = C.slice(E + 1), F = W.match(y);
|
|
3860
3861
|
F && (J.push(F[1]), A.unshift(F[2])), A.length && (P = "/" + A.join(".") + P), this.hostname = J.join(".");
|
|
3861
3862
|
break;
|
|
3862
3863
|
}
|
|
3863
3864
|
}
|
|
3864
3865
|
}
|
|
3865
|
-
this.hostname.length >
|
|
3866
|
+
this.hostname.length > f ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(), U || (this.hostname = e.toASCII(this.hostname));
|
|
3866
3867
|
var _ = this.port ? ":" + this.port : "", Q = this.hostname || "";
|
|
3867
3868
|
this.host = Q + _, this.href += this.host, U && (this.hostname = this.hostname.substr(1, this.hostname.length - 2), P[0] !== "/" && (P = "/" + P));
|
|
3868
3869
|
}
|
|
@@ -3877,20 +3878,20 @@ function os() {
|
|
|
3877
3878
|
var oe = P.indexOf("#");
|
|
3878
3879
|
oe !== -1 && (this.hash = P.substr(oe), P = P.slice(0, oe));
|
|
3879
3880
|
var he = P.indexOf("?");
|
|
3880
|
-
if (he !== -1 ? (this.search = P.substr(he), this.query = P.substr(he + 1), O && (this.query =
|
|
3881
|
+
if (he !== -1 ? (this.search = P.substr(he), this.query = P.substr(he + 1), O && (this.query = p.parse(this.query)), P = P.slice(0, he)) : O && (this.search = "", this.query = {}), P && (this.pathname = P), $[D] && this.hostname && !this.pathname && (this.pathname = "/"), this.pathname || this.search) {
|
|
3881
3882
|
var _ = this.pathname || "", Oe = this.search || "";
|
|
3882
3883
|
this.path = _ + Oe;
|
|
3883
3884
|
}
|
|
3884
3885
|
return this.href = this.format(), this;
|
|
3885
3886
|
};
|
|
3886
|
-
function
|
|
3887
|
-
return typeof u == "string" && (u =
|
|
3887
|
+
function m(u) {
|
|
3888
|
+
return typeof u == "string" && (u = h(u)), u instanceof t ? u.format() : t.prototype.format.call(u);
|
|
3888
3889
|
}
|
|
3889
3890
|
t.prototype.format = function() {
|
|
3890
3891
|
var u = this.auth || "";
|
|
3891
3892
|
u && (u = encodeURIComponent(u), u = u.replace(/%3A/i, ":"), u += "@");
|
|
3892
3893
|
var O = this.protocol || "", v = this.pathname || "", q = this.hash || "", L = !1, N = "";
|
|
3893
|
-
this.host ? L = u + this.host : this.hostname && (L = u + (this.hostname.indexOf(":") === -1 ? this.hostname : "[" + this.hostname + "]"), this.port && (L += ":" + this.port)), this.query && typeof this.query == "object" && Object.keys(this.query).length && (N =
|
|
3894
|
+
this.host ? L = u + this.host : this.hostname && (L = u + (this.hostname.indexOf(":") === -1 ? this.hostname : "[" + this.hostname + "]"), this.port && (L += ":" + this.port)), this.query && typeof this.query == "object" && Object.keys(this.query).length && (N = p.stringify(this.query, {
|
|
3894
3895
|
arrayFormat: "repeat",
|
|
3895
3896
|
addQueryPrefix: !1
|
|
3896
3897
|
}));
|
|
@@ -3900,13 +3901,13 @@ function os() {
|
|
|
3900
3901
|
}), B = B.replace("#", "%23"), O + L + v + B + q;
|
|
3901
3902
|
};
|
|
3902
3903
|
function w(u, O) {
|
|
3903
|
-
return
|
|
3904
|
+
return h(u, !1, !0).resolve(O);
|
|
3904
3905
|
}
|
|
3905
3906
|
t.prototype.resolve = function(u) {
|
|
3906
|
-
return this.resolveObject(
|
|
3907
|
+
return this.resolveObject(h(u, !1, !0)).format();
|
|
3907
3908
|
};
|
|
3908
3909
|
function T(u, O) {
|
|
3909
|
-
return u ?
|
|
3910
|
+
return u ? h(u, !1, !0).resolveObject(O) : O;
|
|
3910
3911
|
}
|
|
3911
3912
|
return t.prototype.resolveObject = function(u) {
|
|
3912
3913
|
if (typeof u == "string") {
|
|
@@ -3977,14 +3978,14 @@ function os() {
|
|
|
3977
3978
|
}, t.prototype.parseHost = function() {
|
|
3978
3979
|
var u = this.host, O = o.exec(u);
|
|
3979
3980
|
O && (O = O[0], O !== ":" && (this.port = O.substr(1)), u = u.substr(0, u.length - O.length)), u && (this.hostname = u);
|
|
3980
|
-
}, Re.parse =
|
|
3981
|
+
}, Re.parse = h, Re.resolve = w, Re.resolveObject = T, Re.format = m, Re.Url = t, Re;
|
|
3981
3982
|
}
|
|
3982
|
-
var fr =
|
|
3983
|
+
var fr = us(), pr = /* @__PURE__ */ vo(), fs = (e) => typeof e == "object" && "log" in e && typeof e.log == "object" && "entries" in e.log && Array.isArray(e.log.entries), ps = class {
|
|
3983
3984
|
constructor(e, t = {}) {
|
|
3984
3985
|
this.initCalled = !1, this.entries = [], this.requests = [], this.options = {}, this.options = {
|
|
3985
3986
|
harIsAlreadyEncoded: !1,
|
|
3986
3987
|
...t
|
|
3987
|
-
}, this.requests = [],
|
|
3988
|
+
}, this.requests = [], fs(e) ? this.entries = e.log.entries : this.entries = [
|
|
3988
3989
|
{
|
|
3989
3990
|
request: e
|
|
3990
3991
|
}
|
|
@@ -4009,7 +4010,7 @@ var fr = os(), pr = /* @__PURE__ */ vo(), as = (e) => typeof e == "object" && "l
|
|
|
4009
4010
|
}), this;
|
|
4010
4011
|
}
|
|
4011
4012
|
prepare(e, t) {
|
|
4012
|
-
var
|
|
4013
|
+
var f, d, y;
|
|
4013
4014
|
const n = {
|
|
4014
4015
|
...e,
|
|
4015
4016
|
fullUrl: "",
|
|
@@ -4021,11 +4022,11 @@ var fr = os(), pr = /* @__PURE__ */ vo(), as = (e) => typeof e == "object" && "l
|
|
|
4021
4022
|
};
|
|
4022
4023
|
if (n.queryString && n.queryString.length && (n.queryObj = n.queryString.reduce(Br, {})), n.headers && n.headers.length) {
|
|
4023
4024
|
const g = /^HTTP\/2/;
|
|
4024
|
-
n.headersObj = n.headers.reduce((x, { name: $, value:
|
|
4025
|
-
const
|
|
4025
|
+
n.headersObj = n.headers.reduce((x, { name: $, value: p }) => {
|
|
4026
|
+
const h = g.exec(n.httpVersion) ? $.toLocaleLowerCase() : $;
|
|
4026
4027
|
return {
|
|
4027
4028
|
...x,
|
|
4028
|
-
[
|
|
4029
|
+
[h]: p
|
|
4029
4030
|
};
|
|
4030
4031
|
}, {});
|
|
4031
4032
|
}
|
|
@@ -4036,22 +4037,22 @@ var fr = os(), pr = /* @__PURE__ */ vo(), as = (e) => typeof e == "object" && "l
|
|
|
4036
4037
|
}),
|
|
4037
4038
|
{}
|
|
4038
4039
|
));
|
|
4039
|
-
const o = (
|
|
4040
|
+
const o = (f = n.cookies) == null ? void 0 : f.map(({ name: g, value: x }) => t.harIsAlreadyEncoded ? `${g}=${x}` : `${encodeURIComponent(g)}=${encodeURIComponent(x)}`);
|
|
4040
4041
|
switch (o != null && o.length && (n.allHeaders.cookie = o.join("; ")), n.postData.mimeType) {
|
|
4041
4042
|
case "multipart/mixed":
|
|
4042
4043
|
case "multipart/related":
|
|
4043
4044
|
case "multipart/form-data":
|
|
4044
4045
|
case "multipart/alternative":
|
|
4045
|
-
if (n.postData.text = "", n.postData.mimeType = "multipart/form-data", (
|
|
4046
|
+
if (n.postData.text = "", n.postData.mimeType = "multipart/form-data", (d = n.postData) != null && d.params) {
|
|
4046
4047
|
const g = "---011000010111000001101001", x = `${g}--`, $ = `\r
|
|
4047
|
-
`,
|
|
4048
|
-
`),
|
|
4049
|
-
(
|
|
4048
|
+
`, p = (T) => T.replace(/\n/g, "%0A").replace(/\r/g, "%0D").replace(/"/g, "%22"), h = (T) => T.replace(/\r?\n|\r/g, `\r
|
|
4049
|
+
`), m = [`--${g}`];
|
|
4050
|
+
(y = n.postData) == null || y.params.forEach((T, u) => {
|
|
4050
4051
|
const O = T.name, v = T.value || "", q = T.fileName || null, L = T.contentType || "application/octet-stream";
|
|
4051
|
-
q ? (
|
|
4052
|
-
`Content-Disposition: form-data; name="${
|
|
4053
|
-
),
|
|
4054
|
-
}),
|
|
4052
|
+
q ? (m.push(
|
|
4053
|
+
`Content-Disposition: form-data; name="${p(h(O))}"; filename="${q}"`
|
|
4054
|
+
), m.push(`Content-Type: ${L}`)) : m.push(`Content-Disposition: form-data; name="${p(h(O))}"`), m.push(""), m.push(h(v)), u !== n.postData.params.length - 1 && m.push(`--${g}`);
|
|
4055
|
+
}), m.push(`--${x}`), n.postData.boundary = g, n.postData.text = m.join($);
|
|
4055
4056
|
const w = fe(n.headersObj, "content-type") || "content-type";
|
|
4056
4057
|
n.headersObj[w] = `multipart/form-data; boundary=${g}`;
|
|
4057
4058
|
}
|
|
@@ -4074,10 +4075,10 @@ var fr = os(), pr = /* @__PURE__ */ vo(), as = (e) => typeof e == "object" && "l
|
|
|
4074
4075
|
const s = {
|
|
4075
4076
|
...n.allHeaders,
|
|
4076
4077
|
...n.headersObj
|
|
4077
|
-
},
|
|
4078
|
+
}, c = fr.parse(n.url, !0, !0);
|
|
4078
4079
|
n.queryObj = {
|
|
4079
4080
|
...n.queryObj,
|
|
4080
|
-
...
|
|
4081
|
+
...c.query
|
|
4081
4082
|
};
|
|
4082
4083
|
let r;
|
|
4083
4084
|
t.harIsAlreadyEncoded ? r = pr.stringify(n.queryObj, {
|
|
@@ -4087,56 +4088,56 @@ var fr = os(), pr = /* @__PURE__ */ vo(), as = (e) => typeof e == "object" && "l
|
|
|
4087
4088
|
indices: !1
|
|
4088
4089
|
});
|
|
4089
4090
|
const a = {
|
|
4090
|
-
...
|
|
4091
|
+
...c,
|
|
4091
4092
|
query: n.queryObj,
|
|
4092
4093
|
search: r,
|
|
4093
|
-
path: r ? `${
|
|
4094
|
+
path: r ? `${c.pathname}?${r}` : c.pathname
|
|
4094
4095
|
}, i = fr.format({
|
|
4095
|
-
...
|
|
4096
|
+
...c,
|
|
4096
4097
|
query: null,
|
|
4097
4098
|
search: null
|
|
4098
|
-
}),
|
|
4099
|
-
...
|
|
4099
|
+
}), l = fr.format({
|
|
4100
|
+
...c,
|
|
4100
4101
|
...a
|
|
4101
4102
|
});
|
|
4102
4103
|
return {
|
|
4103
4104
|
...n,
|
|
4104
4105
|
allHeaders: s,
|
|
4105
|
-
fullUrl:
|
|
4106
|
+
fullUrl: l,
|
|
4106
4107
|
url: i,
|
|
4107
4108
|
uriObj: a
|
|
4108
4109
|
};
|
|
4109
4110
|
}
|
|
4110
4111
|
convert(e, t, n) {
|
|
4111
4112
|
this.initCalled || this.init(), !n && t && (n = t);
|
|
4112
|
-
const o =
|
|
4113
|
+
const o = Ri[e];
|
|
4113
4114
|
if (!o)
|
|
4114
4115
|
return !1;
|
|
4115
4116
|
const { convert: s } = o.clientsById[t || o.info.default];
|
|
4116
4117
|
return this.requests.map((r) => s(r, n));
|
|
4117
4118
|
}
|
|
4118
4119
|
};
|
|
4119
|
-
const
|
|
4120
|
+
const ds = ({
|
|
4120
4121
|
rootMargin: e = "0px",
|
|
4121
4122
|
threshold: t
|
|
4122
4123
|
} = {}) => {
|
|
4123
4124
|
const [n, o] = Se(!1), s = eo(null);
|
|
4124
4125
|
return to(() => {
|
|
4125
|
-
const
|
|
4126
|
+
const c = new IntersectionObserver(
|
|
4126
4127
|
([a]) => {
|
|
4127
4128
|
a && o(a.isIntersecting);
|
|
4128
4129
|
},
|
|
4129
4130
|
{ rootMargin: e, threshold: t }
|
|
4130
4131
|
), r = s.current;
|
|
4131
4132
|
if (r)
|
|
4132
|
-
return
|
|
4133
|
+
return c.observe(r), () => c.unobserve(r);
|
|
4133
4134
|
}, [e, t]), [s, n];
|
|
4134
|
-
},
|
|
4135
|
+
}, hs = ye.Root, Yn = ye.CollapsibleTrigger, ys = ye.CollapsibleContent, ms = typeof window < "u" ? Wo : to, Sr = ({
|
|
4135
4136
|
children: e,
|
|
4136
4137
|
maxHeight: t = 250
|
|
4137
4138
|
}) => {
|
|
4138
|
-
const n = eo(null), [o, s] = Se(!1), [
|
|
4139
|
-
return
|
|
4139
|
+
const n = eo(null), [o, s] = Se(!1), [c, r] = Se(!1);
|
|
4140
|
+
return ms(() => {
|
|
4140
4141
|
const a = n.current;
|
|
4141
4142
|
if (!a) return;
|
|
4142
4143
|
s(a.scrollHeight > t);
|
|
@@ -4145,25 +4146,25 @@ const ss = ({
|
|
|
4145
4146
|
});
|
|
4146
4147
|
return i.observe(a), () => i.disconnect();
|
|
4147
4148
|
}, [t]), /* @__PURE__ */ b.jsxs(
|
|
4148
|
-
|
|
4149
|
+
hs,
|
|
4149
4150
|
{
|
|
4150
4151
|
className: "group",
|
|
4151
|
-
open:
|
|
4152
|
+
open: c,
|
|
4152
4153
|
onOpenChange: r,
|
|
4153
4154
|
style: { "--max-height": `${t}px` },
|
|
4154
4155
|
children: [
|
|
4155
4156
|
/* @__PURE__ */ b.jsxs(
|
|
4156
|
-
|
|
4157
|
+
ys,
|
|
4157
4158
|
{
|
|
4158
4159
|
forceMount: !0,
|
|
4159
4160
|
className: pe(
|
|
4160
4161
|
"relative overflow-hidden",
|
|
4161
|
-
!
|
|
4162
|
+
!c && o && "max-h-[--max-height]"
|
|
4162
4163
|
),
|
|
4163
4164
|
children: [
|
|
4164
|
-
!
|
|
4165
|
+
!c && o && /* @__PURE__ */ b.jsx("div", { className: "absolute inset-0 bg-gradient-to-b from-transparent to-zinc-50/90 dark:to-zinc-800/90 z-10" }),
|
|
4165
4166
|
/* @__PURE__ */ b.jsx("div", { ref: n, children: e }),
|
|
4166
|
-
!
|
|
4167
|
+
!c && o && /* @__PURE__ */ b.jsx(
|
|
4167
4168
|
Yn,
|
|
4168
4169
|
{
|
|
4169
4170
|
className: "absolute inset-0 grid place-items-center z-10",
|
|
@@ -4177,32 +4178,32 @@ const ss = ({
|
|
|
4177
4178
|
o && /* @__PURE__ */ b.jsx(
|
|
4178
4179
|
"div",
|
|
4179
4180
|
{
|
|
4180
|
-
className: pe("flex justify-center w-full mb-2", !
|
|
4181
|
+
className: pe("flex justify-center w-full mb-2", !c && "hidden"),
|
|
4181
4182
|
children: /* @__PURE__ */ b.jsx(Yn, { asChild: !0, children: /* @__PURE__ */ b.jsx(Fr, { className: "border border-accent-foreground/25", children: "Collapse code" }) })
|
|
4182
4183
|
}
|
|
4183
4184
|
)
|
|
4184
4185
|
]
|
|
4185
4186
|
}
|
|
4186
4187
|
);
|
|
4187
|
-
},
|
|
4188
|
+
}, gs = ({
|
|
4188
4189
|
server: e,
|
|
4189
4190
|
servers: t,
|
|
4190
4191
|
operation: n
|
|
4191
4192
|
}) => {
|
|
4192
4193
|
var r, a, i;
|
|
4193
|
-
const o = (r = n.parameters) == null ? void 0 : r.filter((
|
|
4194
|
-
var
|
|
4194
|
+
const o = (r = n.parameters) == null ? void 0 : r.filter((l) => l.in === "header").map((l) => {
|
|
4195
|
+
var f, d;
|
|
4195
4196
|
return {
|
|
4196
|
-
name:
|
|
4197
|
-
defaultValue: ((
|
|
4197
|
+
name: l.name,
|
|
4198
|
+
defaultValue: ((d = (f = l.examples) == null ? void 0 : f.find((y) => y.value)) == null ? void 0 : d.value) ?? ""
|
|
4198
4199
|
};
|
|
4199
|
-
}), s = (a = n.parameters) == null ? void 0 : a.filter((
|
|
4200
|
-
name:
|
|
4201
|
-
defaultActive:
|
|
4202
|
-
isRequired:
|
|
4203
|
-
})),
|
|
4200
|
+
}), s = (a = n.parameters) == null ? void 0 : a.filter((l) => l.in === "query").sort((l, f) => l.required && !f.required ? -1 : 1).map((l) => ({
|
|
4201
|
+
name: l.name,
|
|
4202
|
+
defaultActive: l.required ?? !1,
|
|
4203
|
+
isRequired: l.required ?? !1
|
|
4204
|
+
})), c = (i = n.parameters) == null ? void 0 : i.filter((l) => l.in === "path").map((l) => ({ name: l.name }));
|
|
4204
4205
|
return /* @__PURE__ */ b.jsx(
|
|
4205
|
-
|
|
4206
|
+
Ko,
|
|
4206
4207
|
{
|
|
4207
4208
|
server: e,
|
|
4208
4209
|
servers: t,
|
|
@@ -4210,7 +4211,7 @@ const ss = ({
|
|
|
4210
4211
|
url: n.path,
|
|
4211
4212
|
headers: o,
|
|
4212
4213
|
queryParams: s,
|
|
4213
|
-
pathParams:
|
|
4214
|
+
pathParams: c
|
|
4214
4215
|
}
|
|
4215
4216
|
);
|
|
4216
4217
|
}, Or = ({ children: e, className: t }) => /* @__PURE__ */ b.jsx(
|
|
@@ -4280,7 +4281,7 @@ const ss = ({
|
|
|
4280
4281
|
default:
|
|
4281
4282
|
return {};
|
|
4282
4283
|
}
|
|
4283
|
-
},
|
|
4284
|
+
}, vs = ({ content: e }) => {
|
|
4284
4285
|
var o, s;
|
|
4285
4286
|
if (!e.length) return null;
|
|
4286
4287
|
const t = e.at(0), n = ((s = (o = t == null ? void 0 : t.examples) == null ? void 0 : o.at(0)) == null ? void 0 : s.value) ?? (t != null && t.schema ? Ue(t.schema) : "");
|
|
@@ -4297,7 +4298,7 @@ const ss = ({
|
|
|
4297
4298
|
}
|
|
4298
4299
|
) }) })
|
|
4299
4300
|
] }) });
|
|
4300
|
-
},
|
|
4301
|
+
}, bs = ({
|
|
4301
4302
|
responses: e,
|
|
4302
4303
|
selectedResponse: t,
|
|
4303
4304
|
onSelectResponse: n
|
|
@@ -4327,8 +4328,8 @@ const ss = ({
|
|
|
4327
4328
|
)) })
|
|
4328
4329
|
] }),
|
|
4329
4330
|
e.map((s) => {
|
|
4330
|
-
var a, i,
|
|
4331
|
-
const
|
|
4331
|
+
var a, i, l;
|
|
4332
|
+
const c = (a = s.content) == null ? void 0 : a.at(0), r = ((l = (i = c == null ? void 0 : c.examples) == null ? void 0 : i.at(0)) == null ? void 0 : l.value) ?? (c != null && c.schema ? Ue(c.schema) : "");
|
|
4332
4333
|
return /* @__PURE__ */ b.jsxs(Ke.Content, { value: s.statusCode, children: [
|
|
4333
4334
|
/* @__PURE__ */ b.jsx(Pr, { className: "p-0", children: /* @__PURE__ */ b.jsx(Sr, { children: /* @__PURE__ */ b.jsx(
|
|
4334
4335
|
vr,
|
|
@@ -4345,7 +4346,7 @@ const ss = ({
|
|
|
4345
4346
|
]
|
|
4346
4347
|
}
|
|
4347
4348
|
) });
|
|
4348
|
-
},
|
|
4349
|
+
}, xs = (e, t) => {
|
|
4349
4350
|
let n;
|
|
4350
4351
|
switch (t) {
|
|
4351
4352
|
case "shell":
|
|
@@ -4386,7 +4387,7 @@ const ss = ({
|
|
|
4386
4387
|
break;
|
|
4387
4388
|
}
|
|
4388
4389
|
return n ? n[0] : "";
|
|
4389
|
-
},
|
|
4390
|
+
}, $s = tt(
|
|
4390
4391
|
/* GraphQL */
|
|
4391
4392
|
`
|
|
4392
4393
|
query getServerQuery($input: JSON!, $type: SchemaType!) {
|
|
@@ -4398,7 +4399,7 @@ const ss = ({
|
|
|
4398
4399
|
}
|
|
4399
4400
|
}
|
|
4400
4401
|
`
|
|
4401
|
-
),
|
|
4402
|
+
), js = {
|
|
4402
4403
|
get: be.green,
|
|
4403
4404
|
post: be.blue,
|
|
4404
4405
|
put: be.yellow,
|
|
@@ -4407,7 +4408,7 @@ const ss = ({
|
|
|
4407
4408
|
options: be.indigo,
|
|
4408
4409
|
head: be.gray,
|
|
4409
4410
|
trace: be.gray
|
|
4410
|
-
},
|
|
4411
|
+
}, ws = [
|
|
4411
4412
|
{ value: "shell", label: "cURL" },
|
|
4412
4413
|
{ value: "js", label: "JavaScript" },
|
|
4413
4414
|
{ value: "python", label: "Python" },
|
|
@@ -4419,17 +4420,17 @@ const ss = ({
|
|
|
4419
4420
|
{ value: "php", label: "PHP" },
|
|
4420
4421
|
{ value: "ruby", label: "Ruby" },
|
|
4421
4422
|
{ value: "swift", label: "Swift" }
|
|
4422
|
-
],
|
|
4423
|
+
], Ss = ({
|
|
4423
4424
|
operation: e,
|
|
4424
4425
|
selectedResponse: t,
|
|
4425
4426
|
onSelectResponse: n
|
|
4426
4427
|
}) => {
|
|
4427
|
-
var
|
|
4428
|
-
const { input: o, type: s } = gr(),
|
|
4428
|
+
var m;
|
|
4429
|
+
const { input: o, type: s } = gr(), c = br($s, { input: o, type: s }), r = mr(c), a = js[e.method.toLocaleLowerCase()] ?? be.gray, [i, l] = Po(), [, f] = Zn(), d = i.get("lang") ?? "shell", y = (m = e.requestBody) == null ? void 0 : m.content, g = e.path.split("/").map((w, T, u) => {
|
|
4429
4430
|
const v = w.startsWith("{") && w.endsWith("}") || w.startsWith(":") ? w.replace(/[:{}]/g, "") : void 0;
|
|
4430
4431
|
return (
|
|
4431
4432
|
// eslint-disable-next-line react/no-array-index-key
|
|
4432
|
-
/* @__PURE__ */ b.jsxs(
|
|
4433
|
+
/* @__PURE__ */ b.jsxs(Jo, { children: [
|
|
4433
4434
|
v ? /* @__PURE__ */ b.jsx(
|
|
4434
4435
|
ao,
|
|
4435
4436
|
{
|
|
@@ -4445,7 +4446,7 @@ const ss = ({
|
|
|
4445
4446
|
);
|
|
4446
4447
|
}), { selectedServer: x } = ro(), $ = Xn(() => {
|
|
4447
4448
|
var u;
|
|
4448
|
-
const w = (u =
|
|
4449
|
+
const w = (u = y == null ? void 0 : y[0]) != null && u.schema ? Ue(y[0].schema) : void 0, T = new ps({
|
|
4449
4450
|
method: e.method.toLocaleUpperCase(),
|
|
4450
4451
|
url: (x ?? r.data.schema.url ?? "") + e.path.replaceAll("{", ":").replaceAll("}", ""),
|
|
4451
4452
|
postData: w ? {
|
|
@@ -4459,19 +4460,19 @@ const ss = ({
|
|
|
4459
4460
|
headersSize: 0,
|
|
4460
4461
|
bodySize: 0
|
|
4461
4462
|
});
|
|
4462
|
-
return
|
|
4463
|
+
return xs(T, d);
|
|
4463
4464
|
}, [
|
|
4464
|
-
|
|
4465
|
+
y,
|
|
4465
4466
|
e.method,
|
|
4466
4467
|
e.path,
|
|
4467
4468
|
x,
|
|
4468
4469
|
r.data.schema.url,
|
|
4469
|
-
|
|
4470
|
-
]), [
|
|
4470
|
+
d
|
|
4471
|
+
]), [p, h] = ds({ rootMargin: "200px 0px 200px 0px" });
|
|
4471
4472
|
return /* @__PURE__ */ b.jsxs(
|
|
4472
4473
|
"aside",
|
|
4473
4474
|
{
|
|
4474
|
-
ref:
|
|
4475
|
+
ref: p,
|
|
4475
4476
|
className: "flex flex-col overflow-hidden sticky top-[--scroll-padding] gap-4",
|
|
4476
4477
|
children: [
|
|
4477
4478
|
/* @__PURE__ */ b.jsxs(Or, { children: [
|
|
@@ -4481,8 +4482,8 @@ const ss = ({
|
|
|
4481
4482
|
" ",
|
|
4482
4483
|
g
|
|
4483
4484
|
] }),
|
|
4484
|
-
|
|
4485
|
-
|
|
4485
|
+
h && /* @__PURE__ */ b.jsx(
|
|
4486
|
+
gs,
|
|
4486
4487
|
{
|
|
4487
4488
|
server: r.data.schema.url ?? "",
|
|
4488
4489
|
servers: r.data.schema.servers.map((w) => w.url) ?? [],
|
|
@@ -4490,11 +4491,11 @@ const ss = ({
|
|
|
4490
4491
|
}
|
|
4491
4492
|
)
|
|
4492
4493
|
] }),
|
|
4493
|
-
|
|
4494
|
+
h && /* @__PURE__ */ b.jsxs(b.Fragment, { children: [
|
|
4494
4495
|
/* @__PURE__ */ b.jsx(Pr, { className: "p-0", children: /* @__PURE__ */ b.jsx(Sr, { children: /* @__PURE__ */ b.jsx(
|
|
4495
4496
|
vr,
|
|
4496
4497
|
{
|
|
4497
|
-
language:
|
|
4498
|
+
language: d,
|
|
4498
4499
|
noBackground: !0,
|
|
4499
4500
|
className: "[--scrollbar-color:gray] text-xs max-h-[500px] p-2",
|
|
4500
4501
|
code: $
|
|
@@ -4506,21 +4507,21 @@ const ss = ({
|
|
|
4506
4507
|
oo,
|
|
4507
4508
|
{
|
|
4508
4509
|
className: "self-start max-w-[150px]",
|
|
4509
|
-
value:
|
|
4510
|
+
value: d,
|
|
4510
4511
|
onChange: (w) => {
|
|
4511
|
-
|
|
4512
|
-
|
|
4512
|
+
f(() => {
|
|
4513
|
+
l((T) => (T.set("lang", w.target.value), T));
|
|
4513
4514
|
});
|
|
4514
4515
|
},
|
|
4515
|
-
options:
|
|
4516
|
+
options: ws
|
|
4516
4517
|
}
|
|
4517
4518
|
)
|
|
4518
4519
|
] })
|
|
4519
4520
|
] })
|
|
4520
4521
|
] }),
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4522
|
+
h && y && /* @__PURE__ */ b.jsx(vs, { content: y }),
|
|
4523
|
+
h && e.responses.length > 0 && /* @__PURE__ */ b.jsx(
|
|
4524
|
+
bs,
|
|
4524
4525
|
{
|
|
4525
4526
|
selectedResponse: t,
|
|
4526
4527
|
onSelectResponse: n,
|
|
@@ -4530,15 +4531,15 @@ const ss = ({
|
|
|
4530
4531
|
]
|
|
4531
4532
|
}
|
|
4532
4533
|
);
|
|
4533
|
-
},
|
|
4534
|
-
AND: /* @__PURE__ */ b.jsx(
|
|
4535
|
-
OR: /* @__PURE__ */ b.jsx(
|
|
4536
|
-
ONE: /* @__PURE__ */ b.jsx(
|
|
4537
|
-
},
|
|
4534
|
+
}, Os = (e) => Object.entries(e), Ts = {
|
|
4535
|
+
AND: /* @__PURE__ */ b.jsx(Fo, { size: 16, className: "fill-card" }),
|
|
4536
|
+
OR: /* @__PURE__ */ b.jsx(_o, { size: 16, className: "fill-card" }),
|
|
4537
|
+
ONE: /* @__PURE__ */ b.jsx(Bo, { size: 14, className: "fill-card" })
|
|
4538
|
+
}, Ps = {
|
|
4538
4539
|
AND: "text-green-500 dark:text-green-300/60",
|
|
4539
4540
|
OR: "text-blue-400 dark:text-blue-500",
|
|
4540
4541
|
ONE: "text-purple-500 dark:text-purple-300/60"
|
|
4541
|
-
},
|
|
4542
|
+
}, Cs = ({
|
|
4542
4543
|
type: e,
|
|
4543
4544
|
isOpen: t,
|
|
4544
4545
|
className: n
|
|
@@ -4546,13 +4547,13 @@ const ss = ({
|
|
|
4546
4547
|
"div",
|
|
4547
4548
|
{
|
|
4548
4549
|
className: pe(
|
|
4549
|
-
|
|
4550
|
+
Ps[e],
|
|
4550
4551
|
"relative text-sm flex py-2",
|
|
4551
4552
|
"before:border-l before:absolute before:-top-2 before:-bottom-2 before:border-border before:border-dashed before:content-['']",
|
|
4552
4553
|
n
|
|
4553
4554
|
),
|
|
4554
4555
|
children: /* @__PURE__ */ b.jsxs("div", { className: "-translate-x-[7px] flex gap-1 items-center", children: [
|
|
4555
|
-
|
|
4556
|
+
Ts[e],
|
|
4556
4557
|
/* @__PURE__ */ b.jsx(
|
|
4557
4558
|
"div",
|
|
4558
4559
|
{
|
|
@@ -4560,12 +4561,12 @@ const ss = ({
|
|
|
4560
4561
|
"translate-y-px mx-px opacity-0 group-hover:opacity-100 transition",
|
|
4561
4562
|
!t && "-rotate-90"
|
|
4562
4563
|
),
|
|
4563
|
-
children: /* @__PURE__ */ b.jsx(
|
|
4564
|
+
children: /* @__PURE__ */ b.jsx(Uo, { size: 16 })
|
|
4564
4565
|
}
|
|
4565
4566
|
)
|
|
4566
4567
|
] })
|
|
4567
4568
|
}
|
|
4568
|
-
),
|
|
4569
|
+
), Rs = (e) => {
|
|
4569
4570
|
const [t, n] = Se(!0);
|
|
4570
4571
|
return /* @__PURE__ */ b.jsxs(
|
|
4571
4572
|
ye.Root,
|
|
@@ -4574,17 +4575,17 @@ const ss = ({
|
|
|
4574
4575
|
onOpenChange: () => n((o) => !o),
|
|
4575
4576
|
className: "group",
|
|
4576
4577
|
children: [
|
|
4577
|
-
/* @__PURE__ */ b.jsx(ye.Trigger, { children: /* @__PURE__ */ b.jsx(
|
|
4578
|
+
/* @__PURE__ */ b.jsx(ye.Trigger, { children: /* @__PURE__ */ b.jsx(Cs, { type: e.type, isOpen: t }) }),
|
|
4578
4579
|
!t && /* @__PURE__ */ b.jsx("div", { className: "wavy-line bg-border translate-y-1" }),
|
|
4579
4580
|
/* @__PURE__ */ b.jsx(ye.Content, { children: /* @__PURE__ */ b.jsx(Ge, { schema: e.schema, level: e.level + 1 }) })
|
|
4580
4581
|
]
|
|
4581
4582
|
}
|
|
4582
4583
|
);
|
|
4583
|
-
},
|
|
4584
|
+
}, qs = {
|
|
4584
4585
|
AND: "All of",
|
|
4585
4586
|
OR: "Any of",
|
|
4586
4587
|
ONE: "One of"
|
|
4587
|
-
},
|
|
4588
|
+
}, ks = ({
|
|
4588
4589
|
schemas: e,
|
|
4589
4590
|
type: t,
|
|
4590
4591
|
isOpen: n,
|
|
@@ -4592,22 +4593,22 @@ const ss = ({
|
|
|
4592
4593
|
toggleOpen: s
|
|
4593
4594
|
}) => /* @__PURE__ */ b.jsx(ye.Root, { open: n, onOpenChange: s, asChild: !0, children: /* @__PURE__ */ b.jsxs(xe, { className: "px-6", children: [
|
|
4594
4595
|
/* @__PURE__ */ b.jsxs(ye.Trigger, { className: "flex gap-2 items-center py-2 w-full text-sm text-muted-foreground -translate-x-1.5", children: [
|
|
4595
|
-
n ? /* @__PURE__ */ b.jsx(
|
|
4596
|
-
/* @__PURE__ */ b.jsx("span", { children:
|
|
4596
|
+
n ? /* @__PURE__ */ b.jsx(Ho, { size: 14 }) : /* @__PURE__ */ b.jsx(Mo, { size: 14 }),
|
|
4597
|
+
/* @__PURE__ */ b.jsx("span", { children: qs[t] })
|
|
4597
4598
|
] }),
|
|
4598
|
-
/* @__PURE__ */ b.jsx(ye.Content, { className: "pb-4", children: e.map((
|
|
4599
|
+
/* @__PURE__ */ b.jsx(ye.Content, { className: "pb-4", children: e.map((c, r) => (
|
|
4599
4600
|
// eslint-disable-next-line react/no-array-index-key
|
|
4600
4601
|
/* @__PURE__ */ b.jsx(
|
|
4601
|
-
|
|
4602
|
+
Rs,
|
|
4602
4603
|
{
|
|
4603
4604
|
type: t,
|
|
4604
|
-
schema:
|
|
4605
|
+
schema: c,
|
|
4605
4606
|
level: o
|
|
4606
4607
|
},
|
|
4607
4608
|
r
|
|
4608
4609
|
)
|
|
4609
4610
|
)) })
|
|
4610
|
-
] }) }),
|
|
4611
|
+
] }) }), Es = (e) => e.type === "object" || e.type === "array" && typeof e.items == "object" && (!e.items.type || e.items.type === "object"), yr = (e) => !!(e.oneOf ?? e.allOf ?? e.anyOf), Ns = {
|
|
4611
4612
|
allOf: "AND",
|
|
4612
4613
|
anyOf: "OR",
|
|
4613
4614
|
oneOf: "ONE"
|
|
@@ -4615,26 +4616,26 @@ const ss = ({
|
|
|
4615
4616
|
schema: e,
|
|
4616
4617
|
level: t
|
|
4617
4618
|
}) => {
|
|
4618
|
-
const [n, o] = Se(!0), s =
|
|
4619
|
-
for (const [
|
|
4620
|
-
if (e[
|
|
4619
|
+
const [n, o] = Se(!0), s = Vo(() => o((c) => !c), []);
|
|
4620
|
+
for (const [c, r] of Os(Ns))
|
|
4621
|
+
if (e[c])
|
|
4621
4622
|
return /* @__PURE__ */ b.jsx(
|
|
4622
|
-
|
|
4623
|
+
ks,
|
|
4623
4624
|
{
|
|
4624
|
-
schemas: e[
|
|
4625
|
+
schemas: e[c],
|
|
4625
4626
|
type: r,
|
|
4626
4627
|
isOpen: n,
|
|
4627
4628
|
toggleOpen: s,
|
|
4628
4629
|
level: t
|
|
4629
4630
|
}
|
|
4630
4631
|
);
|
|
4631
|
-
},
|
|
4632
|
+
}, As = ({
|
|
4632
4633
|
name: e,
|
|
4633
4634
|
schema: t,
|
|
4634
4635
|
group: n,
|
|
4635
4636
|
level: o,
|
|
4636
4637
|
defaultOpen: s = !1,
|
|
4637
|
-
showCollapseButton:
|
|
4638
|
+
showCollapseButton: c = !0
|
|
4638
4639
|
}) => {
|
|
4639
4640
|
const [r, a] = Se(s);
|
|
4640
4641
|
return /* @__PURE__ */ b.jsx("li", { className: "p-4 bg-border/20 hover:bg-border/30", children: /* @__PURE__ */ b.jsxs("div", { className: "flex flex-col gap-1 justify-between text-sm", children: [
|
|
@@ -4653,21 +4654,21 @@ const ss = ({
|
|
|
4653
4654
|
content: t.description
|
|
4654
4655
|
}
|
|
4655
4656
|
),
|
|
4656
|
-
(yr(t) ||
|
|
4657
|
+
(yr(t) || Es(t)) && /* @__PURE__ */ b.jsxs(
|
|
4657
4658
|
ye.Root,
|
|
4658
4659
|
{
|
|
4659
4660
|
defaultOpen: s,
|
|
4660
4661
|
open: r,
|
|
4661
4662
|
onOpenChange: () => a(!r),
|
|
4662
4663
|
children: [
|
|
4663
|
-
|
|
4664
|
+
c && /* @__PURE__ */ b.jsx(ye.Trigger, { asChild: !0, children: /* @__PURE__ */ b.jsxs(
|
|
4664
4665
|
no,
|
|
4665
4666
|
{
|
|
4666
4667
|
variant: "outline",
|
|
4667
4668
|
size: "sm",
|
|
4668
4669
|
className: "mt-2 flex gap-1.5",
|
|
4669
4670
|
children: [
|
|
4670
|
-
/* @__PURE__ */ b.jsx(
|
|
4671
|
+
/* @__PURE__ */ b.jsx(zo, { size: 18 }),
|
|
4671
4672
|
r ? "Hide nested properties" : "Show nested properties"
|
|
4672
4673
|
]
|
|
4673
4674
|
}
|
|
@@ -4684,9 +4685,9 @@ const ss = ({
|
|
|
4684
4685
|
}) => {
|
|
4685
4686
|
if (!e || Object.keys(e).length === 0)
|
|
4686
4687
|
return /* @__PURE__ */ b.jsx(xe, { className: "p-4", children: /* @__PURE__ */ b.jsx("span", { className: "text-sm text-muted-foreground italic", children: "No response specified" }) });
|
|
4687
|
-
const o = (s,
|
|
4688
|
+
const o = (s, c) => {
|
|
4688
4689
|
if (yr(s))
|
|
4689
|
-
return /* @__PURE__ */ b.jsx(xo, { schema: s, level:
|
|
4690
|
+
return /* @__PURE__ */ b.jsx(xo, { schema: s, level: c });
|
|
4690
4691
|
if (s.type === "array" && s.items) {
|
|
4691
4692
|
const r = s.items;
|
|
4692
4693
|
return typeof r.type == "string" && ["string", "number", "boolean", "integer"].includes(r.type) ? /* @__PURE__ */ b.jsxs(xe, { className: "p-4", children: [
|
|
@@ -4706,8 +4707,8 @@ const ss = ({
|
|
|
4706
4707
|
)
|
|
4707
4708
|
] }) : r.type === "object" ? /* @__PURE__ */ b.jsxs(xe, { className: "flex flex-col gap-2 bg-border/30 p-4", children: [
|
|
4708
4709
|
/* @__PURE__ */ b.jsx("span", { className: "text-sm text-muted-foreground", children: "object[]" }),
|
|
4709
|
-
o(r,
|
|
4710
|
-
] }) : o(r,
|
|
4710
|
+
o(r, c + 1)
|
|
4711
|
+
] }) : o(r, c + 1);
|
|
4711
4712
|
}
|
|
4712
4713
|
if (s.type === "object" && (!s.properties || Object.keys(s.properties).length === 0))
|
|
4713
4714
|
return /* @__PURE__ */ b.jsxs(xe, { className: "p-4 flex gap-2 items-center", children: [
|
|
@@ -4727,22 +4728,22 @@ const ss = ({
|
|
|
4727
4728
|
if (s.properties) {
|
|
4728
4729
|
const r = io(
|
|
4729
4730
|
Object.entries(s.properties),
|
|
4730
|
-
([i,
|
|
4731
|
-
var
|
|
4732
|
-
return
|
|
4731
|
+
([i, l]) => {
|
|
4732
|
+
var f;
|
|
4733
|
+
return l.deprecated ? "deprecated" : (f = s.required) != null && f.includes(i) ? "required" : "optional";
|
|
4733
4734
|
}
|
|
4734
4735
|
), a = ["required", "optional", "deprecated"];
|
|
4735
4736
|
return /* @__PURE__ */ b.jsx(xe, { className: "divide-y overflow-hidden", children: a.map(
|
|
4736
|
-
(i) => r[i] && /* @__PURE__ */ b.jsx("ul", { className: "divide-y", children: r[i].map(([
|
|
4737
|
-
|
|
4737
|
+
(i) => r[i] && /* @__PURE__ */ b.jsx("ul", { className: "divide-y", children: r[i].map(([l, f]) => /* @__PURE__ */ b.jsx(
|
|
4738
|
+
As,
|
|
4738
4739
|
{
|
|
4739
|
-
name:
|
|
4740
|
-
schema:
|
|
4740
|
+
name: l,
|
|
4741
|
+
schema: f,
|
|
4741
4742
|
group: i,
|
|
4742
|
-
level:
|
|
4743
|
+
level: c,
|
|
4743
4744
|
defaultOpen: n
|
|
4744
4745
|
},
|
|
4745
|
-
|
|
4746
|
+
l
|
|
4746
4747
|
)) }, i)
|
|
4747
4748
|
) });
|
|
4748
4749
|
}
|
|
@@ -4759,22 +4760,22 @@ const ss = ({
|
|
|
4759
4760
|
}
|
|
4760
4761
|
)
|
|
4761
4762
|
] }) : s.additionalProperties ? /* @__PURE__ */ b.jsxs(xe, { className: "my-2", children: [
|
|
4762
|
-
/* @__PURE__ */ b.jsx(
|
|
4763
|
-
/* @__PURE__ */ b.jsx(
|
|
4763
|
+
/* @__PURE__ */ b.jsx(ra, { children: /* @__PURE__ */ b.jsx(na, { children: "Additional Properties:" }) }),
|
|
4764
|
+
/* @__PURE__ */ b.jsx(oa, { children: o(
|
|
4764
4765
|
s.additionalProperties,
|
|
4765
|
-
|
|
4766
|
+
c + 1
|
|
4766
4767
|
) })
|
|
4767
4768
|
] }) : null;
|
|
4768
4769
|
};
|
|
4769
4770
|
return o(e, t);
|
|
4770
|
-
},
|
|
4771
|
+
}, Is = ["path", "query", "header", "cookie"], Ls = ({
|
|
4771
4772
|
operationFragment: e
|
|
4772
4773
|
}) => {
|
|
4773
4774
|
var r, a, i;
|
|
4774
|
-
const t =
|
|
4775
|
+
const t = ca(Fs, e), n = io(
|
|
4775
4776
|
t.parameters ?? [],
|
|
4776
|
-
(
|
|
4777
|
-
), o = t.responses.at(0), [s,
|
|
4777
|
+
(l) => l.in
|
|
4778
|
+
), o = t.responses.at(0), [s, c] = Se(o == null ? void 0 : o.statusCode);
|
|
4778
4779
|
return /* @__PURE__ */ b.jsxs(
|
|
4779
4780
|
"div",
|
|
4780
4781
|
{
|
|
@@ -4789,21 +4790,21 @@ const ss = ({
|
|
|
4789
4790
|
content: t.description
|
|
4790
4791
|
}
|
|
4791
4792
|
),
|
|
4792
|
-
t.parameters && t.parameters.length > 0 && /* @__PURE__ */ b.jsx(b.Fragment, { children:
|
|
4793
|
-
(
|
|
4794
|
-
var
|
|
4795
|
-
return (
|
|
4796
|
-
|
|
4793
|
+
t.parameters && t.parameters.length > 0 && /* @__PURE__ */ b.jsx(b.Fragment, { children: Is.flatMap(
|
|
4794
|
+
(l) => {
|
|
4795
|
+
var f;
|
|
4796
|
+
return (f = n[l]) != null && f.length ? /* @__PURE__ */ b.jsx(
|
|
4797
|
+
ha,
|
|
4797
4798
|
{
|
|
4798
4799
|
id: t.slug,
|
|
4799
|
-
parameters: n[
|
|
4800
|
-
group:
|
|
4800
|
+
parameters: n[l],
|
|
4801
|
+
group: l
|
|
4801
4802
|
},
|
|
4802
|
-
|
|
4803
|
+
l
|
|
4803
4804
|
) : [];
|
|
4804
4805
|
}
|
|
4805
4806
|
) }),
|
|
4806
|
-
|
|
4807
|
+
fa((i = (a = (r = t.requestBody) == null ? void 0 : r.content) == null ? void 0 : a.at(0)) == null ? void 0 : i.schema, (l) => /* @__PURE__ */ b.jsxs("div", { className: "mt-4 flex flex-col gap-4", children: [
|
|
4807
4808
|
/* @__PURE__ */ b.jsx(
|
|
4808
4809
|
He,
|
|
4809
4810
|
{
|
|
@@ -4814,7 +4815,7 @@ const ss = ({
|
|
|
4814
4815
|
children: "Request Body"
|
|
4815
4816
|
}
|
|
4816
4817
|
),
|
|
4817
|
-
/* @__PURE__ */ b.jsx(Ge, { schema:
|
|
4818
|
+
/* @__PURE__ */ b.jsx(Ge, { schema: l })
|
|
4818
4819
|
] })),
|
|
4819
4820
|
t.responses.length > 0 && /* @__PURE__ */ b.jsxs(b.Fragment, { children: [
|
|
4820
4821
|
/* @__PURE__ */ b.jsx(
|
|
@@ -4828,34 +4829,34 @@ const ss = ({
|
|
|
4828
4829
|
}
|
|
4829
4830
|
),
|
|
4830
4831
|
/* @__PURE__ */ b.jsxs(
|
|
4831
|
-
|
|
4832
|
+
Yo,
|
|
4832
4833
|
{
|
|
4833
|
-
onValueChange: (
|
|
4834
|
+
onValueChange: (l) => c(l),
|
|
4834
4835
|
value: s,
|
|
4835
4836
|
children: [
|
|
4836
|
-
t.responses.length > 1 && /* @__PURE__ */ b.jsx(
|
|
4837
|
-
|
|
4837
|
+
t.responses.length > 1 && /* @__PURE__ */ b.jsx(Xo, { children: t.responses.map((l) => /* @__PURE__ */ b.jsx(
|
|
4838
|
+
Zo,
|
|
4838
4839
|
{
|
|
4839
|
-
value:
|
|
4840
|
-
title:
|
|
4841
|
-
children:
|
|
4840
|
+
value: l.statusCode,
|
|
4841
|
+
title: l.description ?? void 0,
|
|
4842
|
+
children: l.statusCode
|
|
4842
4843
|
},
|
|
4843
|
-
|
|
4844
|
+
l.statusCode
|
|
4844
4845
|
)) }),
|
|
4845
|
-
/* @__PURE__ */ b.jsx("ul", { className: "list-none m-0 px-0", children: t.responses.map((
|
|
4846
|
-
var
|
|
4846
|
+
/* @__PURE__ */ b.jsx("ul", { className: "list-none m-0 px-0", children: t.responses.map((l) => {
|
|
4847
|
+
var f, d;
|
|
4847
4848
|
return /* @__PURE__ */ b.jsx(
|
|
4848
|
-
|
|
4849
|
+
ea,
|
|
4849
4850
|
{
|
|
4850
|
-
value:
|
|
4851
|
+
value: l.statusCode,
|
|
4851
4852
|
children: /* @__PURE__ */ b.jsx(
|
|
4852
4853
|
Ge,
|
|
4853
4854
|
{
|
|
4854
|
-
schema: (
|
|
4855
|
+
schema: (d = (f = l.content) == null ? void 0 : f.find((y) => y.schema)) == null ? void 0 : d.schema
|
|
4855
4856
|
}
|
|
4856
4857
|
)
|
|
4857
4858
|
},
|
|
4858
|
-
|
|
4859
|
+
l.statusCode
|
|
4859
4860
|
);
|
|
4860
4861
|
}) })
|
|
4861
4862
|
]
|
|
@@ -4864,10 +4865,10 @@ const ss = ({
|
|
|
4864
4865
|
] })
|
|
4865
4866
|
] }),
|
|
4866
4867
|
/* @__PURE__ */ b.jsx(
|
|
4867
|
-
|
|
4868
|
+
Ss,
|
|
4868
4869
|
{
|
|
4869
4870
|
selectedResponse: s,
|
|
4870
|
-
onSelectResponse:
|
|
4871
|
+
onSelectResponse: c,
|
|
4871
4872
|
operation: t
|
|
4872
4873
|
}
|
|
4873
4874
|
)
|
|
@@ -4875,7 +4876,11 @@ const ss = ({
|
|
|
4875
4876
|
},
|
|
4876
4877
|
t.operationId
|
|
4877
4878
|
);
|
|
4878
|
-
}
|
|
4879
|
+
};
|
|
4880
|
+
function Us(e, t = 160) {
|
|
4881
|
+
return e ? e.replace(/\[([^\]]+)\]\([^)]+\)/g, "$1").replace(/!\[.*?\]\(.*?\)/g, "").replace(/[_*`~]/g, "").replace(/^(?:>|\s*#+|-{3,}|\*{3,})/gm, "").replace(/[|>{}[\]]/g, "").replace(/\s+/g, " ").trim().substring(0, t).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'") : "";
|
|
4882
|
+
}
|
|
4883
|
+
const Fs = tt(
|
|
4879
4884
|
/* GraphQL */
|
|
4880
4885
|
`
|
|
4881
4886
|
fragment OperationsFragment on OperationItem {
|
|
@@ -4940,7 +4945,7 @@ const ss = ({
|
|
|
4940
4945
|
}
|
|
4941
4946
|
}
|
|
4942
4947
|
`
|
|
4943
|
-
),
|
|
4948
|
+
), _s = tt(
|
|
4944
4949
|
/* GraphQL */
|
|
4945
4950
|
`
|
|
4946
4951
|
query AllOperations($input: JSON!, $type: SchemaType!) {
|
|
@@ -4961,54 +4966,65 @@ const ss = ({
|
|
|
4961
4966
|
}
|
|
4962
4967
|
}
|
|
4963
4968
|
`
|
|
4964
|
-
)
|
|
4965
|
-
|
|
4966
|
-
return e ? (e = e.replace(/\[([^\]]+)\]\([^)]+\)/g, "$1"), e = e.replace(/!\[.*?\]\(.*?\)/g, ""), e = e.replace(/[_*`~]/g, ""), e = e.replace(/^(?:>|\s*#+|-{3,}|\*{3,})/gm, ""), e = e.replace(/[|>{}[\]]/g, ""), e = e.replace(/\s+/g, " ").trim(), e = e.substring(0, t), e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'")) : "";
|
|
4967
|
-
}
|
|
4968
|
-
const tc = () => {
|
|
4969
|
-
const { input: e, type: t } = gr(), n = br(Es, { input: e, type: t }), o = mr(n), s = o.data.schema.title, l = o.data.schema.summary, r = o.data.schema.description, a = l || (r ? Ns(r) : void 0);
|
|
4969
|
+
), cc = () => {
|
|
4970
|
+
const { input: e, type: t, versions: n, version: o } = gr(), s = br(_s, { input: e, type: t }), c = mr(s), r = c.data.schema.title, a = c.data.schema.summary, i = c.data.schema.description, l = Co(), f = a || (i ? Us(i) : void 0);
|
|
4970
4971
|
return /* @__PURE__ */ b.jsxs("div", { className: "pt-[--padding-content-top]", children: [
|
|
4971
4972
|
/* @__PURE__ */ b.jsxs(To, { children: [
|
|
4972
|
-
/* @__PURE__ */ b.jsx("title", { children:
|
|
4973
|
-
|
|
4973
|
+
/* @__PURE__ */ b.jsx("title", { children: r }),
|
|
4974
|
+
f && /* @__PURE__ */ b.jsx("meta", { name: "description", content: f })
|
|
4974
4975
|
] }),
|
|
4975
4976
|
/* @__PURE__ */ b.jsxs(
|
|
4976
4977
|
"div",
|
|
4977
4978
|
{
|
|
4978
4979
|
className: pe(qe, "mb-16 max-w-full prose-img:max-w-prose"),
|
|
4979
4980
|
children: [
|
|
4980
|
-
/* @__PURE__ */ b.
|
|
4981
|
-
|
|
4982
|
-
|
|
4981
|
+
/* @__PURE__ */ b.jsxs("div", { className: "flex", children: [
|
|
4982
|
+
/* @__PURE__ */ b.jsxs("div", { className: "flex-1", children: [
|
|
4983
|
+
/* @__PURE__ */ b.jsx(Ur, { children: "Overview" }),
|
|
4984
|
+
/* @__PURE__ */ b.jsx(He, { level: 1, id: "description", registerSidebarAnchor: !0, children: r })
|
|
4985
|
+
] }),
|
|
4986
|
+
/* @__PURE__ */ b.jsx("div", { children: Object.entries(n).length > 1 && /* @__PURE__ */ b.jsxs(
|
|
4987
|
+
Ro,
|
|
4988
|
+
{
|
|
4989
|
+
onValueChange: (d) => l(n[d]),
|
|
4990
|
+
defaultValue: o,
|
|
4991
|
+
children: [
|
|
4992
|
+
/* @__PURE__ */ b.jsx(qo, { className: "w-[180px]", children: /* @__PURE__ */ b.jsx(ko, { placeholder: "Select version" }) }),
|
|
4993
|
+
/* @__PURE__ */ b.jsx(Eo, { children: Object.entries(n).map(([d]) => /* @__PURE__ */ b.jsx(No, { value: d, children: d }, d)) })
|
|
4994
|
+
]
|
|
4995
|
+
}
|
|
4996
|
+
) })
|
|
4997
|
+
] }),
|
|
4998
|
+
/* @__PURE__ */ b.jsx(we, { content: c.data.schema.description ?? "" })
|
|
4983
4999
|
]
|
|
4984
5000
|
}
|
|
4985
5001
|
),
|
|
4986
5002
|
/* @__PURE__ */ b.jsx("hr", {}),
|
|
4987
|
-
/* @__PURE__ */ b.jsx("div", { className: "my-4 flex justify-end", children: /* @__PURE__ */ b.jsx(
|
|
4988
|
-
|
|
5003
|
+
/* @__PURE__ */ b.jsx("div", { className: "my-4 flex items-center justify-end gap-4", children: /* @__PURE__ */ b.jsx(ua, {}) }),
|
|
5004
|
+
c.data.schema.tags.filter((d) => d.operations.length > 0).map((d) => (
|
|
4989
5005
|
// px, -mx is so that `content-visibility` doesn't cut off overflown heading anchor links '#'
|
|
4990
5006
|
/* @__PURE__ */ b.jsxs("div", { className: "px-6 -mx-6 [content-visibility:auto]", children: [
|
|
4991
|
-
|
|
4992
|
-
|
|
5007
|
+
d.name && /* @__PURE__ */ b.jsx(Ur, { children: d.name }),
|
|
5008
|
+
d.description && /* @__PURE__ */ b.jsx(
|
|
4993
5009
|
we,
|
|
4994
5010
|
{
|
|
4995
5011
|
className: `${qe} max-w-full prose-img:max-w-prose w-full mt-2 mb-12`,
|
|
4996
|
-
content:
|
|
5012
|
+
content: d.description
|
|
4997
5013
|
}
|
|
4998
5014
|
),
|
|
4999
|
-
/* @__PURE__ */ b.jsx("div", { className: "operation mb-12", children: /* @__PURE__ */ b.jsx(
|
|
5000
|
-
|
|
5015
|
+
/* @__PURE__ */ b.jsx("div", { className: "operation mb-12", children: /* @__PURE__ */ b.jsx(ta, { children: d.operations.map((y) => /* @__PURE__ */ b.jsx(
|
|
5016
|
+
Ls,
|
|
5001
5017
|
{
|
|
5002
|
-
operationFragment:
|
|
5018
|
+
operationFragment: y
|
|
5003
5019
|
},
|
|
5004
|
-
|
|
5020
|
+
y.slug
|
|
5005
5021
|
)) }) })
|
|
5006
|
-
] },
|
|
5022
|
+
] }, d.name)
|
|
5007
5023
|
))
|
|
5008
5024
|
] });
|
|
5009
5025
|
};
|
|
5010
5026
|
export {
|
|
5011
|
-
|
|
5012
|
-
|
|
5027
|
+
cc as OperationList,
|
|
5028
|
+
Fs as OperationsFragment
|
|
5013
5029
|
};
|
|
5014
|
-
//# sourceMappingURL=OperationList-
|
|
5030
|
+
//# sourceMappingURL=OperationList-wvY-BrxS.js.map
|