zudoku 0.3.0-dev.78 → 0.3.0-dev.79
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/lib/authentication/providers/openid.d.ts +1 -1
- package/dist/lib/authentication/providers/openid.js +1 -1
- package/dist/lib/authentication/providers/openid.js.map +1 -1
- package/dist/lib/plugins/openapi/index.js +3 -5
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Playground.js +3 -3
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.d.ts +2 -1
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/ResponseTab.d.ts +4 -0
- package/dist/lib/plugins/openapi/playground/ResponseTab.js +40 -0
- package/dist/lib/plugins/openapi/playground/ResponseTab.js.map +1 -0
- package/dist/lib/ui/Button.d.ts +5 -1
- package/dist/lib/ui/Button.js +24 -1
- package/dist/lib/ui/Button.js.map +1 -1
- package/lib/{Combination-BIdpLnWg.js → Combination-CS4rK8IJ.js} +8 -8
- package/lib/Combination-CS4rK8IJ.js.map +1 -0
- package/lib/{Input-qyZciIJp.js → Input-GFpPXs5b.js} +2 -2
- package/lib/{Input-qyZciIJp.js.map → Input-GFpPXs5b.js.map} +1 -1
- package/lib/{OperationList-qfNEBPAx.js → OperationList-C-M33Hxu.js} +691 -720
- package/lib/OperationList-C-M33Hxu.js.map +1 -0
- package/lib/{Spinner-yPSFgoZ8.js → Spinner-oNQQyp-I.js} +2 -2
- package/lib/{Spinner-yPSFgoZ8.js.map → Spinner-oNQQyp-I.js.map} +1 -1
- package/lib/{index-BpO_SgPQ.js → index-D4bOMg7f.js} +3 -3
- package/lib/{index-BpO_SgPQ.js.map → index-D4bOMg7f.js.map} +1 -1
- package/lib/{index-DccqEFTy.js → index-Uqja2h2M.js} +264 -182
- package/lib/index-Uqja2h2M.js.map +1 -0
- package/lib/zudoku.auth-openid.js +1 -1
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +3 -3
- package/lib/zudoku.plugin-api-keys.js +2 -2
- package/lib/zudoku.plugin-openapi.js +2 -2
- package/package.json +1 -1
- package/src/app/main.css +1 -1
- package/src/lib/authentication/providers/openid.tsx +1 -1
- package/src/lib/plugins/openapi/index.tsx +13 -7
- package/src/lib/plugins/openapi/playground/Playground.tsx +7 -11
- package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +3 -1
- package/src/lib/plugins/openapi/playground/ResponseTab.tsx +76 -0
- package/src/lib/ui/Button.tsx +32 -2
- package/dist/lib/ui/button-variants.d.ts +0 -4
- package/dist/lib/ui/button-variants.js +0 -25
- package/dist/lib/ui/button-variants.js.map +0 -1
- package/lib/Combination-BIdpLnWg.js.map +0 -1
- package/lib/OperationList-qfNEBPAx.js.map +0 -1
- package/lib/index-DccqEFTy.js.map +0 -1
- package/src/lib/ui/button-variants.ts +0 -32
|
@@ -1,32 +1,22 @@
|
|
|
1
1
|
import { j as g } from "./jsx-runtime-CJBdjYYx.js";
|
|
2
2
|
import { C as Vt } from "./CategoryHeading-DCmchnA1.js";
|
|
3
|
-
import { D as
|
|
4
|
-
import { C as Ir, P as
|
|
5
|
-
import { c as
|
|
6
|
-
import { R as Lr, T as
|
|
7
|
-
import { u as
|
|
8
|
-
import { u as
|
|
9
|
-
import { useState as
|
|
10
|
-
import { B as
|
|
11
|
-
import { a as
|
|
12
|
-
import { u as
|
|
3
|
+
import { D as hn } from "./DeveloperHint-DQVwIery.js";
|
|
4
|
+
import { C as Ir, P as yn, g as qt, M as mn, S as gn, T as bn, a as vn, b as $n, c as xn, E as wn } from "./index-Uqja2h2M.js";
|
|
5
|
+
import { c as Sn, h as Te, H as Ae, a as le, P as jn, S as at, I as Kt } from "./Markdown-QsZ-PHET.js";
|
|
6
|
+
import { R as Lr, T as Ur, C as _r, a as On } from "./index-D4bOMg7f.js";
|
|
7
|
+
import { u as Fr } from "./context-_fYfJFgk.js";
|
|
8
|
+
import { u as Hr } from "./urql-DrBfkb92.js";
|
|
9
|
+
import { useState as Br, useTransition as Tn, Fragment as Pn, useMemo as kn } from "react";
|
|
10
|
+
import { B as En } from "./Combination-CS4rK8IJ.js";
|
|
11
|
+
import { a as Cn, c as Ge, g as Nn } from "./_commonjsHelpers-BVfed4GL.js";
|
|
12
|
+
import { u as Rn } from "./index-Dt-pU7Vu.js";
|
|
13
13
|
/**
|
|
14
14
|
* @license lucide-react v0.378.0 - ISC
|
|
15
15
|
*
|
|
16
16
|
* This source code is licensed under the ISC license.
|
|
17
17
|
* See the LICENSE file in the root directory of this source tree.
|
|
18
18
|
*/
|
|
19
|
-
const
|
|
20
|
-
["path", { d: "m7 15 5 5 5-5", key: "1hf1tw" }],
|
|
21
|
-
["path", { d: "m7 9 5-5 5 5", key: "sgt6xg" }]
|
|
22
|
-
]);
|
|
23
|
-
/**
|
|
24
|
-
* @license lucide-react v0.378.0 - ISC
|
|
25
|
-
*
|
|
26
|
-
* This source code is licensed under the ISC license.
|
|
27
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
28
|
-
*/
|
|
29
|
-
const An = Ur("ListPlus", [
|
|
19
|
+
const An = Sn("ListPlus", [
|
|
30
20
|
["path", { d: "M11 12H3", key: "51ecnj" }],
|
|
31
21
|
["path", { d: "M16 6H3", key: "1wxfjs" }],
|
|
32
22
|
["path", { d: "M16 18H3", key: "12xzn7" }],
|
|
@@ -36,10 +26,10 @@ const An = Ur("ListPlus", [
|
|
|
36
26
|
function qn(t, e) {
|
|
37
27
|
return e;
|
|
38
28
|
}
|
|
39
|
-
const
|
|
29
|
+
const Mr = (t, e) => t.reduce(
|
|
40
30
|
(r, o) => {
|
|
41
|
-
const
|
|
42
|
-
return r[
|
|
31
|
+
const c = e(o);
|
|
32
|
+
return r[c] || (r[c] = []), r[c].push(o), r;
|
|
43
33
|
},
|
|
44
34
|
{}
|
|
45
35
|
), Qt = (t, e) => t ? e(t) : void 0, Dt = (t) => t.schema != null && typeof t.schema == "object" ? t.schema : {
|
|
@@ -68,7 +58,7 @@ const Wr = (t, e) => t.reduce(
|
|
|
68
58
|
className: "text-sm prose-p:my-1"
|
|
69
59
|
}
|
|
70
60
|
)
|
|
71
|
-
] }),
|
|
61
|
+
] }), Ln = ({
|
|
72
62
|
group: t,
|
|
73
63
|
parameters: e,
|
|
74
64
|
id: r
|
|
@@ -83,17 +73,17 @@ const Wr = (t, e) => t.reduce(
|
|
|
83
73
|
},
|
|
84
74
|
`${o.name}-${o.in}`
|
|
85
75
|
)) })
|
|
86
|
-
] }),
|
|
76
|
+
] }), Un = (t) => Object.entries(t), _n = ({
|
|
87
77
|
propertyName: t,
|
|
88
78
|
property: e,
|
|
89
79
|
nestingLevel: r,
|
|
90
80
|
isRequired: o
|
|
91
81
|
}) => {
|
|
92
|
-
var
|
|
82
|
+
var c;
|
|
93
83
|
return e ? /* @__PURE__ */ g.jsxs(
|
|
94
84
|
"div",
|
|
95
85
|
{
|
|
96
|
-
className:
|
|
86
|
+
className: le(
|
|
97
87
|
"p-4 bg-border/20 hover:bg-border/30 flex gap-1 flex-col text-sm",
|
|
98
88
|
e.deprecated && "opacity-50"
|
|
99
89
|
),
|
|
@@ -130,12 +120,12 @@ const Wr = (t, e) => t.reduce(
|
|
|
130
120
|
)).slice(0, 4),
|
|
131
121
|
e.enum.length > 4 && /* @__PURE__ */ g.jsx("span", { className: "font-mono text-xs border bg-muted rounded px-1", children: "..." })
|
|
132
122
|
] }),
|
|
133
|
-
e.type === "object" && (((
|
|
134
|
-
/* @__PURE__ */ g.jsx(
|
|
123
|
+
e.type === "object" && (((c = e.properties) == null ? void 0 : c.length) ?? Object.entries(e.additionalProperties ?? {}).length > 0) || e.type === "array" && e.items.type === "object" ? /* @__PURE__ */ g.jsxs(Lr, { className: "CollapsibleRoot", defaultOpen: !1, children: [
|
|
124
|
+
/* @__PURE__ */ g.jsx(Ur, { asChild: !0, children: /* @__PURE__ */ g.jsxs(En, { variant: "ghost", size: "sm", children: [
|
|
135
125
|
"Show nested fields",
|
|
136
126
|
/* @__PURE__ */ g.jsx(An, { size: 18, className: "ml-1.5" })
|
|
137
127
|
] }) }),
|
|
138
|
-
/* @__PURE__ */ g.jsxs(
|
|
128
|
+
/* @__PURE__ */ g.jsxs(_r, { children: [
|
|
139
129
|
e.type === "object" && /* @__PURE__ */ g.jsx("div", { className: "mt-2.5", children: /* @__PURE__ */ g.jsx(
|
|
140
130
|
Xe,
|
|
141
131
|
{
|
|
@@ -163,9 +153,9 @@ const Wr = (t, e) => t.reduce(
|
|
|
163
153
|
properties: e,
|
|
164
154
|
nestingLevel: r,
|
|
165
155
|
required: o,
|
|
166
|
-
defaultOpen:
|
|
156
|
+
defaultOpen: c = !1
|
|
167
157
|
}) => {
|
|
168
|
-
const a =
|
|
158
|
+
const a = c || t === "required" || e.length === 1 || r === 0, [n, i] = Br(a);
|
|
169
159
|
if (e.length !== 0)
|
|
170
160
|
return /* @__PURE__ */ g.jsxs(
|
|
171
161
|
Lr,
|
|
@@ -175,9 +165,9 @@ const Wr = (t, e) => t.reduce(
|
|
|
175
165
|
onOpenChange: i,
|
|
176
166
|
children: [
|
|
177
167
|
!n && /* @__PURE__ */ g.jsxs(
|
|
178
|
-
|
|
168
|
+
Ur,
|
|
179
169
|
{
|
|
180
|
-
className:
|
|
170
|
+
className: le(
|
|
181
171
|
"py-2 hover:bg-muted w-full",
|
|
182
172
|
t === "optional" && "font-semibold",
|
|
183
173
|
t === "deprecated" && "text-muted-foreground"
|
|
@@ -190,21 +180,21 @@ const Wr = (t, e) => t.reduce(
|
|
|
190
180
|
]
|
|
191
181
|
}
|
|
192
182
|
),
|
|
193
|
-
/* @__PURE__ */ g.jsx(
|
|
183
|
+
/* @__PURE__ */ g.jsx(_r, { className: "divide-y divide-border", children: e.map(([s, l]) => /* @__PURE__ */ g.jsx(
|
|
194
184
|
_n,
|
|
195
185
|
{
|
|
196
186
|
property: l,
|
|
197
|
-
propertyName:
|
|
187
|
+
propertyName: s,
|
|
198
188
|
nestingLevel: r,
|
|
199
|
-
isRequired: o.includes(
|
|
189
|
+
isRequired: o.includes(s)
|
|
200
190
|
},
|
|
201
|
-
|
|
191
|
+
s
|
|
202
192
|
)) })
|
|
203
193
|
]
|
|
204
194
|
}
|
|
205
195
|
);
|
|
206
|
-
}, Ye =
|
|
207
|
-
|
|
196
|
+
}, Ye = le(
|
|
197
|
+
jn,
|
|
208
198
|
"max-w-full prose-img:max-w-prose"
|
|
209
199
|
), Xe = ({
|
|
210
200
|
name: t,
|
|
@@ -212,25 +202,25 @@ const Wr = (t, e) => t.reduce(
|
|
|
212
202
|
level: r = 0,
|
|
213
203
|
defaultOpen: o = !1
|
|
214
204
|
}) => {
|
|
215
|
-
const
|
|
205
|
+
const c = Object.entries(e.properties ?? {}), a = typeof e.additionalProperties == "object" ? Object.entries(e.additionalProperties) : [], n = c.concat(
|
|
216
206
|
Array.isArray(a) ? a : []
|
|
217
|
-
), i =
|
|
207
|
+
), i = Mr(n, ([s, l]) => {
|
|
218
208
|
var u;
|
|
219
|
-
return l.deprecated ? "deprecated" : (u = e.required) != null && u.includes(
|
|
209
|
+
return l.deprecated ? "deprecated" : (u = e.required) != null && u.includes(s) ? "required" : "optional";
|
|
220
210
|
});
|
|
221
211
|
return /* @__PURE__ */ g.jsxs("div", { className: "flex flex-col gap-2.5", children: [
|
|
222
212
|
(e.title ?? t) && /* @__PURE__ */ g.jsx("div", { className: "ml-2 my-1 font-bold", children: e.title ?? t }),
|
|
223
213
|
r === 0 && e.description && /* @__PURE__ */ g.jsx(Te, { className: Ye, content: e.description }),
|
|
224
|
-
/* @__PURE__ */ g.jsx("ul", { className: "border-border border rounded overflow-hidden", children:
|
|
214
|
+
/* @__PURE__ */ g.jsx("ul", { className: "border-border border rounded overflow-hidden", children: Un(i).map(([s, l]) => /* @__PURE__ */ g.jsx(
|
|
225
215
|
Fn,
|
|
226
216
|
{
|
|
227
217
|
defaultOpen: o,
|
|
228
|
-
group:
|
|
218
|
+
group: s,
|
|
229
219
|
nestingLevel: r,
|
|
230
220
|
properties: l ?? [],
|
|
231
221
|
required: e.required ?? []
|
|
232
222
|
},
|
|
233
|
-
|
|
223
|
+
s
|
|
234
224
|
)) })
|
|
235
225
|
] });
|
|
236
226
|
};
|
|
@@ -245,16 +235,16 @@ var Yt = (t, e) => {
|
|
|
245
235
|
*/
|
|
246
236
|
constructor({ indent: t, join: e } = {}) {
|
|
247
237
|
this.postProcessors = [], this.code = [], this.indentationCharacter = Xt, this.lineJoin = Zt, this.indentLine = (r, o = 0) => `${this.indentationCharacter.repeat(o)}${r}`, this.unshift = (r, o) => {
|
|
248
|
-
const
|
|
249
|
-
this.code.unshift(
|
|
238
|
+
const c = this.indentLine(r, o);
|
|
239
|
+
this.code.unshift(c);
|
|
250
240
|
}, this.push = (r, o) => {
|
|
251
|
-
const
|
|
252
|
-
this.code.push(
|
|
241
|
+
const c = this.indentLine(r, o);
|
|
242
|
+
this.code.push(c);
|
|
253
243
|
}, this.blank = () => {
|
|
254
244
|
this.code.push("");
|
|
255
245
|
}, this.join = () => {
|
|
256
246
|
const r = this.code.join(this.lineJoin);
|
|
257
|
-
return this.postProcessors.reduce((
|
|
247
|
+
return this.postProcessors.reduce((c, a) => a(c), r);
|
|
258
248
|
}, this.addPostProcessor = (r) => {
|
|
259
249
|
this.postProcessors = [...this.postProcessors, r];
|
|
260
250
|
}, this.indentationCharacter = t || Xt, this.lineJoin = e ?? Zt;
|
|
@@ -267,20 +257,20 @@ var Yt = (t, e) => {
|
|
|
267
257
|
}, It = {};
|
|
268
258
|
Object.defineProperty(It, "__esModule", { value: !0 });
|
|
269
259
|
It.default = (t) => Object.getOwnPropertySymbols(t).filter((e) => Object.prototype.propertyIsEnumerable.call(t, e));
|
|
270
|
-
const Mn = Hn, Wn = Bn,
|
|
271
|
-
var
|
|
260
|
+
const Mn = Hn, Wn = Bn, Jn = It.default;
|
|
261
|
+
var zn = (t, e, r) => {
|
|
272
262
|
const o = [];
|
|
273
|
-
return function
|
|
263
|
+
return function c(a, n, i) {
|
|
274
264
|
n = n || {}, n.indent = n.indent || " ", i = i || "";
|
|
275
|
-
let
|
|
276
|
-
n.inlineCharacterLimit === void 0 ?
|
|
265
|
+
let s;
|
|
266
|
+
n.inlineCharacterLimit === void 0 ? s = {
|
|
277
267
|
newLine: `
|
|
278
268
|
`,
|
|
279
269
|
newLineOrSpace: `
|
|
280
270
|
`,
|
|
281
271
|
pad: i,
|
|
282
272
|
indent: i + n.indent
|
|
283
|
-
} :
|
|
273
|
+
} : s = {
|
|
284
274
|
newLine: "@@__STRINGIFY_OBJECT_NEW_LINE__@@",
|
|
285
275
|
newLineOrSpace: "@@__STRINGIFY_OBJECT_NEW_LINE_OR_SPACE__@@",
|
|
286
276
|
pad: "@@__STRINGIFY_OBJECT_PAD__@@",
|
|
@@ -289,9 +279,9 @@ var Jn = (t, e, r) => {
|
|
|
289
279
|
const l = (u) => {
|
|
290
280
|
if (n.inlineCharacterLimit === void 0)
|
|
291
281
|
return u;
|
|
292
|
-
const p = u.replace(new RegExp(
|
|
293
|
-
return p.length <= n.inlineCharacterLimit ? p : u.replace(new RegExp(
|
|
294
|
-
`).replace(new RegExp(
|
|
282
|
+
const p = u.replace(new RegExp(s.newLine, "g"), "").replace(new RegExp(s.newLineOrSpace, "g"), " ").replace(new RegExp(s.pad + "|" + s.indent, "g"), "");
|
|
283
|
+
return p.length <= n.inlineCharacterLimit ? p : u.replace(new RegExp(s.newLine + "|" + s.newLineOrSpace, "g"), `
|
|
284
|
+
`).replace(new RegExp(s.pad, "g"), i).replace(new RegExp(s.indent, "g"), i + n.indent);
|
|
295
285
|
};
|
|
296
286
|
if (o.indexOf(a) !== -1)
|
|
297
287
|
return '"[Circular]"';
|
|
@@ -303,36 +293,36 @@ var Jn = (t, e, r) => {
|
|
|
303
293
|
if (a.length === 0)
|
|
304
294
|
return "[]";
|
|
305
295
|
o.push(a);
|
|
306
|
-
const u = "[" +
|
|
307
|
-
const d = a.length - 1 === f ?
|
|
308
|
-
let h =
|
|
309
|
-
return n.transform && (h = n.transform(a, f, h)),
|
|
310
|
-
}).join("") +
|
|
296
|
+
const u = "[" + s.newLine + a.map((p, f) => {
|
|
297
|
+
const d = a.length - 1 === f ? s.newLine : "," + s.newLineOrSpace;
|
|
298
|
+
let h = c(p, n, i + n.indent);
|
|
299
|
+
return n.transform && (h = n.transform(a, f, h)), s.indent + h + d;
|
|
300
|
+
}).join("") + s.pad + "]";
|
|
311
301
|
return o.pop(), l(u);
|
|
312
302
|
}
|
|
313
303
|
if (Wn(a)) {
|
|
314
|
-
let u = Object.keys(a).concat(
|
|
304
|
+
let u = Object.keys(a).concat(Jn(a));
|
|
315
305
|
if (n.filter && (u = u.filter((f) => n.filter(a, f))), u.length === 0)
|
|
316
306
|
return "{}";
|
|
317
307
|
o.push(a);
|
|
318
|
-
const p = "{" +
|
|
319
|
-
const h = u.length - 1 === d ?
|
|
320
|
-
let y =
|
|
321
|
-
return n.transform && (y = n.transform(a, f, y)),
|
|
322
|
-
}).join("") +
|
|
308
|
+
const p = "{" + s.newLine + u.map((f, d) => {
|
|
309
|
+
const h = u.length - 1 === d ? s.newLine : "," + s.newLineOrSpace, m = typeof f == "symbol", b = !m && /^[a-z$_][a-z$_0-9]*$/i.test(f), v = m || b ? f : c(f, n);
|
|
310
|
+
let y = c(a[f], n, i + n.indent);
|
|
311
|
+
return n.transform && (y = n.transform(a, f, y)), s.indent + String(v) + ": " + y + h;
|
|
312
|
+
}).join("") + s.pad + "}";
|
|
323
313
|
return o.pop(), l(p);
|
|
324
314
|
}
|
|
325
315
|
return a = String(a).replace(/[\r\n]/g, (u) => u === `
|
|
326
316
|
` ? "\\n" : "\\r"), n.singleQuotes === !1 ? (a = a.replace(/"/g, '\\"'), `"${a}"`) : (a = a.replace(/\\?'/g, "\\'"), `'${a}'`);
|
|
327
317
|
}(t, e, r);
|
|
328
318
|
};
|
|
329
|
-
const W = /* @__PURE__ */
|
|
330
|
-
function
|
|
331
|
-
const { delimiter: r = '"', escapeChar: o = "\\", escapeNewlines:
|
|
319
|
+
const W = /* @__PURE__ */ Cn(zn);
|
|
320
|
+
function Ue(t, e = {}) {
|
|
321
|
+
const { delimiter: r = '"', escapeChar: o = "\\", escapeNewlines: c = !0 } = e;
|
|
332
322
|
return [...t.toString()].map((n) => n === "\b" ? `${o}b` : n === " " ? `${o}t` : n === `
|
|
333
|
-
` ?
|
|
323
|
+
` ? c ? `${o}n` : n : n === "\f" ? `${o}f` : n === "\r" ? c ? `${o}r` : n : n === o ? o + o : n === r ? o + r : n < " " || n > "~" ? JSON.stringify(n).slice(1, -1) : n).join("");
|
|
334
324
|
}
|
|
335
|
-
var _e = (t) =>
|
|
325
|
+
var _e = (t) => Ue(t, { delimiter: "'" }), H = (t) => Ue(t, { delimiter: '"' }), Gn = {
|
|
336
326
|
info: {
|
|
337
327
|
key: "libcurl",
|
|
338
328
|
title: "Libcurl",
|
|
@@ -340,13 +330,13 @@ var _e = (t) => Le(t, { delimiter: "'" }), H = (t) => Le(t, { delimiter: '"' }),
|
|
|
340
330
|
description: "Simple REST and HTTP API Client for C",
|
|
341
331
|
extname: ".c"
|
|
342
332
|
},
|
|
343
|
-
convert: ({ method: t, fullUrl: e, headersObj: r, allHeaders: o, postData:
|
|
333
|
+
convert: ({ method: t, fullUrl: e, headersObj: r, allHeaders: o, postData: c }) => {
|
|
344
334
|
const { push: a, blank: n, join: i } = new P();
|
|
345
335
|
a("CURL *hnd = curl_easy_init();"), n(), a(`curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "${t.toUpperCase()}");`), a("curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);"), a(`curl_easy_setopt(hnd, CURLOPT_URL, "${e}");`);
|
|
346
|
-
const
|
|
347
|
-
return
|
|
336
|
+
const s = Object.keys(r);
|
|
337
|
+
return s.length && (n(), a("struct curl_slist *headers = NULL;"), s.forEach((l) => {
|
|
348
338
|
a(`headers = curl_slist_append(headers, "${l}: ${H(r[l])}");`);
|
|
349
|
-
}), a("curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);")), o.cookie && (n(), a(`curl_easy_setopt(hnd, CURLOPT_COOKIE, "${o.cookie}");`)),
|
|
339
|
+
}), a("curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);")), o.cookie && (n(), a(`curl_easy_setopt(hnd, CURLOPT_COOKIE, "${o.cookie}");`)), c.text && (n(), a(`curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, ${JSON.stringify(c.text)});`)), n(), a("CURLcode ret = curl_easy_perform(hnd);"), i();
|
|
350
340
|
}
|
|
351
341
|
}, Vn = {
|
|
352
342
|
info: {
|
|
@@ -358,11 +348,11 @@ var _e = (t) => Le(t, { delimiter: "'" }), H = (t) => Le(t, { delimiter: '"' }),
|
|
|
358
348
|
clientsById: {
|
|
359
349
|
libcurl: Gn
|
|
360
350
|
}
|
|
361
|
-
},
|
|
362
|
-
const r =
|
|
351
|
+
}, z = (t, e) => Object.keys(t).find((r) => r.toLowerCase() === e.toLowerCase()), ce = (t, e) => {
|
|
352
|
+
const r = z(t, e);
|
|
363
353
|
if (r)
|
|
364
354
|
return t[r];
|
|
365
|
-
}, it = (t, e) => !!
|
|
355
|
+
}, it = (t, e) => !!z(t, e), Kn = (t) => ["application/json", "application/x-json", "text/json", "text/x-json", "+json"].some(
|
|
366
356
|
(e) => t.indexOf(e) > -1
|
|
367
357
|
), er = class {
|
|
368
358
|
constructor(t) {
|
|
@@ -372,14 +362,14 @@ var _e = (t) => Le(t, { delimiter: "'" }), H = (t) => Le(t, { delimiter: '"' }),
|
|
|
372
362
|
constructor(t) {
|
|
373
363
|
this.path = "", this.toString = () => `(clojure.java.io/file "${this.path}")`, this.path = t;
|
|
374
364
|
}
|
|
375
|
-
},
|
|
365
|
+
}, Wr = (t) => t === void 0 ? null : t === null ? "null" : t.constructor.name.toLowerCase(), Jr = (t) => t === void 0 ? !0 : Wr(t) === "object" ? Object.keys(t).length === 0 : !1, tr = (t) => (Object.keys(t).filter((e) => Jr(t[e])).forEach((e) => {
|
|
376
366
|
delete t[e];
|
|
377
367
|
}), t), Ve = (t, e) => {
|
|
378
368
|
const r = " ".repeat(t);
|
|
379
369
|
return e.replace(/\n/g, `
|
|
380
370
|
${r}`);
|
|
381
371
|
}, wt = (t) => {
|
|
382
|
-
switch (
|
|
372
|
+
switch (Wr(t)) {
|
|
383
373
|
case "string":
|
|
384
374
|
return `"${t.replace(/"/g, '\\"')}"`;
|
|
385
375
|
case "file":
|
|
@@ -392,8 +382,8 @@ ${r}`);
|
|
|
392
382
|
return `#"${t.source}"`;
|
|
393
383
|
case "object": {
|
|
394
384
|
const e = Object.keys(t).reduce((r, o) => {
|
|
395
|
-
const
|
|
396
|
-
return `${r}:${o} ${
|
|
385
|
+
const c = Ve(o.length + 2, wt(t[o]));
|
|
386
|
+
return `${r}:${o} ${c}
|
|
397
387
|
`;
|
|
398
388
|
}, "").trim();
|
|
399
389
|
return `{${Ve(1, e)}}`;
|
|
@@ -413,33 +403,33 @@ ${r}`);
|
|
|
413
403
|
description: "An idiomatic clojure http client wrapping the apache client.",
|
|
414
404
|
extname: ".clj"
|
|
415
405
|
},
|
|
416
|
-
convert: ({ queryObj: t, method: e, postData: r, url: o, allHeaders:
|
|
417
|
-
const { push: n, join: i } = new P({ indent: a == null ? void 0 : a.indent }),
|
|
418
|
-
if (e = e.toLowerCase(), !
|
|
406
|
+
convert: ({ queryObj: t, method: e, postData: r, url: o, allHeaders: c }, a) => {
|
|
407
|
+
const { push: n, join: i } = new P({ indent: a == null ? void 0 : a.indent }), s = ["get", "post", "put", "delete", "patch", "head", "options"];
|
|
408
|
+
if (e = e.toLowerCase(), !s.includes(e))
|
|
419
409
|
return n("Method not supported"), i();
|
|
420
410
|
const l = {
|
|
421
|
-
headers:
|
|
411
|
+
headers: c,
|
|
422
412
|
"query-params": t
|
|
423
413
|
};
|
|
424
414
|
switch (r.mimeType) {
|
|
425
415
|
case "application/json":
|
|
426
416
|
{
|
|
427
417
|
l["content-type"] = new er("json"), l["form-params"] = r.jsonObj;
|
|
428
|
-
const u =
|
|
418
|
+
const u = z(l.headers, "content-type");
|
|
429
419
|
u && delete l.headers[u];
|
|
430
420
|
}
|
|
431
421
|
break;
|
|
432
422
|
case "application/x-www-form-urlencoded":
|
|
433
423
|
{
|
|
434
424
|
l["form-params"] = r.paramsObj;
|
|
435
|
-
const u =
|
|
425
|
+
const u = z(l.headers, "content-type");
|
|
436
426
|
u && delete l.headers[u];
|
|
437
427
|
}
|
|
438
428
|
break;
|
|
439
429
|
case "text/plain":
|
|
440
430
|
{
|
|
441
431
|
l.body = r.text;
|
|
442
|
-
const u =
|
|
432
|
+
const u = z(l.headers, "content-type");
|
|
443
433
|
u && delete l.headers[u];
|
|
444
434
|
}
|
|
445
435
|
break;
|
|
@@ -452,17 +442,17 @@ ${r}`);
|
|
|
452
442
|
name: p.name,
|
|
453
443
|
content: p.value
|
|
454
444
|
});
|
|
455
|
-
const u =
|
|
445
|
+
const u = z(l.headers, "content-type");
|
|
456
446
|
u && delete l.headers[u];
|
|
457
447
|
}
|
|
458
448
|
break;
|
|
459
449
|
}
|
|
460
450
|
}
|
|
461
|
-
switch (
|
|
451
|
+
switch (ce(l.headers, "accept")) {
|
|
462
452
|
case "application/json":
|
|
463
453
|
{
|
|
464
454
|
l.accept = new er("json");
|
|
465
|
-
const u =
|
|
455
|
+
const u = z(l.headers, "accept");
|
|
466
456
|
u && delete l.headers[u];
|
|
467
457
|
}
|
|
468
458
|
break;
|
|
@@ -486,15 +476,15 @@ ${r}`);
|
|
|
486
476
|
clj_http: Dn
|
|
487
477
|
}
|
|
488
478
|
}, Xn = (t) => {
|
|
489
|
-
let e =
|
|
479
|
+
let e = ce(t, "accept-encoding");
|
|
490
480
|
if (!e)
|
|
491
481
|
return [];
|
|
492
482
|
const r = {
|
|
493
483
|
gzip: "DecompressionMethods.GZip",
|
|
494
484
|
deflate: "DecompressionMethods.Deflate"
|
|
495
485
|
}, o = [];
|
|
496
|
-
return typeof e == "string" && (e = [e]), e.forEach((
|
|
497
|
-
|
|
486
|
+
return typeof e == "string" && (e = [e]), e.forEach((c) => {
|
|
487
|
+
c.split(",").forEach((a) => {
|
|
498
488
|
const n = /\s*([^;\s]+)/.exec(a);
|
|
499
489
|
if (n) {
|
|
500
490
|
const i = r[n[1]];
|
|
@@ -510,16 +500,16 @@ ${r}`);
|
|
|
510
500
|
description: ".NET Standard HTTP Client",
|
|
511
501
|
extname: ".cs"
|
|
512
502
|
},
|
|
513
|
-
convert: ({ allHeaders: t, postData: e, method: r, fullUrl: o },
|
|
503
|
+
convert: ({ allHeaders: t, postData: e, method: r, fullUrl: o }, c) => {
|
|
514
504
|
var d, h;
|
|
515
505
|
const a = {
|
|
516
506
|
indent: " ",
|
|
517
|
-
...
|
|
507
|
+
...c
|
|
518
508
|
}, { push: n, join: i } = new P({ indent: a.indent });
|
|
519
509
|
n("using System.Net.Http.Headers;");
|
|
520
|
-
let
|
|
510
|
+
let s = "";
|
|
521
511
|
const l = !!t.cookie, u = Xn(t);
|
|
522
|
-
(l || u.length) && (
|
|
512
|
+
(l || u.length) && (s = "clientHandler", n("var clientHandler = new HttpClientHandler"), n("{"), l && n("UseCookies = false,", 1), u.length && n(`AutomaticDecompression = ${u.join(" | ")},`, 1), n("};")), n(`var client = new HttpClient(${s});`), n("var request = new HttpRequestMessage"), n("{");
|
|
523
513
|
const p = ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS", "TRACE"];
|
|
524
514
|
r = r.toUpperCase(), r && p.includes(r) ? r = `HttpMethod.${r[0]}${r.substring(1).toLowerCase()}` : r = `new HttpMethod("${r}")`, n(`Method = ${r},`, 1), n(`RequestUri = new Uri("${o}"),`, 1);
|
|
525
515
|
const f = Object.keys(t).filter((m) => {
|
|
@@ -567,7 +557,7 @@ var to = {
|
|
|
567
557
|
extname: ".cs",
|
|
568
558
|
installation: "dotnet add package RestSharp"
|
|
569
559
|
},
|
|
570
|
-
convert: ({ method: t, fullUrl: e, headersObj: r, cookies: o, postData:
|
|
560
|
+
convert: ({ method: t, fullUrl: e, headersObj: r, cookies: o, postData: c, uriObj: a }) => {
|
|
571
561
|
const { push: n, join: i } = new P();
|
|
572
562
|
if (!["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"].includes(
|
|
573
563
|
t.toUpperCase()
|
|
@@ -576,37 +566,37 @@ var to = {
|
|
|
576
566
|
n(`using RestSharp;
|
|
577
567
|
|
|
578
568
|
`), n(`var options = new RestClientOptions("${e}");`), n("var client = new RestClient(options);"), n('var request = new RestRequest("");');
|
|
579
|
-
const l =
|
|
569
|
+
const l = c.mimeType && c.mimeType === "multipart/form-data";
|
|
580
570
|
switch (l && n("request.AlwaysMultipartFormData = true;"), Object.keys(r).forEach((u) => {
|
|
581
|
-
if (
|
|
582
|
-
l &&
|
|
571
|
+
if (c.mimeType && u.toLowerCase() === "content-type" && c.text) {
|
|
572
|
+
l && c.boundary && n(`request.FormBoundary = "${c.boundary}";`);
|
|
583
573
|
return;
|
|
584
574
|
}
|
|
585
575
|
n(`request.AddHeader("${u}", "${H(r[u])}");`);
|
|
586
576
|
}), o.forEach(({ name: u, value: p }) => {
|
|
587
577
|
n(`request.AddCookie("${u}", "${H(p)}", "${a.pathname}", "${a.host}");`);
|
|
588
|
-
}),
|
|
578
|
+
}), c.mimeType) {
|
|
589
579
|
case "multipart/form-data":
|
|
590
|
-
if (!
|
|
591
|
-
|
|
580
|
+
if (!c.params) break;
|
|
581
|
+
c.params.forEach((u) => {
|
|
592
582
|
u.fileName ? n(`request.AddFile("${u.name}", "${u.fileName}");`) : n(`request.AddParameter("${u.name}", "${u.value}");`);
|
|
593
583
|
});
|
|
594
584
|
break;
|
|
595
585
|
case "application/x-www-form-urlencoded":
|
|
596
|
-
if (!
|
|
597
|
-
|
|
586
|
+
if (!c.params) break;
|
|
587
|
+
c.params.forEach((u) => {
|
|
598
588
|
n(`request.AddParameter("${u.name}", "${u.value}");`);
|
|
599
589
|
});
|
|
600
590
|
break;
|
|
601
591
|
case "application/json": {
|
|
602
|
-
if (!
|
|
603
|
-
const u = JSON.stringify(
|
|
592
|
+
if (!c.text) break;
|
|
593
|
+
const u = JSON.stringify(c.text);
|
|
604
594
|
n(`request.AddJsonBody(${u}, false);`);
|
|
605
595
|
break;
|
|
606
596
|
}
|
|
607
597
|
default:
|
|
608
|
-
if (!
|
|
609
|
-
n(`request.AddStringBody("${
|
|
598
|
+
if (!c.text) break;
|
|
599
|
+
n(`request.AddStringBody("${c.text}", "${c.mimeType}");`);
|
|
610
600
|
}
|
|
611
601
|
return n(`var response = await client.${eo(t)}Async(request);
|
|
612
602
|
`), n(`Console.WriteLine("{0}", response.Content);
|
|
@@ -631,15 +621,15 @@ var to = {
|
|
|
631
621
|
description: "Golang HTTP client request",
|
|
632
622
|
extname: ".go"
|
|
633
623
|
},
|
|
634
|
-
convert: ({ postData: t, method: e, allHeaders: r, fullUrl: o },
|
|
635
|
-
const { blank: a, push: n, join: i } = new P({ indent: " " }), { showBoilerplate:
|
|
624
|
+
convert: ({ postData: t, method: e, allHeaders: r, fullUrl: o }, c = {}) => {
|
|
625
|
+
const { blank: a, push: n, join: i } = new P({ indent: " " }), { showBoilerplate: s = !0, checkErrors: l = !1, printBody: u = !0, timeout: p = -1 } = c, f = l ? "err" : "_", d = s ? 1 : 0, h = () => {
|
|
636
626
|
l && (n("if err != nil {", d), n("panic(err)", d + 1), n("}", d));
|
|
637
627
|
};
|
|
638
|
-
|
|
628
|
+
s && (n("package main"), a(), n("import ("), n('"fmt"', d), p > 0 && n('"time"', d), t.text && n('"strings"', d), n('"net/http"', d), u && n('"io"', d), n(")"), a(), n("func main() {"), a());
|
|
639
629
|
const m = p > 0, b = m, v = b ? "client" : "http.DefaultClient";
|
|
640
630
|
return b && (n("client := http.Client{", d), m && n(`Timeout: time.Duration(${p} * time.Second),`, d + 1), n("}", d), a()), n(`url := "${o}"`, d), a(), t.text ? (n(`payload := strings.NewReader(${JSON.stringify(t.text)})`, d), a(), n(`req, ${f} := http.NewRequest("${e}", url, payload)`, d), a()) : (n(`req, ${f} := http.NewRequest("${e}", url, nil)`, d), a()), h(), Object.keys(r).length && (Object.keys(r).forEach((y) => {
|
|
641
631
|
n(`req.Header.Add("${y}", "${H(r[y])}")`, d);
|
|
642
|
-
}), a()), n(`res, ${f} := ${v}.Do(req)`, d), h(), u && (a(), n("defer res.Body.Close()", d), n(`body, ${f} := io.ReadAll(res.Body)`, d), h()), a(), u && n("fmt.Println(string(body))", d),
|
|
632
|
+
}), a()), n(`res, ${f} := ${v}.Do(req)`, d), h(), u && (a(), n("defer res.Body.Close()", d), n(`body, ${f} := io.ReadAll(res.Body)`, d), h()), a(), u && n("fmt.Println(string(body))", d), s && (a(), n("}")), i();
|
|
643
633
|
}
|
|
644
634
|
}, oo = {
|
|
645
635
|
info: {
|
|
@@ -660,23 +650,23 @@ var to = {
|
|
|
660
650
|
description: "HTTP/1.1 request string in accordance with RFC 7230",
|
|
661
651
|
extname: null
|
|
662
652
|
},
|
|
663
|
-
convert: ({ method: t, fullUrl: e, uriObj: r, httpVersion: o, allHeaders:
|
|
653
|
+
convert: ({ method: t, fullUrl: e, uriObj: r, httpVersion: o, allHeaders: c, postData: a }, n) => {
|
|
664
654
|
const i = {
|
|
665
655
|
absoluteURI: !1,
|
|
666
656
|
autoContentLength: !0,
|
|
667
657
|
autoHost: !0,
|
|
668
658
|
...n
|
|
669
|
-
}, { blank:
|
|
659
|
+
}, { blank: s, push: l, join: u } = new P({ indent: "", join: rr }), p = i.absoluteURI ? e : r.path;
|
|
670
660
|
l(`${t} ${p} ${o}`);
|
|
671
|
-
const f = Object.keys(
|
|
661
|
+
const f = Object.keys(c);
|
|
672
662
|
if (f.forEach((m) => {
|
|
673
663
|
const b = m.toLowerCase().replace(/(^|-)(\w)/g, (v) => v.toUpperCase());
|
|
674
|
-
l(`${b}: ${
|
|
664
|
+
l(`${b}: ${c[m]}`);
|
|
675
665
|
}), i.autoHost && !f.includes("host") && l(`Host: ${r.host}`), i.autoContentLength && a.text && !f.includes("content-length")) {
|
|
676
666
|
const b = new TextEncoder().encode(a.text).length.toString();
|
|
677
667
|
l(`Content-Length: ${b}`);
|
|
678
668
|
}
|
|
679
|
-
|
|
669
|
+
s();
|
|
680
670
|
const d = u(), h = a.text || "";
|
|
681
671
|
return `${d}${rr}${h}`;
|
|
682
672
|
}
|
|
@@ -697,14 +687,14 @@ var to = {
|
|
|
697
687
|
description: "Asynchronous Http and WebSocket Client library for Java",
|
|
698
688
|
extname: ".java"
|
|
699
689
|
},
|
|
700
|
-
convert: ({ method: t, allHeaders: e, postData: r, fullUrl: o },
|
|
690
|
+
convert: ({ method: t, allHeaders: e, postData: r, fullUrl: o }, c) => {
|
|
701
691
|
const a = {
|
|
702
692
|
indent: " ",
|
|
703
|
-
...
|
|
704
|
-
}, { blank: n, push: i, join:
|
|
693
|
+
...c
|
|
694
|
+
}, { blank: n, push: i, join: s } = new P({ indent: a.indent });
|
|
705
695
|
return i("AsyncHttpClient client = new DefaultAsyncHttpClient();"), i(`client.prepare("${t.toUpperCase()}", "${o}")`), Object.keys(e).forEach((l) => {
|
|
706
696
|
i(`.setHeader("${l}", "${H(e[l])}")`, 1);
|
|
707
|
-
}), r.text && i(`.setBody(${JSON.stringify(r.text)})`, 1), i(".execute()", 1), i(".toCompletableFuture()", 1), i(".thenAccept(System.out::println)", 1), i(".join();", 1), n(), i("client.close();"),
|
|
697
|
+
}), r.text && i(`.setBody(${JSON.stringify(r.text)})`, 1), i(".execute()", 1), i(".toCompletableFuture()", 1), i(".thenAccept(System.out::println)", 1), i(".join();", 1), n(), i("client.close();"), s();
|
|
708
698
|
}
|
|
709
699
|
}, co = {
|
|
710
700
|
info: {
|
|
@@ -714,13 +704,13 @@ var to = {
|
|
|
714
704
|
description: "Java Standardized HTTP Client API",
|
|
715
705
|
extname: ".java"
|
|
716
706
|
},
|
|
717
|
-
convert: ({ allHeaders: t, fullUrl: e, method: r, postData: o },
|
|
707
|
+
convert: ({ allHeaders: t, fullUrl: e, method: r, postData: o }, c) => {
|
|
718
708
|
const a = {
|
|
719
709
|
indent: " ",
|
|
720
|
-
...
|
|
710
|
+
...c
|
|
721
711
|
}, { push: n, join: i } = new P({ indent: a.indent });
|
|
722
|
-
return n("HttpRequest request = HttpRequest.newBuilder()"), n(`.uri(URI.create("${e}"))`, 2), Object.keys(t).forEach((
|
|
723
|
-
n(`.header("${
|
|
712
|
+
return n("HttpRequest request = HttpRequest.newBuilder()"), n(`.uri(URI.create("${e}"))`, 2), Object.keys(t).forEach((s) => {
|
|
713
|
+
n(`.header("${s}", "${H(t[s])}")`, 2);
|
|
724
714
|
}), o.text ? n(
|
|
725
715
|
`.method("${r.toUpperCase()}", HttpRequest.BodyPublishers.ofString(${JSON.stringify(o.text)}))`,
|
|
726
716
|
2
|
|
@@ -736,14 +726,14 @@ var to = {
|
|
|
736
726
|
description: "An HTTP Request Client Library",
|
|
737
727
|
extname: ".java"
|
|
738
728
|
},
|
|
739
|
-
convert: ({ postData: t, method: e, fullUrl: r, allHeaders: o },
|
|
729
|
+
convert: ({ postData: t, method: e, fullUrl: r, allHeaders: o }, c) => {
|
|
740
730
|
const a = {
|
|
741
731
|
indent: " ",
|
|
742
|
-
...
|
|
743
|
-
}, { push: n, blank: i, join:
|
|
732
|
+
...c
|
|
733
|
+
}, { push: n, blank: i, join: s } = new P({ indent: a.indent }), l = ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD"], u = ["POST", "PUT", "DELETE", "PATCH"];
|
|
744
734
|
return n("OkHttpClient client = new OkHttpClient();"), i(), t.text && (t.boundary ? n(`MediaType mediaType = MediaType.parse("${t.mimeType}; boundary=${t.boundary}");`) : n(`MediaType mediaType = MediaType.parse("${t.mimeType}");`), n(`RequestBody body = RequestBody.create(mediaType, ${JSON.stringify(t.text)});`)), n("Request request = new Request.Builder()"), n(`.url("${r}")`, 1), l.includes(e.toUpperCase()) ? u.includes(e.toUpperCase()) ? t.text ? n(`.${e.toLowerCase()}(body)`, 1) : n(`.${e.toLowerCase()}(null)`, 1) : n(`.${e.toLowerCase()}()`, 1) : t.text ? n(`.method("${e.toUpperCase()}", body)`, 1) : n(`.method("${e.toUpperCase()}", null)`, 1), Object.keys(o).forEach((p) => {
|
|
745
735
|
n(`.addHeader("${p}", "${H(o[p])}")`, 1);
|
|
746
|
-
}), n(".build();", 1), i(), n("Response response = client.newCall(request).execute();"),
|
|
736
|
+
}), n(".build();", 1), i(), n("Response response = client.newCall(request).execute();"), s();
|
|
747
737
|
}
|
|
748
738
|
}, uo = {
|
|
749
739
|
info: {
|
|
@@ -753,10 +743,10 @@ var to = {
|
|
|
753
743
|
description: "Lightweight HTTP Request Client Library",
|
|
754
744
|
extname: ".java"
|
|
755
745
|
},
|
|
756
|
-
convert: ({ method: t, allHeaders: e, postData: r, fullUrl: o },
|
|
746
|
+
convert: ({ method: t, allHeaders: e, postData: r, fullUrl: o }, c) => {
|
|
757
747
|
const a = {
|
|
758
748
|
indent: " ",
|
|
759
|
-
...
|
|
749
|
+
...c
|
|
760
750
|
}, { join: n, push: i } = new P({ indent: a.indent });
|
|
761
751
|
return ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"].includes(t.toUpperCase()) ? i(`HttpResponse<String> response = Unirest.${t.toLowerCase()}("${o}")`) : i(`HttpResponse<String> response = Unirest.customMethod("${t.toUpperCase()}","${o}")`), Object.keys(e).forEach((l) => {
|
|
762
752
|
i(`.header("${l}", "${H(e[l])}")`, 1);
|
|
@@ -783,40 +773,40 @@ var to = {
|
|
|
783
773
|
extname: ".js",
|
|
784
774
|
installation: "npm install axios --save"
|
|
785
775
|
},
|
|
786
|
-
convert: ({ allHeaders: t, method: e, url: r, queryObj: o, postData:
|
|
776
|
+
convert: ({ allHeaders: t, method: e, url: r, queryObj: o, postData: c }, a) => {
|
|
787
777
|
const n = {
|
|
788
778
|
indent: " ",
|
|
789
779
|
...a
|
|
790
|
-
}, { blank: i, push:
|
|
791
|
-
|
|
780
|
+
}, { blank: i, push: s, join: l, addPostProcessor: u } = new P({ indent: n.indent });
|
|
781
|
+
s("import axios from 'axios';"), i();
|
|
792
782
|
const p = {
|
|
793
783
|
method: e,
|
|
794
784
|
url: r
|
|
795
785
|
};
|
|
796
|
-
switch (Object.keys(o).length && (p.params = o), Object.keys(t).length && (p.headers = t),
|
|
786
|
+
switch (Object.keys(o).length && (p.params = o), Object.keys(t).length && (p.headers = t), c.mimeType) {
|
|
797
787
|
case "application/x-www-form-urlencoded":
|
|
798
|
-
|
|
799
|
-
|
|
788
|
+
c.params && (s("const encodedParams = new URLSearchParams();"), c.params.forEach((d) => {
|
|
789
|
+
s(`encodedParams.set('${d.name}', '${d.value}');`);
|
|
800
790
|
}), i(), p.data = "encodedParams,", u((d) => d.replace(/'encodedParams,'/, "encodedParams,")));
|
|
801
791
|
break;
|
|
802
792
|
case "application/json":
|
|
803
|
-
|
|
793
|
+
c.jsonObj && (p.data = c.jsonObj);
|
|
804
794
|
break;
|
|
805
795
|
case "multipart/form-data":
|
|
806
|
-
if (!
|
|
796
|
+
if (!c.params)
|
|
807
797
|
break;
|
|
808
|
-
|
|
809
|
-
|
|
798
|
+
s("const form = new FormData();"), c.params.forEach((d) => {
|
|
799
|
+
s(`form.append('${d.name}', '${d.value || d.fileName || ""}');`);
|
|
810
800
|
}), i(), p.data = "[form]";
|
|
811
801
|
break;
|
|
812
802
|
default:
|
|
813
|
-
|
|
803
|
+
c.text && (p.data = c.text);
|
|
814
804
|
}
|
|
815
805
|
const f = W(p, {
|
|
816
806
|
indent: " ",
|
|
817
807
|
inlineCharacterLimit: 80
|
|
818
808
|
}).replace('"[form]"', "form");
|
|
819
|
-
return
|
|
809
|
+
return s(`const options = ${f};`), i(), s("axios"), s(".request(options)", 1), s(".then(function (response) {", 1), s("console.log(response.data);", 2), s("})", 1), s(".catch(function (error) {", 1), s("console.error(error);", 2), s("});", 1), l();
|
|
820
810
|
}
|
|
821
811
|
}, ho = {
|
|
822
812
|
info: {
|
|
@@ -826,12 +816,12 @@ var to = {
|
|
|
826
816
|
description: "Perform asynchronous HTTP requests with the Fetch API",
|
|
827
817
|
extname: ".js"
|
|
828
818
|
},
|
|
829
|
-
convert: ({ method: t, allHeaders: e, postData: r, fullUrl: o },
|
|
819
|
+
convert: ({ method: t, allHeaders: e, postData: r, fullUrl: o }, c) => {
|
|
830
820
|
const a = {
|
|
831
821
|
indent: " ",
|
|
832
822
|
credentials: null,
|
|
833
|
-
...
|
|
834
|
-
}, { blank: n, join: i, push:
|
|
823
|
+
...c
|
|
824
|
+
}, { blank: n, join: i, push: s } = new P({ indent: a.indent }), l = {
|
|
835
825
|
method: t
|
|
836
826
|
};
|
|
837
827
|
switch (Object.keys(e).length && (l.headers = e), a.credentials !== null && (l.credentials = a.credentials), r.mimeType) {
|
|
@@ -844,15 +834,15 @@ var to = {
|
|
|
844
834
|
case "multipart/form-data":
|
|
845
835
|
if (!r.params)
|
|
846
836
|
break;
|
|
847
|
-
const u =
|
|
848
|
-
u && delete e[u],
|
|
849
|
-
|
|
837
|
+
const u = z(e, "content-type");
|
|
838
|
+
u && delete e[u], s("const form = new FormData();"), r.params.forEach((p) => {
|
|
839
|
+
s(`form.append('${p.name}', '${p.value || p.fileName || ""}');`);
|
|
850
840
|
}), n();
|
|
851
841
|
break;
|
|
852
842
|
default:
|
|
853
843
|
r.text && (l.body = r.text);
|
|
854
844
|
}
|
|
855
|
-
return l.headers && !Object.keys(l.headers).length && delete l.headers,
|
|
845
|
+
return l.headers && !Object.keys(l.headers).length && delete l.headers, s(
|
|
856
846
|
`const options = ${W(l, {
|
|
857
847
|
indent: a.indent,
|
|
858
848
|
inlineCharacterLimit: 80,
|
|
@@ -869,7 +859,7 @@ var to = {
|
|
|
869
859
|
return f;
|
|
870
860
|
}
|
|
871
861
|
})};`
|
|
872
|
-
), n(), r.params && r.mimeType === "multipart/form-data" && (
|
|
862
|
+
), n(), r.params && r.mimeType === "multipart/form-data" && (s("options.body = form;"), n()), s(`fetch('${o}', options)`), s(".then(response => response.json())", 1), s(".then(response => console.log(response))", 1), s(".catch(err => console.error(err));", 1), i();
|
|
873
863
|
}
|
|
874
864
|
}, yo = {
|
|
875
865
|
info: {
|
|
@@ -879,12 +869,12 @@ var to = {
|
|
|
879
869
|
description: "Perform an asynchronous HTTP (Ajax) requests with jQuery",
|
|
880
870
|
extname: ".js"
|
|
881
871
|
},
|
|
882
|
-
convert: ({ fullUrl: t, method: e, allHeaders: r, postData: o },
|
|
872
|
+
convert: ({ fullUrl: t, method: e, allHeaders: r, postData: o }, c) => {
|
|
883
873
|
var p;
|
|
884
874
|
const a = {
|
|
885
875
|
indent: " ",
|
|
886
|
-
...
|
|
887
|
-
}, { blank: n, push: i, join:
|
|
876
|
+
...c
|
|
877
|
+
}, { blank: n, push: i, join: s } = new P({ indent: a.indent }), l = {
|
|
888
878
|
async: !0,
|
|
889
879
|
crossDomain: !0,
|
|
890
880
|
url: t,
|
|
@@ -903,8 +893,8 @@ var to = {
|
|
|
903
893
|
break;
|
|
904
894
|
if (i("const form = new FormData();"), o.params.forEach((f) => {
|
|
905
895
|
i(`form.append('${f.name}', '${f.value || f.fileName || ""}');`);
|
|
906
|
-
}), l.processData = !1, l.contentType = !1, l.mimeType = "multipart/form-data", l.data = "[form]", it(r, "content-type") && (p =
|
|
907
|
-
const f =
|
|
896
|
+
}), l.processData = !1, l.contentType = !1, l.mimeType = "multipart/form-data", l.data = "[form]", it(r, "content-type") && (p = ce(r, "content-type")) != null && p.includes("boundary")) {
|
|
897
|
+
const f = z(r, "content-type");
|
|
908
898
|
f && delete l.headers[f];
|
|
909
899
|
}
|
|
910
900
|
n();
|
|
@@ -913,7 +903,7 @@ var to = {
|
|
|
913
903
|
o.text && (l.data = o.text);
|
|
914
904
|
}
|
|
915
905
|
const u = W(l, { indent: a.indent }).replace("'[form]'", "form");
|
|
916
|
-
return i(`const settings = ${u};`), n(), i("$.ajax(settings).done(function (response) {"), i("console.log(response);", 1), i("});"),
|
|
906
|
+
return i(`const settings = ${u};`), n(), i("$.ajax(settings).done(function (response) {"), i("console.log(response);", 1), i("});"), s();
|
|
917
907
|
}
|
|
918
908
|
}, mo = {
|
|
919
909
|
info: {
|
|
@@ -923,13 +913,13 @@ var to = {
|
|
|
923
913
|
description: "W3C Standard API that provides scripted client functionality",
|
|
924
914
|
extname: ".js"
|
|
925
915
|
},
|
|
926
|
-
convert: ({ postData: t, allHeaders: e, method: r, fullUrl: o },
|
|
916
|
+
convert: ({ postData: t, allHeaders: e, method: r, fullUrl: o }, c) => {
|
|
927
917
|
var l;
|
|
928
918
|
const a = {
|
|
929
919
|
indent: " ",
|
|
930
920
|
cors: !0,
|
|
931
|
-
...
|
|
932
|
-
}, { blank: n, push: i, join:
|
|
921
|
+
...c
|
|
922
|
+
}, { blank: n, push: i, join: s } = new P({ indent: a.indent });
|
|
933
923
|
switch (t.mimeType) {
|
|
934
924
|
case "application/json":
|
|
935
925
|
i(
|
|
@@ -943,8 +933,8 @@ var to = {
|
|
|
943
933
|
break;
|
|
944
934
|
if (i("const data = new FormData();"), t.params.forEach((u) => {
|
|
945
935
|
i(`data.append('${u.name}', '${u.value || u.fileName || ""}');`);
|
|
946
|
-
}), it(e, "content-type") && (l =
|
|
947
|
-
const u =
|
|
936
|
+
}), it(e, "content-type") && (l = ce(e, "content-type")) != null && l.includes("boundary")) {
|
|
937
|
+
const u = z(e, "content-type");
|
|
948
938
|
u && delete e[u];
|
|
949
939
|
}
|
|
950
940
|
n();
|
|
@@ -954,7 +944,7 @@ var to = {
|
|
|
954
944
|
}
|
|
955
945
|
return i("const xhr = new XMLHttpRequest();"), a.cors && i("xhr.withCredentials = true;"), n(), i("xhr.addEventListener('readystatechange', function () {"), i("if (this.readyState === this.DONE) {", 1), i("console.log(this.responseText);", 2), i("}", 1), i("});"), n(), i(`xhr.open('${r}', '${o}');`), Object.keys(e).forEach((u) => {
|
|
956
946
|
i(`xhr.setRequestHeader('${u}', '${_e(e[u])}');`);
|
|
957
|
-
}), n(), i("xhr.send(data);"),
|
|
947
|
+
}), n(), i("xhr.send(data);"), s();
|
|
958
948
|
}
|
|
959
949
|
}, go = {
|
|
960
950
|
info: {
|
|
@@ -992,10 +982,10 @@ var to = {
|
|
|
992
982
|
case "multipart/form-data":
|
|
993
983
|
if (!t.params)
|
|
994
984
|
break;
|
|
995
|
-
const
|
|
985
|
+
const c = {};
|
|
996
986
|
t.params.forEach((a) => {
|
|
997
|
-
|
|
998
|
-
}), o =
|
|
987
|
+
c[a.name] = a.value;
|
|
988
|
+
}), o = c;
|
|
999
989
|
break;
|
|
1000
990
|
default:
|
|
1001
991
|
t.text && (o = t.text);
|
|
@@ -1019,14 +1009,14 @@ var to = {
|
|
|
1019
1009
|
description: "An HTTP Request Client Library",
|
|
1020
1010
|
extname: ".kt"
|
|
1021
1011
|
},
|
|
1022
|
-
convert: ({ postData: t, fullUrl: e, method: r, allHeaders: o },
|
|
1012
|
+
convert: ({ postData: t, fullUrl: e, method: r, allHeaders: o }, c) => {
|
|
1023
1013
|
const a = {
|
|
1024
1014
|
indent: " ",
|
|
1025
|
-
...
|
|
1026
|
-
}, { blank: n, join: i, push:
|
|
1027
|
-
return
|
|
1028
|
-
|
|
1029
|
-
}),
|
|
1015
|
+
...c
|
|
1016
|
+
}, { blank: n, join: i, push: s } = new P({ indent: a.indent }), l = ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD"], u = ["POST", "PUT", "DELETE", "PATCH"];
|
|
1017
|
+
return s("val client = OkHttpClient()"), n(), t.text && (t.boundary ? s(`val mediaType = MediaType.parse("${t.mimeType}; boundary=${t.boundary}")`) : s(`val mediaType = MediaType.parse("${t.mimeType}")`), s(`val body = RequestBody.create(mediaType, ${JSON.stringify(t.text)})`)), s("val request = Request.Builder()"), s(`.url("${e}")`, 1), l.includes(r.toUpperCase()) ? u.includes(r.toUpperCase()) ? t.text ? s(`.${r.toLowerCase()}(body)`, 1) : s(`.${r.toLowerCase()}(null)`, 1) : s(`.${r.toLowerCase()}()`, 1) : t.text ? s(`.method("${r.toUpperCase()}", body)`, 1) : s(`.method("${r.toUpperCase()}", null)`, 1), Object.keys(o).forEach((p) => {
|
|
1018
|
+
s(`.addHeader("${p}", "${H(o[p])}")`, 1);
|
|
1019
|
+
}), s(".build()", 1), n(), s("val response = client.newCall(request).execute()"), i();
|
|
1030
1020
|
}
|
|
1031
1021
|
}, xo = {
|
|
1032
1022
|
info: {
|
|
@@ -1046,20 +1036,20 @@ var to = {
|
|
|
1046
1036
|
extname: ".cjs",
|
|
1047
1037
|
installation: "npm install axios --save"
|
|
1048
1038
|
},
|
|
1049
|
-
convert: ({ method: t, fullUrl: e, allHeaders: r, postData: o },
|
|
1039
|
+
convert: ({ method: t, fullUrl: e, allHeaders: r, postData: o }, c) => {
|
|
1050
1040
|
const a = {
|
|
1051
1041
|
indent: " ",
|
|
1052
|
-
...
|
|
1053
|
-
}, { blank: n, join: i, push:
|
|
1054
|
-
|
|
1042
|
+
...c
|
|
1043
|
+
}, { blank: n, join: i, push: s, addPostProcessor: l } = new P({ indent: a.indent });
|
|
1044
|
+
s("const axios = require('axios');");
|
|
1055
1045
|
const u = {
|
|
1056
1046
|
method: t,
|
|
1057
1047
|
url: e
|
|
1058
1048
|
};
|
|
1059
1049
|
switch (Object.keys(r).length && (u.headers = r), o.mimeType) {
|
|
1060
1050
|
case "application/x-www-form-urlencoded":
|
|
1061
|
-
o.params && (
|
|
1062
|
-
|
|
1051
|
+
o.params && (s("const { URLSearchParams } = require('url');"), n(), s("const encodedParams = new URLSearchParams();"), o.params.forEach((f) => {
|
|
1052
|
+
s(`encodedParams.set('${f.name}', '${f.value}');`);
|
|
1063
1053
|
}), n(), u.data = "encodedParams,", l((f) => f.replace(/'encodedParams,'/, "encodedParams,")));
|
|
1064
1054
|
break;
|
|
1065
1055
|
case "application/json":
|
|
@@ -1069,7 +1059,7 @@ var to = {
|
|
|
1069
1059
|
n(), o.text && (u.data = o.text);
|
|
1070
1060
|
}
|
|
1071
1061
|
const p = W(u, { indent: " ", inlineCharacterLimit: 80 });
|
|
1072
|
-
return
|
|
1062
|
+
return s(`const options = ${p};`), n(), s("axios"), s(".request(options)", 1), s(".then(function (response) {", 1), s("console.log(response.data);", 2), s("})", 1), s(".catch(function (error) {", 1), s("console.error(error);", 2), s("});", 1), i();
|
|
1073
1063
|
}
|
|
1074
1064
|
}, So = {
|
|
1075
1065
|
info: {
|
|
@@ -1080,21 +1070,21 @@ var to = {
|
|
|
1080
1070
|
extname: ".cjs",
|
|
1081
1071
|
installation: "npm install node-fetch@2 --save"
|
|
1082
1072
|
},
|
|
1083
|
-
convert: ({ method: t, fullUrl: e, postData: r, headersObj: o, cookies:
|
|
1073
|
+
convert: ({ method: t, fullUrl: e, postData: r, headersObj: o, cookies: c }, a) => {
|
|
1084
1074
|
var m;
|
|
1085
1075
|
const n = {
|
|
1086
1076
|
indent: " ",
|
|
1087
1077
|
...a
|
|
1088
1078
|
};
|
|
1089
1079
|
let i = !1;
|
|
1090
|
-
const { blank:
|
|
1080
|
+
const { blank: s, push: l, join: u, unshift: p } = new P({ indent: n.indent });
|
|
1091
1081
|
l("const fetch = require('node-fetch');");
|
|
1092
1082
|
const f = e, d = {
|
|
1093
1083
|
method: t
|
|
1094
1084
|
};
|
|
1095
1085
|
switch (Object.keys(o).length && (d.headers = o), r.mimeType) {
|
|
1096
1086
|
case "application/x-www-form-urlencoded":
|
|
1097
|
-
p("const { URLSearchParams } = require('url');"), l("const encodedParams = new URLSearchParams();"),
|
|
1087
|
+
p("const { URLSearchParams } = require('url');"), l("const encodedParams = new URLSearchParams();"), s(), (m = r.params) == null || m.forEach((v) => {
|
|
1098
1088
|
l(`encodedParams.set('${v.name}', '${v.value}');`);
|
|
1099
1089
|
}), d.body = "encodedParams";
|
|
1100
1090
|
break;
|
|
@@ -1104,8 +1094,8 @@ var to = {
|
|
|
1104
1094
|
case "multipart/form-data":
|
|
1105
1095
|
if (!r.params)
|
|
1106
1096
|
break;
|
|
1107
|
-
const b =
|
|
1108
|
-
b && delete o[b], p("const FormData = require('form-data');"), l("const formData = new FormData();"),
|
|
1097
|
+
const b = z(o, "content-type");
|
|
1098
|
+
b && delete o[b], p("const FormData = require('form-data');"), l("const formData = new FormData();"), s(), r.params.forEach((v) => {
|
|
1109
1099
|
if (!v.fileName && !v.fileName && !v.contentType) {
|
|
1110
1100
|
l(`formData.append('${v.name}', '${v.value}');`);
|
|
1111
1101
|
return;
|
|
@@ -1116,11 +1106,11 @@ var to = {
|
|
|
1116
1106
|
default:
|
|
1117
1107
|
r.text && (d.body = r.text);
|
|
1118
1108
|
}
|
|
1119
|
-
if (
|
|
1120
|
-
const b =
|
|
1109
|
+
if (c.length) {
|
|
1110
|
+
const b = c.map(({ name: v, value: y }) => `${encodeURIComponent(v)}=${encodeURIComponent(y)}`).join("; ");
|
|
1121
1111
|
d.headers || (d.headers = {}), d.headers.cookie = b;
|
|
1122
1112
|
}
|
|
1123
|
-
|
|
1113
|
+
s(), l(`const url = '${f}';`), d.headers && !Object.keys(d.headers).length && delete d.headers;
|
|
1124
1114
|
const h = W(d, {
|
|
1125
1115
|
indent: " ",
|
|
1126
1116
|
inlineCharacterLimit: 80,
|
|
@@ -1129,7 +1119,7 @@ var to = {
|
|
|
1129
1119
|
// in a `JSON.stringify` call.
|
|
1130
1120
|
transform: (b, v, y) => v === "body" && r.mimeType === "application/json" ? `JSON.stringify(${y})` : y
|
|
1131
1121
|
});
|
|
1132
|
-
return l(`const options = ${h};`),
|
|
1122
|
+
return l(`const options = ${h};`), s(), i && p("const fs = require('fs');"), r.params && r.mimeType === "multipart/form-data" && (l("options.body = formData;"), s()), 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), u().replace(/'encodedParams'/, "encodedParams").replace(/"fs\.createReadStream\(\\"(.+)\\"\)"/, 'fs.createReadStream("$1")');
|
|
1133
1123
|
}
|
|
1134
1124
|
}, jo = {
|
|
1135
1125
|
info: {
|
|
@@ -1139,18 +1129,18 @@ var to = {
|
|
|
1139
1129
|
description: "Node.js native HTTP interface",
|
|
1140
1130
|
extname: ".cjs"
|
|
1141
1131
|
},
|
|
1142
|
-
convert: ({ uriObj: t, method: e, allHeaders: r, postData: o },
|
|
1132
|
+
convert: ({ uriObj: t, method: e, allHeaders: r, postData: o }, c = {}) => {
|
|
1143
1133
|
var p;
|
|
1144
|
-
const { indent: a = " " } =
|
|
1134
|
+
const { indent: a = " " } = c, { blank: n, join: i, push: s, unshift: l } = new P({ indent: a }), u = {
|
|
1145
1135
|
method: e,
|
|
1146
1136
|
hostname: t.hostname,
|
|
1147
1137
|
port: t.port,
|
|
1148
1138
|
path: t.path,
|
|
1149
1139
|
headers: r
|
|
1150
1140
|
};
|
|
1151
|
-
switch (
|
|
1141
|
+
switch (s(`const http = require('${(p = t.protocol) == null ? void 0 : p.replace(":", "")}');`), n(), s(`const options = ${W(u, { indent: a })};`), n(), s("const req = http.request(options, function (res) {"), s("const chunks = [];", 1), n(), s("res.on('data', function (chunk) {", 1), s("chunks.push(chunk);", 2), s("});", 1), n(), s("res.on('end', function () {", 1), s("const body = Buffer.concat(chunks);", 2), s("console.log(body.toString());", 2), s("});", 1), s("});"), n(), o.mimeType) {
|
|
1152
1142
|
case "application/x-www-form-urlencoded":
|
|
1153
|
-
o.paramsObj && (l("const qs = require('querystring');"),
|
|
1143
|
+
o.paramsObj && (l("const qs = require('querystring');"), s(
|
|
1154
1144
|
`req.write(qs.stringify(${W(o.paramsObj, {
|
|
1155
1145
|
indent: " ",
|
|
1156
1146
|
inlineCharacterLimit: 80
|
|
@@ -1158,7 +1148,7 @@ var to = {
|
|
|
1158
1148
|
));
|
|
1159
1149
|
break;
|
|
1160
1150
|
case "application/json":
|
|
1161
|
-
o.jsonObj &&
|
|
1151
|
+
o.jsonObj && s(
|
|
1162
1152
|
`req.write(JSON.stringify(${W(o.jsonObj, {
|
|
1163
1153
|
indent: " ",
|
|
1164
1154
|
inlineCharacterLimit: 80
|
|
@@ -1166,9 +1156,9 @@ var to = {
|
|
|
1166
1156
|
);
|
|
1167
1157
|
break;
|
|
1168
1158
|
default:
|
|
1169
|
-
o.text &&
|
|
1159
|
+
o.text && s(`req.write(${W(o.text, { indent: a })});`);
|
|
1170
1160
|
}
|
|
1171
|
-
return
|
|
1161
|
+
return s("req.end();"), i();
|
|
1172
1162
|
}
|
|
1173
1163
|
}, Oo = {
|
|
1174
1164
|
info: {
|
|
@@ -1179,19 +1169,19 @@ var to = {
|
|
|
1179
1169
|
extname: ".cjs",
|
|
1180
1170
|
installation: "npm install request --save"
|
|
1181
1171
|
},
|
|
1182
|
-
convert: ({ method: t, url: e, fullUrl: r, postData: o, headersObj:
|
|
1172
|
+
convert: ({ method: t, url: e, fullUrl: r, postData: o, headersObj: c, cookies: a }, n) => {
|
|
1183
1173
|
const i = {
|
|
1184
1174
|
indent: " ",
|
|
1185
1175
|
...n
|
|
1186
1176
|
};
|
|
1187
|
-
let
|
|
1177
|
+
let s = !1;
|
|
1188
1178
|
const { push: l, blank: u, join: p, unshift: f, addPostProcessor: d } = new P({ indent: i.indent });
|
|
1189
1179
|
l("const request = require('request');"), u();
|
|
1190
1180
|
const h = {
|
|
1191
1181
|
method: t,
|
|
1192
1182
|
url: r
|
|
1193
1183
|
};
|
|
1194
|
-
switch (Object.keys(
|
|
1184
|
+
switch (Object.keys(c).length && (h.headers = c), o.mimeType) {
|
|
1195
1185
|
case "application/x-www-form-urlencoded":
|
|
1196
1186
|
h.form = o.paramsObj;
|
|
1197
1187
|
break;
|
|
@@ -1207,7 +1197,7 @@ var to = {
|
|
|
1207
1197
|
return;
|
|
1208
1198
|
}
|
|
1209
1199
|
let b = {};
|
|
1210
|
-
m.fileName ? (
|
|
1200
|
+
m.fileName ? (s = !0, b = {
|
|
1211
1201
|
value: `fs.createReadStream(${m.fileName})`,
|
|
1212
1202
|
options: {
|
|
1213
1203
|
filename: m.fileName,
|
|
@@ -1221,7 +1211,7 @@ var to = {
|
|
|
1221
1211
|
}
|
|
1222
1212
|
return a.length && (h.jar = "JAR", l("const jar = request.jar();"), a.forEach(({ name: m, value: b }) => {
|
|
1223
1213
|
l(`jar.setCookie(request.cookie('${encodeURIComponent(m)}=${encodeURIComponent(b)}'), '${e}');`);
|
|
1224
|
-
}), u(), d((m) => m.replace(/'JAR'/, "jar"))),
|
|
1214
|
+
}), u(), d((m) => m.replace(/'JAR'/, "jar"))), s && f("const fs = require('fs');"), l(`const options = ${W(h, { indent: " ", inlineCharacterLimit: 80 })};`), u(), l("request(options, function (error, response, body) {"), l("if (error) throw new Error(error);", 1), u(), l("console.log(body);", 1), l("});"), p();
|
|
1225
1215
|
}
|
|
1226
1216
|
}, To = {
|
|
1227
1217
|
info: {
|
|
@@ -1231,38 +1221,38 @@ var to = {
|
|
|
1231
1221
|
description: "Lightweight HTTP Request Client Library",
|
|
1232
1222
|
extname: ".cjs"
|
|
1233
1223
|
},
|
|
1234
|
-
convert: ({ method: t, url: e, cookies: r, queryObj: o, postData:
|
|
1224
|
+
convert: ({ method: t, url: e, cookies: r, queryObj: o, postData: c, headersObj: a }, n) => {
|
|
1235
1225
|
const i = {
|
|
1236
1226
|
indent: " ",
|
|
1237
1227
|
...n
|
|
1238
1228
|
};
|
|
1239
|
-
let
|
|
1229
|
+
let s = !1;
|
|
1240
1230
|
const { addPostProcessor: l, blank: u, join: p, push: f, unshift: d } = new P({
|
|
1241
1231
|
indent: i.indent
|
|
1242
1232
|
});
|
|
1243
1233
|
switch (f("const unirest = require('unirest');"), u(), f(`const req = unirest('${t}', '${e}');`), u(), r.length && (f("const CookieJar = unirest.jar();"), r.forEach((h) => {
|
|
1244
1234
|
f(`CookieJar.add('${encodeURIComponent(h.name)}=${encodeURIComponent(h.value)}', '${e}');`);
|
|
1245
|
-
}), f("req.jar(CookieJar);"), u()), Object.keys(o).length && (f(`req.query(${W(o, { indent: i.indent })});`), u()), Object.keys(a).length && (f(`req.headers(${W(a, { indent: i.indent })});`), u()),
|
|
1235
|
+
}), f("req.jar(CookieJar);"), u()), Object.keys(o).length && (f(`req.query(${W(o, { indent: i.indent })});`), u()), Object.keys(a).length && (f(`req.headers(${W(a, { indent: i.indent })});`), u()), c.mimeType) {
|
|
1246
1236
|
case "application/x-www-form-urlencoded":
|
|
1247
|
-
|
|
1237
|
+
c.paramsObj && (f(`req.form(${W(c.paramsObj, { indent: i.indent })});`), u());
|
|
1248
1238
|
break;
|
|
1249
1239
|
case "application/json":
|
|
1250
|
-
|
|
1240
|
+
c.jsonObj && (f("req.type('json');"), f(`req.send(${W(c.jsonObj, { indent: i.indent })});`), u());
|
|
1251
1241
|
break;
|
|
1252
1242
|
case "multipart/form-data": {
|
|
1253
|
-
if (!
|
|
1243
|
+
if (!c.params)
|
|
1254
1244
|
break;
|
|
1255
1245
|
const h = [];
|
|
1256
|
-
|
|
1246
|
+
c.params.forEach((m) => {
|
|
1257
1247
|
const b = {};
|
|
1258
|
-
m.fileName && !m.value ? (
|
|
1248
|
+
m.fileName && !m.value ? (s = !0, b.body = `fs.createReadStream('${m.fileName}')`, l((v) => v.replace(/'fs\.createReadStream\(\\'(.+)\\'\)'/, "fs.createReadStream('$1')"))) : m.value && (b.body = m.value), b.body && (m.contentType && (b["content-type"] = m.contentType), h.push(b));
|
|
1259
1249
|
}), f(`req.multipart(${W(h, { indent: i.indent })});`), u();
|
|
1260
1250
|
break;
|
|
1261
1251
|
}
|
|
1262
1252
|
default:
|
|
1263
|
-
|
|
1253
|
+
c.text && (f(`req.send(${W(c.text, { indent: i.indent })});`), u());
|
|
1264
1254
|
}
|
|
1265
|
-
return
|
|
1255
|
+
return s && d("const fs = require('fs');"), f("req.end(function (res) {"), f("if (res.error) throw new Error(res.error);", 1), u(), f("console.log(res.body);", 1), f("});"), p();
|
|
1266
1256
|
}
|
|
1267
1257
|
}, Po = {
|
|
1268
1258
|
info: {
|
|
@@ -1279,8 +1269,8 @@ var to = {
|
|
|
1279
1269
|
fetch: So
|
|
1280
1270
|
}
|
|
1281
1271
|
}, lt = (t, e, r, o) => {
|
|
1282
|
-
const
|
|
1283
|
-
return `${
|
|
1272
|
+
const c = `${t} *${e} = `, a = St(r, o ? c.length : void 0);
|
|
1273
|
+
return `${c}${a};`;
|
|
1284
1274
|
}, St = (t, e) => {
|
|
1285
1275
|
const r = e === void 0 ? ", " : `,
|
|
1286
1276
|
${" ".repeat(e)}`;
|
|
@@ -1288,11 +1278,11 @@ var to = {
|
|
|
1288
1278
|
case "[object Number]":
|
|
1289
1279
|
return `@${t}`;
|
|
1290
1280
|
case "[object Array]":
|
|
1291
|
-
return `@[ ${t.map((
|
|
1281
|
+
return `@[ ${t.map((c) => St(c)).join(r)} ]`;
|
|
1292
1282
|
case "[object Object]": {
|
|
1293
1283
|
const o = [];
|
|
1294
|
-
return Object.keys(t).forEach((
|
|
1295
|
-
o.push(`@"${
|
|
1284
|
+
return Object.keys(t).forEach((c) => {
|
|
1285
|
+
o.push(`@"${c}": ${St(t[c])}`);
|
|
1296
1286
|
}), `@{ ${o.join(r)} }`;
|
|
1297
1287
|
}
|
|
1298
1288
|
case "[object Boolean]":
|
|
@@ -1308,22 +1298,22 @@ var to = {
|
|
|
1308
1298
|
description: "Foundation's NSURLSession request",
|
|
1309
1299
|
extname: ".m"
|
|
1310
1300
|
},
|
|
1311
|
-
convert: ({ allHeaders: t, postData: e, method: r, fullUrl: o },
|
|
1301
|
+
convert: ({ allHeaders: t, postData: e, method: r, fullUrl: o }, c) => {
|
|
1312
1302
|
var u;
|
|
1313
1303
|
const a = {
|
|
1314
1304
|
indent: " ",
|
|
1315
1305
|
pretty: !0,
|
|
1316
1306
|
timeout: 10,
|
|
1317
|
-
...
|
|
1318
|
-
}, { push: n, join: i, blank:
|
|
1307
|
+
...c
|
|
1308
|
+
}, { push: n, join: i, blank: s } = new P({ indent: a.indent }), l = {
|
|
1319
1309
|
hasHeaders: !1,
|
|
1320
1310
|
hasBody: !1
|
|
1321
1311
|
};
|
|
1322
|
-
if (n("#import <Foundation/Foundation.h>"), Object.keys(t).length && (l.hasHeaders = !0,
|
|
1312
|
+
if (n("#import <Foundation/Foundation.h>"), Object.keys(t).length && (l.hasHeaders = !0, s(), n(lt("NSDictionary", "headers", t, a.pretty))), e.text || e.jsonObj || e.params)
|
|
1323
1313
|
switch (l.hasBody = !0, e.mimeType) {
|
|
1324
1314
|
case "application/x-www-form-urlencoded":
|
|
1325
1315
|
if ((u = e.params) != null && u.length) {
|
|
1326
|
-
|
|
1316
|
+
s();
|
|
1327
1317
|
const [p, ...f] = e.params;
|
|
1328
1318
|
n(
|
|
1329
1319
|
`NSMutableData *postData = [[NSMutableData alloc] initWithData:[@"${p.name}=${p.value}" dataUsingEncoding:NSUTF8StringEncoding]];`
|
|
@@ -1334,10 +1324,10 @@ var to = {
|
|
|
1334
1324
|
l.hasBody = !1;
|
|
1335
1325
|
break;
|
|
1336
1326
|
case "application/json":
|
|
1337
|
-
e.jsonObj && (n(lt("NSDictionary", "parameters", e.jsonObj, a.pretty)),
|
|
1327
|
+
e.jsonObj && (n(lt("NSDictionary", "parameters", e.jsonObj, a.pretty)), s(), n("NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];"));
|
|
1338
1328
|
break;
|
|
1339
1329
|
case "multipart/form-data":
|
|
1340
|
-
n(lt("NSArray", "parameters", e.params || [], a.pretty)), n(`NSString *boundary = @"${e.boundary}";`),
|
|
1330
|
+
n(lt("NSArray", "parameters", e.params || [], a.pretty)), n(`NSString *boundary = @"${e.boundary}";`), s(), n("NSError *error;"), n("NSMutableString *body = [NSMutableString string];"), n("for (NSDictionary *param in parameters) {"), n('[body appendFormat:@"--%@\\r\\n", boundary];', 1), n('if (param[@"fileName"]) {', 1), n(
|
|
1341
1331
|
'[body appendFormat:@"Content-Disposition:form-data; name=\\"%@\\"; filename=\\"%@\\"\\r\\n", param[@"name"], param[@"fileName"]];',
|
|
1342
1332
|
2
|
|
1343
1333
|
), n('[body appendFormat:@"Content-Type: %@\\r\\n\\r\\n", param[@"contentType"]];', 2), n(
|
|
@@ -1346,11 +1336,11 @@ var to = {
|
|
|
1346
1336
|
), n("if (error) {", 2), n('NSLog(@"%@", error);', 3), n("}", 2), n("} else {", 1), n('[body appendFormat:@"Content-Disposition:form-data; name=\\"%@\\"\\r\\n\\r\\n", param[@"name"]];', 2), n('[body appendFormat:@"%@", param[@"value"]];', 2), n("}", 1), n("}"), n('[body appendFormat:@"\\r\\n--%@--\\r\\n", boundary];'), n("NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];");
|
|
1347
1337
|
break;
|
|
1348
1338
|
default:
|
|
1349
|
-
|
|
1339
|
+
s(), n(
|
|
1350
1340
|
`NSData *postData = [[NSData alloc] initWithData:[@"${e.text}" dataUsingEncoding:NSUTF8StringEncoding]];`
|
|
1351
1341
|
);
|
|
1352
1342
|
}
|
|
1353
|
-
return
|
|
1343
|
+
return s(), n(`NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"${o}"]`), n(" cachePolicy:NSURLRequestUseProtocolCachePolicy"), n(` timeoutInterval:${a.timeout.toFixed(1)}];`), n(`[request setHTTPMethod:@"${r}"];`), l.hasHeaders && n("[request setAllHTTPHeaderFields:headers];"), l.hasBody && n("[request setHTTPBody:postData];"), s(), n("NSURLSession *session = [NSURLSession sharedSession];"), n("NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request"), n(
|
|
1354
1344
|
" completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {"
|
|
1355
1345
|
), n(" if (error) {", 1), n(' NSLog(@"%@", error);', 2), n(" } else {", 1), n(
|
|
1356
1346
|
" NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;",
|
|
@@ -1375,12 +1365,12 @@ var to = {
|
|
|
1375
1365
|
extname: ".ml",
|
|
1376
1366
|
installation: "opam install cohttp-lwt-unix cohttp-async"
|
|
1377
1367
|
},
|
|
1378
|
-
convert: ({ fullUrl: t, allHeaders: e, postData: r, method: o },
|
|
1368
|
+
convert: ({ fullUrl: t, allHeaders: e, postData: r, method: o }, c) => {
|
|
1379
1369
|
const a = {
|
|
1380
1370
|
indent: " ",
|
|
1381
|
-
...
|
|
1382
|
-
}, n = ["get", "post", "head", "delete", "patch", "put", "options"], { push: i, blank:
|
|
1383
|
-
i("open Cohttp_lwt_unix"), i("open Cohttp"), i("open Lwt"),
|
|
1371
|
+
...c
|
|
1372
|
+
}, n = ["get", "post", "head", "delete", "patch", "put", "options"], { push: i, blank: s, join: l } = new P({ indent: a.indent });
|
|
1373
|
+
i("open Cohttp_lwt_unix"), i("open Cohttp"), i("open Lwt"), s(), i(`let uri = Uri.of_string "${t}" in`);
|
|
1384
1374
|
const u = Object.keys(e);
|
|
1385
1375
|
u.length === 1 ? i(
|
|
1386
1376
|
`let headers = Header.add (Header.init ()) "${u[0]}" "${H(
|
|
@@ -1388,7 +1378,7 @@ var to = {
|
|
|
1388
1378
|
)}" in`
|
|
1389
1379
|
) : u.length > 1 && (i("let headers = Header.add_list (Header.init ()) ["), u.forEach((h) => {
|
|
1390
1380
|
i(`("${h}", "${H(e[h])}");`, 1);
|
|
1391
|
-
}), i("] in")), r.text && i(`let body = Cohttp_lwt_body.of_string ${JSON.stringify(r.text)} in`),
|
|
1381
|
+
}), i("] in")), r.text && i(`let body = Cohttp_lwt_body.of_string ${JSON.stringify(r.text)} in`), s();
|
|
1392
1382
|
const p = u.length ? "~headers " : "", f = r.text ? "~body " : "", d = n.includes(o.toLowerCase()) ? `\`${o.toUpperCase()}` : `(Code.method_of_string "${o}")`;
|
|
1393
1383
|
return i(`Client.call ${p}${f}${d} uri`), i(">>= fun (res, body_stream) ->"), i("(* Do stuff with the result *)", 1), l();
|
|
1394
1384
|
}
|
|
@@ -1410,11 +1400,11 @@ var to = {
|
|
|
1410
1400
|
case "[object Undefined]":
|
|
1411
1401
|
return "null";
|
|
1412
1402
|
case "[object String]":
|
|
1413
|
-
return `'${
|
|
1403
|
+
return `'${Ue(t, { delimiter: "'", escapeNewlines: !1 })}'`;
|
|
1414
1404
|
case "[object Number]":
|
|
1415
1405
|
return t.toString();
|
|
1416
1406
|
case "[object Array]": {
|
|
1417
|
-
const o = t.map((
|
|
1407
|
+
const o = t.map((c) => C(c, `${e}${e}`, e)).join(`,
|
|
1418
1408
|
${e}`);
|
|
1419
1409
|
return `[
|
|
1420
1410
|
${e}${o}
|
|
@@ -1422,8 +1412,8 @@ ${r}]`;
|
|
|
1422
1412
|
}
|
|
1423
1413
|
case "[object Object]": {
|
|
1424
1414
|
const o = [];
|
|
1425
|
-
for (const
|
|
1426
|
-
Object.prototype.hasOwnProperty.call(t,
|
|
1415
|
+
for (const c in t)
|
|
1416
|
+
Object.prototype.hasOwnProperty.call(t, c) && o.push(`${C(c, e)} => ${C(t[c], `${e}${e}`, e)}`);
|
|
1427
1417
|
return `[
|
|
1428
1418
|
${e}${o.join(`,
|
|
1429
1419
|
${e}`)}
|
|
@@ -1468,9 +1458,9 @@ ${r}]`;
|
|
|
1468
1458
|
description: "PHP with ext-curl",
|
|
1469
1459
|
extname: ".php"
|
|
1470
1460
|
},
|
|
1471
|
-
convert: ({ uriObj: t, postData: e, fullUrl: r, method: o, httpVersion:
|
|
1461
|
+
convert: ({ uriObj: t, postData: e, fullUrl: r, method: o, httpVersion: c, cookies: a, headersObj: n }, i = {}) => {
|
|
1472
1462
|
const {
|
|
1473
|
-
closingTag:
|
|
1463
|
+
closingTag: s = !1,
|
|
1474
1464
|
indent: l = " ",
|
|
1475
1465
|
maxRedirects: u = 10,
|
|
1476
1466
|
namedErrors: p = !1,
|
|
@@ -1513,7 +1503,7 @@ ${r}]`;
|
|
|
1513
1503
|
{
|
|
1514
1504
|
escape: !1,
|
|
1515
1505
|
name: "CURLOPT_HTTP_VERSION",
|
|
1516
|
-
value:
|
|
1506
|
+
value: c === "HTTP/1.0" ? "CURL_HTTP_VERSION_1_0" : "CURL_HTTP_VERSION_1_1"
|
|
1517
1507
|
},
|
|
1518
1508
|
{
|
|
1519
1509
|
escape: !0,
|
|
@@ -1536,7 +1526,7 @@ ${l}` });
|
|
|
1536
1526
|
S.length && $.push(`CURLOPT_COOKIE => "${S.join("; ")}",`);
|
|
1537
1527
|
const w = Object.keys(n).sort().map((j) => `"${j}: ${H(n[j])}"`);
|
|
1538
1528
|
return w.length && ($.push("CURLOPT_HTTPHEADER => ["), $.push(w.join(`,
|
|
1539
|
-
${l}${l}`), 1), $.push("],")), m($.join(), 1), m("]);"), b(), m("$response = curl_exec($curl);"), m("$err = curl_error($curl);"), b(), m("curl_close($curl);"), b(), m("if ($err) {"), m(p ? 'echo array_flip(get_defined_constants(true)["curl"])[$err];' : 'echo "cURL Error #:" . $err;', 1), m("} else {"), m("echo $response;", 1), m("}"), !f &&
|
|
1529
|
+
${l}${l}`), 1), $.push("],")), m($.join(), 1), m("]);"), b(), m("$response = curl_exec($curl);"), m("$err = curl_error($curl);"), b(), m("curl_close($curl);"), b(), m("if ($err) {"), m(p ? 'echo array_flip(get_defined_constants(true)["curl"])[$err];' : 'echo "cURL Error #:" . $err;', 1), m("} else {"), m("echo $response;", 1), m("}"), !f && s && (b(), m("?>")), v();
|
|
1540
1530
|
}
|
|
1541
1531
|
}, Ao = {
|
|
1542
1532
|
info: {
|
|
@@ -1547,7 +1537,7 @@ ${l}${l}`), 1), $.push("],")), m($.join(), 1), m("]);"), b(), m("$response = cur
|
|
|
1547
1537
|
extname: ".php",
|
|
1548
1538
|
installation: "composer require guzzlehttp/guzzle"
|
|
1549
1539
|
},
|
|
1550
|
-
convert: ({ postData: t, fullUrl: e, method: r, cookies: o, headersObj:
|
|
1540
|
+
convert: ({ postData: t, fullUrl: e, method: r, cookies: o, headersObj: c }, a) => {
|
|
1551
1541
|
var m;
|
|
1552
1542
|
const n = {
|
|
1553
1543
|
closingTag: !1,
|
|
@@ -1555,8 +1545,8 @@ ${l}${l}`), 1), $.push("],")), m($.join(), 1), m("]);"), b(), m("$response = cur
|
|
|
1555
1545
|
noTags: !1,
|
|
1556
1546
|
shortTags: !1,
|
|
1557
1547
|
...a
|
|
1558
|
-
}, { push: i, blank:
|
|
1559
|
-
switch (n.noTags || i(n.shortTags ? "<?" : "<?php"), i("require_once('vendor/autoload.php');"),
|
|
1548
|
+
}, { push: i, blank: s, join: l } = new P({ indent: n.indent }), { code: u, push: p, join: f } = new P({ indent: n.indent });
|
|
1549
|
+
switch (n.noTags || i(n.shortTags ? "<?" : "<?php"), i("require_once('vendor/autoload.php');"), s(), t.mimeType) {
|
|
1560
1550
|
case "application/x-www-form-urlencoded":
|
|
1561
1551
|
p(`'form_params' => ${C(t.paramsObj, n.indent + n.indent, n.indent)},`, 1);
|
|
1562
1552
|
break;
|
|
@@ -1574,20 +1564,20 @@ ${l}${l}`), 1), $.push("],")), m($.join(), 1), m("]);"), b(), m("$response = cur
|
|
|
1574
1564
|
name: v.name,
|
|
1575
1565
|
contents: v.value
|
|
1576
1566
|
});
|
|
1577
|
-
}), b.length && (p(`'multipart' => ${C(b, n.indent + n.indent, n.indent)}`, 1), it(
|
|
1578
|
-
const v =
|
|
1579
|
-
v && delete
|
|
1567
|
+
}), b.length && (p(`'multipart' => ${C(b, n.indent + n.indent, n.indent)}`, 1), it(c, "content-type") && (m = ce(c, "content-type")) != null && m.indexOf("boundary"))) {
|
|
1568
|
+
const v = z(c, "content-type");
|
|
1569
|
+
v && delete c[v];
|
|
1580
1570
|
}
|
|
1581
1571
|
break;
|
|
1582
1572
|
}
|
|
1583
1573
|
default:
|
|
1584
1574
|
t.text && p(`'body' => ${C(t.text)},`, 1);
|
|
1585
1575
|
}
|
|
1586
|
-
const d = Object.keys(
|
|
1587
|
-
return `${n.indent}${n.indent}'${b}' => '${_e(
|
|
1576
|
+
const d = Object.keys(c).sort().map(function(b) {
|
|
1577
|
+
return `${n.indent}${n.indent}'${b}' => '${_e(c[b])}',`;
|
|
1588
1578
|
}), h = o.map((b) => `${encodeURIComponent(b.name)}=${encodeURIComponent(b.value)}`).join("; ");
|
|
1589
1579
|
return h.length && d.push(`${n.indent}${n.indent}'cookie' => '${_e(h)}',`), d.length && (p("'headers' => [", 1), p(d.join(`
|
|
1590
|
-
`)), p("],", 1)), i("$client = new \\GuzzleHttp\\Client();"),
|
|
1580
|
+
`)), p("],", 1)), i("$client = new \\GuzzleHttp\\Client();"), s(), u.length ? (i(`$response = $client->request('${r}', '${e}', [`), i(f()), i("]);")) : i(`$response = $client->request('${r}', '${e}');`), s(), i("echo $response->getBody();"), !n.noTags && n.closingTag && (s(), i("?>")), l();
|
|
1591
1581
|
}
|
|
1592
1582
|
}, qo = {
|
|
1593
1583
|
info: {
|
|
@@ -1597,14 +1587,14 @@ ${l}${l}`), 1), $.push("],")), m($.join(), 1), m("]);"), b(), m("$response = cur
|
|
|
1597
1587
|
description: "PHP with pecl/http v1",
|
|
1598
1588
|
extname: ".php"
|
|
1599
1589
|
},
|
|
1600
|
-
convert: ({ method: t, url: e, postData: r, queryObj: o, headersObj:
|
|
1601
|
-
const { closingTag: i = !1, indent:
|
|
1602
|
-
switch (l || (p(u ? "<?" : "<?php"), f()), nr.includes(t.toUpperCase()) || p(`HttpRequest::methodRegister('${t}');`), p("$request = new HttpRequest();"), p(`$request->setUrl(${C(e)});`), nr.includes(t.toUpperCase()) ? p(`$request->setMethod(HTTP_METH_${t.toUpperCase()});`) : p(`$request->setMethod(HttpRequest::HTTP_METH_${t.toUpperCase()});`), f(), Object.keys(o).length && (p(`$request->setQueryData(${C(o,
|
|
1590
|
+
convert: ({ method: t, url: e, postData: r, queryObj: o, headersObj: c, cookiesObj: a }, n = {}) => {
|
|
1591
|
+
const { closingTag: i = !1, indent: s = " ", noTags: l = !1, shortTags: u = !1 } = n, { push: p, blank: f, join: d } = new P({ indent: s });
|
|
1592
|
+
switch (l || (p(u ? "<?" : "<?php"), f()), nr.includes(t.toUpperCase()) || p(`HttpRequest::methodRegister('${t}');`), p("$request = new HttpRequest();"), p(`$request->setUrl(${C(e)});`), nr.includes(t.toUpperCase()) ? p(`$request->setMethod(HTTP_METH_${t.toUpperCase()});`) : p(`$request->setMethod(HttpRequest::HTTP_METH_${t.toUpperCase()});`), f(), Object.keys(o).length && (p(`$request->setQueryData(${C(o, s)});`), f()), Object.keys(c).length && (p(`$request->setHeaders(${C(c, s)});`), f()), Object.keys(a).length && (p(`$request->setCookies(${C(a, s)});`), f()), r.mimeType) {
|
|
1603
1593
|
case "application/x-www-form-urlencoded":
|
|
1604
|
-
p(`$request->setContentType(${C(r.mimeType)});`), p(`$request->setPostFields(${C(r.paramsObj,
|
|
1594
|
+
p(`$request->setContentType(${C(r.mimeType)});`), p(`$request->setPostFields(${C(r.paramsObj, s)});`), f();
|
|
1605
1595
|
break;
|
|
1606
1596
|
case "application/json":
|
|
1607
|
-
p(`$request->setContentType(${C(r.mimeType)});`), p(`$request->setBody(json_encode(${C(r.jsonObj,
|
|
1597
|
+
p(`$request->setContentType(${C(r.mimeType)});`), p(`$request->setBody(json_encode(${C(r.jsonObj, s)}));`), f();
|
|
1608
1598
|
break;
|
|
1609
1599
|
default:
|
|
1610
1600
|
r.text && (p(`$request->setBody(${C(r.text)});`), f());
|
|
@@ -1619,13 +1609,13 @@ ${l}${l}`), 1), $.push("],")), m($.join(), 1), m("]);"), b(), m("$response = cur
|
|
|
1619
1609
|
description: "PHP with pecl/http v2",
|
|
1620
1610
|
extname: ".php"
|
|
1621
1611
|
},
|
|
1622
|
-
convert: ({ postData: t, headersObj: e, method: r, queryObj: o, cookiesObj:
|
|
1612
|
+
convert: ({ postData: t, headersObj: e, method: r, queryObj: o, cookiesObj: c, url: a }, n = {}) => {
|
|
1623
1613
|
var m;
|
|
1624
|
-
const { closingTag: i = !1, indent:
|
|
1614
|
+
const { closingTag: i = !1, indent: s = " ", noTags: l = !1, shortTags: u = !1 } = n, { push: p, blank: f, join: d } = new P({ indent: s });
|
|
1625
1615
|
let h = !1;
|
|
1626
1616
|
switch (l || (p(u ? "<?" : "<?php"), f()), p("$client = new http\\Client;"), p("$request = new http\\Client\\Request;"), f(), t.mimeType) {
|
|
1627
1617
|
case "application/x-www-form-urlencoded":
|
|
1628
|
-
p("$body = new http\\Message\\Body;"), p(`$body->append(new http\\QueryString(${C(t.paramsObj,
|
|
1618
|
+
p("$body = new http\\Message\\Body;"), p(`$body->append(new http\\QueryString(${C(t.paramsObj, s)}));`), f(), h = !0;
|
|
1629
1619
|
break;
|
|
1630
1620
|
case "multipart/form-data": {
|
|
1631
1621
|
if (!t.params)
|
|
@@ -1643,23 +1633,23 @@ ${l}${l}`), 1), $.push("],")), m($.join(), 1), m("]);"), b(), m("$response = cur
|
|
|
1643
1633
|
}
|
|
1644
1634
|
j && (v[S] = j);
|
|
1645
1635
|
});
|
|
1646
|
-
const y = Object.keys(v).length ? C(v,
|
|
1647
|
-
if (p("$body = new http\\Message\\Body;"), p(`$body->addForm(${y}, ${$});`), it(e, "content-type") && (m =
|
|
1648
|
-
const S =
|
|
1636
|
+
const y = Object.keys(v).length ? C(v, s) : "null", $ = b.length ? C(b, s) : "null";
|
|
1637
|
+
if (p("$body = new http\\Message\\Body;"), p(`$body->addForm(${y}, ${$});`), it(e, "content-type") && (m = ce(e, "content-type")) != null && m.indexOf("boundary")) {
|
|
1638
|
+
const S = z(e, "content-type");
|
|
1649
1639
|
S && delete e[S];
|
|
1650
1640
|
}
|
|
1651
1641
|
f(), h = !0;
|
|
1652
1642
|
break;
|
|
1653
1643
|
}
|
|
1654
1644
|
case "application/json":
|
|
1655
|
-
p("$body = new http\\Message\\Body;"), p(`$body->append(json_encode(${C(t.jsonObj,
|
|
1645
|
+
p("$body = new http\\Message\\Body;"), p(`$body->append(json_encode(${C(t.jsonObj, s)}));`), h = !0;
|
|
1656
1646
|
break;
|
|
1657
1647
|
default:
|
|
1658
1648
|
t.text && (p("$body = new http\\Message\\Body;"), p(`$body->append(${C(t.text)});`), f(), h = !0);
|
|
1659
1649
|
}
|
|
1660
|
-
return p(`$request->setRequestUrl(${C(a)});`), p(`$request->setRequestMethod(${C(r)});`), h && (p("$request->setBody($body);"), f()), Object.keys(o).length && (p(`$request->setQuery(new http\\QueryString(${C(o,
|
|
1650
|
+
return p(`$request->setRequestUrl(${C(a)});`), p(`$request->setRequestMethod(${C(r)});`), h && (p("$request->setBody($body);"), f()), Object.keys(o).length && (p(`$request->setQuery(new http\\QueryString(${C(o, s)}));`), f()), Object.keys(e).length && (p(`$request->setHeaders(${C(e, s)});`), f()), Object.keys(c).length && (f(), p(`$client->setCookies(${C(c, s)});`), f()), p("$client->enqueue($request)->send();"), p("$response = $client->getResponse();"), f(), p("echo $response->getBody();"), !l && i && (f(), p("?>")), d();
|
|
1661
1651
|
}
|
|
1662
|
-
},
|
|
1652
|
+
}, Lo = {
|
|
1663
1653
|
info: {
|
|
1664
1654
|
key: "php",
|
|
1665
1655
|
title: "PHP",
|
|
@@ -1672,19 +1662,19 @@ ${l}${l}`), 1), $.push("],")), m($.join(), 1), m("]);"), b(), m("$response = cur
|
|
|
1672
1662
|
http1: qo,
|
|
1673
1663
|
http2: Io
|
|
1674
1664
|
}
|
|
1675
|
-
},
|
|
1665
|
+
}, zr = (t) => ({ method: r, headersObj: o, cookies: c, uriObj: a, fullUrl: n, postData: i, allHeaders: s }) => {
|
|
1676
1666
|
const { push: l, join: u } = new P();
|
|
1677
1667
|
if (!["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"].includes(r.toUpperCase()))
|
|
1678
1668
|
return "Method not supported";
|
|
1679
1669
|
const f = [], d = Object.keys(o);
|
|
1680
1670
|
return d.length && (l("$headers=@{}"), d.forEach((h) => {
|
|
1681
|
-
h !== "connection" && l(`$headers.Add("${h}", "${
|
|
1682
|
-
}), f.push("-Headers $headers")),
|
|
1671
|
+
h !== "connection" && l(`$headers.Add("${h}", "${Ue(o[h], { escapeChar: "`" })}")`);
|
|
1672
|
+
}), f.push("-Headers $headers")), c.length && (l("$session = New-Object Microsoft.PowerShell.Commands.WebRequestSession"), c.forEach((h) => {
|
|
1683
1673
|
l("$cookie = New-Object System.Net.Cookie"), l(`$cookie.Name = '${h.name}'`), l(`$cookie.Value = '${h.value}'`), l(`$cookie.Domain = '${a.host}'`), l("$session.Cookies.Add($cookie)");
|
|
1684
1674
|
}), f.push("-WebSession $session")), i.text && (f.push(
|
|
1685
|
-
`-ContentType '${
|
|
1675
|
+
`-ContentType '${Ue(ce(s, "content-type"), { delimiter: "'", escapeChar: "`" })}'`
|
|
1686
1676
|
), f.push(`-Body '${i.text}'`)), l(`$response = ${t} -Uri '${n}' -Method ${r} ${f.join(" ")}`.trim()), u();
|
|
1687
|
-
},
|
|
1677
|
+
}, Uo = {
|
|
1688
1678
|
info: {
|
|
1689
1679
|
key: "restmethod",
|
|
1690
1680
|
title: "Invoke-RestMethod",
|
|
@@ -1692,7 +1682,7 @@ ${l}${l}`), 1), $.push("],")), m($.join(), 1), m("]);"), b(), m("$response = cur
|
|
|
1692
1682
|
description: "Powershell Invoke-RestMethod client",
|
|
1693
1683
|
extname: ".ps1"
|
|
1694
1684
|
},
|
|
1695
|
-
convert:
|
|
1685
|
+
convert: zr("Invoke-RestMethod")
|
|
1696
1686
|
}, _o = {
|
|
1697
1687
|
info: {
|
|
1698
1688
|
key: "webrequest",
|
|
@@ -1701,7 +1691,7 @@ ${l}${l}`), 1), $.push("],")), m($.join(), 1), m("]);"), b(), m("$response = cur
|
|
|
1701
1691
|
description: "Powershell Invoke-WebRequest client",
|
|
1702
1692
|
extname: ".ps1"
|
|
1703
1693
|
},
|
|
1704
|
-
convert:
|
|
1694
|
+
convert: zr("Invoke-WebRequest")
|
|
1705
1695
|
}, Fo = {
|
|
1706
1696
|
info: {
|
|
1707
1697
|
key: "powershell",
|
|
@@ -1710,15 +1700,15 @@ ${l}${l}`), 1), $.push("],")), m($.join(), 1), m("]);"), b(), m("$response = cur
|
|
|
1710
1700
|
},
|
|
1711
1701
|
clientsById: {
|
|
1712
1702
|
webrequest: _o,
|
|
1713
|
-
restmethod:
|
|
1703
|
+
restmethod: Uo
|
|
1714
1704
|
}
|
|
1715
1705
|
};
|
|
1716
|
-
function or(t, e, r, o,
|
|
1717
|
-
const a = o.repeat(
|
|
1718
|
-
${a}` : ", ",
|
|
1719
|
-
return r ? `${
|
|
1706
|
+
function or(t, e, r, o, c) {
|
|
1707
|
+
const a = o.repeat(c), n = o.repeat(c - 1), i = r ? `,
|
|
1708
|
+
${a}` : ", ", s = t === "object" ? "{" : "[", l = t === "object" ? "}" : "]";
|
|
1709
|
+
return r ? `${s}
|
|
1720
1710
|
${a}${e.join(i)}
|
|
1721
|
-
${n}${l}` : t === "object" && e.length > 0 ? `${
|
|
1711
|
+
${n}${l}` : t === "object" && e.length > 0 ? `${s} ${e.join(i)} ${l}` : `${s}${e.join(i)}${l}`;
|
|
1722
1712
|
}
|
|
1723
1713
|
var Se = (t, e, r) => {
|
|
1724
1714
|
switch (r = r === void 0 ? 1 : r + 1, Object.prototype.toString.call(t)) {
|
|
@@ -1726,13 +1716,13 @@ var Se = (t, e, r) => {
|
|
|
1726
1716
|
return t;
|
|
1727
1717
|
case "[object Array]": {
|
|
1728
1718
|
let o = !1;
|
|
1729
|
-
const
|
|
1730
|
-
return or("array",
|
|
1719
|
+
const c = t.map((a) => (Object.prototype.toString.call(a) === "[object Object]" && (o = Object.keys(a).length > 1), Se(a, e, r)));
|
|
1720
|
+
return or("array", c, o, e.indent, r);
|
|
1731
1721
|
}
|
|
1732
1722
|
case "[object Object]": {
|
|
1733
1723
|
const o = [];
|
|
1734
|
-
for (const
|
|
1735
|
-
o.push(`"${
|
|
1724
|
+
for (const c in t)
|
|
1725
|
+
o.push(`"${c}": ${Se(t[c], e, r)}`);
|
|
1736
1726
|
return or("object", o, e.pretty && o.length > 1, e.indent, r);
|
|
1737
1727
|
}
|
|
1738
1728
|
case "[object Null]":
|
|
@@ -1751,12 +1741,12 @@ var Se = (t, e, r) => {
|
|
|
1751
1741
|
extname: ".py",
|
|
1752
1742
|
installation: "python -m pip install requests"
|
|
1753
1743
|
},
|
|
1754
|
-
convert: ({ fullUrl: t, postData: e, allHeaders: r, method: o },
|
|
1744
|
+
convert: ({ fullUrl: t, postData: e, allHeaders: r, method: o }, c) => {
|
|
1755
1745
|
const a = {
|
|
1756
1746
|
indent: " ",
|
|
1757
1747
|
pretty: !0,
|
|
1758
|
-
...
|
|
1759
|
-
}, { push: n, blank: i, join:
|
|
1748
|
+
...c
|
|
1749
|
+
}, { push: n, blank: i, join: s, addPostProcessor: l } = new P({ indent: a.indent });
|
|
1760
1750
|
n("import requests"), i(), n(`url = "${t}"`), i();
|
|
1761
1751
|
const u = r;
|
|
1762
1752
|
let p = {};
|
|
@@ -1773,7 +1763,7 @@ var Se = (t, e, r) => {
|
|
|
1773
1763
|
y.fileName ? (y.contentType ? f[y.name] = `('${y.fileName}', open('${y.fileName}', 'rb'), '${y.contentType}')` : f[y.name] = `('${y.fileName}', open('${y.fileName}', 'rb'))`, d = !0) : (p[y.name] = y.value, h = !0);
|
|
1774
1764
|
}), d) {
|
|
1775
1765
|
n(`files = ${Se(f, a)}`), h && n(`payload = ${Se(p, a)}`);
|
|
1776
|
-
const y =
|
|
1766
|
+
const y = z(u, "content-type");
|
|
1777
1767
|
y && delete u[y];
|
|
1778
1768
|
} else {
|
|
1779
1769
|
const y = JSON.stringify(e.text);
|
|
@@ -1806,7 +1796,7 @@ var Se = (t, e, r) => {
|
|
|
1806
1796
|
}), n("}"), i();
|
|
1807
1797
|
}
|
|
1808
1798
|
let v = Ho.includes(o) ? `response = requests.${o.toLowerCase()}(url` : `response = requests.request("${o}", url`;
|
|
1809
|
-
return h && (m ? v += ", json=payload" : v += ", data=payload"), d && (v += ", files=files"), b > 0 && (v += ", headers=headers"), v += ")", n(v), i(), n("print(response.text)"),
|
|
1799
|
+
return h && (m ? v += ", json=payload" : v += ", data=payload"), d && (v += ", files=files"), b > 0 && (v += ", headers=headers"), v += ")", n(v), i(), n("print(response.text)"), s();
|
|
1810
1800
|
}
|
|
1811
1801
|
}, Mo = {
|
|
1812
1802
|
info: {
|
|
@@ -1826,8 +1816,8 @@ var Se = (t, e, r) => {
|
|
|
1826
1816
|
description: "httr: Tools for Working with URLs and HTTP",
|
|
1827
1817
|
extname: ".r"
|
|
1828
1818
|
},
|
|
1829
|
-
convert: ({ url: t, queryObj: e, queryString: r, postData: o, allHeaders:
|
|
1830
|
-
const { push: n, blank: i, join:
|
|
1819
|
+
convert: ({ url: t, queryObj: e, queryString: r, postData: o, allHeaders: c, method: a }) => {
|
|
1820
|
+
const { push: n, blank: i, join: s } = new P();
|
|
1831
1821
|
n("library(httr)"), i(), n(`url <- "${t}"`), i();
|
|
1832
1822
|
const l = e;
|
|
1833
1823
|
delete e.key;
|
|
@@ -1851,13 +1841,13 @@ var Se = (t, e, r) => {
|
|
|
1851
1841
|
n('encode <- "raw"'), i();
|
|
1852
1842
|
break;
|
|
1853
1843
|
}
|
|
1854
|
-
const f =
|
|
1844
|
+
const f = ce(c, "cookie"), d = ce(c, "accept"), h = f ? `set_cookies(\`${String(f).replace(/;/g, '", `').replace(/` /g, "`").replace(/[=]/g, '` = "')}")` : void 0, m = d ? `accept("${H(d)}")` : void 0, b = `content_type("${H(o.mimeType)}")`, v = Object.entries(c).filter(([w]) => !["cookie", "accept", "content-type"].includes(w.toLowerCase())).map(([w, j]) => `'${w}' = '${_e(j)}'`).join(", "), y = v ? `add_headers(${v})` : void 0;
|
|
1855
1845
|
let $ = `response <- VERB("${a}", url`;
|
|
1856
1846
|
p && ($ += ", body = payload"), r.length && ($ += ", query = queryString");
|
|
1857
1847
|
const S = [y, b, m, h].filter((w) => !!w).join(", ");
|
|
1858
|
-
return S && ($ += `, ${S}`), (o.text || o.jsonObj || o.params) && ($ += ", encode = encode"), $ += ")", n($), i(), n('content(response, "text")'),
|
|
1848
|
+
return S && ($ += `, ${S}`), (o.text || o.jsonObj || o.params) && ($ += ", encode = encode"), $ += ")", n($), i(), n('content(response, "text")'), s();
|
|
1859
1849
|
}
|
|
1860
|
-
},
|
|
1850
|
+
}, Jo = {
|
|
1861
1851
|
info: {
|
|
1862
1852
|
key: "r",
|
|
1863
1853
|
title: "R",
|
|
@@ -1866,7 +1856,7 @@ var Se = (t, e, r) => {
|
|
|
1866
1856
|
clientsById: {
|
|
1867
1857
|
httr: Wo
|
|
1868
1858
|
}
|
|
1869
|
-
},
|
|
1859
|
+
}, zo = {
|
|
1870
1860
|
info: {
|
|
1871
1861
|
key: "native",
|
|
1872
1862
|
title: "net::http",
|
|
@@ -1874,10 +1864,10 @@ var Se = (t, e, r) => {
|
|
|
1874
1864
|
description: "Ruby HTTP client",
|
|
1875
1865
|
extname: ".rb"
|
|
1876
1866
|
},
|
|
1877
|
-
convert: ({ uriObj: t, method: e, fullUrl: r, postData: o, allHeaders:
|
|
1867
|
+
convert: ({ uriObj: t, method: e, fullUrl: r, postData: o, allHeaders: c }) => {
|
|
1878
1868
|
const { push: a, blank: n, join: i } = new P();
|
|
1879
1869
|
a("require 'uri'"), a("require 'net/http'"), n();
|
|
1880
|
-
const
|
|
1870
|
+
const s = e.toUpperCase(), l = [
|
|
1881
1871
|
"GET",
|
|
1882
1872
|
"POST",
|
|
1883
1873
|
"HEAD",
|
|
@@ -1890,11 +1880,11 @@ var Se = (t, e, r) => {
|
|
|
1890
1880
|
"UNLOCK",
|
|
1891
1881
|
"MOVE",
|
|
1892
1882
|
"TRACE"
|
|
1893
|
-
], u =
|
|
1894
|
-
l.includes(
|
|
1895
|
-
const p = Object.keys(
|
|
1883
|
+
], u = s.charAt(0) + s.substring(1).toLowerCase();
|
|
1884
|
+
l.includes(s) || (a(`class Net::HTTP::${u} < Net::HTTPRequest`), a(` METHOD = '${s.toUpperCase()}'`), a(` REQUEST_HAS_BODY = '${o.text ? "true" : "false"}'`), a(" RESPONSE_HAS_BODY = true"), a("end"), n()), a(`url = URI("${r}")`), n(), a("http = Net::HTTP.new(url.host, url.port)"), t.protocol === "https:" && a("http.use_ssl = true"), n(), a(`request = Net::HTTP::${u}.new(url)`);
|
|
1885
|
+
const p = Object.keys(c);
|
|
1896
1886
|
return p.length && p.forEach((f) => {
|
|
1897
|
-
a(`request["${f}"] = '${_e(
|
|
1887
|
+
a(`request["${f}"] = '${_e(c[f])}'`);
|
|
1898
1888
|
}), o.text && a(`request.body = ${JSON.stringify(o.text)}`), n(), a("response = http.request(request)"), a("puts response.read_body"), i();
|
|
1899
1889
|
}
|
|
1900
1890
|
}, Go = {
|
|
@@ -1904,7 +1894,7 @@ var Se = (t, e, r) => {
|
|
|
1904
1894
|
default: "native"
|
|
1905
1895
|
},
|
|
1906
1896
|
clientsById: {
|
|
1907
|
-
native:
|
|
1897
|
+
native: zo
|
|
1908
1898
|
}
|
|
1909
1899
|
}, M = (t = "") => /^[a-z0-9-_/.@%^=:]+$/i.test(t) ? t : `'${t.replace(/'/g, "'\\''")}'`, Vo = (t) => t.replace(/\r/g, "\\r").replace(/\n/g, "\\n"), Ko = {
|
|
1910
1900
|
"http1.0": "0",
|
|
@@ -1930,28 +1920,28 @@ var Se = (t, e, r) => {
|
|
|
1930
1920
|
description: "cURL is a command line tool and library for transferring data with URL syntax",
|
|
1931
1921
|
extname: ".sh"
|
|
1932
1922
|
},
|
|
1933
|
-
convert: ({ fullUrl: t, method: e, httpVersion: r, headersObj: o, allHeaders:
|
|
1923
|
+
convert: ({ fullUrl: t, method: e, httpVersion: r, headersObj: o, allHeaders: c, postData: a }, n = {}) => {
|
|
1934
1924
|
var b;
|
|
1935
|
-
const { indent: i = " ", short:
|
|
1925
|
+
const { indent: i = " ", short: s = !1, binary: l = !1, globOff: u = !1 } = n, p = " ", { push: f, join: d } = new P({
|
|
1936
1926
|
...typeof i == "string" ? { indent: i } : {},
|
|
1937
1927
|
join: i !== !1 ? ` \\
|
|
1938
1928
|
${i}` : " "
|
|
1939
|
-
}), h = Qo(
|
|
1929
|
+
}), h = Qo(s);
|
|
1940
1930
|
let m = M(t);
|
|
1941
|
-
if (f(`curl ${h("request")} ${e}`), u && (m = unescape(m), f(h("globoff"))), f(`${h("url ")}${m}`), r === "HTTP/1.0" && f(h("http1.0")),
|
|
1942
|
-
const v =
|
|
1931
|
+
if (f(`curl ${h("request")} ${e}`), u && (m = unescape(m), f(h("globoff"))), f(`${h("url ")}${m}`), r === "HTTP/1.0" && f(h("http1.0")), ce(c, "accept-encoding") && f("--compressed"), a.mimeType === "multipart/form-data") {
|
|
1932
|
+
const v = z(o, "content-type");
|
|
1943
1933
|
if (v) {
|
|
1944
1934
|
const y = o[v];
|
|
1945
1935
|
if (v && y) {
|
|
1946
1936
|
const $ = String(y).replace(/; boundary.+?(?=(;|$))/, "");
|
|
1947
|
-
o[v] = $,
|
|
1937
|
+
o[v] = $, c[v] = $;
|
|
1948
1938
|
}
|
|
1949
1939
|
}
|
|
1950
1940
|
}
|
|
1951
1941
|
switch (Object.keys(o).sort().forEach((v) => {
|
|
1952
1942
|
const y = `${v}: ${o[v]}`;
|
|
1953
1943
|
f(`${h("header")} ${M(y)}`);
|
|
1954
|
-
}),
|
|
1944
|
+
}), c.cookie && f(`${h("cookie")} ${M(c.cookie)}`), a.mimeType) {
|
|
1955
1945
|
case "multipart/form-data":
|
|
1956
1946
|
(b = a.params) == null || b.forEach((y) => {
|
|
1957
1947
|
let $ = "";
|
|
@@ -1999,7 +1989,7 @@ ${JSON.stringify(y, null, p)}
|
|
|
1999
1989
|
extname: ".sh",
|
|
2000
1990
|
installation: "brew install httpie"
|
|
2001
1991
|
},
|
|
2002
|
-
convert: ({ allHeaders: t, postData: e, queryObj: r, fullUrl: o, method:
|
|
1992
|
+
convert: ({ allHeaders: t, postData: e, queryObj: r, fullUrl: o, method: c, url: a }, n) => {
|
|
2003
1993
|
const i = {
|
|
2004
1994
|
body: !1,
|
|
2005
1995
|
cert: !1,
|
|
@@ -2014,7 +2004,7 @@ ${JSON.stringify(y, null, p)}
|
|
|
2014
2004
|
verbose: !1,
|
|
2015
2005
|
verify: !1,
|
|
2016
2006
|
...n
|
|
2017
|
-
}, { push:
|
|
2007
|
+
}, { push: s, join: l, unshift: u } = new P({
|
|
2018
2008
|
indent: i.indent,
|
|
2019
2009
|
// @ts-expect-error SEEMS LEGIT
|
|
2020
2010
|
join: i.indent !== !1 ? ` \\
|
|
@@ -2025,15 +2015,15 @@ ${i.indent}` : " "
|
|
|
2025
2015
|
i.headers && f.push(i.short ? "-h" : "--headers"), i.body && f.push(i.short ? "-b" : "--body"), i.verbose && f.push(i.short ? "-v" : "--verbose"), i.print && f.push(`${i.short ? "-p" : "--print"}=${i.print}`), i.verify && f.push(`--verify=${i.verify}`), i.cert && f.push(`--cert=${i.cert}`), i.pretty && f.push(`--pretty=${i.pretty}`), i.style && f.push(`--style=${i.style}`), i.timeout && f.push(`--timeout=${i.timeout}`), i.queryParams && Object.keys(r).forEach((h) => {
|
|
2026
2016
|
const m = r[h];
|
|
2027
2017
|
Array.isArray(m) ? m.forEach((b) => {
|
|
2028
|
-
|
|
2029
|
-
}) :
|
|
2018
|
+
s(`${h}==${M(b)}`);
|
|
2019
|
+
}) : s(`${h}==${M(m)}`);
|
|
2030
2020
|
}), Object.keys(t).sort().forEach((h) => {
|
|
2031
|
-
|
|
2021
|
+
s(`${h}:${M(t[h])}`);
|
|
2032
2022
|
}), e.mimeType === "application/x-www-form-urlencoded" ? e.params && e.params.length && (f.push(i.short ? "-f" : "--form"), e.params.forEach((h) => {
|
|
2033
|
-
|
|
2023
|
+
s(`${h.name}=${M(h.value)}`);
|
|
2034
2024
|
})) : p = !0;
|
|
2035
2025
|
const d = f.length ? `${f.join(" ")} ` : "";
|
|
2036
|
-
if (a = M(i.queryParams ? a : o), u(`http ${d}${
|
|
2026
|
+
if (a = M(i.queryParams ? a : o), u(`http ${d}${c} ${a}`), p && e.text) {
|
|
2037
2027
|
const h = M(e.text);
|
|
2038
2028
|
u(`echo ${h} | `);
|
|
2039
2029
|
}
|
|
@@ -2047,19 +2037,19 @@ ${i.indent}` : " "
|
|
|
2047
2037
|
description: "a free software package for retrieving files using HTTP, HTTPS",
|
|
2048
2038
|
extname: ".sh"
|
|
2049
2039
|
},
|
|
2050
|
-
convert: ({ method: t, postData: e, allHeaders: r, fullUrl: o },
|
|
2040
|
+
convert: ({ method: t, postData: e, allHeaders: r, fullUrl: o }, c) => {
|
|
2051
2041
|
const a = {
|
|
2052
2042
|
indent: " ",
|
|
2053
2043
|
short: !1,
|
|
2054
2044
|
verbose: !1,
|
|
2055
|
-
...
|
|
2045
|
+
...c
|
|
2056
2046
|
}, { push: n, join: i } = new P({
|
|
2057
2047
|
...typeof a.indent == "string" ? { indent: a.indent } : {},
|
|
2058
2048
|
join: a.indent !== !1 ? ` \\
|
|
2059
2049
|
${a.indent}` : " "
|
|
2060
2050
|
});
|
|
2061
|
-
return a.verbose ? n(`wget ${a.short ? "-v" : "--verbose"}`) : n(`wget ${a.short ? "-q" : "--quiet"}`), n(`--method ${M(t)}`), Object.keys(r).forEach((
|
|
2062
|
-
const l = `${
|
|
2051
|
+
return a.verbose ? n(`wget ${a.short ? "-v" : "--verbose"}`) : n(`wget ${a.short ? "-q" : "--quiet"}`), n(`--method ${M(t)}`), Object.keys(r).forEach((s) => {
|
|
2052
|
+
const l = `${s}: ${r[s]}`;
|
|
2063
2053
|
n(`--header ${M(l)}`);
|
|
2064
2054
|
}), e.text && n(`--body-data ${Vo(M(e.text))}`), n(a.short ? "-O" : "--output-document"), n(`- ${M(o)}`), i();
|
|
2065
2055
|
}
|
|
@@ -2076,10 +2066,10 @@ ${a.indent}` : " "
|
|
|
2076
2066
|
wget: Xo
|
|
2077
2067
|
}
|
|
2078
2068
|
}, ar = (t, e) => e.repeat(t), ir = (t, e, r, o) => {
|
|
2079
|
-
const
|
|
2080
|
-
${
|
|
2069
|
+
const c = ar(o, r), a = ar(o - 1, r), n = e ? `,
|
|
2070
|
+
${c}` : ", ";
|
|
2081
2071
|
return e ? `[
|
|
2082
|
-
${
|
|
2072
|
+
${c}${t.join(n)}
|
|
2083
2073
|
${a}]` : `[${t.join(n)}]`;
|
|
2084
2074
|
}, sr = (t, e, r) => `let ${t} = ${Ze(e, r)}`, Ze = (t, e, r) => {
|
|
2085
2075
|
switch (r = r === void 0 ? 1 : r + 1, Object.prototype.toString.call(t)) {
|
|
@@ -2087,13 +2077,13 @@ ${a}]` : `[${t.join(n)}]`;
|
|
|
2087
2077
|
return t;
|
|
2088
2078
|
case "[object Array]": {
|
|
2089
2079
|
let o = !1;
|
|
2090
|
-
const
|
|
2091
|
-
return ir(
|
|
2080
|
+
const c = t.map((a) => (Object.prototype.toString.call(a) === "[object Object]" && (o = Object.keys(a).length > 1), Ze(a, e, r)));
|
|
2081
|
+
return ir(c, o, e.indent, r);
|
|
2092
2082
|
}
|
|
2093
2083
|
case "[object Object]": {
|
|
2094
2084
|
const o = [];
|
|
2095
|
-
for (const
|
|
2096
|
-
o.push(`"${
|
|
2085
|
+
for (const c in t)
|
|
2086
|
+
o.push(`"${c}": ${Ze(t[c], e, r)}`);
|
|
2097
2087
|
return ir(
|
|
2098
2088
|
o,
|
|
2099
2089
|
// @ts-expect-error needs better types
|
|
@@ -2116,32 +2106,32 @@ ${a}]` : `[${t.join(n)}]`;
|
|
|
2116
2106
|
description: "Foundation's URLSession request",
|
|
2117
2107
|
extname: ".swift"
|
|
2118
2108
|
},
|
|
2119
|
-
convert: ({ allHeaders: t, postData: e, uriObj: r, queryObj: o, method:
|
|
2109
|
+
convert: ({ allHeaders: t, postData: e, uriObj: r, queryObj: o, method: c }, a) => {
|
|
2120
2110
|
var f;
|
|
2121
2111
|
const n = {
|
|
2122
2112
|
indent: " ",
|
|
2123
2113
|
pretty: !0,
|
|
2124
2114
|
timeout: 10,
|
|
2125
2115
|
...a
|
|
2126
|
-
}, { push: i, blank:
|
|
2127
|
-
i("import Foundation"),
|
|
2116
|
+
}, { push: i, blank: s, join: l } = new P({ indent: n.indent });
|
|
2117
|
+
i("import Foundation"), s();
|
|
2128
2118
|
const u = e.text || e.jsonObj || e.params;
|
|
2129
2119
|
if (u)
|
|
2130
2120
|
switch (e.mimeType) {
|
|
2131
2121
|
case "application/x-www-form-urlencoded":
|
|
2132
2122
|
if ((f = e.params) != null && f.length) {
|
|
2133
2123
|
const d = e.params.map((h) => `"${h.name}": "${h.value}"`);
|
|
2134
|
-
n.pretty ? (i("let parameters = ["), d.forEach((h) => i(`${h},`, 1)), i("]")) : i(`let parameters = [${d.join(", ")}]`), i('let joinedParameters = parameters.map { "\\($0.key)=\\($0.value)" }.joined(separator: "&")'), i("let postData = Data(joinedParameters.utf8)"),
|
|
2124
|
+
n.pretty ? (i("let parameters = ["), d.forEach((h) => i(`${h},`, 1)), i("]")) : i(`let parameters = [${d.join(", ")}]`), i('let joinedParameters = parameters.map { "\\($0.key)=\\($0.value)" }.joined(separator: "&")'), i("let postData = Data(joinedParameters.utf8)"), s();
|
|
2135
2125
|
}
|
|
2136
2126
|
break;
|
|
2137
2127
|
case "application/json":
|
|
2138
|
-
e.jsonObj && (i(`${sr("parameters", e.jsonObj, n)} as [String : Any?]`),
|
|
2128
|
+
e.jsonObj && (i(`${sr("parameters", e.jsonObj, n)} as [String : Any?]`), s(), i("let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])"), s());
|
|
2139
2129
|
break;
|
|
2140
2130
|
case "multipart/form-data":
|
|
2141
|
-
i(sr("parameters", e.params, n)),
|
|
2131
|
+
i(sr("parameters", e.params, n)), s(), i(`let boundary = "${e.boundary}"`), s(), i('var body = ""'), i("for param in parameters {"), i('let paramName = param["name"]!', 1), i('body += "--\\(boundary)\\r\\n"', 1), i('body += "Content-Disposition:form-data; name=\\"\\(paramName)\\""', 1), i('if let filename = param["fileName"] {', 1), i('let contentType = param["contentType"]!', 2), i("let fileContent = try String(contentsOfFile: filename, encoding: .utf8)", 2), i('body += "; filename=\\"\\(filename)\\"\\r\\n"', 2), i('body += "Content-Type: \\(contentType)\\r\\n\\r\\n"', 2), i("body += fileContent", 2), i('} else if let paramValue = param["value"] {', 1), i('body += "\\r\\n\\r\\n\\(paramValue)"', 2), i("}", 1), i("}"), s(), i("let postData = Data(body.utf8)"), s();
|
|
2142
2132
|
break;
|
|
2143
2133
|
default:
|
|
2144
|
-
i(`let postData = Data("${e.text}".utf8)`),
|
|
2134
|
+
i(`let postData = Data("${e.text}".utf8)`), s();
|
|
2145
2135
|
}
|
|
2146
2136
|
i(`let url = URL(string: "${r.href}")!`);
|
|
2147
2137
|
const p = o ? Object.entries(o) : [];
|
|
@@ -2157,7 +2147,7 @@ ${a}]` : `[${t.join(n)}]`;
|
|
|
2157
2147
|
});
|
|
2158
2148
|
break;
|
|
2159
2149
|
}
|
|
2160
|
-
}), i("]"), i("components.queryItems = components.queryItems.map { $0 + queryItems } ?? queryItems"),
|
|
2150
|
+
}), i("]"), i("components.queryItems = components.queryItems.map { $0 + queryItems } ?? queryItems"), s(), i("var request = URLRequest(url: components.url!)")), i(`request.httpMethod = "${c}"`), i(`request.timeoutInterval = ${n.timeout}`), Object.keys(t).length && i(`request.allHTTPHeaderFields = ${Ze(t, n)}`), u && i("request.httpBody = postData"), s(), i("let (data, _) = try await URLSession.shared.data(for: request)"), i("print(String(decoding: data, as: UTF8.self))"), l();
|
|
2161
2151
|
}
|
|
2162
2152
|
}, ta = {
|
|
2163
2153
|
info: {
|
|
@@ -2181,10 +2171,10 @@ ${a}]` : `[${t.join(n)}]`;
|
|
|
2181
2171
|
node: Po,
|
|
2182
2172
|
objc: Eo,
|
|
2183
2173
|
ocaml: No,
|
|
2184
|
-
php:
|
|
2174
|
+
php: Lo,
|
|
2185
2175
|
powershell: Fo,
|
|
2186
2176
|
python: Mo,
|
|
2187
|
-
r:
|
|
2177
|
+
r: Jo,
|
|
2188
2178
|
ruby: Go,
|
|
2189
2179
|
shell: Zo,
|
|
2190
2180
|
swift: ta
|
|
@@ -2193,13 +2183,13 @@ ${a}]` : `[${t.join(n)}]`;
|
|
|
2193
2183
|
et.exports;
|
|
2194
2184
|
(function(t, e) {
|
|
2195
2185
|
(function(r) {
|
|
2196
|
-
var o = e && !e.nodeType && e,
|
|
2186
|
+
var o = e && !e.nodeType && e, c = t && !t.nodeType && t, a = typeof Ge == "object" && Ge;
|
|
2197
2187
|
(a.global === a || a.window === a || a.self === a) && (r = a);
|
|
2198
|
-
var n, i = 2147483647,
|
|
2188
|
+
var n, i = 2147483647, s = 36, l = 1, u = 26, p = 38, f = 700, d = 72, h = 128, m = "-", b = /^xn--/, v = /[^\x20-\x7E]/, y = /[\x2E\u3002\uFF0E\uFF61]/g, $ = {
|
|
2199
2189
|
overflow: "Overflow: input needs wider integers to process",
|
|
2200
2190
|
"not-basic": "Illegal input >= 0x80 (not a basic code point)",
|
|
2201
2191
|
"invalid-input": "Invalid input"
|
|
2202
|
-
}, S =
|
|
2192
|
+
}, S = s - l, w = Math.floor, j = String.fromCharCode, N;
|
|
2203
2193
|
function E(x) {
|
|
2204
2194
|
throw new RangeError($[x]);
|
|
2205
2195
|
}
|
|
@@ -2214,54 +2204,54 @@ et.exports;
|
|
|
2214
2204
|
var q = x.split("."), Q = R(q, O).join(".");
|
|
2215
2205
|
return A + Q;
|
|
2216
2206
|
}
|
|
2217
|
-
function
|
|
2207
|
+
function Z(x) {
|
|
2218
2208
|
for (var O = [], k = 0, A = x.length, q, Q; k < A; )
|
|
2219
2209
|
q = x.charCodeAt(k++), q >= 55296 && q <= 56319 && k < A ? (Q = x.charCodeAt(k++), (Q & 64512) == 56320 ? O.push(((q & 1023) << 10) + (Q & 1023) + 65536) : (O.push(q), k--)) : O.push(q);
|
|
2220
2210
|
return O;
|
|
2221
2211
|
}
|
|
2222
|
-
function
|
|
2212
|
+
function ee(x) {
|
|
2223
2213
|
return R(x, function(O) {
|
|
2224
2214
|
var k = "";
|
|
2225
2215
|
return O > 65535 && (O -= 65536, k += j(O >>> 10 & 1023 | 55296), O = 56320 | O & 1023), k += j(O), k;
|
|
2226
2216
|
}).join("");
|
|
2227
2217
|
}
|
|
2228
|
-
function
|
|
2229
|
-
return x - 48 < 10 ? x - 22 : x - 65 < 26 ? x - 65 : x - 97 < 26 ? x - 97 :
|
|
2218
|
+
function L(x) {
|
|
2219
|
+
return x - 48 < 10 ? x - 22 : x - 65 < 26 ? x - 65 : x - 97 < 26 ? x - 97 : s;
|
|
2230
2220
|
}
|
|
2231
2221
|
function V(x, O) {
|
|
2232
2222
|
return x + 22 + 75 * (x < 26) - ((O != 0) << 5);
|
|
2233
2223
|
}
|
|
2234
2224
|
function K(x, O, k) {
|
|
2235
2225
|
var A = 0;
|
|
2236
|
-
for (x = k ? w(x / f) : x >> 1, x += w(x / O); x > S * u >> 1; A +=
|
|
2226
|
+
for (x = k ? w(x / f) : x >> 1, x += w(x / O); x > S * u >> 1; A += s)
|
|
2237
2227
|
x = w(x / S);
|
|
2238
2228
|
return w(A + (S + 1) * x / (x + p));
|
|
2239
2229
|
}
|
|
2240
2230
|
function D(x) {
|
|
2241
|
-
var O = [], k = x.length, A, q = 0, Q = h, B = d, Y,
|
|
2242
|
-
for (Y = x.lastIndexOf(m), Y < 0 && (Y = 0),
|
|
2243
|
-
x.charCodeAt(
|
|
2244
|
-
for (
|
|
2245
|
-
for (ue = q,
|
|
2246
|
-
me =
|
|
2231
|
+
var O = [], k = x.length, A, q = 0, Q = h, B = d, Y, te, oe, ue, J, X, re, pe, me;
|
|
2232
|
+
for (Y = x.lastIndexOf(m), Y < 0 && (Y = 0), te = 0; te < Y; ++te)
|
|
2233
|
+
x.charCodeAt(te) >= 128 && E("not-basic"), O.push(x.charCodeAt(te));
|
|
2234
|
+
for (oe = Y > 0 ? Y + 1 : 0; oe < k; ) {
|
|
2235
|
+
for (ue = q, J = 1, X = s; oe >= k && E("invalid-input"), re = L(x.charCodeAt(oe++)), (re >= s || re > w((i - q) / J)) && E("overflow"), q += re * J, pe = X <= B ? l : X >= B + u ? u : X - B, !(re < pe); X += s)
|
|
2236
|
+
me = s - pe, J > w(i / me) && E("overflow"), J *= me;
|
|
2247
2237
|
A = O.length + 1, B = K(q - ue, A, ue == 0), w(q / A) > i - Q && E("overflow"), Q += w(q / A), q %= A, O.splice(q++, 0, Q);
|
|
2248
2238
|
}
|
|
2249
|
-
return
|
|
2239
|
+
return ee(O);
|
|
2250
2240
|
}
|
|
2251
2241
|
function fe(x) {
|
|
2252
|
-
var O, k, A, q, Q, B, Y,
|
|
2253
|
-
for (x =
|
|
2254
|
-
|
|
2255
|
-
for (A = q = X.length, q && X.push(m); A <
|
|
2256
|
-
for (Y = i, B = 0; B <
|
|
2257
|
-
|
|
2258
|
-
for (pe = A + 1, Y - O > w((i - k) / pe) && E("overflow"), k += (Y - O) * pe, O = Y, B = 0; B <
|
|
2259
|
-
if (
|
|
2260
|
-
for (
|
|
2261
|
-
ct =
|
|
2242
|
+
var O, k, A, q, Q, B, Y, te, oe, ue, J, X = [], re, pe, me, ct;
|
|
2243
|
+
for (x = Z(x), re = x.length, O = h, k = 0, Q = d, B = 0; B < re; ++B)
|
|
2244
|
+
J = x[B], J < 128 && X.push(j(J));
|
|
2245
|
+
for (A = q = X.length, q && X.push(m); A < re; ) {
|
|
2246
|
+
for (Y = i, B = 0; B < re; ++B)
|
|
2247
|
+
J = x[B], J >= O && J < Y && (Y = J);
|
|
2248
|
+
for (pe = A + 1, Y - O > w((i - k) / pe) && E("overflow"), k += (Y - O) * pe, O = Y, B = 0; B < re; ++B)
|
|
2249
|
+
if (J = x[B], J < O && ++k > i && E("overflow"), J == O) {
|
|
2250
|
+
for (te = k, oe = s; ue = oe <= Q ? l : oe >= Q + u ? u : oe - Q, !(te < ue); oe += s)
|
|
2251
|
+
ct = te - ue, me = s - ue, X.push(
|
|
2262
2252
|
j(V(ue + ct % me, 0))
|
|
2263
|
-
),
|
|
2264
|
-
X.push(j(V(
|
|
2253
|
+
), te = w(ct / me);
|
|
2254
|
+
X.push(j(V(te, 0))), Q = K(k, pe, A == q), k = 0, ++A;
|
|
2265
2255
|
}
|
|
2266
2256
|
++k, ++O;
|
|
2267
2257
|
}
|
|
@@ -2292,16 +2282,16 @@ et.exports;
|
|
|
2292
2282
|
* @type Object
|
|
2293
2283
|
*/
|
|
2294
2284
|
ucs2: {
|
|
2295
|
-
decode:
|
|
2296
|
-
encode:
|
|
2285
|
+
decode: Z,
|
|
2286
|
+
encode: ee
|
|
2297
2287
|
},
|
|
2298
2288
|
decode: D,
|
|
2299
2289
|
encode: fe,
|
|
2300
2290
|
toASCII: Me,
|
|
2301
2291
|
toUnicode: st
|
|
2302
|
-
}, o &&
|
|
2292
|
+
}, o && c)
|
|
2303
2293
|
if (t.exports == o)
|
|
2304
|
-
|
|
2294
|
+
c.exports = n;
|
|
2305
2295
|
else
|
|
2306
2296
|
for (N in n)
|
|
2307
2297
|
n.hasOwnProperty(N) && (o[N] = n[N]);
|
|
@@ -2309,7 +2299,7 @@ et.exports;
|
|
|
2309
2299
|
r.punycode = n;
|
|
2310
2300
|
})(Ge);
|
|
2311
2301
|
})(et, et.exports);
|
|
2312
|
-
var na = et.exports, oa = Error, aa = EvalError, ia = RangeError, sa = ReferenceError,
|
|
2302
|
+
var na = et.exports, oa = Error, aa = EvalError, ia = RangeError, sa = ReferenceError, Gr = SyntaxError, He = TypeError, ca = URIError, la = function() {
|
|
2313
2303
|
if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function")
|
|
2314
2304
|
return !1;
|
|
2315
2305
|
if (typeof Symbol.iterator == "symbol")
|
|
@@ -2317,8 +2307,8 @@ var na = et.exports, oa = Error, aa = EvalError, ia = RangeError, sa = Reference
|
|
|
2317
2307
|
var e = {}, r = Symbol("test"), o = Object(r);
|
|
2318
2308
|
if (typeof r == "string" || Object.prototype.toString.call(r) !== "[object Symbol]" || Object.prototype.toString.call(o) !== "[object Symbol]")
|
|
2319
2309
|
return !1;
|
|
2320
|
-
var
|
|
2321
|
-
e[r] =
|
|
2310
|
+
var c = 42;
|
|
2311
|
+
e[r] = c;
|
|
2322
2312
|
for (r in e)
|
|
2323
2313
|
return !1;
|
|
2324
2314
|
if (typeof Object.keys == "function" && Object.keys(e).length !== 0 || typeof Object.getOwnPropertyNames == "function" && Object.getOwnPropertyNames(e).length !== 0)
|
|
@@ -2328,7 +2318,7 @@ var na = et.exports, oa = Error, aa = EvalError, ia = RangeError, sa = Reference
|
|
|
2328
2318
|
return !1;
|
|
2329
2319
|
if (typeof Object.getOwnPropertyDescriptor == "function") {
|
|
2330
2320
|
var n = Object.getOwnPropertyDescriptor(e, r);
|
|
2331
|
-
if (n.value !==
|
|
2321
|
+
if (n.value !== c || n.enumerable !== !0)
|
|
2332
2322
|
return !1;
|
|
2333
2323
|
}
|
|
2334
2324
|
return !0;
|
|
@@ -2340,14 +2330,14 @@ var na = et.exports, oa = Error, aa = EvalError, ia = RangeError, sa = Reference
|
|
|
2340
2330
|
}, pa = Object, da = function() {
|
|
2341
2331
|
return { __proto__: ut }.foo === ut.foo && !(ut instanceof pa);
|
|
2342
2332
|
}, ha = "Function.prototype.bind called on incompatible ", ya = Object.prototype.toString, ma = Math.max, ga = "[object Function]", lr = function(e, r) {
|
|
2343
|
-
for (var o = [],
|
|
2344
|
-
o[
|
|
2333
|
+
for (var o = [], c = 0; c < e.length; c += 1)
|
|
2334
|
+
o[c] = e[c];
|
|
2345
2335
|
for (var a = 0; a < r.length; a += 1)
|
|
2346
2336
|
o[a + e.length] = r[a];
|
|
2347
2337
|
return o;
|
|
2348
2338
|
}, ba = function(e, r) {
|
|
2349
|
-
for (var o = [],
|
|
2350
|
-
o[a] = e[
|
|
2339
|
+
for (var o = [], c = r, a = 0; c < e.length; c += 1, a += 1)
|
|
2340
|
+
o[a] = e[c];
|
|
2351
2341
|
return o;
|
|
2352
2342
|
}, va = function(t, e) {
|
|
2353
2343
|
for (var r = "", o = 0; o < t.length; o += 1)
|
|
@@ -2357,8 +2347,8 @@ var na = et.exports, oa = Error, aa = EvalError, ia = RangeError, sa = Reference
|
|
|
2357
2347
|
var r = this;
|
|
2358
2348
|
if (typeof r != "function" || ya.apply(r) !== ga)
|
|
2359
2349
|
throw new TypeError(ha + r);
|
|
2360
|
-
for (var o = ba(arguments, 1),
|
|
2361
|
-
if (this instanceof
|
|
2350
|
+
for (var o = ba(arguments, 1), c, a = function() {
|
|
2351
|
+
if (this instanceof c) {
|
|
2362
2352
|
var u = r.apply(
|
|
2363
2353
|
this,
|
|
2364
2354
|
lr(o, arguments)
|
|
@@ -2369,17 +2359,17 @@ var na = et.exports, oa = Error, aa = EvalError, ia = RangeError, sa = Reference
|
|
|
2369
2359
|
e,
|
|
2370
2360
|
lr(o, arguments)
|
|
2371
2361
|
);
|
|
2372
|
-
}, n = ma(0, r.length - o.length), i = [],
|
|
2373
|
-
i[
|
|
2374
|
-
if (
|
|
2362
|
+
}, n = ma(0, r.length - o.length), i = [], s = 0; s < n; s++)
|
|
2363
|
+
i[s] = "$" + s;
|
|
2364
|
+
if (c = Function("binder", "return function (" + va(i, ",") + "){ return binder.apply(this,arguments); }")(a), r.prototype) {
|
|
2375
2365
|
var l = function() {
|
|
2376
2366
|
};
|
|
2377
|
-
l.prototype = r.prototype,
|
|
2367
|
+
l.prototype = r.prototype, c.prototype = new l(), l.prototype = null;
|
|
2378
2368
|
}
|
|
2379
|
-
return
|
|
2380
|
-
}, xa = $a,
|
|
2369
|
+
return c;
|
|
2370
|
+
}, xa = $a, Lt = Function.prototype.bind || xa, wa = Function.prototype.call, Sa = Object.prototype.hasOwnProperty, ja = Lt, Oa = ja.call(wa, Sa), T, Ta = oa, Pa = aa, ka = ia, Ea = sa, Pe = Gr, je = He, Ca = ca, Vr = Function, ft = function(t) {
|
|
2381
2371
|
try {
|
|
2382
|
-
return
|
|
2372
|
+
return Vr('"use strict"; return (' + t + ").constructor;")();
|
|
2383
2373
|
} catch {
|
|
2384
2374
|
}
|
|
2385
2375
|
}, be = Object.getOwnPropertyDescriptor;
|
|
@@ -2432,7 +2422,7 @@ var pt = function() {
|
|
|
2432
2422
|
"%Float32Array%": typeof Float32Array > "u" ? T : Float32Array,
|
|
2433
2423
|
"%Float64Array%": typeof Float64Array > "u" ? T : Float64Array,
|
|
2434
2424
|
"%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? T : FinalizationRegistry,
|
|
2435
|
-
"%Function%":
|
|
2425
|
+
"%Function%": Vr,
|
|
2436
2426
|
"%GeneratorFunction%": we,
|
|
2437
2427
|
"%Int8Array%": typeof Int8Array > "u" ? T : Int8Array,
|
|
2438
2428
|
"%Int16Array%": typeof Int16Array > "u" ? T : Int16Array,
|
|
@@ -2492,8 +2482,8 @@ var Ia = function t(e) {
|
|
|
2492
2482
|
var o = t("%AsyncGeneratorFunction%");
|
|
2493
2483
|
o && (r = o.prototype);
|
|
2494
2484
|
} else if (e === "%AsyncIteratorPrototype%") {
|
|
2495
|
-
var
|
|
2496
|
-
|
|
2485
|
+
var c = t("%AsyncGenerator%");
|
|
2486
|
+
c && F && (r = F(c.prototype));
|
|
2497
2487
|
}
|
|
2498
2488
|
return ve[e] = r, r;
|
|
2499
2489
|
}, ur = {
|
|
@@ -2549,24 +2539,24 @@ var Ia = function t(e) {
|
|
|
2549
2539
|
"%URIErrorPrototype%": ["URIError", "prototype"],
|
|
2550
2540
|
"%WeakMapPrototype%": ["WeakMap", "prototype"],
|
|
2551
2541
|
"%WeakSetPrototype%": ["WeakSet", "prototype"]
|
|
2552
|
-
}, Be =
|
|
2542
|
+
}, Be = Lt, tt = Oa, La = Be.call(Function.call, Array.prototype.concat), Ua = Be.call(Function.apply, Array.prototype.splice), fr = Be.call(Function.call, String.prototype.replace), rt = Be.call(Function.call, String.prototype.slice), _a = Be.call(Function.call, RegExp.prototype.exec), Fa = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, Ha = /\\(\\)?/g, Ba = function(e) {
|
|
2553
2543
|
var r = rt(e, 0, 1), o = rt(e, -1);
|
|
2554
2544
|
if (r === "%" && o !== "%")
|
|
2555
2545
|
throw new Pe("invalid intrinsic syntax, expected closing `%`");
|
|
2556
2546
|
if (o === "%" && r !== "%")
|
|
2557
2547
|
throw new Pe("invalid intrinsic syntax, expected opening `%`");
|
|
2558
|
-
var
|
|
2559
|
-
return fr(e, Fa, function(a, n, i,
|
|
2560
|
-
|
|
2561
|
-
}),
|
|
2548
|
+
var c = [];
|
|
2549
|
+
return fr(e, Fa, function(a, n, i, s) {
|
|
2550
|
+
c[c.length] = i ? fr(s, Ha, "$1") : n || a;
|
|
2551
|
+
}), c;
|
|
2562
2552
|
}, Ma = function(e, r) {
|
|
2563
|
-
var o = e,
|
|
2564
|
-
if (tt(ur, o) && (
|
|
2553
|
+
var o = e, c;
|
|
2554
|
+
if (tt(ur, o) && (c = ur[o], o = "%" + c[0] + "%"), tt(ve, o)) {
|
|
2565
2555
|
var a = ve[o];
|
|
2566
2556
|
if (a === we && (a = Ia(o)), typeof a > "u" && !r)
|
|
2567
2557
|
throw new je("intrinsic " + e + " exists, but is not available. Please file an issue!");
|
|
2568
2558
|
return {
|
|
2569
|
-
alias:
|
|
2559
|
+
alias: c,
|
|
2570
2560
|
name: o,
|
|
2571
2561
|
value: a
|
|
2572
2562
|
};
|
|
@@ -2579,13 +2569,13 @@ var Ia = function t(e) {
|
|
|
2579
2569
|
throw new je('"allowMissing" argument must be a boolean');
|
|
2580
2570
|
if (_a(/^%?[^%]*%?$/, e) === null)
|
|
2581
2571
|
throw new Pe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
|
|
2582
|
-
var o = Ba(e),
|
|
2583
|
-
l && (
|
|
2572
|
+
var o = Ba(e), c = o.length > 0 ? o[0] : "", a = Ma("%" + c + "%", r), n = a.name, i = a.value, s = !1, l = a.alias;
|
|
2573
|
+
l && (c = l[0], Ua(o, La([0, 1], l)));
|
|
2584
2574
|
for (var u = 1, p = !0; u < o.length; u += 1) {
|
|
2585
2575
|
var f = o[u], d = rt(f, 0, 1), h = rt(f, -1);
|
|
2586
2576
|
if ((d === '"' || d === "'" || d === "`" || h === '"' || h === "'" || h === "`") && d !== h)
|
|
2587
2577
|
throw new Pe("property names with quotes must have matching quotes");
|
|
2588
|
-
if ((f === "constructor" || !p) && (
|
|
2578
|
+
if ((f === "constructor" || !p) && (s = !0), c += "." + f, n = "%" + c + "%", tt(ve, n))
|
|
2589
2579
|
i = ve[n];
|
|
2590
2580
|
else if (i != null) {
|
|
2591
2581
|
if (!(f in i)) {
|
|
@@ -2598,12 +2588,12 @@ var Ia = function t(e) {
|
|
|
2598
2588
|
p = !!m, p && "get" in m && !("originalValue" in m.get) ? i = m.get : i = i[f];
|
|
2599
2589
|
} else
|
|
2600
2590
|
p = tt(i, f), i = i[f];
|
|
2601
|
-
p && !
|
|
2591
|
+
p && !s && (ve[n] = i);
|
|
2602
2592
|
}
|
|
2603
2593
|
}
|
|
2604
2594
|
return i;
|
|
2605
|
-
},
|
|
2606
|
-
function
|
|
2595
|
+
}, Kr = { exports: {} }, dt, pr;
|
|
2596
|
+
function Ut() {
|
|
2607
2597
|
if (pr) return dt;
|
|
2608
2598
|
pr = 1;
|
|
2609
2599
|
var t = Ce, e = t("%Object.defineProperty%", !0) || !1;
|
|
@@ -2622,7 +2612,7 @@ if (Ke)
|
|
|
2622
2612
|
} catch {
|
|
2623
2613
|
Ke = null;
|
|
2624
2614
|
}
|
|
2625
|
-
var
|
|
2615
|
+
var Qr = Ke, dr = Ut(), Ja = Gr, xe = He, hr = Qr, za = function(e, r, o) {
|
|
2626
2616
|
if (!e || typeof e != "object" && typeof e != "function")
|
|
2627
2617
|
throw new xe("`obj` must be an object or a function`");
|
|
2628
2618
|
if (typeof r != "string" && typeof r != "symbol")
|
|
@@ -2635,22 +2625,22 @@ var Dr = Ke, dr = Lt(), za = Vr, xe = He, hr = Dr, Ja = function(e, r, o) {
|
|
|
2635
2625
|
throw new xe("`nonConfigurable`, if provided, must be a boolean or null");
|
|
2636
2626
|
if (arguments.length > 6 && typeof arguments[6] != "boolean")
|
|
2637
2627
|
throw new xe("`loose`, if provided, must be a boolean");
|
|
2638
|
-
var
|
|
2628
|
+
var c = arguments.length > 3 ? arguments[3] : null, a = arguments.length > 4 ? arguments[4] : null, n = arguments.length > 5 ? arguments[5] : null, i = arguments.length > 6 ? arguments[6] : !1, s = !!hr && hr(e, r);
|
|
2639
2629
|
if (dr)
|
|
2640
2630
|
dr(e, r, {
|
|
2641
|
-
configurable: n === null &&
|
|
2642
|
-
enumerable:
|
|
2631
|
+
configurable: n === null && s ? s.configurable : !n,
|
|
2632
|
+
enumerable: c === null && s ? s.enumerable : !c,
|
|
2643
2633
|
value: o,
|
|
2644
|
-
writable: a === null &&
|
|
2634
|
+
writable: a === null && s ? s.writable : !a
|
|
2645
2635
|
});
|
|
2646
|
-
else if (i || !
|
|
2636
|
+
else if (i || !c && !a && !n)
|
|
2647
2637
|
e[r] = o;
|
|
2648
2638
|
else
|
|
2649
|
-
throw new
|
|
2650
|
-
}, jt =
|
|
2639
|
+
throw new Ja("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");
|
|
2640
|
+
}, jt = Ut(), Dr = function() {
|
|
2651
2641
|
return !!jt;
|
|
2652
2642
|
};
|
|
2653
|
-
|
|
2643
|
+
Dr.hasArrayLengthDefineBug = function() {
|
|
2654
2644
|
if (!jt)
|
|
2655
2645
|
return null;
|
|
2656
2646
|
try {
|
|
@@ -2659,17 +2649,17 @@ Yr.hasArrayLengthDefineBug = function() {
|
|
|
2659
2649
|
return !0;
|
|
2660
2650
|
}
|
|
2661
2651
|
};
|
|
2662
|
-
var Ga =
|
|
2652
|
+
var Ga = Dr, Va = Ce, yr = za, Ka = Ga(), mr = Qr, gr = He, Qa = Va("%Math.floor%"), Da = function(e, r) {
|
|
2663
2653
|
if (typeof e != "function")
|
|
2664
2654
|
throw new gr("`fn` is not a function");
|
|
2665
2655
|
if (typeof r != "number" || r < 0 || r > 4294967295 || Qa(r) !== r)
|
|
2666
2656
|
throw new gr("`length` must be a positive 32-bit integer");
|
|
2667
|
-
var o = arguments.length > 2 && !!arguments[2],
|
|
2657
|
+
var o = arguments.length > 2 && !!arguments[2], c = !0, a = !0;
|
|
2668
2658
|
if ("length" in e && mr) {
|
|
2669
2659
|
var n = mr(e, "length");
|
|
2670
|
-
n && !n.configurable && (
|
|
2660
|
+
n && !n.configurable && (c = !1), n && !n.writable && (a = !1);
|
|
2671
2661
|
}
|
|
2672
|
-
return (
|
|
2662
|
+
return (c || a || !o) && (Ka ? yr(
|
|
2673
2663
|
/** @type {Parameters<define>[0]} */
|
|
2674
2664
|
e,
|
|
2675
2665
|
"length",
|
|
@@ -2684,10 +2674,10 @@ var Ga = Yr, Va = Ce, yr = Ja, Ka = Ga(), mr = Dr, gr = He, Qa = Va("%Math.floor
|
|
|
2684
2674
|
)), e;
|
|
2685
2675
|
};
|
|
2686
2676
|
(function(t) {
|
|
2687
|
-
var e =
|
|
2677
|
+
var e = Lt, r = Ce, o = Da, c = He, a = r("%Function.prototype.apply%"), n = r("%Function.prototype.call%"), i = r("%Reflect.apply%", !0) || e.call(n, a), s = Ut(), l = r("%Math.max%");
|
|
2688
2678
|
t.exports = function(f) {
|
|
2689
2679
|
if (typeof f != "function")
|
|
2690
|
-
throw new
|
|
2680
|
+
throw new c("a function is required");
|
|
2691
2681
|
var d = i(e, n, arguments);
|
|
2692
2682
|
return o(
|
|
2693
2683
|
d,
|
|
@@ -2698,33 +2688,33 @@ var Ga = Yr, Va = Ce, yr = Ja, Ka = Ga(), mr = Dr, gr = He, Qa = Va("%Math.floor
|
|
|
2698
2688
|
var u = function() {
|
|
2699
2689
|
return i(e, a, arguments);
|
|
2700
2690
|
};
|
|
2701
|
-
|
|
2702
|
-
})(
|
|
2703
|
-
var Ya =
|
|
2704
|
-
var o =
|
|
2705
|
-
return typeof o == "function" && Xa(e, ".prototype.") > -1 ?
|
|
2691
|
+
s ? s(t.exports, "apply", { value: u }) : t.exports.apply = u;
|
|
2692
|
+
})(Kr);
|
|
2693
|
+
var Ya = Kr.exports, Yr = Ce, Xr = Ya, Xa = Xr(Yr("String.prototype.indexOf")), Za = function(e, r) {
|
|
2694
|
+
var o = Yr(e, !!r);
|
|
2695
|
+
return typeof o == "function" && Xa(e, ".prototype.") > -1 ? Xr(o) : o;
|
|
2706
2696
|
};
|
|
2707
2697
|
const ei = {}, ti = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2708
2698
|
__proto__: null,
|
|
2709
2699
|
default: ei
|
|
2710
|
-
}, Symbol.toStringTag, { value: "Module" })), ri = /* @__PURE__ */
|
|
2711
|
-
var _t = typeof Map == "function" && Map.prototype, ht = Object.getOwnPropertyDescriptor && _t ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null, nt = _t && ht && typeof ht.get == "function" ? ht.get : null, br = _t && Map.prototype.forEach, Ft = typeof Set == "function" && Set.prototype, yt = Object.getOwnPropertyDescriptor && Ft ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null, ot = Ft && yt && typeof yt.get == "function" ? yt.get : null, vr = Ft && Set.prototype.forEach, ni = typeof WeakMap == "function" && WeakMap.prototype, qe = ni ? WeakMap.prototype.has : null, oi = typeof WeakSet == "function" && WeakSet.prototype, Ie = oi ? WeakSet.prototype.has : null, ai = typeof WeakRef == "function" && WeakRef.prototype, $r = ai ? WeakRef.prototype.deref : null, ii = Boolean.prototype.valueOf, si = Object.prototype.toString, ci = Function.prototype.toString, li = String.prototype.match, Ht = String.prototype.slice, he = String.prototype.replace, ui = String.prototype.toUpperCase, xr = String.prototype.toLowerCase,
|
|
2700
|
+
}, Symbol.toStringTag, { value: "Module" })), ri = /* @__PURE__ */ Nn(ti);
|
|
2701
|
+
var _t = typeof Map == "function" && Map.prototype, ht = Object.getOwnPropertyDescriptor && _t ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null, nt = _t && ht && typeof ht.get == "function" ? ht.get : null, br = _t && Map.prototype.forEach, Ft = typeof Set == "function" && Set.prototype, yt = Object.getOwnPropertyDescriptor && Ft ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null, ot = Ft && yt && typeof yt.get == "function" ? yt.get : null, vr = Ft && Set.prototype.forEach, ni = typeof WeakMap == "function" && WeakMap.prototype, qe = ni ? WeakMap.prototype.has : null, oi = typeof WeakSet == "function" && WeakSet.prototype, Ie = oi ? WeakSet.prototype.has : null, ai = typeof WeakRef == "function" && WeakRef.prototype, $r = ai ? WeakRef.prototype.deref : null, ii = Boolean.prototype.valueOf, si = Object.prototype.toString, ci = Function.prototype.toString, li = String.prototype.match, Ht = String.prototype.slice, he = String.prototype.replace, ui = String.prototype.toUpperCase, xr = String.prototype.toLowerCase, Zr = RegExp.prototype.test, wr = Array.prototype.concat, se = Array.prototype.join, fi = Array.prototype.slice, Sr = Math.floor, Ot = typeof BigInt == "function" ? BigInt.prototype.valueOf : null, mt = Object.getOwnPropertySymbols, Tt = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Symbol.prototype.toString : null, ke = typeof Symbol == "function" && typeof Symbol.iterator == "object", G = typeof Symbol == "function" && Symbol.toStringTag && (typeof Symbol.toStringTag === ke || !0) ? Symbol.toStringTag : null, en = Object.prototype.propertyIsEnumerable, jr = (typeof Reflect == "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(t) {
|
|
2712
2702
|
return t.__proto__;
|
|
2713
2703
|
} : null);
|
|
2714
2704
|
function Or(t, e) {
|
|
2715
|
-
if (t === 1 / 0 || t === -1 / 0 || t !== t || t && t > -1e3 && t < 1e3 ||
|
|
2705
|
+
if (t === 1 / 0 || t === -1 / 0 || t !== t || t && t > -1e3 && t < 1e3 || Zr.call(/e/, e))
|
|
2716
2706
|
return e;
|
|
2717
2707
|
var r = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
|
|
2718
2708
|
if (typeof t == "number") {
|
|
2719
2709
|
var o = t < 0 ? -Sr(-t) : Sr(t);
|
|
2720
2710
|
if (o !== t) {
|
|
2721
|
-
var
|
|
2722
|
-
return he.call(
|
|
2711
|
+
var c = String(o), a = Ht.call(e, c.length + 1);
|
|
2712
|
+
return he.call(c, r, "$&_") + "." + he.call(he.call(a, /([0-9]{3})/g, "$&_"), /_$/, "");
|
|
2723
2713
|
}
|
|
2724
2714
|
}
|
|
2725
2715
|
return he.call(e, r, "$&_");
|
|
2726
2716
|
}
|
|
2727
|
-
var Pt = ri, Tr = Pt.custom, Pr =
|
|
2717
|
+
var Pt = ri, Tr = Pt.custom, Pr = rn(Tr) ? Tr : null, pi = function t(e, r, o, c) {
|
|
2728
2718
|
var a = r || {};
|
|
2729
2719
|
if (de(a, "quoteStyle") && a.quoteStyle !== "single" && a.quoteStyle !== "double")
|
|
2730
2720
|
throw new TypeError('option "quoteStyle" must be "single" or "double"');
|
|
@@ -2745,12 +2735,12 @@ var Pt = ri, Tr = Pt.custom, Pr = nn(Tr) ? Tr : null, pi = function t(e, r, o, s
|
|
|
2745
2735
|
if (typeof e == "boolean")
|
|
2746
2736
|
return e ? "true" : "false";
|
|
2747
2737
|
if (typeof e == "string")
|
|
2748
|
-
return
|
|
2738
|
+
return on(e, a);
|
|
2749
2739
|
if (typeof e == "number") {
|
|
2750
2740
|
if (e === 0)
|
|
2751
2741
|
return 1 / 0 / e > 0 ? "0" : "-0";
|
|
2752
|
-
var
|
|
2753
|
-
return i ? Or(e,
|
|
2742
|
+
var s = String(e);
|
|
2743
|
+
return i ? Or(e, s) : s;
|
|
2754
2744
|
}
|
|
2755
2745
|
if (typeof e == "bigint") {
|
|
2756
2746
|
var l = String(e) + "n";
|
|
@@ -2760,41 +2750,41 @@ var Pt = ri, Tr = Pt.custom, Pr = nn(Tr) ? Tr : null, pi = function t(e, r, o, s
|
|
|
2760
2750
|
if (typeof o > "u" && (o = 0), o >= u && u > 0 && typeof e == "object")
|
|
2761
2751
|
return kt(e) ? "[Array]" : "[Object]";
|
|
2762
2752
|
var p = Ci(a, o);
|
|
2763
|
-
if (typeof
|
|
2764
|
-
|
|
2765
|
-
else if (
|
|
2753
|
+
if (typeof c > "u")
|
|
2754
|
+
c = [];
|
|
2755
|
+
else if (nn(c, e) >= 0)
|
|
2766
2756
|
return "[Circular]";
|
|
2767
|
-
function f(
|
|
2768
|
-
if (V && (
|
|
2757
|
+
function f(L, V, K) {
|
|
2758
|
+
if (V && (c = fi.call(c), c.push(V)), K) {
|
|
2769
2759
|
var D = {
|
|
2770
2760
|
depth: a.depth
|
|
2771
2761
|
};
|
|
2772
|
-
return de(a, "quoteStyle") && (D.quoteStyle = a.quoteStyle), t(
|
|
2762
|
+
return de(a, "quoteStyle") && (D.quoteStyle = a.quoteStyle), t(L, D, o + 1, c);
|
|
2773
2763
|
}
|
|
2774
|
-
return t(
|
|
2764
|
+
return t(L, a, o + 1, c);
|
|
2775
2765
|
}
|
|
2776
2766
|
if (typeof e == "function" && !kr(e)) {
|
|
2777
2767
|
var d = xi(e), h = We(e, f);
|
|
2778
|
-
return "[Function" + (d ? ": " + d : " (anonymous)") + "]" + (h.length > 0 ? " { " +
|
|
2768
|
+
return "[Function" + (d ? ": " + d : " (anonymous)") + "]" + (h.length > 0 ? " { " + se.call(h, ", ") + " }" : "");
|
|
2779
2769
|
}
|
|
2780
|
-
if (
|
|
2770
|
+
if (rn(e)) {
|
|
2781
2771
|
var m = ke ? he.call(String(e), /^(Symbol\(.*\))_[^)]*$/, "$1") : Tt.call(e);
|
|
2782
2772
|
return typeof e == "object" && !ke ? Re(m) : m;
|
|
2783
2773
|
}
|
|
2784
2774
|
if (Pi(e)) {
|
|
2785
2775
|
for (var b = "<" + xr.call(String(e.nodeName)), v = e.attributes || [], y = 0; y < v.length; y++)
|
|
2786
|
-
b += " " + v[y].name + "=" +
|
|
2776
|
+
b += " " + v[y].name + "=" + tn(di(v[y].value), "double", a);
|
|
2787
2777
|
return b += ">", e.childNodes && e.childNodes.length && (b += "..."), b += "</" + xr.call(String(e.nodeName)) + ">", b;
|
|
2788
2778
|
}
|
|
2789
2779
|
if (kt(e)) {
|
|
2790
2780
|
if (e.length === 0)
|
|
2791
2781
|
return "[]";
|
|
2792
2782
|
var $ = We(e, f);
|
|
2793
|
-
return p && !Ei($) ? "[" + Et($, p) + "]" : "[ " +
|
|
2783
|
+
return p && !Ei($) ? "[" + Et($, p) + "]" : "[ " + se.call($, ", ") + " ]";
|
|
2794
2784
|
}
|
|
2795
2785
|
if (yi(e)) {
|
|
2796
2786
|
var S = We(e, f);
|
|
2797
|
-
return !("cause" in Error.prototype) && "cause" in e && !
|
|
2787
|
+
return !("cause" in Error.prototype) && "cause" in e && !en.call(e, "cause") ? "{ [" + String(e) + "] " + se.call(wr.call("[cause]: " + f(e.cause), S), ", ") + " }" : S.length === 0 ? "[" + String(e) + "]" : "{ [" + String(e) + "] " + se.call(S, ", ") + " }";
|
|
2798
2788
|
}
|
|
2799
2789
|
if (typeof e == "object" && n) {
|
|
2800
2790
|
if (Pr && typeof e[Pr] == "function" && Pt)
|
|
@@ -2804,14 +2794,14 @@ var Pt = ri, Tr = Pt.custom, Pr = nn(Tr) ? Tr : null, pi = function t(e, r, o, s
|
|
|
2804
2794
|
}
|
|
2805
2795
|
if (wi(e)) {
|
|
2806
2796
|
var w = [];
|
|
2807
|
-
return br && br.call(e, function(
|
|
2808
|
-
w.push(f(V, e, !0) + " => " + f(
|
|
2797
|
+
return br && br.call(e, function(L, V) {
|
|
2798
|
+
w.push(f(V, e, !0) + " => " + f(L, e));
|
|
2809
2799
|
}), Er("Map", nt.call(e), w, p);
|
|
2810
2800
|
}
|
|
2811
2801
|
if (Oi(e)) {
|
|
2812
2802
|
var j = [];
|
|
2813
|
-
return vr && vr.call(e, function(
|
|
2814
|
-
j.push(f(
|
|
2803
|
+
return vr && vr.call(e, function(L) {
|
|
2804
|
+
j.push(f(L, e));
|
|
2815
2805
|
}), Er("Set", ot.call(e), j, p);
|
|
2816
2806
|
}
|
|
2817
2807
|
if (Si(e))
|
|
@@ -2833,12 +2823,12 @@ var Pt = ri, Tr = Pt.custom, Pr = nn(Tr) ? Tr : null, pi = function t(e, r, o, s
|
|
|
2833
2823
|
if (e === Ge)
|
|
2834
2824
|
return "{ [object globalThis] }";
|
|
2835
2825
|
if (!hi(e) && !kr(e)) {
|
|
2836
|
-
var N = We(e, f), E = jr ? jr(e) === Object.prototype : e instanceof Object || e.constructor === Object, R = e instanceof Object ? "" : "null prototype", _ = !E && G && Object(e) === e && G in e ? Ht.call(ye(e), 8, -1) : R ? "Object" : "",
|
|
2837
|
-
return N.length === 0 ?
|
|
2826
|
+
var N = We(e, f), E = jr ? jr(e) === Object.prototype : e instanceof Object || e.constructor === Object, R = e instanceof Object ? "" : "null prototype", _ = !E && G && Object(e) === e && G in e ? Ht.call(ye(e), 8, -1) : R ? "Object" : "", Z = E || typeof e.constructor != "function" ? "" : e.constructor.name ? e.constructor.name + " " : "", ee = Z + (_ || R ? "[" + se.call(wr.call([], _ || [], R || []), ": ") + "] " : "");
|
|
2827
|
+
return N.length === 0 ? ee + "{}" : p ? ee + "{" + Et(N, p) + "}" : ee + "{ " + se.call(N, ", ") + " }";
|
|
2838
2828
|
}
|
|
2839
2829
|
return String(e);
|
|
2840
2830
|
};
|
|
2841
|
-
function
|
|
2831
|
+
function tn(t, e, r) {
|
|
2842
2832
|
var o = (r.quoteStyle || e) === "double" ? '"' : "'";
|
|
2843
2833
|
return o + t + o;
|
|
2844
2834
|
}
|
|
@@ -2866,7 +2856,7 @@ function gi(t) {
|
|
|
2866
2856
|
function bi(t) {
|
|
2867
2857
|
return ye(t) === "[object Boolean]" && (!G || !(typeof t == "object" && G in t));
|
|
2868
2858
|
}
|
|
2869
|
-
function
|
|
2859
|
+
function rn(t) {
|
|
2870
2860
|
if (ke)
|
|
2871
2861
|
return t && typeof t == "object" && t instanceof Symbol;
|
|
2872
2862
|
if (typeof t == "symbol")
|
|
@@ -2903,7 +2893,7 @@ function xi(t) {
|
|
|
2903
2893
|
var e = li.call(ci.call(t), /^function\s*([\w$]+)/);
|
|
2904
2894
|
return e ? e[1] : null;
|
|
2905
2895
|
}
|
|
2906
|
-
function
|
|
2896
|
+
function nn(t, e) {
|
|
2907
2897
|
if (t.indexOf)
|
|
2908
2898
|
return t.indexOf(e);
|
|
2909
2899
|
for (var r = 0, o = t.length; r < o; r++)
|
|
@@ -2983,13 +2973,13 @@ function Ti(t) {
|
|
|
2983
2973
|
function Pi(t) {
|
|
2984
2974
|
return !t || typeof t != "object" ? !1 : typeof HTMLElement < "u" && t instanceof HTMLElement ? !0 : typeof t.nodeName == "string" && typeof t.getAttribute == "function";
|
|
2985
2975
|
}
|
|
2986
|
-
function
|
|
2976
|
+
function on(t, e) {
|
|
2987
2977
|
if (t.length > e.maxStringLength) {
|
|
2988
2978
|
var r = t.length - e.maxStringLength, o = "... " + r + " more character" + (r > 1 ? "s" : "");
|
|
2989
|
-
return
|
|
2979
|
+
return on(Ht.call(t, 0, e.maxStringLength), e) + o;
|
|
2990
2980
|
}
|
|
2991
|
-
var
|
|
2992
|
-
return
|
|
2981
|
+
var c = he.call(he.call(t, /(['\\])/g, "\\$1"), /[\x00-\x1f]/g, ki);
|
|
2982
|
+
return tn(c, "single", e);
|
|
2993
2983
|
}
|
|
2994
2984
|
function ki(t) {
|
|
2995
2985
|
var e = t.charCodeAt(0), r = {
|
|
@@ -3008,12 +2998,12 @@ function gt(t) {
|
|
|
3008
2998
|
return t + " { ? }";
|
|
3009
2999
|
}
|
|
3010
3000
|
function Er(t, e, r, o) {
|
|
3011
|
-
var
|
|
3012
|
-
return t + " (" + e + ") {" +
|
|
3001
|
+
var c = o ? Et(r, o) : se.call(r, ", ");
|
|
3002
|
+
return t + " (" + e + ") {" + c + "}";
|
|
3013
3003
|
}
|
|
3014
3004
|
function Ei(t) {
|
|
3015
3005
|
for (var e = 0; e < t.length; e++)
|
|
3016
|
-
if (
|
|
3006
|
+
if (nn(t[e], `
|
|
3017
3007
|
`) >= 0)
|
|
3018
3008
|
return !1;
|
|
3019
3009
|
return !0;
|
|
@@ -3023,12 +3013,12 @@ function Ci(t, e) {
|
|
|
3023
3013
|
if (t.indent === " ")
|
|
3024
3014
|
r = " ";
|
|
3025
3015
|
else if (typeof t.indent == "number" && t.indent > 0)
|
|
3026
|
-
r =
|
|
3016
|
+
r = se.call(Array(t.indent + 1), " ");
|
|
3027
3017
|
else
|
|
3028
3018
|
return null;
|
|
3029
3019
|
return {
|
|
3030
3020
|
base: r,
|
|
3031
|
-
prev:
|
|
3021
|
+
prev: se.call(Array(e + 1), r)
|
|
3032
3022
|
};
|
|
3033
3023
|
}
|
|
3034
3024
|
function Et(t, e) {
|
|
@@ -3036,15 +3026,15 @@ function Et(t, e) {
|
|
|
3036
3026
|
return "";
|
|
3037
3027
|
var r = `
|
|
3038
3028
|
` + e.prev + e.base;
|
|
3039
|
-
return r +
|
|
3029
|
+
return r + se.call(t, "," + r) + `
|
|
3040
3030
|
` + e.prev;
|
|
3041
3031
|
}
|
|
3042
3032
|
function We(t, e) {
|
|
3043
3033
|
var r = kt(t), o = [];
|
|
3044
3034
|
if (r) {
|
|
3045
3035
|
o.length = t.length;
|
|
3046
|
-
for (var
|
|
3047
|
-
o[
|
|
3036
|
+
for (var c = 0; c < t.length; c++)
|
|
3037
|
+
o[c] = de(t, c) ? e(t[c], t) : "";
|
|
3048
3038
|
}
|
|
3049
3039
|
var a = typeof mt == "function" ? mt(t) : [], n;
|
|
3050
3040
|
if (ke) {
|
|
@@ -3052,14 +3042,14 @@ function We(t, e) {
|
|
|
3052
3042
|
for (var i = 0; i < a.length; i++)
|
|
3053
3043
|
n["$" + a[i]] = a[i];
|
|
3054
3044
|
}
|
|
3055
|
-
for (var
|
|
3056
|
-
de(t,
|
|
3045
|
+
for (var s in t)
|
|
3046
|
+
de(t, s) && (r && String(Number(s)) === s && s < t.length || ke && n["$" + s] instanceof Symbol || (Zr.call(/[^\w$]/, s) ? o.push(e(s, t) + ": " + e(t[s], t)) : o.push(s + ": " + e(t[s], t))));
|
|
3057
3047
|
if (typeof mt == "function")
|
|
3058
3048
|
for (var l = 0; l < a.length; l++)
|
|
3059
|
-
|
|
3049
|
+
en.call(t, a[l]) && o.push("[" + e(a[l]) + "]: " + e(t[a[l]], t));
|
|
3060
3050
|
return o;
|
|
3061
3051
|
}
|
|
3062
|
-
var
|
|
3052
|
+
var an = Ce, Ne = Za, Ni = pi, Ri = He, Je = an("%WeakMap%", !0), ze = an("%Map%", !0), Ai = Ne("WeakMap.prototype.get", !0), qi = Ne("WeakMap.prototype.set", !0), Ii = Ne("WeakMap.prototype.has", !0), Li = Ne("Map.prototype.get", !0), Ui = Ne("Map.prototype.set", !0), _i = Ne("Map.prototype.has", !0), Bt = function(t, e) {
|
|
3063
3053
|
for (var r = t, o; (o = r.next) !== null; r = o)
|
|
3064
3054
|
if (o.key === e)
|
|
3065
3055
|
return r.next = o.next, o.next = /** @type {NonNullable<typeof list.next>} */
|
|
@@ -3079,26 +3069,26 @@ var sn = Ce, Ne = Za, Ni = pi, Ri = He, ze = sn("%WeakMap%", !0), Je = sn("%Map%
|
|
|
3079
3069
|
}, Bi = function(t, e) {
|
|
3080
3070
|
return !!Bt(t, e);
|
|
3081
3071
|
}, Mi = function() {
|
|
3082
|
-
var e, r, o,
|
|
3072
|
+
var e, r, o, c = {
|
|
3083
3073
|
assert: function(a) {
|
|
3084
|
-
if (!
|
|
3074
|
+
if (!c.has(a))
|
|
3085
3075
|
throw new Ri("Side channel does not contain " + Ni(a));
|
|
3086
3076
|
},
|
|
3087
3077
|
get: function(a) {
|
|
3088
|
-
if (
|
|
3078
|
+
if (Je && a && (typeof a == "object" || typeof a == "function")) {
|
|
3089
3079
|
if (e)
|
|
3090
3080
|
return Ai(e, a);
|
|
3091
|
-
} else if (
|
|
3081
|
+
} else if (ze) {
|
|
3092
3082
|
if (r)
|
|
3093
|
-
return
|
|
3083
|
+
return Li(r, a);
|
|
3094
3084
|
} else if (o)
|
|
3095
3085
|
return Fi(o, a);
|
|
3096
3086
|
},
|
|
3097
3087
|
has: function(a) {
|
|
3098
|
-
if (
|
|
3088
|
+
if (Je && a && (typeof a == "object" || typeof a == "function")) {
|
|
3099
3089
|
if (e)
|
|
3100
3090
|
return Ii(e, a);
|
|
3101
|
-
} else if (
|
|
3091
|
+
} else if (ze) {
|
|
3102
3092
|
if (r)
|
|
3103
3093
|
return _i(r, a);
|
|
3104
3094
|
} else if (o)
|
|
@@ -3106,18 +3096,18 @@ var sn = Ce, Ne = Za, Ni = pi, Ri = He, ze = sn("%WeakMap%", !0), Je = sn("%Map%
|
|
|
3106
3096
|
return !1;
|
|
3107
3097
|
},
|
|
3108
3098
|
set: function(a, n) {
|
|
3109
|
-
|
|
3099
|
+
Je && a && (typeof a == "object" || typeof a == "function") ? (e || (e = new Je()), qi(e, a, n)) : ze ? (r || (r = new ze()), Ui(r, a, n)) : (o || (o = { key: {}, next: null }), Hi(o, a, n));
|
|
3110
3100
|
}
|
|
3111
3101
|
};
|
|
3112
|
-
return
|
|
3113
|
-
}, Wi = String.prototype.replace,
|
|
3102
|
+
return c;
|
|
3103
|
+
}, Wi = String.prototype.replace, Ji = /%20/g, bt = {
|
|
3114
3104
|
RFC1738: "RFC1738",
|
|
3115
3105
|
RFC3986: "RFC3986"
|
|
3116
3106
|
}, Mt = {
|
|
3117
3107
|
default: bt.RFC3986,
|
|
3118
3108
|
formatters: {
|
|
3119
3109
|
RFC1738: function(t) {
|
|
3120
|
-
return Wi.call(t,
|
|
3110
|
+
return Wi.call(t, Ji, "+");
|
|
3121
3111
|
},
|
|
3122
3112
|
RFC3986: function(t) {
|
|
3123
3113
|
return String(t);
|
|
@@ -3125,7 +3115,7 @@ var sn = Ce, Ne = Za, Ni = pi, Ri = He, ze = sn("%WeakMap%", !0), Je = sn("%Map%
|
|
|
3125
3115
|
},
|
|
3126
3116
|
RFC1738: bt.RFC1738,
|
|
3127
3117
|
RFC3986: bt.RFC3986
|
|
3128
|
-
},
|
|
3118
|
+
}, zi = Mt, vt = Object.prototype.hasOwnProperty, ge = Array.isArray, ae = function() {
|
|
3129
3119
|
for (var t = [], e = 0; e < 256; ++e)
|
|
3130
3120
|
t.push("%" + ((e < 16 ? "0" : "") + e.toString(16)).toUpperCase());
|
|
3131
3121
|
return t;
|
|
@@ -3133,14 +3123,14 @@ var sn = Ce, Ne = Za, Ni = pi, Ri = He, ze = sn("%WeakMap%", !0), Je = sn("%Map%
|
|
|
3133
3123
|
for (; e.length > 1; ) {
|
|
3134
3124
|
var r = e.pop(), o = r.obj[r.prop];
|
|
3135
3125
|
if (ge(o)) {
|
|
3136
|
-
for (var
|
|
3137
|
-
typeof o[a] < "u" &&
|
|
3138
|
-
r.obj[r.prop] =
|
|
3126
|
+
for (var c = [], a = 0; a < o.length; ++a)
|
|
3127
|
+
typeof o[a] < "u" && c.push(o[a]);
|
|
3128
|
+
r.obj[r.prop] = c;
|
|
3139
3129
|
}
|
|
3140
3130
|
}
|
|
3141
|
-
},
|
|
3142
|
-
for (var o = r && r.plainObjects ? /* @__PURE__ */ Object.create(null) : {},
|
|
3143
|
-
typeof e[
|
|
3131
|
+
}, sn = function(e, r) {
|
|
3132
|
+
for (var o = r && r.plainObjects ? /* @__PURE__ */ Object.create(null) : {}, c = 0; c < e.length; ++c)
|
|
3133
|
+
typeof e[c] < "u" && (o[c] = e[c]);
|
|
3144
3134
|
return o;
|
|
3145
3135
|
}, Vi = function t(e, r, o) {
|
|
3146
3136
|
if (!r)
|
|
@@ -3156,8 +3146,8 @@ var sn = Ce, Ne = Za, Ni = pi, Ri = He, ze = sn("%WeakMap%", !0), Je = sn("%Map%
|
|
|
3156
3146
|
}
|
|
3157
3147
|
if (!e || typeof e != "object")
|
|
3158
3148
|
return [e].concat(r);
|
|
3159
|
-
var
|
|
3160
|
-
return ge(e) && !ge(r) && (
|
|
3149
|
+
var c = e;
|
|
3150
|
+
return ge(e) && !ge(r) && (c = sn(e, o)), ge(e) && ge(r) ? (r.forEach(function(a, n) {
|
|
3161
3151
|
if (vt.call(e, n)) {
|
|
3162
3152
|
var i = e[n];
|
|
3163
3153
|
i && typeof i == "object" && a && typeof a == "object" ? e[n] = t(i, a, o) : e.push(a);
|
|
@@ -3166,10 +3156,10 @@ var sn = Ce, Ne = Za, Ni = pi, Ri = He, ze = sn("%WeakMap%", !0), Je = sn("%Map%
|
|
|
3166
3156
|
}), e) : Object.keys(r).reduce(function(a, n) {
|
|
3167
3157
|
var i = r[n];
|
|
3168
3158
|
return vt.call(a, n) ? a[n] = t(a[n], i, o) : a[n] = i, a;
|
|
3169
|
-
},
|
|
3159
|
+
}, c);
|
|
3170
3160
|
}, Ki = function(e, r) {
|
|
3171
|
-
return Object.keys(r).reduce(function(o,
|
|
3172
|
-
return o[
|
|
3161
|
+
return Object.keys(r).reduce(function(o, c) {
|
|
3162
|
+
return o[c] = r[c], o;
|
|
3173
3163
|
}, e);
|
|
3174
3164
|
}, Qi = function(t, e, r) {
|
|
3175
3165
|
var o = t.replace(/\+/g, " ");
|
|
@@ -3180,7 +3170,7 @@ var sn = Ce, Ne = Za, Ni = pi, Ri = He, ze = sn("%WeakMap%", !0), Je = sn("%Map%
|
|
|
3180
3170
|
} catch {
|
|
3181
3171
|
return o;
|
|
3182
3172
|
}
|
|
3183
|
-
}, $t = 1024, Di = function(e, r, o,
|
|
3173
|
+
}, $t = 1024, Di = function(e, r, o, c, a) {
|
|
3184
3174
|
if (e.length === 0)
|
|
3185
3175
|
return e;
|
|
3186
3176
|
var n = e;
|
|
@@ -3188,34 +3178,34 @@ var sn = Ce, Ne = Za, Ni = pi, Ri = He, ze = sn("%WeakMap%", !0), Je = sn("%Map%
|
|
|
3188
3178
|
return escape(n).replace(/%u[0-9a-f]{4}/gi, function(d) {
|
|
3189
3179
|
return "%26%23" + parseInt(d.slice(2), 16) + "%3B";
|
|
3190
3180
|
});
|
|
3191
|
-
for (var i = "",
|
|
3192
|
-
for (var l = n.length >= $t ? n.slice(
|
|
3181
|
+
for (var i = "", s = 0; s < n.length; s += $t) {
|
|
3182
|
+
for (var l = n.length >= $t ? n.slice(s, s + $t) : n, u = [], p = 0; p < l.length; ++p) {
|
|
3193
3183
|
var f = l.charCodeAt(p);
|
|
3194
|
-
if (f === 45 || f === 46 || f === 95 || f === 126 || f >= 48 && f <= 57 || f >= 65 && f <= 90 || f >= 97 && f <= 122 || a ===
|
|
3184
|
+
if (f === 45 || f === 46 || f === 95 || f === 126 || f >= 48 && f <= 57 || f >= 65 && f <= 90 || f >= 97 && f <= 122 || a === zi.RFC1738 && (f === 40 || f === 41)) {
|
|
3195
3185
|
u[u.length] = l.charAt(p);
|
|
3196
3186
|
continue;
|
|
3197
3187
|
}
|
|
3198
3188
|
if (f < 128) {
|
|
3199
|
-
u[u.length] =
|
|
3189
|
+
u[u.length] = ae[f];
|
|
3200
3190
|
continue;
|
|
3201
3191
|
}
|
|
3202
3192
|
if (f < 2048) {
|
|
3203
|
-
u[u.length] =
|
|
3193
|
+
u[u.length] = ae[192 | f >> 6] + ae[128 | f & 63];
|
|
3204
3194
|
continue;
|
|
3205
3195
|
}
|
|
3206
3196
|
if (f < 55296 || f >= 57344) {
|
|
3207
|
-
u[u.length] =
|
|
3197
|
+
u[u.length] = ae[224 | f >> 12] + ae[128 | f >> 6 & 63] + ae[128 | f & 63];
|
|
3208
3198
|
continue;
|
|
3209
3199
|
}
|
|
3210
|
-
p += 1, f = 65536 + ((f & 1023) << 10 | l.charCodeAt(p) & 1023), u[u.length] =
|
|
3200
|
+
p += 1, f = 65536 + ((f & 1023) << 10 | l.charCodeAt(p) & 1023), u[u.length] = ae[240 | f >> 18] + ae[128 | f >> 12 & 63] + ae[128 | f >> 6 & 63] + ae[128 | f & 63];
|
|
3211
3201
|
}
|
|
3212
3202
|
i += u.join("");
|
|
3213
3203
|
}
|
|
3214
3204
|
return i;
|
|
3215
3205
|
}, Yi = function(e) {
|
|
3216
|
-
for (var r = [{ obj: { o: e }, prop: "o" }], o = [],
|
|
3217
|
-
for (var a = r[
|
|
3218
|
-
var l = i[
|
|
3206
|
+
for (var r = [{ obj: { o: e }, prop: "o" }], o = [], c = 0; c < r.length; ++c)
|
|
3207
|
+
for (var a = r[c], n = a.obj[a.prop], i = Object.keys(n), s = 0; s < i.length; ++s) {
|
|
3208
|
+
var l = i[s], u = n[l];
|
|
3219
3209
|
typeof u == "object" && u !== null && o.indexOf(u) === -1 && (r.push({ obj: n, prop: l }), o.push(u));
|
|
3220
3210
|
}
|
|
3221
3211
|
return Gi(r), e;
|
|
@@ -3227,13 +3217,13 @@ var sn = Ce, Ne = Za, Ni = pi, Ri = He, ze = sn("%WeakMap%", !0), Je = sn("%Map%
|
|
|
3227
3217
|
return [].concat(e, r);
|
|
3228
3218
|
}, ts = function(e, r) {
|
|
3229
3219
|
if (ge(e)) {
|
|
3230
|
-
for (var o = [],
|
|
3231
|
-
o.push(r(e[
|
|
3220
|
+
for (var o = [], c = 0; c < e.length; c += 1)
|
|
3221
|
+
o.push(r(e[c]));
|
|
3232
3222
|
return o;
|
|
3233
3223
|
}
|
|
3234
3224
|
return r(e);
|
|
3235
|
-
},
|
|
3236
|
-
arrayToObject:
|
|
3225
|
+
}, cn = {
|
|
3226
|
+
arrayToObject: sn,
|
|
3237
3227
|
assign: Ki,
|
|
3238
3228
|
combine: es,
|
|
3239
3229
|
compact: Yi,
|
|
@@ -3243,7 +3233,7 @@ var sn = Ce, Ne = Za, Ni = pi, Ri = He, ze = sn("%WeakMap%", !0), Je = sn("%Map%
|
|
|
3243
3233
|
isRegExp: Xi,
|
|
3244
3234
|
maybeMap: ts,
|
|
3245
3235
|
merge: Vi
|
|
3246
|
-
},
|
|
3236
|
+
}, ln = Mi, Qe = cn, Le = Mt, rs = Object.prototype.hasOwnProperty, un = {
|
|
3247
3237
|
brackets: function(e) {
|
|
3248
3238
|
return e + "[]";
|
|
3249
3239
|
},
|
|
@@ -3254,9 +3244,9 @@ var sn = Ce, Ne = Za, Ni = pi, Ri = He, ze = sn("%WeakMap%", !0), Je = sn("%Map%
|
|
|
3254
3244
|
repeat: function(e) {
|
|
3255
3245
|
return e;
|
|
3256
3246
|
}
|
|
3257
|
-
},
|
|
3258
|
-
ns.apply(t,
|
|
3259
|
-
}, os = Date.prototype.toISOString, Cr =
|
|
3247
|
+
}, ie = Array.isArray, ns = Array.prototype.push, fn = function(t, e) {
|
|
3248
|
+
ns.apply(t, ie(e) ? e : [e]);
|
|
3249
|
+
}, os = Date.prototype.toISOString, Cr = Le.default, U = {
|
|
3260
3250
|
addQueryPrefix: !1,
|
|
3261
3251
|
allowDots: !1,
|
|
3262
3252
|
allowEmptyArrays: !1,
|
|
@@ -3269,7 +3259,7 @@ var sn = Ce, Ne = Za, Ni = pi, Ri = He, ze = sn("%WeakMap%", !0), Je = sn("%Map%
|
|
|
3269
3259
|
encoder: Qe.encode,
|
|
3270
3260
|
encodeValuesOnly: !1,
|
|
3271
3261
|
format: Cr,
|
|
3272
|
-
formatter:
|
|
3262
|
+
formatter: Le.formatters[Cr],
|
|
3273
3263
|
// deprecated
|
|
3274
3264
|
indices: !1,
|
|
3275
3265
|
serializeDate: function(e) {
|
|
@@ -3279,7 +3269,7 @@ var sn = Ce, Ne = Za, Ni = pi, Ri = He, ze = sn("%WeakMap%", !0), Je = sn("%Map%
|
|
|
3279
3269
|
strictNullHandling: !1
|
|
3280
3270
|
}, as = function(e) {
|
|
3281
3271
|
return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "symbol" || typeof e == "bigint";
|
|
3282
|
-
}, xt = {}, is = function t(e, r, o,
|
|
3272
|
+
}, xt = {}, is = function t(e, r, o, c, a, n, i, s, l, u, p, f, d, h, m, b, v, y) {
|
|
3283
3273
|
for (var $ = e, S = y, w = 0, j = !1; (S = S.get(xt)) !== void 0 && !j; ) {
|
|
3284
3274
|
var N = S.get(e);
|
|
3285
3275
|
if (w += 1, typeof N < "u") {
|
|
@@ -3289,17 +3279,17 @@ var sn = Ce, Ne = Za, Ni = pi, Ri = He, ze = sn("%WeakMap%", !0), Je = sn("%Map%
|
|
|
3289
3279
|
}
|
|
3290
3280
|
typeof S.get(xt) > "u" && (w = 0);
|
|
3291
3281
|
}
|
|
3292
|
-
if (typeof u == "function" ? $ = u(r, $) : $ instanceof Date ? $ = d($) : o === "comma" &&
|
|
3282
|
+
if (typeof u == "function" ? $ = u(r, $) : $ instanceof Date ? $ = d($) : o === "comma" && ie($) && ($ = Qe.maybeMap($, function(x) {
|
|
3293
3283
|
return x instanceof Date ? d(x) : x;
|
|
3294
3284
|
})), $ === null) {
|
|
3295
3285
|
if (n)
|
|
3296
|
-
return l && !b ? l(r,
|
|
3286
|
+
return l && !b ? l(r, U.encoder, v, "key", h) : r;
|
|
3297
3287
|
$ = "";
|
|
3298
3288
|
}
|
|
3299
3289
|
if (as($) || Qe.isBuffer($)) {
|
|
3300
3290
|
if (l) {
|
|
3301
|
-
var E = b ? r : l(r,
|
|
3302
|
-
return [m(E) + "=" + m(l($,
|
|
3291
|
+
var E = b ? r : l(r, U.encoder, v, "key", h);
|
|
3292
|
+
return [m(E) + "=" + m(l($, U.encoder, v, "value", h))];
|
|
3303
3293
|
}
|
|
3304
3294
|
return [m(r) + "=" + m(String($))];
|
|
3305
3295
|
}
|
|
@@ -3307,33 +3297,33 @@ var sn = Ce, Ne = Za, Ni = pi, Ri = He, ze = sn("%WeakMap%", !0), Je = sn("%Map%
|
|
|
3307
3297
|
if (typeof $ > "u")
|
|
3308
3298
|
return R;
|
|
3309
3299
|
var _;
|
|
3310
|
-
if (o === "comma" &&
|
|
3300
|
+
if (o === "comma" && ie($))
|
|
3311
3301
|
b && l && ($ = Qe.maybeMap($, l)), _ = [{ value: $.length > 0 ? $.join(",") || null : void 0 }];
|
|
3312
|
-
else if (
|
|
3302
|
+
else if (ie(u))
|
|
3313
3303
|
_ = u;
|
|
3314
3304
|
else {
|
|
3315
|
-
var
|
|
3316
|
-
_ = p ?
|
|
3305
|
+
var Z = Object.keys($);
|
|
3306
|
+
_ = p ? Z.sort(p) : Z;
|
|
3317
3307
|
}
|
|
3318
|
-
var
|
|
3319
|
-
if (a &&
|
|
3320
|
-
return
|
|
3308
|
+
var ee = s ? r.replace(/\./g, "%2E") : r, L = c && ie($) && $.length === 1 ? ee + "[]" : ee;
|
|
3309
|
+
if (a && ie($) && $.length === 0)
|
|
3310
|
+
return L + "[]";
|
|
3321
3311
|
for (var V = 0; V < _.length; ++V) {
|
|
3322
3312
|
var K = _[V], D = typeof K == "object" && typeof K.value < "u" ? K.value : $[K];
|
|
3323
3313
|
if (!(i && D === null)) {
|
|
3324
|
-
var fe = f &&
|
|
3314
|
+
var fe = f && s ? K.replace(/\./g, "%2E") : K, st = ie($) ? typeof o == "function" ? o(L, fe) : L : L + (f ? "." + fe : "[" + fe + "]");
|
|
3325
3315
|
y.set(e, w);
|
|
3326
|
-
var Me =
|
|
3327
|
-
Me.set(xt, y),
|
|
3316
|
+
var Me = ln();
|
|
3317
|
+
Me.set(xt, y), fn(R, t(
|
|
3328
3318
|
D,
|
|
3329
3319
|
st,
|
|
3330
3320
|
o,
|
|
3331
|
-
|
|
3321
|
+
c,
|
|
3332
3322
|
a,
|
|
3333
3323
|
n,
|
|
3334
3324
|
i,
|
|
3335
|
-
|
|
3336
|
-
o === "comma" && b &&
|
|
3325
|
+
s,
|
|
3326
|
+
o === "comma" && b && ie($) ? null : l,
|
|
3337
3327
|
u,
|
|
3338
3328
|
p,
|
|
3339
3329
|
f,
|
|
@@ -3349,64 +3339,64 @@ var sn = Ce, Ne = Za, Ni = pi, Ri = He, ze = sn("%WeakMap%", !0), Je = sn("%Map%
|
|
|
3349
3339
|
return R;
|
|
3350
3340
|
}, ss = function(e) {
|
|
3351
3341
|
if (!e)
|
|
3352
|
-
return
|
|
3342
|
+
return U;
|
|
3353
3343
|
if (typeof e.allowEmptyArrays < "u" && typeof e.allowEmptyArrays != "boolean")
|
|
3354
3344
|
throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
|
|
3355
3345
|
if (typeof e.encodeDotInKeys < "u" && typeof e.encodeDotInKeys != "boolean")
|
|
3356
3346
|
throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");
|
|
3357
3347
|
if (e.encoder !== null && typeof e.encoder < "u" && typeof e.encoder != "function")
|
|
3358
3348
|
throw new TypeError("Encoder has to be a function.");
|
|
3359
|
-
var r = e.charset ||
|
|
3349
|
+
var r = e.charset || U.charset;
|
|
3360
3350
|
if (typeof e.charset < "u" && e.charset !== "utf-8" && e.charset !== "iso-8859-1")
|
|
3361
3351
|
throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
|
|
3362
|
-
var o =
|
|
3352
|
+
var o = Le.default;
|
|
3363
3353
|
if (typeof e.format < "u") {
|
|
3364
|
-
if (!rs.call(
|
|
3354
|
+
if (!rs.call(Le.formatters, e.format))
|
|
3365
3355
|
throw new TypeError("Unknown format option provided.");
|
|
3366
3356
|
o = e.format;
|
|
3367
3357
|
}
|
|
3368
|
-
var
|
|
3369
|
-
(typeof e.filter == "function" ||
|
|
3358
|
+
var c = Le.formatters[o], a = U.filter;
|
|
3359
|
+
(typeof e.filter == "function" || ie(e.filter)) && (a = e.filter);
|
|
3370
3360
|
var n;
|
|
3371
|
-
if (e.arrayFormat in
|
|
3361
|
+
if (e.arrayFormat in un ? n = e.arrayFormat : "indices" in e ? n = e.indices ? "indices" : "repeat" : n = U.arrayFormat, "commaRoundTrip" in e && typeof e.commaRoundTrip != "boolean")
|
|
3372
3362
|
throw new TypeError("`commaRoundTrip` must be a boolean, or absent");
|
|
3373
|
-
var i = typeof e.allowDots > "u" ? e.encodeDotInKeys === !0 ? !0 :
|
|
3363
|
+
var i = typeof e.allowDots > "u" ? e.encodeDotInKeys === !0 ? !0 : U.allowDots : !!e.allowDots;
|
|
3374
3364
|
return {
|
|
3375
|
-
addQueryPrefix: typeof e.addQueryPrefix == "boolean" ? e.addQueryPrefix :
|
|
3365
|
+
addQueryPrefix: typeof e.addQueryPrefix == "boolean" ? e.addQueryPrefix : U.addQueryPrefix,
|
|
3376
3366
|
allowDots: i,
|
|
3377
|
-
allowEmptyArrays: typeof e.allowEmptyArrays == "boolean" ? !!e.allowEmptyArrays :
|
|
3367
|
+
allowEmptyArrays: typeof e.allowEmptyArrays == "boolean" ? !!e.allowEmptyArrays : U.allowEmptyArrays,
|
|
3378
3368
|
arrayFormat: n,
|
|
3379
3369
|
charset: r,
|
|
3380
|
-
charsetSentinel: typeof e.charsetSentinel == "boolean" ? e.charsetSentinel :
|
|
3370
|
+
charsetSentinel: typeof e.charsetSentinel == "boolean" ? e.charsetSentinel : U.charsetSentinel,
|
|
3381
3371
|
commaRoundTrip: e.commaRoundTrip,
|
|
3382
|
-
delimiter: typeof e.delimiter > "u" ?
|
|
3383
|
-
encode: typeof e.encode == "boolean" ? e.encode :
|
|
3384
|
-
encodeDotInKeys: typeof e.encodeDotInKeys == "boolean" ? e.encodeDotInKeys :
|
|
3385
|
-
encoder: typeof e.encoder == "function" ? e.encoder :
|
|
3386
|
-
encodeValuesOnly: typeof e.encodeValuesOnly == "boolean" ? e.encodeValuesOnly :
|
|
3372
|
+
delimiter: typeof e.delimiter > "u" ? U.delimiter : e.delimiter,
|
|
3373
|
+
encode: typeof e.encode == "boolean" ? e.encode : U.encode,
|
|
3374
|
+
encodeDotInKeys: typeof e.encodeDotInKeys == "boolean" ? e.encodeDotInKeys : U.encodeDotInKeys,
|
|
3375
|
+
encoder: typeof e.encoder == "function" ? e.encoder : U.encoder,
|
|
3376
|
+
encodeValuesOnly: typeof e.encodeValuesOnly == "boolean" ? e.encodeValuesOnly : U.encodeValuesOnly,
|
|
3387
3377
|
filter: a,
|
|
3388
3378
|
format: o,
|
|
3389
|
-
formatter:
|
|
3390
|
-
serializeDate: typeof e.serializeDate == "function" ? e.serializeDate :
|
|
3391
|
-
skipNulls: typeof e.skipNulls == "boolean" ? e.skipNulls :
|
|
3379
|
+
formatter: c,
|
|
3380
|
+
serializeDate: typeof e.serializeDate == "function" ? e.serializeDate : U.serializeDate,
|
|
3381
|
+
skipNulls: typeof e.skipNulls == "boolean" ? e.skipNulls : U.skipNulls,
|
|
3392
3382
|
sort: typeof e.sort == "function" ? e.sort : null,
|
|
3393
|
-
strictNullHandling: typeof e.strictNullHandling == "boolean" ? e.strictNullHandling :
|
|
3383
|
+
strictNullHandling: typeof e.strictNullHandling == "boolean" ? e.strictNullHandling : U.strictNullHandling
|
|
3394
3384
|
};
|
|
3395
3385
|
}, cs = function(t, e) {
|
|
3396
|
-
var r = t, o = ss(e),
|
|
3397
|
-
typeof o.filter == "function" ? (a = o.filter, r = a("", r)) :
|
|
3386
|
+
var r = t, o = ss(e), c, a;
|
|
3387
|
+
typeof o.filter == "function" ? (a = o.filter, r = a("", r)) : ie(o.filter) && (a = o.filter, c = a);
|
|
3398
3388
|
var n = [];
|
|
3399
3389
|
if (typeof r != "object" || r === null)
|
|
3400
3390
|
return "";
|
|
3401
|
-
var i =
|
|
3402
|
-
|
|
3403
|
-
for (var l =
|
|
3404
|
-
var p =
|
|
3405
|
-
o.skipNulls && r[p] === null ||
|
|
3391
|
+
var i = un[o.arrayFormat], s = i === "comma" && o.commaRoundTrip;
|
|
3392
|
+
c || (c = Object.keys(r)), o.sort && c.sort(o.sort);
|
|
3393
|
+
for (var l = ln(), u = 0; u < c.length; ++u) {
|
|
3394
|
+
var p = c[u];
|
|
3395
|
+
o.skipNulls && r[p] === null || fn(n, is(
|
|
3406
3396
|
r[p],
|
|
3407
3397
|
p,
|
|
3408
3398
|
i,
|
|
3409
|
-
|
|
3399
|
+
s,
|
|
3410
3400
|
o.allowEmptyArrays,
|
|
3411
3401
|
o.strictNullHandling,
|
|
3412
3402
|
o.skipNulls,
|
|
@@ -3425,7 +3415,7 @@ var sn = Ce, Ne = Za, Ni = pi, Ri = He, ze = sn("%WeakMap%", !0), Je = sn("%Map%
|
|
|
3425
3415
|
}
|
|
3426
3416
|
var f = n.join(o.delimiter), d = o.addQueryPrefix === !0 ? "?" : "";
|
|
3427
3417
|
return o.charsetSentinel && (o.charset === "iso-8859-1" ? d += "utf8=%26%2310003%3B&" : d += "utf8=%E2%9C%93&"), f.length > 0 ? d + f : "";
|
|
3428
|
-
}, Ee =
|
|
3418
|
+
}, Ee = cn, Ct = Object.prototype.hasOwnProperty, ls = Array.isArray, I = {
|
|
3429
3419
|
allowDots: !1,
|
|
3430
3420
|
allowEmptyArrays: !1,
|
|
3431
3421
|
allowPrototypes: !1,
|
|
@@ -3449,18 +3439,18 @@ var sn = Ce, Ne = Za, Ni = pi, Ri = He, ze = sn("%WeakMap%", !0), Je = sn("%Map%
|
|
|
3449
3439
|
return t.replace(/&#(\d+);/g, function(e, r) {
|
|
3450
3440
|
return String.fromCharCode(parseInt(r, 10));
|
|
3451
3441
|
});
|
|
3452
|
-
},
|
|
3442
|
+
}, pn = function(t, e) {
|
|
3453
3443
|
return t && typeof t == "string" && e.comma && t.indexOf(",") > -1 ? t.split(",") : t;
|
|
3454
3444
|
}, fs = "utf8=%26%2310003%3B", ps = "utf8=%E2%9C%93", ds = function(e, r) {
|
|
3455
|
-
var o = { __proto__: null },
|
|
3445
|
+
var o = { __proto__: null }, c = r.ignoreQueryPrefix ? e.replace(/^\?/, "") : e, a = r.parameterLimit === 1 / 0 ? void 0 : r.parameterLimit, n = c.split(r.delimiter, a), i = -1, s, l = r.charset;
|
|
3456
3446
|
if (r.charsetSentinel)
|
|
3457
|
-
for (
|
|
3458
|
-
n[
|
|
3459
|
-
for (
|
|
3460
|
-
if (
|
|
3461
|
-
var u = n[
|
|
3447
|
+
for (s = 0; s < n.length; ++s)
|
|
3448
|
+
n[s].indexOf("utf8=") === 0 && (n[s] === ps ? l = "utf-8" : n[s] === fs && (l = "iso-8859-1"), i = s, s = n.length);
|
|
3449
|
+
for (s = 0; s < n.length; ++s)
|
|
3450
|
+
if (s !== i) {
|
|
3451
|
+
var u = n[s], p = u.indexOf("]="), f = p === -1 ? u.indexOf("=") : p + 1, d, h;
|
|
3462
3452
|
f === -1 ? (d = r.decoder(u, I.decoder, l, "key"), h = r.strictNullHandling ? null : "") : (d = r.decoder(u.slice(0, f), I.decoder, l, "key"), h = Ee.maybeMap(
|
|
3463
|
-
|
|
3453
|
+
pn(u.slice(f + 1), r),
|
|
3464
3454
|
function(b) {
|
|
3465
3455
|
return r.decoder(b, I.decoder, l, "value");
|
|
3466
3456
|
}
|
|
@@ -3470,32 +3460,32 @@ var sn = Ce, Ne = Za, Ni = pi, Ri = He, ze = sn("%WeakMap%", !0), Je = sn("%Map%
|
|
|
3470
3460
|
}
|
|
3471
3461
|
return o;
|
|
3472
3462
|
}, hs = function(t, e, r, o) {
|
|
3473
|
-
for (var
|
|
3463
|
+
for (var c = o ? e : pn(e, r), a = t.length - 1; a >= 0; --a) {
|
|
3474
3464
|
var n, i = t[a];
|
|
3475
3465
|
if (i === "[]" && r.parseArrays)
|
|
3476
|
-
n = r.allowEmptyArrays &&
|
|
3466
|
+
n = r.allowEmptyArrays && c === "" ? [] : [].concat(c);
|
|
3477
3467
|
else {
|
|
3478
3468
|
n = r.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
|
|
3479
|
-
var
|
|
3480
|
-
!r.parseArrays && l === "" ? n = { 0:
|
|
3469
|
+
var s = i.charAt(0) === "[" && i.charAt(i.length - 1) === "]" ? i.slice(1, -1) : i, l = r.decodeDotInKeys ? s.replace(/%2E/g, ".") : s, u = parseInt(l, 10);
|
|
3470
|
+
!r.parseArrays && l === "" ? n = { 0: c } : !isNaN(u) && i !== l && String(u) === l && u >= 0 && r.parseArrays && u <= r.arrayLimit ? (n = [], n[u] = c) : l !== "__proto__" && (n[l] = c);
|
|
3481
3471
|
}
|
|
3482
|
-
|
|
3472
|
+
c = n;
|
|
3483
3473
|
}
|
|
3484
|
-
return
|
|
3485
|
-
}, ys = function(e, r, o,
|
|
3474
|
+
return c;
|
|
3475
|
+
}, ys = function(e, r, o, c) {
|
|
3486
3476
|
if (e) {
|
|
3487
|
-
var a = o.allowDots ? e.replace(/\.([^.[]+)/g, "[$1]") : e, n = /(\[[^[\]]*])/, i = /(\[[^[\]]*])/g,
|
|
3477
|
+
var a = o.allowDots ? e.replace(/\.([^.[]+)/g, "[$1]") : e, n = /(\[[^[\]]*])/, i = /(\[[^[\]]*])/g, s = o.depth > 0 && n.exec(a), l = s ? a.slice(0, s.index) : a, u = [];
|
|
3488
3478
|
if (l) {
|
|
3489
3479
|
if (!o.plainObjects && Ct.call(Object.prototype, l) && !o.allowPrototypes)
|
|
3490
3480
|
return;
|
|
3491
3481
|
u.push(l);
|
|
3492
3482
|
}
|
|
3493
|
-
for (var p = 0; o.depth > 0 && (
|
|
3494
|
-
if (p += 1, !o.plainObjects && Ct.call(Object.prototype,
|
|
3483
|
+
for (var p = 0; o.depth > 0 && (s = i.exec(a)) !== null && p < o.depth; ) {
|
|
3484
|
+
if (p += 1, !o.plainObjects && Ct.call(Object.prototype, s[1].slice(1, -1)) && !o.allowPrototypes)
|
|
3495
3485
|
return;
|
|
3496
|
-
u.push(
|
|
3486
|
+
u.push(s[1]);
|
|
3497
3487
|
}
|
|
3498
|
-
return
|
|
3488
|
+
return s && u.push("[" + a.slice(s.index) + "]"), hs(u, r, o, c);
|
|
3499
3489
|
}
|
|
3500
3490
|
}, ms = function(e) {
|
|
3501
3491
|
if (!e)
|
|
@@ -3511,9 +3501,9 @@ var sn = Ce, Ne = Za, Ni = pi, Ri = He, ze = sn("%WeakMap%", !0), Je = sn("%Map%
|
|
|
3511
3501
|
var r = typeof e.charset > "u" ? I.charset : e.charset, o = typeof e.duplicates > "u" ? I.duplicates : e.duplicates;
|
|
3512
3502
|
if (o !== "combine" && o !== "first" && o !== "last")
|
|
3513
3503
|
throw new TypeError("The duplicates option must be either combine, first, or last");
|
|
3514
|
-
var
|
|
3504
|
+
var c = typeof e.allowDots > "u" ? e.decodeDotInKeys === !0 ? !0 : I.allowDots : !!e.allowDots;
|
|
3515
3505
|
return {
|
|
3516
|
-
allowDots:
|
|
3506
|
+
allowDots: c,
|
|
3517
3507
|
allowEmptyArrays: typeof e.allowEmptyArrays == "boolean" ? !!e.allowEmptyArrays : I.allowEmptyArrays,
|
|
3518
3508
|
allowPrototypes: typeof e.allowPrototypes == "boolean" ? e.allowPrototypes : I.allowPrototypes,
|
|
3519
3509
|
allowSparse: typeof e.allowSparse == "boolean" ? e.allowSparse : I.allowSparse,
|
|
@@ -3538,17 +3528,17 @@ var sn = Ce, Ne = Za, Ni = pi, Ri = He, ze = sn("%WeakMap%", !0), Je = sn("%Map%
|
|
|
3538
3528
|
var r = ms(e);
|
|
3539
3529
|
if (t === "" || t === null || typeof t > "u")
|
|
3540
3530
|
return r.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
|
|
3541
|
-
for (var o = typeof t == "string" ? ds(t, r) : t,
|
|
3542
|
-
var i = a[n],
|
|
3543
|
-
|
|
3531
|
+
for (var o = typeof t == "string" ? ds(t, r) : t, c = r.plainObjects ? /* @__PURE__ */ Object.create(null) : {}, a = Object.keys(o), n = 0; n < a.length; ++n) {
|
|
3532
|
+
var i = a[n], s = ys(i, o[i], r, typeof t == "string");
|
|
3533
|
+
c = Ee.merge(c, s, r);
|
|
3544
3534
|
}
|
|
3545
|
-
return r.allowSparse === !0 ?
|
|
3535
|
+
return r.allowSparse === !0 ? c : Ee.compact(c);
|
|
3546
3536
|
}, bs = cs, vs = gs, $s = Mt, De = {
|
|
3547
3537
|
formats: $s,
|
|
3548
3538
|
parse: vs,
|
|
3549
3539
|
stringify: bs
|
|
3550
3540
|
}, xs = na;
|
|
3551
|
-
function
|
|
3541
|
+
function ne() {
|
|
3552
3542
|
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;
|
|
3553
3543
|
}
|
|
3554
3544
|
var ws = /^([a-z0-9.+-]+:)/i, Ss = /:[0-9]*$/, js = /^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/, Os = [
|
|
@@ -3597,21 +3587,21 @@ var ws = /^([a-z0-9.+-]+:)/i, Ss = /:[0-9]*$/, js = /^(\/\/?(?!\/)[^?\s]*)(\?[^\
|
|
|
3597
3587
|
"file:": !0
|
|
3598
3588
|
}, At = De;
|
|
3599
3589
|
function Wt(t, e, r) {
|
|
3600
|
-
if (t && typeof t == "object" && t instanceof
|
|
3590
|
+
if (t && typeof t == "object" && t instanceof ne)
|
|
3601
3591
|
return t;
|
|
3602
|
-
var o = new
|
|
3592
|
+
var o = new ne();
|
|
3603
3593
|
return o.parse(t, e, r), o;
|
|
3604
3594
|
}
|
|
3605
|
-
|
|
3595
|
+
ne.prototype.parse = function(t, e, r) {
|
|
3606
3596
|
if (typeof t != "string")
|
|
3607
3597
|
throw new TypeError("Parameter 'url' must be a string, not " + typeof t);
|
|
3608
|
-
var o = t.indexOf("?"),
|
|
3609
|
-
a[0] = a[0].replace(n, "/"), t = a.join(
|
|
3598
|
+
var o = t.indexOf("?"), c = o !== -1 && o < t.indexOf("#") ? "?" : "#", a = t.split(c), n = /\\/g;
|
|
3599
|
+
a[0] = a[0].replace(n, "/"), t = a.join(c);
|
|
3610
3600
|
var i = t;
|
|
3611
3601
|
if (i = i.trim(), !r && t.split("#").length === 1) {
|
|
3612
|
-
var
|
|
3613
|
-
if (
|
|
3614
|
-
return this.path = i, this.href = i, this.pathname =
|
|
3602
|
+
var s = js.exec(i);
|
|
3603
|
+
if (s)
|
|
3604
|
+
return this.path = i, this.href = i, this.pathname = s[1], s[2] ? (this.search = s[2], e ? this.query = At.parse(this.search.substr(1)) : this.query = this.search.substr(1)) : e && (this.search = "", this.query = {}), this;
|
|
3615
3605
|
}
|
|
3616
3606
|
var l = ws.exec(i);
|
|
3617
3607
|
if (l) {
|
|
@@ -3650,60 +3640,60 @@ oe.prototype.parse = function(t, e, r) {
|
|
|
3650
3640
|
}
|
|
3651
3641
|
}
|
|
3652
3642
|
this.hostname.length > Ps ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(), v || (this.hostname = xs.toASCII(this.hostname));
|
|
3653
|
-
var
|
|
3654
|
-
this.host =
|
|
3643
|
+
var Z = this.port ? ":" + this.port : "", ee = this.hostname || "";
|
|
3644
|
+
this.host = ee + Z, this.href += this.host, v && (this.hostname = this.hostname.substr(1, this.hostname.length - 2), i[0] !== "/" && (i = "/" + i));
|
|
3655
3645
|
}
|
|
3656
3646
|
if (!Es[u])
|
|
3657
3647
|
for (var d = 0, $ = Nt.length; d < $; d++) {
|
|
3658
|
-
var
|
|
3659
|
-
if (i.indexOf(
|
|
3660
|
-
var V = encodeURIComponent(
|
|
3661
|
-
V ===
|
|
3648
|
+
var L = Nt[d];
|
|
3649
|
+
if (i.indexOf(L) !== -1) {
|
|
3650
|
+
var V = encodeURIComponent(L);
|
|
3651
|
+
V === L && (V = escape(L)), i = i.split(L).join(V);
|
|
3662
3652
|
}
|
|
3663
3653
|
}
|
|
3664
3654
|
var K = i.indexOf("#");
|
|
3665
3655
|
K !== -1 && (this.hash = i.substr(K), i = i.slice(0, K));
|
|
3666
3656
|
var D = i.indexOf("?");
|
|
3667
3657
|
if (D !== -1 ? (this.search = i.substr(D), this.query = i.substr(D + 1), e && (this.query = At.parse(this.query)), i = i.slice(0, D)) : e && (this.search = "", this.query = {}), i && (this.pathname = i), Oe[u] && this.hostname && !this.pathname && (this.pathname = "/"), this.pathname || this.search) {
|
|
3668
|
-
var
|
|
3669
|
-
this.path =
|
|
3658
|
+
var Z = this.pathname || "", fe = this.search || "";
|
|
3659
|
+
this.path = Z + fe;
|
|
3670
3660
|
}
|
|
3671
3661
|
return this.href = this.format(), this;
|
|
3672
3662
|
};
|
|
3673
3663
|
function Cs(t) {
|
|
3674
|
-
return typeof t == "string" && (t = Wt(t)), t instanceof
|
|
3664
|
+
return typeof t == "string" && (t = Wt(t)), t instanceof ne ? t.format() : ne.prototype.format.call(t);
|
|
3675
3665
|
}
|
|
3676
|
-
|
|
3666
|
+
ne.prototype.format = function() {
|
|
3677
3667
|
var t = this.auth || "";
|
|
3678
3668
|
t && (t = encodeURIComponent(t), t = t.replace(/%3A/i, ":"), t += "@");
|
|
3679
|
-
var e = this.protocol || "", r = this.pathname || "", o = this.hash || "",
|
|
3680
|
-
this.host ?
|
|
3669
|
+
var e = this.protocol || "", r = this.pathname || "", o = this.hash || "", c = !1, a = "";
|
|
3670
|
+
this.host ? c = t + this.host : this.hostname && (c = t + (this.hostname.indexOf(":") === -1 ? this.hostname : "[" + this.hostname + "]"), this.port && (c += ":" + this.port)), this.query && typeof this.query == "object" && Object.keys(this.query).length && (a = At.stringify(this.query, {
|
|
3681
3671
|
arrayFormat: "repeat",
|
|
3682
3672
|
addQueryPrefix: !1
|
|
3683
3673
|
}));
|
|
3684
3674
|
var n = this.search || a && "?" + a || "";
|
|
3685
|
-
return e && e.substr(-1) !== ":" && (e += ":"), this.slashes || (!e || Oe[e]) &&
|
|
3675
|
+
return e && e.substr(-1) !== ":" && (e += ":"), this.slashes || (!e || Oe[e]) && c !== !1 ? (c = "//" + (c || ""), r && r.charAt(0) !== "/" && (r = "/" + r)) : c || (c = ""), o && o.charAt(0) !== "#" && (o = "#" + o), n && n.charAt(0) !== "?" && (n = "?" + n), r = r.replace(/[?#]/g, function(i) {
|
|
3686
3676
|
return encodeURIComponent(i);
|
|
3687
|
-
}), n = n.replace("#", "%23"), e +
|
|
3677
|
+
}), n = n.replace("#", "%23"), e + c + r + n + o;
|
|
3688
3678
|
};
|
|
3689
|
-
|
|
3679
|
+
ne.prototype.resolve = function(t) {
|
|
3690
3680
|
return this.resolveObject(Wt(t, !1, !0)).format();
|
|
3691
3681
|
};
|
|
3692
|
-
|
|
3682
|
+
ne.prototype.resolveObject = function(t) {
|
|
3693
3683
|
if (typeof t == "string") {
|
|
3694
|
-
var e = new
|
|
3684
|
+
var e = new ne();
|
|
3695
3685
|
e.parse(t, !1, !0), t = e;
|
|
3696
3686
|
}
|
|
3697
|
-
for (var r = new
|
|
3698
|
-
var a = o[
|
|
3687
|
+
for (var r = new ne(), o = Object.keys(this), c = 0; c < o.length; c++) {
|
|
3688
|
+
var a = o[c];
|
|
3699
3689
|
r[a] = this[a];
|
|
3700
3690
|
}
|
|
3701
3691
|
if (r.hash = t.hash, t.href === "")
|
|
3702
3692
|
return r.href = r.format(), r;
|
|
3703
3693
|
if (t.slashes && !t.protocol) {
|
|
3704
3694
|
for (var n = Object.keys(t), i = 0; i < n.length; i++) {
|
|
3705
|
-
var
|
|
3706
|
-
|
|
3695
|
+
var s = n[i];
|
|
3696
|
+
s !== "protocol" && (r[s] = t[s]);
|
|
3707
3697
|
}
|
|
3708
3698
|
return Oe[r.protocol] && r.hostname && !r.pathname && (r.pathname = "/", r.path = r.pathname), r.href = r.format(), r;
|
|
3709
3699
|
}
|
|
@@ -3756,7 +3746,7 @@ oe.prototype.resolveObject = function(t) {
|
|
|
3756
3746
|
}
|
|
3757
3747
|
return b = b || r.host && y.length, b && !_ && y.unshift(""), y.length > 0 ? r.pathname = y.join("/") : (r.pathname = null, r.path = null), (r.pathname !== null || r.search !== null) && (r.path = (r.pathname ? r.pathname : "") + (r.search ? r.search : "")), r.auth = t.auth || r.auth, r.slashes = r.slashes || t.slashes, r.href = r.format(), r;
|
|
3758
3748
|
};
|
|
3759
|
-
|
|
3749
|
+
ne.prototype.parseHost = function() {
|
|
3760
3750
|
var t = this.host, e = Ss.exec(t);
|
|
3761
3751
|
e && (e = e[0], e !== ":" && (this.port = e.substr(1)), t = t.substr(0, t.length - e.length)), t && (this.hostname = t);
|
|
3762
3752
|
};
|
|
@@ -3833,7 +3823,7 @@ var Ns = Wt, qr = Cs, Rs = (t) => typeof t == "object" && "log" in t && typeof t
|
|
|
3833
3823
|
`Content-Disposition: form-data; name="${b(v(j))}"; filename="${E}"`
|
|
3834
3824
|
), y.push(`Content-Type: ${R}`)) : y.push(`Content-Disposition: form-data; name="${b(v(j))}"`), y.push(""), y.push(v(N)), w !== r.postData.params.length - 1 && y.push(`--${d}`);
|
|
3835
3825
|
}), y.push(`--${h}`), r.postData.boundary = d, r.postData.text = y.join(m);
|
|
3836
|
-
const $ =
|
|
3826
|
+
const $ = z(r.headersObj, "content-type") || "content-type";
|
|
3837
3827
|
r.headersObj[$] = `multipart/form-data; boundary=${d}`;
|
|
3838
3828
|
}
|
|
3839
3829
|
break;
|
|
@@ -3852,7 +3842,7 @@ var Ns = Wt, qr = Cs, Rs = (t) => typeof t == "object" && "log" in t && typeof t
|
|
|
3852
3842
|
}
|
|
3853
3843
|
break;
|
|
3854
3844
|
}
|
|
3855
|
-
const
|
|
3845
|
+
const c = {
|
|
3856
3846
|
...r.allHeaders,
|
|
3857
3847
|
...r.headersObj
|
|
3858
3848
|
}, a = Ns(r.url, !0, !0);
|
|
@@ -3872,7 +3862,7 @@ var Ns = Wt, qr = Cs, Rs = (t) => typeof t == "object" && "log" in t && typeof t
|
|
|
3872
3862
|
query: r.queryObj,
|
|
3873
3863
|
search: n,
|
|
3874
3864
|
path: n ? `${a.pathname}?${n}` : a.pathname
|
|
3875
|
-
},
|
|
3865
|
+
}, s = qr({
|
|
3876
3866
|
...a,
|
|
3877
3867
|
query: null,
|
|
3878
3868
|
search: null
|
|
@@ -3882,9 +3872,9 @@ var Ns = Wt, qr = Cs, Rs = (t) => typeof t == "object" && "log" in t && typeof t
|
|
|
3882
3872
|
});
|
|
3883
3873
|
return {
|
|
3884
3874
|
...r,
|
|
3885
|
-
allHeaders:
|
|
3875
|
+
allHeaders: c,
|
|
3886
3876
|
fullUrl: l,
|
|
3887
|
-
url:
|
|
3877
|
+
url: s,
|
|
3888
3878
|
uriObj: i
|
|
3889
3879
|
};
|
|
3890
3880
|
}
|
|
@@ -3893,8 +3883,8 @@ var Ns = Wt, qr = Cs, Rs = (t) => typeof t == "object" && "log" in t && typeof t
|
|
|
3893
3883
|
const o = ra[t];
|
|
3894
3884
|
if (!o)
|
|
3895
3885
|
return !1;
|
|
3896
|
-
const { convert:
|
|
3897
|
-
return this.requests.map((n) =>
|
|
3886
|
+
const { convert: c } = o.clientsById[e || o.info.default];
|
|
3887
|
+
return this.requests.map((n) => c(n, r));
|
|
3898
3888
|
}
|
|
3899
3889
|
};
|
|
3900
3890
|
const qs = ({
|
|
@@ -3902,41 +3892,41 @@ const qs = ({
|
|
|
3902
3892
|
operation: e
|
|
3903
3893
|
}) => {
|
|
3904
3894
|
var a, n, i;
|
|
3905
|
-
const r = (a = e.parameters) == null ? void 0 : a.filter((
|
|
3895
|
+
const r = (a = e.parameters) == null ? void 0 : a.filter((s) => s.in === "header").map((s) => {
|
|
3906
3896
|
var l, u;
|
|
3907
3897
|
return {
|
|
3908
|
-
name:
|
|
3909
|
-
defaultValue: ((u = (l =
|
|
3898
|
+
name: s.name,
|
|
3899
|
+
defaultValue: ((u = (l = s.examples) == null ? void 0 : l.find((p) => p.value)) == null ? void 0 : u.value) ?? ""
|
|
3910
3900
|
};
|
|
3911
|
-
}), o = (n = e.parameters) == null ? void 0 : n.filter((
|
|
3912
|
-
name:
|
|
3913
|
-
defaultActive:
|
|
3914
|
-
isRequired:
|
|
3915
|
-
})),
|
|
3901
|
+
}), o = (n = e.parameters) == null ? void 0 : n.filter((s) => s.in === "query").sort((s, l) => s.required && !l.required ? -1 : 1).map((s) => ({
|
|
3902
|
+
name: s.name,
|
|
3903
|
+
defaultActive: s.required ?? !1,
|
|
3904
|
+
isRequired: s.required ?? !1
|
|
3905
|
+
})), c = (i = e.parameters) == null ? void 0 : i.filter((s) => s.in === "path").map((s) => ({ name: s.name }));
|
|
3916
3906
|
return /* @__PURE__ */ g.jsx(
|
|
3917
|
-
|
|
3907
|
+
yn,
|
|
3918
3908
|
{
|
|
3919
3909
|
server: t,
|
|
3920
3910
|
method: e.method,
|
|
3921
3911
|
url: e.path,
|
|
3922
3912
|
headers: r,
|
|
3923
3913
|
queryParams: o,
|
|
3924
|
-
pathParams:
|
|
3914
|
+
pathParams: c
|
|
3925
3915
|
}
|
|
3926
3916
|
);
|
|
3927
|
-
},
|
|
3917
|
+
}, Jt = ({ children: t, className: e }) => /* @__PURE__ */ g.jsx(
|
|
3928
3918
|
"div",
|
|
3929
3919
|
{
|
|
3930
|
-
className:
|
|
3920
|
+
className: le(
|
|
3931
3921
|
"rounded-lg overflow-hidden border dark:border-transparent",
|
|
3932
3922
|
e
|
|
3933
3923
|
),
|
|
3934
3924
|
children: t
|
|
3935
3925
|
}
|
|
3936
|
-
),
|
|
3926
|
+
), zt = ({ children: t, className: e }) => /* @__PURE__ */ g.jsx(
|
|
3937
3927
|
"div",
|
|
3938
3928
|
{
|
|
3939
|
-
className:
|
|
3929
|
+
className: le(
|
|
3940
3930
|
"border-b dark:border-zinc-600 bg-zinc-100 dark:bg-zinc-700 p-2",
|
|
3941
3931
|
e
|
|
3942
3932
|
),
|
|
@@ -3945,38 +3935,38 @@ const qs = ({
|
|
|
3945
3935
|
), Gt = ({ children: t, className: e }) => /* @__PURE__ */ g.jsx(
|
|
3946
3936
|
"div",
|
|
3947
3937
|
{
|
|
3948
|
-
className:
|
|
3938
|
+
className: le("bg-zinc-50 dark:bg-zinc-800 overflow-auto p-2", e),
|
|
3949
3939
|
children: t
|
|
3950
3940
|
}
|
|
3951
|
-
),
|
|
3941
|
+
), dn = ({ children: t, className: e }) => /* @__PURE__ */ g.jsx(
|
|
3952
3942
|
"div",
|
|
3953
3943
|
{
|
|
3954
|
-
className:
|
|
3944
|
+
className: le(
|
|
3955
3945
|
"border-t dark:border-zinc-600 bg-zinc-100 dark:bg-zinc-700 p-2",
|
|
3956
3946
|
e
|
|
3957
3947
|
),
|
|
3958
3948
|
children: t
|
|
3959
3949
|
}
|
|
3960
|
-
), Is = (t) => typeof t == "object" && t !== null && !Array.isArray(t), Fe = (t, e) => t.example !== void 0 ? t.example : t.default !== void 0 ? t.default : t.examples && Is(t.examples) ? Object.values(t.examples)[0] :
|
|
3961
|
-
function
|
|
3950
|
+
), Is = (t) => typeof t == "object" && t !== null && !Array.isArray(t), Fe = (t, e) => t.example !== void 0 ? t.example : t.default !== void 0 ? t.default : t.examples && Is(t.examples) ? Object.values(t.examples)[0] : Ls(t);
|
|
3951
|
+
function Ls(t, e) {
|
|
3962
3952
|
const r = Object.entries(t.properties ?? {}).concat(
|
|
3963
3953
|
Object.entries(t.additionalProperties ?? {})
|
|
3964
3954
|
);
|
|
3965
3955
|
if (t.type === "object" && r.length > 0) {
|
|
3966
3956
|
const o = {};
|
|
3967
|
-
return r.forEach(([
|
|
3957
|
+
return r.forEach(([c, a]) => {
|
|
3968
3958
|
const n = Fe(a);
|
|
3969
|
-
n !== void 0 && (o[
|
|
3959
|
+
n !== void 0 && (o[c] = n);
|
|
3970
3960
|
}), o;
|
|
3971
3961
|
} else if (t.type === "array" && t.items) {
|
|
3972
3962
|
const o = Fe(t.items);
|
|
3973
3963
|
return o !== void 0 ? [o] : [];
|
|
3974
3964
|
}
|
|
3975
3965
|
}
|
|
3976
|
-
const
|
|
3966
|
+
const Us = ({ content: t }) => {
|
|
3977
3967
|
var e;
|
|
3978
|
-
return t.length ? /* @__PURE__ */ g.jsx(g.Fragment, { children: /* @__PURE__ */ g.jsxs(
|
|
3979
|
-
/* @__PURE__ */ g.jsx(
|
|
3968
|
+
return t.length ? /* @__PURE__ */ g.jsx(g.Fragment, { children: /* @__PURE__ */ g.jsxs(Jt, { children: [
|
|
3969
|
+
/* @__PURE__ */ g.jsx(zt, { className: "text-xs flex justify-between items-center", children: /* @__PURE__ */ g.jsx("span", { className: "font-mono", children: "Request Body Example" }) }),
|
|
3980
3970
|
/* @__PURE__ */ g.jsx(Gt, { children: /* @__PURE__ */ g.jsx(
|
|
3981
3971
|
at,
|
|
3982
3972
|
{
|
|
@@ -3996,54 +3986,35 @@ const Ls = ({ content: t }) => {
|
|
|
3996
3986
|
responses: t
|
|
3997
3987
|
}) => {
|
|
3998
3988
|
var a, n;
|
|
3999
|
-
const [e, r] =
|
|
4000
|
-
return /* @__PURE__ */ g.jsxs(
|
|
4001
|
-
/* @__PURE__ */ g.jsxs(
|
|
3989
|
+
const [e, r] = Br(0), c = (n = (a = t[e].content) == null ? void 0 : a[0]) == null ? void 0 : n.schema;
|
|
3990
|
+
return /* @__PURE__ */ g.jsxs(Jt, { children: [
|
|
3991
|
+
/* @__PURE__ */ g.jsxs(zt, { className: "text-xs grid grid-rows-2 pb-0", children: [
|
|
4002
3992
|
/* @__PURE__ */ g.jsx("span", { className: "font-mono", children: "Example Responses" }),
|
|
4003
|
-
/* @__PURE__ */ g.jsx("div", { className: "flex gap-2", children: t.map((i,
|
|
3993
|
+
/* @__PURE__ */ g.jsx("div", { className: "flex gap-2", children: t.map((i, s) => /* @__PURE__ */ g.jsx(
|
|
4004
3994
|
"div",
|
|
4005
3995
|
{
|
|
4006
|
-
onClick: () => r(
|
|
4007
|
-
className:
|
|
3996
|
+
onClick: () => r(s),
|
|
3997
|
+
className: le(
|
|
4008
3998
|
"text-xs font-mono px-1.5 py-1 pb-px translate-y-px border-b-2 border-transparent rounded-t cursor-pointer",
|
|
4009
|
-
e ===
|
|
3999
|
+
e === s ? "text-primary dark:text-inherit border-primary" : "hover:border-accent-foreground/25"
|
|
4010
4000
|
),
|
|
4011
4001
|
children: i.statusCode
|
|
4012
4002
|
},
|
|
4013
4003
|
i.statusCode
|
|
4014
4004
|
)) })
|
|
4015
4005
|
] }),
|
|
4016
|
-
/* @__PURE__ */ g.jsx(Gt, { children:
|
|
4006
|
+
/* @__PURE__ */ g.jsx(Gt, { children: c ? /* @__PURE__ */ g.jsx(
|
|
4017
4007
|
at,
|
|
4018
4008
|
{
|
|
4019
4009
|
language: "json",
|
|
4020
4010
|
noBackground: !0,
|
|
4021
4011
|
className: "text-xs",
|
|
4022
|
-
code: JSON.stringify(Fe(
|
|
4012
|
+
code: JSON.stringify(Fe(c), null, 2)
|
|
4023
4013
|
}
|
|
4024
4014
|
) : /* @__PURE__ */ g.jsx("span", { className: "text-muted-foreground font-mono italic text-xs", children: "Empty Response" }) }),
|
|
4025
|
-
/* @__PURE__ */ g.jsx(
|
|
4015
|
+
/* @__PURE__ */ g.jsx(dn, { className: "flex justify-end text-xs", children: t[e].description })
|
|
4026
4016
|
] });
|
|
4027
|
-
}, Fs = ({
|
|
4028
|
-
value: t,
|
|
4029
|
-
onChange: e,
|
|
4030
|
-
className: r,
|
|
4031
|
-
options: o
|
|
4032
|
-
}) => /* @__PURE__ */ g.jsxs("div", { className: Z("grid", r), children: [
|
|
4033
|
-
/* @__PURE__ */ g.jsx(
|
|
4034
|
-
"select",
|
|
4035
|
-
{
|
|
4036
|
-
className: Z(
|
|
4037
|
-
"row-start-1 col-start-1 border border-input text-foreground px-2 py-1 pe-6",
|
|
4038
|
-
"rounded-md appearance-none bg-zinc-50 hover:bg-white dark:bg-zinc-800 hover:dark:bg-zinc-800/75"
|
|
4039
|
-
),
|
|
4040
|
-
value: t,
|
|
4041
|
-
onChange: e,
|
|
4042
|
-
children: o.map((s) => /* @__PURE__ */ g.jsx("option", { value: s.value, children: s.label }, s.value))
|
|
4043
|
-
}
|
|
4044
|
-
),
|
|
4045
|
-
/* @__PURE__ */ g.jsx("div", { className: "row-start-1 col-start-1 self-center justify-self-end relative end-2 pointer-events-none", children: /* @__PURE__ */ g.jsx(Rn, { size: 14 }) })
|
|
4046
|
-
] }), Hs = (t, e) => {
|
|
4017
|
+
}, Fs = (t, e) => {
|
|
4047
4018
|
let r;
|
|
4048
4019
|
switch (e) {
|
|
4049
4020
|
case "shell":
|
|
@@ -4084,7 +4055,7 @@ const Ls = ({ content: t }) => {
|
|
|
4084
4055
|
break;
|
|
4085
4056
|
}
|
|
4086
4057
|
return r ? r[0] : "";
|
|
4087
|
-
},
|
|
4058
|
+
}, Hs = qt(
|
|
4088
4059
|
/* GraphQL */
|
|
4089
4060
|
`
|
|
4090
4061
|
query getServerQuery($input: JSON!, $type: SchemaType!) {
|
|
@@ -4093,15 +4064,15 @@ const Ls = ({ content: t }) => {
|
|
|
4093
4064
|
}
|
|
4094
4065
|
}
|
|
4095
4066
|
`
|
|
4096
|
-
),
|
|
4067
|
+
), Bs = { suspense: !0 }, Ms = ({
|
|
4097
4068
|
operation: t
|
|
4098
4069
|
}) => {
|
|
4099
4070
|
var p, f;
|
|
4100
|
-
const e =
|
|
4101
|
-
query:
|
|
4071
|
+
const e = Fr(), [r] = Hr({
|
|
4072
|
+
query: Hs,
|
|
4102
4073
|
variables: e,
|
|
4103
|
-
context:
|
|
4104
|
-
}), o =
|
|
4074
|
+
context: Bs
|
|
4075
|
+
}), o = mn[t.method], [c, a] = Rn(), [, n] = Tn(), i = c.get("lang") ?? "shell", s = (p = t.requestBody) == null ? void 0 : p.content, l = t.path.split("/").map((d) => /* @__PURE__ */ g.jsxs(Pn, { children: [
|
|
4105
4076
|
d.startsWith("{") && d.endsWith("}") ? /* @__PURE__ */ g.jsx(
|
|
4106
4077
|
Ir,
|
|
4107
4078
|
{
|
|
@@ -4113,9 +4084,9 @@ const Ls = ({ content: t }) => {
|
|
|
4113
4084
|
) : d,
|
|
4114
4085
|
"/",
|
|
4115
4086
|
/* @__PURE__ */ g.jsx("wbr", {})
|
|
4116
|
-
] }, d)), u =
|
|
4087
|
+
] }, d)), u = kn(() => {
|
|
4117
4088
|
var m;
|
|
4118
|
-
const d = (m =
|
|
4089
|
+
const d = (m = s == null ? void 0 : s[0]) != null && m.schema ? Fe(s[0].schema) : void 0, h = new As(
|
|
4119
4090
|
{
|
|
4120
4091
|
method: t.method.toLocaleUpperCase(),
|
|
4121
4092
|
url: t.path.replaceAll("{", ":").replaceAll("}", ""),
|
|
@@ -4127,13 +4098,13 @@ const Ls = ({ content: t }) => {
|
|
|
4127
4098
|
}
|
|
4128
4099
|
// 👈 never touch this
|
|
4129
4100
|
);
|
|
4130
|
-
return
|
|
4131
|
-
}, [i, t.method, t.path,
|
|
4101
|
+
return Fs(h, i);
|
|
4102
|
+
}, [i, t.method, t.path, s]);
|
|
4132
4103
|
return /* @__PURE__ */ g.jsxs("aside", { className: "flex flex-col overflow-hidden sticky top-[--scroll-padding] gap-4", children: [
|
|
4133
|
-
/* @__PURE__ */ g.jsxs(
|
|
4134
|
-
/* @__PURE__ */ g.jsxs(
|
|
4104
|
+
/* @__PURE__ */ g.jsxs(Jt, { children: [
|
|
4105
|
+
/* @__PURE__ */ g.jsxs(zt, { className: "flex justify-between items-center flex-nowrap py-3 gap-2 text-xs", children: [
|
|
4135
4106
|
/* @__PURE__ */ g.jsxs("span", { className: "font-mono break-words", children: [
|
|
4136
|
-
/* @__PURE__ */ g.jsx("span", { className:
|
|
4107
|
+
/* @__PURE__ */ g.jsx("span", { className: le("font-semibold", o), children: t.method.toLocaleUpperCase() }),
|
|
4137
4108
|
" ",
|
|
4138
4109
|
l
|
|
4139
4110
|
] }),
|
|
@@ -4154,10 +4125,10 @@ const Ls = ({ content: t }) => {
|
|
|
4154
4125
|
code: u
|
|
4155
4126
|
}
|
|
4156
4127
|
) }),
|
|
4157
|
-
/* @__PURE__ */ g.jsxs(
|
|
4128
|
+
/* @__PURE__ */ g.jsxs(dn, { className: "flex items-center text-xs gap-2 justify-end py-1", children: [
|
|
4158
4129
|
/* @__PURE__ */ g.jsx("span", { children: "Show example in" }),
|
|
4159
4130
|
/* @__PURE__ */ g.jsx(
|
|
4160
|
-
|
|
4131
|
+
gn,
|
|
4161
4132
|
{
|
|
4162
4133
|
className: "self-start max-w-[150px]",
|
|
4163
4134
|
value: i,
|
|
@@ -4183,14 +4154,14 @@ const Ls = ({ content: t }) => {
|
|
|
4183
4154
|
)
|
|
4184
4155
|
] })
|
|
4185
4156
|
] }),
|
|
4186
|
-
|
|
4157
|
+
s && /* @__PURE__ */ g.jsx(Us, { content: s }),
|
|
4187
4158
|
t.responses.length > 0 && /* @__PURE__ */ g.jsx(_s, { responses: t.responses })
|
|
4188
4159
|
] });
|
|
4189
|
-
},
|
|
4160
|
+
}, Ws = ["path", "query", "header", "cookie"], Js = ({
|
|
4190
4161
|
operationFragment: t
|
|
4191
4162
|
}) => {
|
|
4192
|
-
var
|
|
4193
|
-
const e = qn(
|
|
4163
|
+
var c, a, n;
|
|
4164
|
+
const e = qn(zs, t), r = Mr(
|
|
4194
4165
|
e.parameters ?? [],
|
|
4195
4166
|
(i) => i.in
|
|
4196
4167
|
), o = e.responses.at(0);
|
|
@@ -4208,11 +4179,11 @@ const Ls = ({ content: t }) => {
|
|
|
4208
4179
|
content: e.description
|
|
4209
4180
|
}
|
|
4210
4181
|
),
|
|
4211
|
-
e.parameters && e.parameters.length > 0 && /* @__PURE__ */ g.jsx(g.Fragment, { children:
|
|
4182
|
+
e.parameters && e.parameters.length > 0 && /* @__PURE__ */ g.jsx(g.Fragment, { children: Ws.flatMap(
|
|
4212
4183
|
(i) => {
|
|
4213
|
-
var
|
|
4214
|
-
return (
|
|
4215
|
-
|
|
4184
|
+
var s;
|
|
4185
|
+
return (s = r[i]) != null && s.length ? /* @__PURE__ */ g.jsx(
|
|
4186
|
+
Ln,
|
|
4216
4187
|
{
|
|
4217
4188
|
id: e.slug,
|
|
4218
4189
|
parameters: r[i],
|
|
@@ -4222,7 +4193,7 @@ const Ls = ({ content: t }) => {
|
|
|
4222
4193
|
) : [];
|
|
4223
4194
|
}
|
|
4224
4195
|
) }),
|
|
4225
|
-
Qt((n = (a = (
|
|
4196
|
+
Qt((n = (a = (c = e.requestBody) == null ? void 0 : c.content) == null ? void 0 : a.at(0)) == null ? void 0 : n.schema, (i) => /* @__PURE__ */ g.jsxs("div", { className: "mt-4 flex flex-col gap-4", children: [
|
|
4226
4197
|
/* @__PURE__ */ g.jsx(Ae, { level: 3, className: "capitalize", children: "Request Body" }),
|
|
4227
4198
|
/* @__PURE__ */ g.jsx(Xe, { schema: i })
|
|
4228
4199
|
] })),
|
|
@@ -4239,13 +4210,13 @@ const Ls = ({ content: t }) => {
|
|
|
4239
4210
|
i.statusCode
|
|
4240
4211
|
)) }),
|
|
4241
4212
|
/* @__PURE__ */ g.jsx("ul", { className: "list-none m-0 px-0 overflow-hidden", children: e.responses.map((i) => {
|
|
4242
|
-
var
|
|
4213
|
+
var s;
|
|
4243
4214
|
return /* @__PURE__ */ g.jsx(
|
|
4244
4215
|
xn,
|
|
4245
4216
|
{
|
|
4246
4217
|
value: i.statusCode + i.description,
|
|
4247
4218
|
children: Qt(
|
|
4248
|
-
(
|
|
4219
|
+
(s = i.content) == null ? void 0 : s.find((l) => l.schema),
|
|
4249
4220
|
(l) => /* @__PURE__ */ g.jsx(Xe, { schema: l.schema, name: "" })
|
|
4250
4221
|
) ?? /* @__PURE__ */ g.jsx("div", { className: "border-border font-mono text-sm border rounded p-4", children: "No response body" })
|
|
4251
4222
|
},
|
|
@@ -4255,12 +4226,12 @@ const Ls = ({ content: t }) => {
|
|
|
4255
4226
|
] })
|
|
4256
4227
|
] })
|
|
4257
4228
|
] }),
|
|
4258
|
-
/* @__PURE__ */ g.jsx(
|
|
4229
|
+
/* @__PURE__ */ g.jsx(Ms, { operation: e })
|
|
4259
4230
|
]
|
|
4260
4231
|
},
|
|
4261
4232
|
e.operationId
|
|
4262
4233
|
);
|
|
4263
|
-
},
|
|
4234
|
+
}, zs = qt(
|
|
4264
4235
|
/* GraphQL */
|
|
4265
4236
|
`
|
|
4266
4237
|
fragment OperationsFragment on OperationItem {
|
|
@@ -4311,7 +4282,7 @@ const Ls = ({ content: t }) => {
|
|
|
4311
4282
|
}
|
|
4312
4283
|
}
|
|
4313
4284
|
`
|
|
4314
|
-
),
|
|
4285
|
+
), Gs = qt(
|
|
4315
4286
|
/* GraphQL */
|
|
4316
4287
|
`
|
|
4317
4288
|
query AllOperations($input: JSON!, $type: SchemaType!) {
|
|
@@ -4331,20 +4302,20 @@ const Ls = ({ content: t }) => {
|
|
|
4331
4302
|
}
|
|
4332
4303
|
}
|
|
4333
4304
|
`
|
|
4334
|
-
),
|
|
4335
|
-
var
|
|
4336
|
-
const { type: t, input: e } =
|
|
4337
|
-
query:
|
|
4305
|
+
), Vs = { suspense: !0 }, ic = () => {
|
|
4306
|
+
var c;
|
|
4307
|
+
const { type: t, input: e } = Fr(), [r] = Hr({
|
|
4308
|
+
query: Gs,
|
|
4338
4309
|
variables: { type: t, input: e },
|
|
4339
|
-
context:
|
|
4340
|
-
}), o = (
|
|
4310
|
+
context: Vs
|
|
4311
|
+
}), o = (c = r.error) == null ? void 0 : c.graphQLErrors.at(0);
|
|
4341
4312
|
return o ? /* @__PURE__ */ g.jsx(
|
|
4342
4313
|
wn,
|
|
4343
4314
|
{
|
|
4344
4315
|
category: "Error",
|
|
4345
4316
|
title: "Schema cannot be displayed",
|
|
4346
4317
|
message: /* @__PURE__ */ g.jsxs(g.Fragment, { children: [
|
|
4347
|
-
/* @__PURE__ */ g.jsxs(
|
|
4318
|
+
/* @__PURE__ */ g.jsxs(hn, { className: "mb-4", children: [
|
|
4348
4319
|
"Check your configuration value ",
|
|
4349
4320
|
/* @__PURE__ */ g.jsx(Kt, { children: "apis.type" }),
|
|
4350
4321
|
" ",
|
|
@@ -4360,7 +4331,7 @@ const Ls = ({ content: t }) => {
|
|
|
4360
4331
|
/* @__PURE__ */ g.jsxs(
|
|
4361
4332
|
"div",
|
|
4362
4333
|
{
|
|
4363
|
-
className:
|
|
4334
|
+
className: le(
|
|
4364
4335
|
Ye,
|
|
4365
4336
|
"mb-16 max-w-full prose-img:max-w-prose"
|
|
4366
4337
|
),
|
|
@@ -4380,7 +4351,7 @@ const Ls = ({ content: t }) => {
|
|
|
4380
4351
|
content: a.description
|
|
4381
4352
|
}
|
|
4382
4353
|
),
|
|
4383
|
-
/* @__PURE__ */ g.jsx("div", { className: "operation mb-12", children: /* @__PURE__ */ g.jsx(
|
|
4354
|
+
/* @__PURE__ */ g.jsx("div", { className: "operation mb-12", children: /* @__PURE__ */ g.jsx(On, { children: a.operations.map((n) => /* @__PURE__ */ g.jsx(
|
|
4384
4355
|
Js,
|
|
4385
4356
|
{
|
|
4386
4357
|
operationFragment: n
|
|
@@ -4391,7 +4362,7 @@ const Ls = ({ content: t }) => {
|
|
|
4391
4362
|
] }) : null;
|
|
4392
4363
|
};
|
|
4393
4364
|
export {
|
|
4394
|
-
|
|
4395
|
-
|
|
4365
|
+
ic as OperationList,
|
|
4366
|
+
zs as OperationsFragment
|
|
4396
4367
|
};
|
|
4397
|
-
//# sourceMappingURL=OperationList-
|
|
4368
|
+
//# sourceMappingURL=OperationList-C-M33Hxu.js.map
|