zudoku 0.23.4 → 0.23.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/validators/common.d.ts +37 -37
- package/dist/config/validators/common.js +4 -1
- package/dist/config/validators/common.js.map +1 -1
- package/dist/config/validators/validate.d.ts +14 -14
- package/dist/lib/plugins/openapi/OperationList.js +7 -33
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/Route.d.ts +4 -2
- package/dist/lib/plugins/openapi/Route.js +25 -2
- package/dist/lib/plugins/openapi/Route.js.map +1 -1
- package/dist/lib/plugins/openapi/context.d.ts +3 -3
- package/dist/lib/plugins/openapi/index.js +12 -12
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/interfaces.d.ts +19 -0
- package/dist/lib/plugins/openapi/util/sanitizeMarkdownForMetatag.d.ts +1 -0
- package/dist/lib/plugins/openapi/util/sanitizeMarkdownForMetatag.js +27 -0
- package/dist/lib/plugins/openapi/util/sanitizeMarkdownForMetatag.js.map +1 -0
- package/dist/vite/config.js +2 -1
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/plugin-api.js +35 -14
- package/dist/vite/plugin-api.js.map +1 -1
- package/lib/{OperationList-C7ac3kR5.js → OperationList-wvY-BrxS.js} +1173 -1157
- package/lib/OperationList-wvY-BrxS.js.map +1 -0
- package/lib/Route-C8nwd9A2.js +37 -0
- package/lib/Route-C8nwd9A2.js.map +1 -0
- package/lib/context-h_UkBLvr.js.map +1 -1
- package/lib/{index-C8ubT49C.js → index-C_ul-2fb.js} +442 -437
- package/lib/{index-C8ubT49C.js.map → index-C_ul-2fb.js.map} +1 -1
- package/lib/zudoku.plugin-openapi.js +1 -1
- package/package.json +1 -1
- package/src/lib/plugins/openapi/OperationList.tsx +42 -50
- package/src/lib/plugins/openapi/Route.tsx +45 -9
- package/src/lib/plugins/openapi/context.tsx +2 -2
- package/src/lib/plugins/openapi/index.tsx +35 -28
- package/src/lib/plugins/openapi/interfaces.ts +22 -1
- package/src/lib/plugins/openapi/util/sanitizeMarkdownForMetatag.tsx +32 -0
- package/lib/OperationList-C7ac3kR5.js.map +0 -1
- package/lib/Route-C9cYcP-j.js +0 -11
- package/lib/Route-C9cYcP-j.js.map +0 -1
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
var
|
|
2
|
-
var me = (
|
|
3
|
-
throw TypeError(
|
|
1
|
+
var Ie = Object.defineProperty;
|
|
2
|
+
var me = (e) => {
|
|
3
|
+
throw TypeError(e);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var W = (
|
|
7
|
-
var
|
|
8
|
-
import { j as
|
|
9
|
-
import { m as
|
|
10
|
-
import { i as
|
|
11
|
-
import { XIcon as Ve, EraserIcon as
|
|
5
|
+
var qe = (e, n, s) => n in e ? Ie(e, n, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[n] = s;
|
|
6
|
+
var W = (e, n, s) => qe(e, typeof n != "symbol" ? n + "" : n, s), pe = (e, n, s) => n.has(e) || me("Cannot " + s);
|
|
7
|
+
var y = (e, n, s) => (pe(e, n, "read from private field"), s ? s.call(e) : n.get(e)), R = (e, n, s) => n.has(e) ? me("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(e) : n.set(e, s), M = (e, n, s, a) => (pe(e, n, "write to private field"), a ? a.call(e, s) : n.set(e, s), s);
|
|
8
|
+
import { j as t } from "./jsx-runtime-Dx-03ztt.js";
|
|
9
|
+
import { m as Re } from "./chunk-D52XG6IA-Dl7HLe6j.js";
|
|
10
|
+
import { i as Me, j as he, k as Ae } from "./utils-B4O1uet5.js";
|
|
11
|
+
import { XIcon as Ve, EraserIcon as Ce, ChevronsUpDownIcon as ze, LogInIcon as Fe, CirclePlayIcon as Le } from "lucide-react";
|
|
12
12
|
import { u as De } from "./hook-DgGeo5iL.js";
|
|
13
13
|
import { Button as E } from "./ui/Button.js";
|
|
14
14
|
import { initializeWorker as Ge } from "zudoku/openapi-worker";
|
|
15
15
|
import { Z as Be } from "./invariant-Caa8-XvF.js";
|
|
16
16
|
import { VisuallyHidden as Je } from "@radix-ui/react-visually-hidden";
|
|
17
|
-
import * as
|
|
18
|
-
import { useRef as
|
|
17
|
+
import * as fe from "react";
|
|
18
|
+
import { useRef as $e, useEffect as Te, useState as Ee, useTransition as He, Fragment as Z } from "react";
|
|
19
19
|
import { D as Qe, b as Ue, a as We, c as Ze } from "./Dialog-Bxv1yEIg.js";
|
|
20
|
-
import { u as Ke, S as
|
|
20
|
+
import { u as Ke, S as xe, a as ye, b as ge, c as ve, e as K } from "./Select-D3XuKKuH.js";
|
|
21
21
|
import { b as oe, C as $, u as Xe, a as Ye, F as et } from "./index.esm-BnnBRKJX.js";
|
|
22
22
|
import { a as tt } from "./state-CFQsUZUP.js";
|
|
23
|
-
import { S as
|
|
23
|
+
import { S as je } from "./Spinner-DuxJLLNE.js";
|
|
24
24
|
import { Callout as nt } from "./ui/Callout.js";
|
|
25
25
|
import { Card as ae, CardHeader as st, CardTitle as rt, CardContent as at } from "./ui/Card.js";
|
|
26
|
-
import { Tabs as
|
|
26
|
+
import { Tabs as be, TabsList as Ne, TabsTrigger as A, TabsContent as V } from "./ui/Tabs.js";
|
|
27
27
|
import { z as ot, S as it } from "./SyntaxHighlight-Bz-lOJtH.js";
|
|
28
|
-
import { c as
|
|
28
|
+
import { c as O } from "./cn-qaFjX9_3.js";
|
|
29
29
|
import { Input as H } from "./ui/Input.js";
|
|
30
30
|
import { Slot as lt } from "@radix-ui/react-slot";
|
|
31
31
|
class L extends String {
|
|
32
|
-
constructor(s,
|
|
32
|
+
constructor(s, a) {
|
|
33
33
|
super(s);
|
|
34
34
|
W(this, "__apiType");
|
|
35
|
-
this.value = s, this.__meta__ =
|
|
35
|
+
this.value = s, this.__meta__ = a;
|
|
36
36
|
}
|
|
37
37
|
toString() {
|
|
38
38
|
return this.value;
|
|
@@ -225,36 +225,36 @@ const ct = new L(
|
|
|
225
225
|
"\n query getServerQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n servers {\n url\n }\n }\n }\n": mt,
|
|
226
226
|
"\n query GetCategories($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n tags {\n __typename\n name\n operations {\n __typename\n slug\n deprecated\n method\n summary\n operationId\n path\n }\n }\n }\n }\n": pt
|
|
227
227
|
};
|
|
228
|
-
function ft(
|
|
229
|
-
return ht[
|
|
228
|
+
function ft(e) {
|
|
229
|
+
return ht[e] ?? {};
|
|
230
230
|
}
|
|
231
|
-
function X(
|
|
232
|
-
if (!ie(
|
|
231
|
+
function X(e) {
|
|
232
|
+
if (!ie(e))
|
|
233
233
|
throw new Error("Parameter was not an error");
|
|
234
234
|
}
|
|
235
|
-
function ie(
|
|
236
|
-
return !!
|
|
235
|
+
function ie(e) {
|
|
236
|
+
return !!e && typeof e == "object" && xt(e) === "[object Error]" || e instanceof Error;
|
|
237
237
|
}
|
|
238
|
-
function xt(
|
|
239
|
-
return Object.prototype.toString.call(
|
|
238
|
+
function xt(e) {
|
|
239
|
+
return Object.prototype.toString.call(e);
|
|
240
240
|
}
|
|
241
241
|
const yt = "Layerr";
|
|
242
242
|
let gt = yt;
|
|
243
243
|
function vt() {
|
|
244
244
|
return gt;
|
|
245
245
|
}
|
|
246
|
-
function jt(
|
|
246
|
+
function jt(e) {
|
|
247
247
|
let n, s = "";
|
|
248
|
-
if (
|
|
248
|
+
if (e.length === 0)
|
|
249
249
|
n = {};
|
|
250
|
-
else if (ie(
|
|
250
|
+
else if (ie(e[0]))
|
|
251
251
|
n = {
|
|
252
|
-
cause:
|
|
253
|
-
}, s =
|
|
254
|
-
else if (
|
|
255
|
-
n = Object.assign({},
|
|
256
|
-
else if (typeof
|
|
257
|
-
n = {}, s = s =
|
|
252
|
+
cause: e[0]
|
|
253
|
+
}, s = e.slice(1).join(" ") || "";
|
|
254
|
+
else if (e[0] && typeof e[0] == "object")
|
|
255
|
+
n = Object.assign({}, e[0]), s = e.slice(1).join(" ") || "";
|
|
256
|
+
else if (typeof e[0] == "string")
|
|
257
|
+
n = {}, s = s = e.join(" ") || "";
|
|
258
258
|
else
|
|
259
259
|
throw new Error("Invalid arguments passed to Layerr");
|
|
260
260
|
return {
|
|
@@ -262,13 +262,13 @@ function jt(t) {
|
|
|
262
262
|
shortMessage: s
|
|
263
263
|
};
|
|
264
264
|
}
|
|
265
|
-
class
|
|
265
|
+
class g extends Error {
|
|
266
266
|
constructor(n, s) {
|
|
267
|
-
const
|
|
268
|
-
let
|
|
269
|
-
if (
|
|
270
|
-
const
|
|
271
|
-
Error.captureStackTrace(this,
|
|
267
|
+
const a = [...arguments], { options: r, shortMessage: i } = jt(a);
|
|
268
|
+
let l = i;
|
|
269
|
+
if (r.cause && (l = `${l}: ${r.cause.message}`), super(l), this.message = l, r.name && typeof r.name == "string" ? this.name = r.name : this.name = vt(), r.cause && Object.defineProperty(this, "_cause", { value: r.cause }), Object.defineProperty(this, "_info", { value: {} }), r.info && typeof r.info == "object" && Object.assign(this._info, r.info), Error.captureStackTrace) {
|
|
270
|
+
const u = r.constructorOpt || this.constructor;
|
|
271
|
+
Error.captureStackTrace(this, u);
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
274
|
static cause(n) {
|
|
@@ -276,33 +276,33 @@ class y extends Error {
|
|
|
276
276
|
}
|
|
277
277
|
static fullStack(n) {
|
|
278
278
|
X(n);
|
|
279
|
-
const s =
|
|
279
|
+
const s = g.cause(n);
|
|
280
280
|
return s ? `${n.stack}
|
|
281
|
-
caused by: ${
|
|
281
|
+
caused by: ${g.fullStack(s)}` : n.stack ?? "";
|
|
282
282
|
}
|
|
283
283
|
static info(n) {
|
|
284
284
|
X(n);
|
|
285
|
-
const s = {},
|
|
286
|
-
return
|
|
285
|
+
const s = {}, a = g.cause(n);
|
|
286
|
+
return a && Object.assign(s, g.info(a)), n._info && Object.assign(s, n._info), s;
|
|
287
287
|
}
|
|
288
288
|
toString() {
|
|
289
289
|
let n = this.name || this.constructor.name || this.constructor.prototype.name;
|
|
290
290
|
return this.message && (n = `${n}: ${this.message}`), n;
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
|
-
const
|
|
293
|
+
const Oe = "0123456789ABCDEFGHJKMNPQRSTVWXYZ", F = 32, we = 281474976710655, bt = 10, Nt = 16, z = Object.freeze({
|
|
294
294
|
source: "ulid"
|
|
295
295
|
});
|
|
296
|
-
function wt(
|
|
296
|
+
function wt(e) {
|
|
297
297
|
const n = St(), s = n && (n.crypto || n.msCrypto) || null;
|
|
298
298
|
if (typeof (s == null ? void 0 : s.getRandomValues) == "function")
|
|
299
299
|
return () => {
|
|
300
|
-
const
|
|
301
|
-
return s.getRandomValues(
|
|
300
|
+
const a = new Uint8Array(1);
|
|
301
|
+
return s.getRandomValues(a), a[0] / 255;
|
|
302
302
|
};
|
|
303
303
|
if (typeof (s == null ? void 0 : s.randomBytes) == "function")
|
|
304
304
|
return () => s.randomBytes(1).readUInt8() / 255;
|
|
305
|
-
throw new
|
|
305
|
+
throw new g({
|
|
306
306
|
info: {
|
|
307
307
|
code: "PRNG_DETECT",
|
|
308
308
|
...z
|
|
@@ -312,283 +312,283 @@ function wt(t) {
|
|
|
312
312
|
function St() {
|
|
313
313
|
return Tt() ? self : typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : null;
|
|
314
314
|
}
|
|
315
|
-
function Ct(
|
|
315
|
+
function Ct(e, n) {
|
|
316
316
|
let s = "";
|
|
317
|
-
for (;
|
|
317
|
+
for (; e > 0; e--)
|
|
318
318
|
s = Et(n) + s;
|
|
319
319
|
return s;
|
|
320
320
|
}
|
|
321
|
-
function $t(
|
|
322
|
-
if (isNaN(
|
|
323
|
-
throw new
|
|
321
|
+
function $t(e, n) {
|
|
322
|
+
if (isNaN(e))
|
|
323
|
+
throw new g({
|
|
324
324
|
info: {
|
|
325
325
|
code: "ENC_TIME_NAN",
|
|
326
326
|
...z
|
|
327
327
|
}
|
|
328
|
-
}, `Time must be a number: ${
|
|
329
|
-
if (
|
|
330
|
-
throw new
|
|
328
|
+
}, `Time must be a number: ${e}`);
|
|
329
|
+
if (e > we)
|
|
330
|
+
throw new g({
|
|
331
331
|
info: {
|
|
332
332
|
code: "ENC_TIME_SIZE_EXCEED",
|
|
333
333
|
...z
|
|
334
334
|
}
|
|
335
|
-
}, `Cannot encode a time larger than ${
|
|
336
|
-
if (
|
|
337
|
-
throw new
|
|
335
|
+
}, `Cannot encode a time larger than ${we}: ${e}`);
|
|
336
|
+
if (e < 0)
|
|
337
|
+
throw new g({
|
|
338
338
|
info: {
|
|
339
339
|
code: "ENC_TIME_NEG",
|
|
340
340
|
...z
|
|
341
341
|
}
|
|
342
|
-
}, `Time must be positive: ${
|
|
343
|
-
if (Number.isInteger(
|
|
344
|
-
throw new
|
|
342
|
+
}, `Time must be positive: ${e}`);
|
|
343
|
+
if (Number.isInteger(e) === !1)
|
|
344
|
+
throw new g({
|
|
345
345
|
info: {
|
|
346
346
|
code: "ENC_TIME_TYPE",
|
|
347
347
|
...z
|
|
348
348
|
}
|
|
349
|
-
}, `Time must be an integer: ${
|
|
350
|
-
let s,
|
|
351
|
-
for (let
|
|
352
|
-
s =
|
|
353
|
-
return
|
|
349
|
+
}, `Time must be an integer: ${e}`);
|
|
350
|
+
let s, a = "";
|
|
351
|
+
for (let r = n; r > 0; r--)
|
|
352
|
+
s = e % F, a = Oe.charAt(s) + a, e = (e - s) / F;
|
|
353
|
+
return a;
|
|
354
354
|
}
|
|
355
355
|
function Tt() {
|
|
356
356
|
return typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope;
|
|
357
357
|
}
|
|
358
|
-
function Et(
|
|
359
|
-
let n = Math.floor(
|
|
360
|
-
return n === F && (n = F - 1),
|
|
358
|
+
function Et(e) {
|
|
359
|
+
let n = Math.floor(e() * F);
|
|
360
|
+
return n === F && (n = F - 1), Oe.charAt(n);
|
|
361
361
|
}
|
|
362
|
-
function
|
|
363
|
-
const s = wt(),
|
|
364
|
-
return $t(
|
|
362
|
+
function Ot(e, n) {
|
|
363
|
+
const s = wt(), a = isNaN(e) ? Date.now() : e;
|
|
364
|
+
return $t(a, bt) + Ct(Nt, s);
|
|
365
365
|
}
|
|
366
366
|
let Y, ee;
|
|
367
|
-
const
|
|
368
|
-
|
|
369
|
-
}, te = (
|
|
367
|
+
const Pt = async (e) => {
|
|
368
|
+
e && typeof e == "object" && "type" in e && e.type === "file" && "input" in e && typeof e.input == "function" && (e.input = await e.input());
|
|
369
|
+
}, te = (e) => {
|
|
370
370
|
var n;
|
|
371
|
-
if ((n =
|
|
372
|
-
throw new Be(
|
|
371
|
+
if ((n = e.errors) != null && n[0])
|
|
372
|
+
throw new Be(e.errors[0].message, {
|
|
373
373
|
developerHint: "Check your configuration value `apis.type` and `apis.input` in the Zudoku config."
|
|
374
374
|
});
|
|
375
375
|
};
|
|
376
|
-
var T,
|
|
377
|
-
class
|
|
376
|
+
var T, P, N, Q;
|
|
377
|
+
class kt {
|
|
378
378
|
constructor(n) {
|
|
379
379
|
R(this, T);
|
|
380
|
-
R(this,
|
|
380
|
+
R(this, P, /* @__PURE__ */ new Map());
|
|
381
381
|
R(this, N);
|
|
382
382
|
R(this, Q, () => import("./createServer-69sLlmQA.js").then((n) => n.createServer()));
|
|
383
383
|
W(this, "fetch", async (n, ...[s]) => {
|
|
384
|
-
var
|
|
385
|
-
const
|
|
386
|
-
await
|
|
387
|
-
const
|
|
388
|
-
switch (
|
|
384
|
+
var i;
|
|
385
|
+
const a = (i = n.match(/query (\w+)/)) == null ? void 0 : i[1];
|
|
386
|
+
await Pt(s);
|
|
387
|
+
const r = JSON.stringify({ query: n, variables: s, operationName: a });
|
|
388
|
+
switch (y(this, T)) {
|
|
389
389
|
case "remote": {
|
|
390
|
-
const
|
|
390
|
+
const l = await fetch(this.config.server, {
|
|
391
391
|
method: "POST",
|
|
392
|
-
body:
|
|
392
|
+
body: r,
|
|
393
393
|
headers: { "Content-Type": "application/json" }
|
|
394
394
|
});
|
|
395
|
-
if (!
|
|
395
|
+
if (!l.ok)
|
|
396
396
|
throw new Error("Network response was not ok");
|
|
397
|
-
const
|
|
398
|
-
return te(
|
|
397
|
+
const u = await l.json();
|
|
398
|
+
return te(u), u.data;
|
|
399
399
|
}
|
|
400
400
|
case "in-memory": {
|
|
401
|
-
Y || (Y =
|
|
402
|
-
const
|
|
403
|
-
if (!
|
|
404
|
-
const
|
|
401
|
+
Y || (Y = y(this, Q).call(this));
|
|
402
|
+
const l = await Y;
|
|
403
|
+
if (!l) throw new Error("Local server not initialized");
|
|
404
|
+
const u = await l.fetch(
|
|
405
405
|
new Request("http://localhost/graphql", {
|
|
406
406
|
method: "POST",
|
|
407
|
-
body:
|
|
407
|
+
body: r,
|
|
408
408
|
headers: { "Content-Type": "application/json" }
|
|
409
409
|
})
|
|
410
410
|
);
|
|
411
|
-
if (!
|
|
411
|
+
if (!u.ok)
|
|
412
412
|
throw new Error("Network response was not ok");
|
|
413
|
-
const
|
|
414
|
-
return te(
|
|
413
|
+
const d = await u.json();
|
|
414
|
+
return te(d), d.data;
|
|
415
415
|
}
|
|
416
416
|
case "worker": {
|
|
417
|
-
if (ee || (ee = Ge()), !
|
|
418
|
-
const
|
|
419
|
-
ee.port.postMessage({ port:
|
|
420
|
-
const { id:
|
|
417
|
+
if (ee || (ee = Ge()), !y(this, N)) {
|
|
418
|
+
const c = new MessageChannel();
|
|
419
|
+
ee.port.postMessage({ port: c.port2 }, [c.port2]), M(this, N, c.port1), y(this, N).onmessage = (f) => {
|
|
420
|
+
const { id: h, body: j } = f.data, b = y(this, P).get(h);
|
|
421
421
|
if (b) {
|
|
422
422
|
const w = JSON.parse(j);
|
|
423
|
-
b(w),
|
|
423
|
+
b(w), y(this, P).delete(h);
|
|
424
424
|
} else
|
|
425
|
-
console.error(`No pending request found for id: ${
|
|
426
|
-
},
|
|
425
|
+
console.error(`No pending request found for id: ${h}`);
|
|
426
|
+
}, y(this, N).start();
|
|
427
427
|
}
|
|
428
|
-
const
|
|
429
|
-
(
|
|
430
|
-
|
|
428
|
+
const l = Ot(), d = await new Promise(
|
|
429
|
+
(c) => {
|
|
430
|
+
y(this, P).set(l, c), y(this, N).postMessage({ id: l, body: r });
|
|
431
431
|
}
|
|
432
432
|
);
|
|
433
|
-
return te(
|
|
433
|
+
return te(d), d.data;
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
436
|
});
|
|
437
437
|
this.config = n, n.server ? M(this, T, "remote") : n.inMemory || typeof SharedWorker > "u" ? M(this, T, "in-memory") : M(this, T, "worker");
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
|
-
T = new WeakMap(),
|
|
441
|
-
const ne = (
|
|
442
|
-
isNaN(parseInt(
|
|
443
|
-
), se = (
|
|
444
|
-
const s = (3 * se(
|
|
445
|
-
return `${s}deg ${
|
|
446
|
-
}, re = "data-linked-param", It = (
|
|
440
|
+
T = new WeakMap(), P = new WeakMap(), N = new WeakMap(), Q = new WeakMap();
|
|
441
|
+
const ne = (e) => Math.abs(
|
|
442
|
+
isNaN(parseInt(e)) ? e.toLowerCase().charCodeAt(0) - 96 : isNaN(parseInt(e)) ? 0 : parseInt(e)
|
|
443
|
+
), se = (e) => e.length > 1 ? parseInt(e.split("").reduce((n, s) => `${ne(n) + ne(s)}`)) : ne(e), _t = (e, n = {}) => {
|
|
444
|
+
const s = (3 * se(e) + 2 * se(e) + se(e)) % 360, { saturation: a = 75, lightness: r = 60 } = n;
|
|
445
|
+
return `${s}deg ${a}% ${r}%`;
|
|
446
|
+
}, re = "data-linked-param", It = (e) => {
|
|
447
447
|
const { resolvedTheme: n } = ot();
|
|
448
|
-
return
|
|
449
|
-
|
|
448
|
+
return _t(
|
|
449
|
+
e,
|
|
450
450
|
n === "light" ? { saturation: 85, lightness: 50 } : void 0
|
|
451
451
|
);
|
|
452
452
|
}, Pe = ({
|
|
453
|
-
name:
|
|
453
|
+
name: e,
|
|
454
454
|
className: n,
|
|
455
455
|
backgroundOpacity: s = "100%",
|
|
456
|
-
borderOpacity:
|
|
457
|
-
slug:
|
|
458
|
-
children:
|
|
459
|
-
onClick:
|
|
456
|
+
borderOpacity: a = "100%",
|
|
457
|
+
slug: r,
|
|
458
|
+
children: i,
|
|
459
|
+
onClick: l
|
|
460
460
|
}) => {
|
|
461
|
-
const
|
|
462
|
-
return
|
|
463
|
-
if (!
|
|
461
|
+
const u = $e(null), d = e.replace(/[{}]/g, ""), c = r == null ? void 0 : r.replace(/[{}]/g, ""), f = It(d), h = `hsl(${f} / ${a})`, j = `hsl(${f} / ${s})`;
|
|
462
|
+
return Te(() => {
|
|
463
|
+
if (!c || !u.current) return;
|
|
464
464
|
const b = () => {
|
|
465
|
-
document.querySelectorAll(`[${re}="${
|
|
465
|
+
document.querySelectorAll(`[${re}="${c}"]`).forEach((S) => {
|
|
466
466
|
S instanceof HTMLElement && (S.dataset.active = "true");
|
|
467
467
|
});
|
|
468
468
|
}, w = () => {
|
|
469
|
-
document.querySelectorAll(`[${re}="${
|
|
469
|
+
document.querySelectorAll(`[${re}="${c}"]`).forEach((S) => {
|
|
470
470
|
S instanceof HTMLElement && (S.dataset.active = "false");
|
|
471
471
|
});
|
|
472
|
-
}, v =
|
|
472
|
+
}, v = u.current;
|
|
473
473
|
return v.addEventListener("mouseenter", b), v.addEventListener("mouseleave", w), () => {
|
|
474
474
|
v.removeEventListener("mouseenter", b), v.removeEventListener("mouseleave", w);
|
|
475
475
|
};
|
|
476
|
-
}, [
|
|
476
|
+
}, [c]), /* @__PURE__ */ t.jsx(
|
|
477
477
|
"span",
|
|
478
478
|
{
|
|
479
|
-
[re]:
|
|
480
|
-
className:
|
|
479
|
+
[re]: c,
|
|
480
|
+
className: O(
|
|
481
481
|
"relative after:rounded after:absolute after:inset-0 after:-bottom-0.5 after:border-b-2 after:transition-opacity after:duration-200",
|
|
482
482
|
"after:pointer-events-none after:border-[--border-color] after:opacity-30 after:data-[active=true]:opacity-100",
|
|
483
483
|
n
|
|
484
484
|
),
|
|
485
485
|
suppressHydrationWarning: !0,
|
|
486
|
-
ref:
|
|
487
|
-
onClick:
|
|
486
|
+
ref: u,
|
|
487
|
+
onClick: l,
|
|
488
488
|
style: {
|
|
489
|
-
"--border-color":
|
|
489
|
+
"--border-color": h,
|
|
490
490
|
"--background-color": j
|
|
491
491
|
},
|
|
492
|
-
children:
|
|
492
|
+
children: i ?? e
|
|
493
493
|
}
|
|
494
494
|
);
|
|
495
|
-
}, qt = (
|
|
496
|
-
const
|
|
497
|
-
var
|
|
498
|
-
const
|
|
499
|
-
return ((
|
|
500
|
-
}),
|
|
501
|
-
|
|
502
|
-
|
|
495
|
+
}, qt = (e, n, s) => {
|
|
496
|
+
const a = n.replace(/(:\w+|\{\w+})/g, (i) => {
|
|
497
|
+
var d;
|
|
498
|
+
const l = i.replace(/[:{}]/g, "");
|
|
499
|
+
return ((d = s.pathParams.find((c) => c.name === l)) == null ? void 0 : d.value) ?? i;
|
|
500
|
+
}), r = new URL(
|
|
501
|
+
a.replace(/^\//, ""),
|
|
502
|
+
e.endsWith("/") ? e : `${e}/`
|
|
503
503
|
);
|
|
504
|
-
return s.queryParams.filter((
|
|
505
|
-
|
|
506
|
-
}),
|
|
504
|
+
return s.queryParams.filter((i) => i.active).forEach((i) => {
|
|
505
|
+
r.searchParams.set(i.name, i.value);
|
|
506
|
+
}), r;
|
|
507
507
|
}, Rt = ({
|
|
508
|
-
control:
|
|
508
|
+
control: e,
|
|
509
509
|
register: n
|
|
510
510
|
}) => {
|
|
511
|
-
const { fields: s, append:
|
|
512
|
-
control:
|
|
511
|
+
const { fields: s, append: a, remove: r } = oe({
|
|
512
|
+
control: e,
|
|
513
513
|
name: "headers"
|
|
514
514
|
});
|
|
515
|
-
return /* @__PURE__ */
|
|
516
|
-
/* @__PURE__ */
|
|
515
|
+
return /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
516
|
+
/* @__PURE__ */ t.jsx("table", { className: "w-full [&_td]:border [&_td]:p-1.5 [&_td]:px-2", children: /* @__PURE__ */ t.jsx("tbody", { children: s.map((i, l) => /* @__PURE__ */ t.jsxs(
|
|
517
517
|
"tr",
|
|
518
518
|
{
|
|
519
519
|
className: "group has-[:focus]:bg-muted/50 hover:bg-muted/50",
|
|
520
520
|
children: [
|
|
521
|
-
/* @__PURE__ */
|
|
521
|
+
/* @__PURE__ */ t.jsx("td", { className: "flex gap-2 items-center", children: /* @__PURE__ */ t.jsx(
|
|
522
522
|
H,
|
|
523
523
|
{
|
|
524
|
-
...n(`headers.${
|
|
524
|
+
...n(`headers.${l}.name`),
|
|
525
525
|
placeholder: "Name",
|
|
526
526
|
className: "border-0 shadow-none text-xs font-mono",
|
|
527
527
|
autoComplete: "off"
|
|
528
528
|
}
|
|
529
529
|
) }),
|
|
530
|
-
/* @__PURE__ */
|
|
531
|
-
/* @__PURE__ */
|
|
530
|
+
/* @__PURE__ */ t.jsx("td", { children: /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
531
|
+
/* @__PURE__ */ t.jsx(
|
|
532
532
|
H,
|
|
533
533
|
{
|
|
534
534
|
placeholder: "Value",
|
|
535
535
|
className: "border-0 shadow-none text-xs font-mono",
|
|
536
|
-
...n(`headers.${
|
|
536
|
+
...n(`headers.${l}.value`),
|
|
537
537
|
autoComplete: "off"
|
|
538
538
|
}
|
|
539
539
|
),
|
|
540
|
-
/* @__PURE__ */
|
|
540
|
+
/* @__PURE__ */ t.jsx(
|
|
541
541
|
E,
|
|
542
542
|
{
|
|
543
543
|
size: "icon",
|
|
544
544
|
variant: "ghost",
|
|
545
545
|
className: "text-muted-foreground opacity-0 group-hover:opacity-100",
|
|
546
546
|
onClick: () => {
|
|
547
|
-
|
|
547
|
+
r(l);
|
|
548
548
|
},
|
|
549
549
|
type: "button",
|
|
550
|
-
children: /* @__PURE__ */
|
|
550
|
+
children: /* @__PURE__ */ t.jsx(Ve, { size: 16 })
|
|
551
551
|
}
|
|
552
552
|
)
|
|
553
553
|
] }) })
|
|
554
554
|
]
|
|
555
555
|
},
|
|
556
|
-
|
|
556
|
+
i.id
|
|
557
557
|
)) }) }),
|
|
558
|
-
/* @__PURE__ */
|
|
558
|
+
/* @__PURE__ */ t.jsx("div", { className: "text-end", children: /* @__PURE__ */ t.jsx(
|
|
559
559
|
E,
|
|
560
560
|
{
|
|
561
561
|
className: "",
|
|
562
|
-
onClick: () =>
|
|
562
|
+
onClick: () => a({ name: "", value: "" }),
|
|
563
563
|
type: "button",
|
|
564
564
|
children: "Add header"
|
|
565
565
|
}
|
|
566
566
|
) })
|
|
567
567
|
] });
|
|
568
568
|
}, Mt = ({
|
|
569
|
-
control:
|
|
569
|
+
control: e
|
|
570
570
|
}) => {
|
|
571
571
|
const { fields: n } = oe({
|
|
572
|
-
control:
|
|
572
|
+
control: e,
|
|
573
573
|
name: "pathParams"
|
|
574
574
|
});
|
|
575
|
-
return /* @__PURE__ */
|
|
576
|
-
/* @__PURE__ */
|
|
575
|
+
return /* @__PURE__ */ t.jsx("table", { className: "w-full table-auto [&_td]:border [&_td]:py-1 [&_td]:px-2", children: /* @__PURE__ */ t.jsx("tbody", { children: n.map((s, a) => /* @__PURE__ */ t.jsxs("tr", { className: "hover:bg-accent/40", children: [
|
|
576
|
+
/* @__PURE__ */ t.jsx("td", { children: /* @__PURE__ */ t.jsx(
|
|
577
577
|
$,
|
|
578
578
|
{
|
|
579
|
-
control:
|
|
580
|
-
name: `pathParams.${
|
|
581
|
-
render: ({ field:
|
|
582
|
-
/* @__PURE__ */
|
|
579
|
+
control: e,
|
|
580
|
+
name: `pathParams.${a}.value`,
|
|
581
|
+
render: ({ field: r }) => /* @__PURE__ */ t.jsxs("div", { children: [
|
|
582
|
+
/* @__PURE__ */ t.jsx(
|
|
583
583
|
Pe,
|
|
584
584
|
{
|
|
585
585
|
slug: s.name,
|
|
586
586
|
name: s.name,
|
|
587
587
|
backgroundOpacity: "25%",
|
|
588
|
-
borderOpacity:
|
|
589
|
-
className:
|
|
588
|
+
borderOpacity: r.value ? "100%" : "0",
|
|
589
|
+
className: O(
|
|
590
590
|
"font-mono text-xs m-2",
|
|
591
|
-
!
|
|
591
|
+
!r.value && "opacity-60"
|
|
592
592
|
)
|
|
593
593
|
}
|
|
594
594
|
),
|
|
@@ -596,16 +596,16 @@ const ne = (t) => Math.abs(
|
|
|
596
596
|
] })
|
|
597
597
|
}
|
|
598
598
|
) }),
|
|
599
|
-
/* @__PURE__ */
|
|
600
|
-
/* @__PURE__ */
|
|
599
|
+
/* @__PURE__ */ t.jsx("td", { children: /* @__PURE__ */ t.jsxs("div", { className: "flex justify-between items-center", children: [
|
|
600
|
+
/* @__PURE__ */ t.jsx(
|
|
601
601
|
$,
|
|
602
602
|
{
|
|
603
|
-
control:
|
|
604
|
-
name: `pathParams.${
|
|
605
|
-
render: ({ field:
|
|
603
|
+
control: e,
|
|
604
|
+
name: `pathParams.${a}.value`,
|
|
605
|
+
render: ({ field: r }) => /* @__PURE__ */ t.jsx(
|
|
606
606
|
H,
|
|
607
607
|
{
|
|
608
|
-
...
|
|
608
|
+
...r,
|
|
609
609
|
required: !0,
|
|
610
610
|
placeholder: "Enter value",
|
|
611
611
|
className: "border-0 shadow-none ring-0 font-mono text-xs"
|
|
@@ -613,166 +613,166 @@ const ne = (t) => Math.abs(
|
|
|
613
613
|
)
|
|
614
614
|
}
|
|
615
615
|
),
|
|
616
|
-
/* @__PURE__ */
|
|
616
|
+
/* @__PURE__ */ t.jsx(
|
|
617
617
|
$,
|
|
618
618
|
{
|
|
619
|
-
control:
|
|
620
|
-
name: `pathParams.${
|
|
621
|
-
render: ({ field:
|
|
619
|
+
control: e,
|
|
620
|
+
name: `pathParams.${a}.value`,
|
|
621
|
+
render: ({ field: r }) => /* @__PURE__ */ t.jsx(
|
|
622
622
|
E,
|
|
623
623
|
{
|
|
624
624
|
size: "icon",
|
|
625
625
|
type: "button",
|
|
626
626
|
variant: "ghost",
|
|
627
627
|
"aria-label": "Clear value",
|
|
628
|
-
className:
|
|
628
|
+
className: O(
|
|
629
629
|
"ms-2",
|
|
630
|
-
|
|
630
|
+
r.value.length === 0 ? "opacity-0 pointer-events-none" : "opacity-100"
|
|
631
631
|
),
|
|
632
632
|
title: "Clear value",
|
|
633
|
-
onClick: () =>
|
|
634
|
-
children: /* @__PURE__ */
|
|
633
|
+
onClick: () => r.onChange(""),
|
|
634
|
+
children: /* @__PURE__ */ t.jsx(Ce, { size: 16 })
|
|
635
635
|
}
|
|
636
636
|
)
|
|
637
637
|
}
|
|
638
638
|
)
|
|
639
639
|
] }) })
|
|
640
640
|
] }, s.id)) }) });
|
|
641
|
-
}, At = (
|
|
642
|
-
const s =
|
|
643
|
-
const
|
|
644
|
-
return
|
|
645
|
-
...
|
|
646
|
-
ref:
|
|
647
|
-
className:
|
|
641
|
+
}, At = (e, n) => {
|
|
642
|
+
const s = fe.forwardRef(({ className: a, asChild: r, ...i }, l) => {
|
|
643
|
+
const u = r ? lt : e;
|
|
644
|
+
return fe.createElement(u, {
|
|
645
|
+
...i,
|
|
646
|
+
ref: l,
|
|
647
|
+
className: O(n, a)
|
|
648
648
|
});
|
|
649
649
|
});
|
|
650
|
-
return s.displayName = `VariantComponent(${
|
|
650
|
+
return s.displayName = `VariantComponent(${e})`, s;
|
|
651
651
|
}, Vt = At(
|
|
652
652
|
"input",
|
|
653
653
|
"px-2 bg-transparent h-6 font-mono text-xs m-2"
|
|
654
654
|
), zt = ({
|
|
655
|
-
control:
|
|
655
|
+
control: e,
|
|
656
656
|
queryParams: n
|
|
657
657
|
}) => {
|
|
658
658
|
const { fields: s } = oe({
|
|
659
|
-
control:
|
|
659
|
+
control: e,
|
|
660
660
|
name: "queryParams"
|
|
661
|
-
}),
|
|
662
|
-
return /* @__PURE__ */
|
|
661
|
+
}), a = Xe(), r = n.map((u) => !!u.isRequired), l = a.watch("identity") !== J;
|
|
662
|
+
return /* @__PURE__ */ t.jsx("div", { className: "", children: /* @__PURE__ */ t.jsx("table", { className: "w-full [&_td]:border [&_td]:p-1.5 [&_td]:px-2", children: /* @__PURE__ */ t.jsx("tbody", { children: s.filter(
|
|
663
663
|
// TODO remove this hack for Accu or make it more generic
|
|
664
|
-
(
|
|
665
|
-
).map((
|
|
666
|
-
/* @__PURE__ */
|
|
664
|
+
(u) => !(l && u.name === "apikey")
|
|
665
|
+
).map((u, d) => /* @__PURE__ */ t.jsxs("tr", { className: "hover:bg-accent/40", children: [
|
|
666
|
+
/* @__PURE__ */ t.jsx("td", { className: "text-center", children: /* @__PURE__ */ t.jsx(
|
|
667
667
|
$,
|
|
668
668
|
{
|
|
669
|
-
control:
|
|
670
|
-
name: `queryParams.${
|
|
671
|
-
render: ({ field:
|
|
669
|
+
control: e,
|
|
670
|
+
name: `queryParams.${d}.active`,
|
|
671
|
+
render: ({ field: c }) => /* @__PURE__ */ t.jsx(
|
|
672
672
|
"input",
|
|
673
673
|
{
|
|
674
674
|
type: "checkbox",
|
|
675
|
-
id: `queryParams.${
|
|
676
|
-
checked:
|
|
677
|
-
onChange:
|
|
675
|
+
id: `queryParams.${d}.active`,
|
|
676
|
+
checked: c.value,
|
|
677
|
+
onChange: c.onChange
|
|
678
678
|
}
|
|
679
679
|
)
|
|
680
680
|
}
|
|
681
681
|
) }),
|
|
682
|
-
/* @__PURE__ */
|
|
682
|
+
/* @__PURE__ */ t.jsx("td", { children: /* @__PURE__ */ t.jsx(
|
|
683
683
|
$,
|
|
684
684
|
{
|
|
685
|
-
control:
|
|
686
|
-
render: ({ field:
|
|
685
|
+
control: e,
|
|
686
|
+
render: ({ field: c }) => /* @__PURE__ */ t.jsx(Vt, { asChild: !0, children: /* @__PURE__ */ t.jsxs(
|
|
687
687
|
"label",
|
|
688
688
|
{
|
|
689
689
|
className: "flex items-center cursor-pointer",
|
|
690
|
-
htmlFor: `queryParams.${
|
|
691
|
-
title:
|
|
690
|
+
htmlFor: `queryParams.${d}.active`,
|
|
691
|
+
title: r[d] ? "Required field" : void 0,
|
|
692
692
|
children: [
|
|
693
|
-
|
|
694
|
-
|
|
693
|
+
c.value,
|
|
694
|
+
r[d] && /* @__PURE__ */ t.jsx("sup", { children: " *" })
|
|
695
695
|
]
|
|
696
696
|
}
|
|
697
697
|
) }),
|
|
698
|
-
name: `queryParams.${
|
|
698
|
+
name: `queryParams.${d}.name`
|
|
699
699
|
}
|
|
700
700
|
) }),
|
|
701
|
-
/* @__PURE__ */
|
|
702
|
-
/* @__PURE__ */
|
|
701
|
+
/* @__PURE__ */ t.jsx("td", { children: /* @__PURE__ */ t.jsxs("div", { className: "flex justify-between items-center", children: [
|
|
702
|
+
/* @__PURE__ */ t.jsx(
|
|
703
703
|
$,
|
|
704
704
|
{
|
|
705
|
-
control:
|
|
706
|
-
render: ({ field:
|
|
705
|
+
control: e,
|
|
706
|
+
render: ({ field: c }) => /* @__PURE__ */ t.jsx(
|
|
707
707
|
H,
|
|
708
708
|
{
|
|
709
|
-
...
|
|
710
|
-
onChange: (
|
|
711
|
-
|
|
709
|
+
...c,
|
|
710
|
+
onChange: (f) => {
|
|
711
|
+
c.onChange(f.target.value), f.target.value.length > 0 && a.setValue(`queryParams.${d}.active`, !0);
|
|
712
712
|
},
|
|
713
713
|
placeholder: "Enter value",
|
|
714
714
|
className: "w-full border-0 shadow-none text-xs font-mono"
|
|
715
715
|
}
|
|
716
716
|
),
|
|
717
|
-
name: `queryParams.${
|
|
717
|
+
name: `queryParams.${d}.value`
|
|
718
718
|
}
|
|
719
719
|
),
|
|
720
|
-
/* @__PURE__ */
|
|
720
|
+
/* @__PURE__ */ t.jsx(
|
|
721
721
|
$,
|
|
722
722
|
{
|
|
723
|
-
control:
|
|
724
|
-
render: ({ field:
|
|
723
|
+
control: e,
|
|
724
|
+
render: ({ field: c }) => /* @__PURE__ */ t.jsx(
|
|
725
725
|
E,
|
|
726
726
|
{
|
|
727
727
|
size: "icon",
|
|
728
728
|
type: "button",
|
|
729
729
|
variant: "ghost",
|
|
730
730
|
"aria-label": "Clear value",
|
|
731
|
-
className:
|
|
731
|
+
className: O(
|
|
732
732
|
"ms-2",
|
|
733
|
-
|
|
733
|
+
c.value.length === 0 ? "opacity-0 pointer-events-none" : "opacity-100"
|
|
734
734
|
),
|
|
735
735
|
title: "Clear value",
|
|
736
|
-
onClick: () =>
|
|
737
|
-
children: /* @__PURE__ */
|
|
736
|
+
onClick: () => c.onChange(""),
|
|
737
|
+
children: /* @__PURE__ */ t.jsx(Ce, { size: 16 })
|
|
738
738
|
}
|
|
739
739
|
),
|
|
740
|
-
name: `queryParams.${
|
|
740
|
+
name: `queryParams.${d}.value`
|
|
741
741
|
}
|
|
742
742
|
)
|
|
743
743
|
] }) })
|
|
744
|
-
] },
|
|
744
|
+
] }, u.id)) }) }) });
|
|
745
745
|
}, Ft = ({
|
|
746
|
-
value:
|
|
746
|
+
value: e,
|
|
747
747
|
onChange: n,
|
|
748
748
|
className: s,
|
|
749
|
-
options:
|
|
750
|
-
showChevrons:
|
|
751
|
-
}) => /* @__PURE__ */
|
|
752
|
-
/* @__PURE__ */
|
|
749
|
+
options: a,
|
|
750
|
+
showChevrons: r = !0
|
|
751
|
+
}) => /* @__PURE__ */ t.jsxs("div", { className: "grid", children: [
|
|
752
|
+
/* @__PURE__ */ t.jsx(
|
|
753
753
|
"select",
|
|
754
754
|
{
|
|
755
|
-
className:
|
|
755
|
+
className: O(
|
|
756
756
|
"row-start-1 col-start-1 border border-input text-foreground px-2 py-1 pe-6",
|
|
757
757
|
"rounded-md appearance-none bg-zinc-50 hover:bg-white dark:bg-zinc-800 hover:dark:bg-zinc-800/75",
|
|
758
758
|
s
|
|
759
759
|
),
|
|
760
|
-
value:
|
|
760
|
+
value: e,
|
|
761
761
|
onChange: n,
|
|
762
|
-
children:
|
|
762
|
+
children: a.map((i) => /* @__PURE__ */ t.jsx("option", { value: i.value, children: i.label }, i.value))
|
|
763
763
|
}
|
|
764
764
|
),
|
|
765
|
-
/* @__PURE__ */
|
|
765
|
+
/* @__PURE__ */ t.jsx(
|
|
766
766
|
"div",
|
|
767
767
|
{
|
|
768
|
-
className:
|
|
769
|
-
!
|
|
768
|
+
className: O(
|
|
769
|
+
!r && "hidden",
|
|
770
770
|
"row-start-1 col-start-1 self-center justify-self-end relative end-2 pointer-events-none"
|
|
771
771
|
),
|
|
772
|
-
children: /* @__PURE__ */
|
|
772
|
+
children: /* @__PURE__ */ t.jsx(ze, { size: 14 })
|
|
773
773
|
}
|
|
774
774
|
)
|
|
775
|
-
] }), Lt = (
|
|
775
|
+
] }), Lt = (e) => {
|
|
776
776
|
var s;
|
|
777
777
|
return (s = Object.entries({
|
|
778
778
|
"application/json": "json",
|
|
@@ -783,39 +783,39 @@ const ne = (t) => Math.abs(
|
|
|
783
783
|
"application/xml": "xml",
|
|
784
784
|
"application/xhtml+xml": "xhtml"
|
|
785
785
|
}).find(
|
|
786
|
-
([
|
|
786
|
+
([a]) => e.includes(a)
|
|
787
787
|
)) == null ? void 0 : s[1];
|
|
788
|
-
}, Dt = (
|
|
789
|
-
const n =
|
|
788
|
+
}, Dt = (e) => {
|
|
789
|
+
const n = e.get("Content-Type") || "";
|
|
790
790
|
return Lt(n);
|
|
791
|
-
}, Gt = (
|
|
791
|
+
}, Gt = (e) => {
|
|
792
792
|
try {
|
|
793
|
-
return JSON.stringify(JSON.parse(
|
|
793
|
+
return JSON.stringify(JSON.parse(e), null, 2);
|
|
794
794
|
} catch {
|
|
795
795
|
return null;
|
|
796
796
|
}
|
|
797
797
|
}, Bt = ({
|
|
798
|
-
body:
|
|
798
|
+
body: e = "",
|
|
799
799
|
headers: n
|
|
800
800
|
}) => {
|
|
801
|
-
const s = Dt(n),
|
|
802
|
-
|
|
801
|
+
const s = Dt(n), a = Gt(e), r = a || e, [i, l] = Ee(
|
|
802
|
+
a ? "formatted" : "raw"
|
|
803
803
|
);
|
|
804
|
-
return /* @__PURE__ */
|
|
805
|
-
/* @__PURE__ */
|
|
804
|
+
return /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
805
|
+
/* @__PURE__ */ t.jsx(ae, { className: "shadow-none", children: /* @__PURE__ */ t.jsx(
|
|
806
806
|
it,
|
|
807
807
|
{
|
|
808
|
-
language:
|
|
808
|
+
language: i === "raw" ? a ? "plain" : s : "json",
|
|
809
809
|
noBackground: !0,
|
|
810
810
|
className: "overflow-x-auto p-4 text-xs max-h-[calc(83.333vh-180px)]",
|
|
811
|
-
code:
|
|
811
|
+
code: i === "raw" ? e : r
|
|
812
812
|
}
|
|
813
813
|
) }),
|
|
814
|
-
|
|
814
|
+
a && /* @__PURE__ */ t.jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ t.jsx(
|
|
815
815
|
Ft,
|
|
816
816
|
{
|
|
817
|
-
value:
|
|
818
|
-
onChange: (
|
|
817
|
+
value: i,
|
|
818
|
+
onChange: (u) => l(u.target.value),
|
|
819
819
|
options: [
|
|
820
820
|
{ value: "formatted", label: "Formatted" },
|
|
821
821
|
{ value: "raw", label: "Raw" }
|
|
@@ -835,56 +835,56 @@ const ne = (t) => Math.abs(
|
|
|
835
835
|
405: "Method Not Allowed",
|
|
836
836
|
500: "Internal Server Error"
|
|
837
837
|
}, Ht = ({
|
|
838
|
-
server:
|
|
838
|
+
server: e,
|
|
839
839
|
servers: n,
|
|
840
840
|
url: s,
|
|
841
|
-
method:
|
|
842
|
-
headers:
|
|
843
|
-
queryParams:
|
|
844
|
-
pathParams:
|
|
845
|
-
defaultBody:
|
|
841
|
+
method: a,
|
|
842
|
+
headers: r = [],
|
|
843
|
+
queryParams: i = [],
|
|
844
|
+
pathParams: l = [],
|
|
845
|
+
defaultBody: u = ""
|
|
846
846
|
}) => {
|
|
847
847
|
var de, ue;
|
|
848
|
-
const { selectedServer:
|
|
848
|
+
const { selectedServer: d, setSelectedServer: c } = tt(), [, f] = He(), { register: h, control: j, handleSubmit: b, watch: w, setValue: v, ...S } = Ye({
|
|
849
849
|
defaultValues: {
|
|
850
|
-
body:
|
|
851
|
-
queryParams:
|
|
852
|
-
name:
|
|
853
|
-
value:
|
|
854
|
-
active:
|
|
850
|
+
body: u,
|
|
851
|
+
queryParams: i.map((o) => ({
|
|
852
|
+
name: o.name,
|
|
853
|
+
value: o.defaultValue ?? "",
|
|
854
|
+
active: o.defaultActive ?? !1
|
|
855
855
|
})),
|
|
856
|
-
pathParams:
|
|
857
|
-
name:
|
|
858
|
-
value:
|
|
856
|
+
pathParams: l.map((o) => ({
|
|
857
|
+
name: o.name,
|
|
858
|
+
value: o.defaultValue ?? ""
|
|
859
859
|
})),
|
|
860
|
-
headers:
|
|
861
|
-
name:
|
|
862
|
-
value:
|
|
860
|
+
headers: r.map((o) => ({
|
|
861
|
+
name: o.name,
|
|
862
|
+
value: o.defaultValue ?? ""
|
|
863
863
|
})),
|
|
864
864
|
identity: J
|
|
865
865
|
}
|
|
866
|
-
}), C = w(),
|
|
867
|
-
|
|
868
|
-
var
|
|
866
|
+
}), C = w(), k = Me(), le = $e(!1);
|
|
867
|
+
Te(() => {
|
|
868
|
+
var x;
|
|
869
869
|
if (le.current) return;
|
|
870
|
-
const
|
|
871
|
-
|
|
872
|
-
}, [v,
|
|
870
|
+
const o = (x = k.data) == null ? void 0 : x.at(0);
|
|
871
|
+
o && (v("identity", o.id), le.current = !0);
|
|
872
|
+
}, [v, k.data]);
|
|
873
873
|
const p = Ke({
|
|
874
|
-
mutationFn: async (
|
|
874
|
+
mutationFn: async (o) => {
|
|
875
875
|
var I, q;
|
|
876
|
-
const
|
|
877
|
-
method:
|
|
876
|
+
const x = qt(d ?? e, s, o), _ = performance.now(), D = new Request(x, {
|
|
877
|
+
method: a.toUpperCase(),
|
|
878
878
|
headers: Object.fromEntries(
|
|
879
|
-
|
|
879
|
+
o.headers.filter((m) => m.name).map((m) => [m.name, m.value])
|
|
880
880
|
),
|
|
881
|
-
body:
|
|
881
|
+
body: o.body ? o.body : void 0
|
|
882
882
|
});
|
|
883
|
-
|
|
883
|
+
o.identity !== J && ((q = (I = k.data) == null ? void 0 : I.find((m) => m.id === o.identity)) == null || q.authorizeRequest(D));
|
|
884
884
|
try {
|
|
885
885
|
const m = await fetch(D, {
|
|
886
886
|
signal: AbortSignal.timeout(5e3)
|
|
887
|
-
}), G = performance.now() -
|
|
887
|
+
}), G = performance.now() - _, B = await m.text();
|
|
888
888
|
return {
|
|
889
889
|
status: m.status,
|
|
890
890
|
headers: m.headers,
|
|
@@ -898,126 +898,126 @@ const ne = (t) => Math.abs(
|
|
|
898
898
|
) : m;
|
|
899
899
|
}
|
|
900
900
|
}
|
|
901
|
-
}),
|
|
901
|
+
}), ke = s.split("/").map((o, x, _) => {
|
|
902
902
|
var G;
|
|
903
|
-
const D =
|
|
903
|
+
const D = o.startsWith("{") && o.endsWith("}") || o.startsWith(":"), I = o.replace(/[:{}]/g, ""), q = (G = C.pathParams.find((B) => B.name === I)) == null ? void 0 : G.value, m = q ? /* @__PURE__ */ t.jsx(Pe, { backgroundOpacity: "25%", name: o, slug: o, children: encodeURIComponent(q) }) : /* @__PURE__ */ t.jsx(
|
|
904
904
|
"span",
|
|
905
905
|
{
|
|
906
906
|
className: "underline decoration-wavy decoration-red-500",
|
|
907
907
|
title: `Missing value for path parameter \`${I}\``,
|
|
908
|
-
children:
|
|
908
|
+
children: o
|
|
909
909
|
}
|
|
910
910
|
);
|
|
911
911
|
return (
|
|
912
912
|
// eslint-disable-next-line react/no-array-index-key
|
|
913
|
-
/* @__PURE__ */
|
|
914
|
-
D ? m :
|
|
915
|
-
|
|
916
|
-
/* @__PURE__ */
|
|
917
|
-
] },
|
|
913
|
+
/* @__PURE__ */ t.jsxs(Z, { children: [
|
|
914
|
+
D ? m : o,
|
|
915
|
+
x < _.length - 1 && "/",
|
|
916
|
+
/* @__PURE__ */ t.jsx("wbr", {})
|
|
917
|
+
] }, o + x)
|
|
918
918
|
);
|
|
919
|
-
}), U = Array.from(((de = p.data) == null ? void 0 : de.headers.entries()) ?? []), ce = C.queryParams.filter((
|
|
920
|
-
|
|
919
|
+
}), U = Array.from(((de = p.data) == null ? void 0 : de.headers.entries()) ?? []), ce = C.queryParams.filter((o) => o.active).map((o, x, _) => /* @__PURE__ */ t.jsxs(Z, { children: [
|
|
920
|
+
o.name,
|
|
921
921
|
"=",
|
|
922
|
-
encodeURIComponent(
|
|
923
|
-
|
|
924
|
-
/* @__PURE__ */
|
|
925
|
-
] },
|
|
926
|
-
|
|
922
|
+
encodeURIComponent(o.value).replaceAll("%20", "+"),
|
|
923
|
+
x < _.length - 1 && "&",
|
|
924
|
+
/* @__PURE__ */ t.jsx("wbr", {})
|
|
925
|
+
] }, o.name)), _e = /* @__PURE__ */ t.jsx("div", { className: "inline-block opacity-50 hover:opacity-100 transition", children: n && n.length > 1 ? /* @__PURE__ */ t.jsxs(
|
|
926
|
+
xe,
|
|
927
927
|
{
|
|
928
|
-
onValueChange: (
|
|
929
|
-
|
|
930
|
-
|
|
928
|
+
onValueChange: (o) => {
|
|
929
|
+
f(() => {
|
|
930
|
+
c(o);
|
|
931
931
|
});
|
|
932
932
|
},
|
|
933
|
-
value:
|
|
933
|
+
value: d,
|
|
934
934
|
children: [
|
|
935
|
-
/* @__PURE__ */
|
|
936
|
-
/* @__PURE__ */
|
|
935
|
+
/* @__PURE__ */ t.jsx(ye, { className: "p-0 border-none flex-row-reverse bg-transparent text-xs gap-0.5 h-auto", children: /* @__PURE__ */ t.jsx(ge, {}) }),
|
|
936
|
+
/* @__PURE__ */ t.jsx(ve, { children: n.map((o) => /* @__PURE__ */ t.jsx(K, { value: o, children: o.replace(/^https?:\/\//, "") }, o)) })
|
|
937
937
|
]
|
|
938
938
|
}
|
|
939
|
-
) : /* @__PURE__ */
|
|
940
|
-
return /* @__PURE__ */
|
|
939
|
+
) : /* @__PURE__ */ t.jsx("span", { children: e.replace(/^https?:\/\//, "") }) });
|
|
940
|
+
return /* @__PURE__ */ t.jsx(
|
|
941
941
|
et,
|
|
942
942
|
{
|
|
943
|
-
register:
|
|
943
|
+
register: h,
|
|
944
944
|
control: j,
|
|
945
945
|
handleSubmit: b,
|
|
946
946
|
watch: w,
|
|
947
947
|
setValue: v,
|
|
948
948
|
...S,
|
|
949
|
-
children: /* @__PURE__ */
|
|
950
|
-
/* @__PURE__ */
|
|
951
|
-
/* @__PURE__ */
|
|
952
|
-
/* @__PURE__ */
|
|
953
|
-
/* @__PURE__ */
|
|
954
|
-
/* @__PURE__ */
|
|
949
|
+
children: /* @__PURE__ */ t.jsx("form", { onSubmit: b((o) => p.mutateAsync(o)), children: /* @__PURE__ */ t.jsxs("div", { className: "grid grid-cols-[8fr_7fr] text-sm h-full", children: [
|
|
950
|
+
/* @__PURE__ */ t.jsxs("div", { className: "flex flex-col gap-4 p-8 bg-muted/50 after:bg-muted-foreground/20 relative after:absolute after:w-px after:inset-0 after:left-auto", children: [
|
|
951
|
+
/* @__PURE__ */ t.jsxs("div", { className: "flex gap-2 items-stretch", children: [
|
|
952
|
+
/* @__PURE__ */ t.jsxs("div", { className: "flex flex-1 items-center w-full border rounded-md", children: [
|
|
953
|
+
/* @__PURE__ */ t.jsx("div", { className: "border-r p-2 bg-muted rounded-l-md self-stretch font-semibold font-mono", children: a.toUpperCase() }),
|
|
954
|
+
/* @__PURE__ */ t.jsxs("div", { className: "flex items-center flex-wrap p-2 font-mono text-xs", children: [
|
|
955
955
|
_e,
|
|
956
|
-
|
|
956
|
+
ke,
|
|
957
957
|
ce.length > 0 ? "?" : "",
|
|
958
958
|
ce
|
|
959
959
|
] })
|
|
960
960
|
] }),
|
|
961
|
-
/* @__PURE__ */
|
|
961
|
+
/* @__PURE__ */ t.jsx(E, { type: "submit", className: "h-auto flex gap-1", children: "Send" })
|
|
962
962
|
] }),
|
|
963
|
-
/* @__PURE__ */
|
|
964
|
-
|
|
963
|
+
/* @__PURE__ */ t.jsxs(
|
|
964
|
+
be,
|
|
965
965
|
{
|
|
966
|
-
defaultValue:
|
|
966
|
+
defaultValue: i.length + l.length > 0 ? "parameters" : "headers",
|
|
967
967
|
children: [
|
|
968
|
-
/* @__PURE__ */
|
|
969
|
-
/* @__PURE__ */
|
|
970
|
-
|
|
971
|
-
/* @__PURE__ */
|
|
968
|
+
/* @__PURE__ */ t.jsxs("div", { className: "flex flex-wrap gap-1 justify-between", children: [
|
|
969
|
+
/* @__PURE__ */ t.jsxs(Ne, { children: [
|
|
970
|
+
i.length + l.length > 0 && /* @__PURE__ */ t.jsx(A, { value: "parameters", children: "Parameters" }),
|
|
971
|
+
/* @__PURE__ */ t.jsxs(A, { value: "headers", children: [
|
|
972
972
|
"Headers",
|
|
973
973
|
" ",
|
|
974
974
|
C.headers.length > 0 && `(${C.headers.length})`
|
|
975
975
|
] }),
|
|
976
|
-
/* @__PURE__ */
|
|
976
|
+
/* @__PURE__ */ t.jsx(
|
|
977
977
|
A,
|
|
978
978
|
{
|
|
979
979
|
value: "body",
|
|
980
980
|
disabled: !["POST", "PUT", "PATCH", "DELETE"].includes(
|
|
981
|
-
|
|
981
|
+
a.toUpperCase()
|
|
982
982
|
),
|
|
983
983
|
children: "Body"
|
|
984
984
|
}
|
|
985
985
|
)
|
|
986
986
|
] }),
|
|
987
|
-
/* @__PURE__ */
|
|
987
|
+
/* @__PURE__ */ t.jsxs("div", { className: "flex gap-2 items-center", children: [
|
|
988
988
|
"Auth:",
|
|
989
|
-
/* @__PURE__ */
|
|
990
|
-
|
|
989
|
+
/* @__PURE__ */ t.jsxs(
|
|
990
|
+
xe,
|
|
991
991
|
{
|
|
992
|
-
onValueChange: (
|
|
992
|
+
onValueChange: (o) => v("identity", o),
|
|
993
993
|
value: C.identity,
|
|
994
994
|
defaultValue: C.identity,
|
|
995
995
|
children: [
|
|
996
|
-
/* @__PURE__ */
|
|
997
|
-
/* @__PURE__ */
|
|
998
|
-
/* @__PURE__ */
|
|
999
|
-
(ue =
|
|
996
|
+
/* @__PURE__ */ t.jsx(ye, { className: "w-[180px] flex", children: k.isPending ? /* @__PURE__ */ t.jsx(je, {}) : /* @__PURE__ */ t.jsx(ge, {}) }),
|
|
997
|
+
/* @__PURE__ */ t.jsxs(ve, { align: "center", children: [
|
|
998
|
+
/* @__PURE__ */ t.jsx(K, { value: J, children: "None" }),
|
|
999
|
+
(ue = k.data) == null ? void 0 : ue.map((o) => /* @__PURE__ */ t.jsx(K, { value: o.id, children: o.label }, o.id))
|
|
1000
1000
|
] })
|
|
1001
1001
|
]
|
|
1002
1002
|
}
|
|
1003
1003
|
)
|
|
1004
1004
|
] })
|
|
1005
1005
|
] }),
|
|
1006
|
-
/* @__PURE__ */
|
|
1007
|
-
/* @__PURE__ */
|
|
1008
|
-
|
|
1009
|
-
/* @__PURE__ */
|
|
1010
|
-
/* @__PURE__ */
|
|
1006
|
+
/* @__PURE__ */ t.jsx(V, { value: "headers", children: /* @__PURE__ */ t.jsx(Rt, { control: j, register: h }) }),
|
|
1007
|
+
/* @__PURE__ */ t.jsxs(V, { value: "parameters", children: [
|
|
1008
|
+
l.length > 0 && /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col gap-4 my-4", children: [
|
|
1009
|
+
/* @__PURE__ */ t.jsx("span", { className: "font-semibold", children: "Path Parameters" }),
|
|
1010
|
+
/* @__PURE__ */ t.jsx(Mt, { control: j })
|
|
1011
1011
|
] }),
|
|
1012
|
-
|
|
1013
|
-
/* @__PURE__ */
|
|
1014
|
-
/* @__PURE__ */
|
|
1012
|
+
i.length > 0 && /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col gap-4 my-4", children: [
|
|
1013
|
+
/* @__PURE__ */ t.jsx("span", { className: "font-semibold", children: "Query Parameters" }),
|
|
1014
|
+
/* @__PURE__ */ t.jsx(zt, { control: j, queryParams: i })
|
|
1015
1015
|
] })
|
|
1016
1016
|
] }),
|
|
1017
|
-
/* @__PURE__ */
|
|
1017
|
+
/* @__PURE__ */ t.jsx(V, { value: "body", children: /* @__PURE__ */ t.jsx(
|
|
1018
1018
|
"textarea",
|
|
1019
1019
|
{
|
|
1020
|
-
...
|
|
1020
|
+
...h("body"),
|
|
1021
1021
|
className: "border w-full rounded p-2 bg-muted h-40"
|
|
1022
1022
|
}
|
|
1023
1023
|
) })
|
|
@@ -1025,79 +1025,79 @@ const ne = (t) => Math.abs(
|
|
|
1025
1025
|
}
|
|
1026
1026
|
)
|
|
1027
1027
|
] }),
|
|
1028
|
-
/* @__PURE__ */
|
|
1029
|
-
C.pathParams.some((
|
|
1030
|
-
/* @__PURE__ */
|
|
1031
|
-
/* @__PURE__ */
|
|
1032
|
-
/* @__PURE__ */
|
|
1028
|
+
/* @__PURE__ */ t.jsx("div", { className: "min-w-0 p-8 bg-muted/70", children: p.error ? /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
1029
|
+
C.pathParams.some((o) => o.value === "") && /* @__PURE__ */ t.jsx(nt, { type: "caution", children: "Some path parameters are missing values. Please fill them in to ensure the request is sent correctly." }),
|
|
1030
|
+
/* @__PURE__ */ t.jsxs(ae, { children: [
|
|
1031
|
+
/* @__PURE__ */ t.jsx(st, { children: /* @__PURE__ */ t.jsx(rt, { children: "Request failed" }) }),
|
|
1032
|
+
/* @__PURE__ */ t.jsxs(at, { children: [
|
|
1033
1033
|
"Error:",
|
|
1034
1034
|
" ",
|
|
1035
1035
|
p.error.message || String(p.error) || "Unexpected error"
|
|
1036
1036
|
] })
|
|
1037
1037
|
] })
|
|
1038
|
-
] }) : p.data ? /* @__PURE__ */
|
|
1039
|
-
/* @__PURE__ */
|
|
1040
|
-
/* @__PURE__ */
|
|
1038
|
+
] }) : p.data ? /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
1039
|
+
/* @__PURE__ */ t.jsx("div", { className: "flex gap-2", children: /* @__PURE__ */ t.jsxs("div", { className: "flex text-xs gap-6", children: [
|
|
1040
|
+
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
1041
1041
|
"Status: ",
|
|
1042
1042
|
p.data.status,
|
|
1043
1043
|
" ",
|
|
1044
1044
|
Jt[p.data.status] ?? ""
|
|
1045
1045
|
] }),
|
|
1046
|
-
/* @__PURE__ */
|
|
1046
|
+
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
1047
1047
|
"Time: ",
|
|
1048
1048
|
p.data.time.toFixed(0),
|
|
1049
1049
|
"ms"
|
|
1050
1050
|
] }),
|
|
1051
|
-
/* @__PURE__ */
|
|
1051
|
+
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
1052
1052
|
"Size: ",
|
|
1053
1053
|
p.data.size,
|
|
1054
1054
|
" B"
|
|
1055
1055
|
] })
|
|
1056
1056
|
] }) }),
|
|
1057
|
-
/* @__PURE__ */
|
|
1058
|
-
/* @__PURE__ */
|
|
1059
|
-
/* @__PURE__ */
|
|
1060
|
-
/* @__PURE__ */
|
|
1057
|
+
/* @__PURE__ */ t.jsxs(be, { defaultValue: "response", children: [
|
|
1058
|
+
/* @__PURE__ */ t.jsxs(Ne, { children: [
|
|
1059
|
+
/* @__PURE__ */ t.jsx(A, { value: "response", children: "Response" }),
|
|
1060
|
+
/* @__PURE__ */ t.jsx(A, { value: "headers", children: U.length ? `Headers (${U.length})` : "No headers" })
|
|
1061
1061
|
] }),
|
|
1062
|
-
/* @__PURE__ */
|
|
1062
|
+
/* @__PURE__ */ t.jsx(V, { value: "response", children: /* @__PURE__ */ t.jsx(
|
|
1063
1063
|
Bt,
|
|
1064
1064
|
{
|
|
1065
1065
|
headers: p.data.headers,
|
|
1066
1066
|
body: p.data.body
|
|
1067
1067
|
}
|
|
1068
1068
|
) }),
|
|
1069
|
-
/* @__PURE__ */
|
|
1069
|
+
/* @__PURE__ */ t.jsx(V, { value: "headers", children: /* @__PURE__ */ t.jsxs(
|
|
1070
1070
|
ae,
|
|
1071
1071
|
{
|
|
1072
1072
|
className: "max-h-[calc(83.333vh-140px)] overflow-y-auto grid grid-cols-2 w-full gap-2.5 font-mono text-xs shadow-none p-4",
|
|
1073
1073
|
children: [
|
|
1074
|
-
/* @__PURE__ */
|
|
1075
|
-
/* @__PURE__ */
|
|
1076
|
-
U.map(([
|
|
1077
|
-
/* @__PURE__ */
|
|
1078
|
-
/* @__PURE__ */
|
|
1079
|
-
] },
|
|
1074
|
+
/* @__PURE__ */ t.jsx("div", { className: "font-semibold", children: "Key" }),
|
|
1075
|
+
/* @__PURE__ */ t.jsx("div", { className: "font-semibold", children: "Value" }),
|
|
1076
|
+
U.map(([o, x]) => /* @__PURE__ */ t.jsxs(Z, { children: [
|
|
1077
|
+
/* @__PURE__ */ t.jsx("div", { children: o }),
|
|
1078
|
+
/* @__PURE__ */ t.jsx("div", { className: "break-words", children: x })
|
|
1079
|
+
] }, o))
|
|
1080
1080
|
]
|
|
1081
1081
|
}
|
|
1082
1082
|
) })
|
|
1083
1083
|
] })
|
|
1084
|
-
] }) : /* @__PURE__ */
|
|
1084
|
+
] }) : /* @__PURE__ */ t.jsx("div", { className: "grid place-items-center h-full", children: /* @__PURE__ */ t.jsx("span", { className: "text-[16px] font-semibold text-muted-foreground", children: p.isPending ? /* @__PURE__ */ t.jsx(je, {}) : "Send a request first to see the response here" }) }) })
|
|
1085
1085
|
] }) })
|
|
1086
1086
|
}
|
|
1087
1087
|
);
|
|
1088
1088
|
}, Qt = ({
|
|
1089
|
-
className:
|
|
1089
|
+
className: e,
|
|
1090
1090
|
size: n = 16
|
|
1091
|
-
}) => /* @__PURE__ */
|
|
1091
|
+
}) => /* @__PURE__ */ t.jsx(
|
|
1092
1092
|
"svg",
|
|
1093
1093
|
{
|
|
1094
1094
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1095
1095
|
viewBox: "0 0 24 24",
|
|
1096
1096
|
fill: "currentColor",
|
|
1097
|
-
className:
|
|
1097
|
+
className: e,
|
|
1098
1098
|
width: n,
|
|
1099
1099
|
height: n,
|
|
1100
|
-
children: /* @__PURE__ */
|
|
1100
|
+
children: /* @__PURE__ */ t.jsx(
|
|
1101
1101
|
"path",
|
|
1102
1102
|
{
|
|
1103
1103
|
fillRule: "evenodd",
|
|
@@ -1106,26 +1106,26 @@ const ne = (t) => Math.abs(
|
|
|
1106
1106
|
}
|
|
1107
1107
|
)
|
|
1108
1108
|
}
|
|
1109
|
-
), Ut = (
|
|
1110
|
-
const [n, s] =
|
|
1111
|
-
return /* @__PURE__ */
|
|
1112
|
-
/* @__PURE__ */
|
|
1109
|
+
), Ut = (e) => {
|
|
1110
|
+
const [n, s] = Ee(!1);
|
|
1111
|
+
return /* @__PURE__ */ t.jsxs(Qe, { onOpenChange: (a) => s(a), children: [
|
|
1112
|
+
/* @__PURE__ */ t.jsx(Ue, { asChild: !0, children: e.children ?? /* @__PURE__ */ t.jsxs("button", { className: "flex gap-1 items-center px-2 py-1 rounded-md bg-primary/80 hover:bg-primary transition text-primary-foreground text-xs", children: [
|
|
1113
1113
|
"Test",
|
|
1114
|
-
/* @__PURE__ */
|
|
1114
|
+
/* @__PURE__ */ t.jsx(Qt, { className: "", size: 14 })
|
|
1115
1115
|
] }) }),
|
|
1116
|
-
/* @__PURE__ */
|
|
1116
|
+
/* @__PURE__ */ t.jsxs(
|
|
1117
1117
|
We,
|
|
1118
1118
|
{
|
|
1119
1119
|
className: "max-w-screen-xl w-full h-5/6 overflow-auto p-0",
|
|
1120
1120
|
"aria-describedby": void 0,
|
|
1121
1121
|
children: [
|
|
1122
|
-
/* @__PURE__ */
|
|
1123
|
-
n && /* @__PURE__ */
|
|
1122
|
+
/* @__PURE__ */ t.jsx(Je, { children: /* @__PURE__ */ t.jsx(Ze, { children: "Playground" }) }),
|
|
1123
|
+
n && /* @__PURE__ */ t.jsx(Ht, { ...e })
|
|
1124
1124
|
]
|
|
1125
1125
|
}
|
|
1126
1126
|
)
|
|
1127
1127
|
] });
|
|
1128
|
-
},
|
|
1128
|
+
}, Se = ft(`
|
|
1129
1129
|
query GetCategories($input: JSON!, $type: SchemaType!) {
|
|
1130
1130
|
schema(input: $input, type: $type) {
|
|
1131
1131
|
url
|
|
@@ -1152,79 +1152,80 @@ const ne = (t) => Math.abs(
|
|
|
1152
1152
|
patch: "purple",
|
|
1153
1153
|
options: "gray",
|
|
1154
1154
|
head: "gray"
|
|
1155
|
-
}, jn = (
|
|
1156
|
-
const n =
|
|
1155
|
+
}, jn = (e) => {
|
|
1156
|
+
const n = he(e.navigationId ?? "/reference"), s = e.type === "file" ? Object.keys(e.input) : [], a = new kt(e);
|
|
1157
1157
|
return {
|
|
1158
1158
|
getHead: () => {
|
|
1159
|
-
if (
|
|
1160
|
-
return /* @__PURE__ */
|
|
1159
|
+
if (e.type === "url" && !e.skipPreload)
|
|
1160
|
+
return /* @__PURE__ */ t.jsx(
|
|
1161
1161
|
"link",
|
|
1162
1162
|
{
|
|
1163
1163
|
rel: "preload",
|
|
1164
|
-
href:
|
|
1164
|
+
href: e.input,
|
|
1165
1165
|
as: "fetch",
|
|
1166
1166
|
crossOrigin: "anonymous"
|
|
1167
1167
|
}
|
|
1168
1168
|
);
|
|
1169
|
-
if (
|
|
1170
|
-
return /* @__PURE__ */
|
|
1169
|
+
if (e.server)
|
|
1170
|
+
return /* @__PURE__ */ t.jsx("link", { rel: "preconnect", href: e.server });
|
|
1171
1171
|
},
|
|
1172
1172
|
getMdxComponents: () => ({
|
|
1173
1173
|
OpenPlaygroundButton: ({
|
|
1174
1174
|
requireAuth: r,
|
|
1175
|
-
server:
|
|
1175
|
+
server: i,
|
|
1176
1176
|
method: l,
|
|
1177
|
-
url:
|
|
1178
|
-
...
|
|
1177
|
+
url: u,
|
|
1178
|
+
...d
|
|
1179
1179
|
}) => {
|
|
1180
1180
|
var h;
|
|
1181
|
-
const
|
|
1182
|
-
queryFn: () =>
|
|
1183
|
-
type:
|
|
1184
|
-
input:
|
|
1181
|
+
const c = De(), f = Ae({
|
|
1182
|
+
queryFn: () => a.fetch(Se, {
|
|
1183
|
+
type: e.type,
|
|
1184
|
+
input: e.input
|
|
1185
1185
|
}),
|
|
1186
|
-
enabled: !
|
|
1186
|
+
enabled: !i,
|
|
1187
1187
|
queryKey: ["playground-server"]
|
|
1188
1188
|
});
|
|
1189
|
-
return r && !
|
|
1189
|
+
return r && !c.isAuthenticated ? /* @__PURE__ */ t.jsxs(
|
|
1190
1190
|
E,
|
|
1191
1191
|
{
|
|
1192
1192
|
className: "gap-2 items-center",
|
|
1193
1193
|
variant: "outline",
|
|
1194
|
-
onClick:
|
|
1194
|
+
onClick: c.login,
|
|
1195
1195
|
children: [
|
|
1196
1196
|
"Login to open in Playground ",
|
|
1197
|
-
/* @__PURE__ */
|
|
1197
|
+
/* @__PURE__ */ t.jsx(Fe, { size: 16 })
|
|
1198
1198
|
]
|
|
1199
1199
|
}
|
|
1200
|
-
) : /* @__PURE__ */
|
|
1200
|
+
) : /* @__PURE__ */ t.jsx(
|
|
1201
1201
|
Ut,
|
|
1202
1202
|
{
|
|
1203
|
-
url:
|
|
1203
|
+
url: u ?? "/",
|
|
1204
1204
|
method: l ?? "get",
|
|
1205
|
-
server:
|
|
1206
|
-
...
|
|
1207
|
-
children: /* @__PURE__ */
|
|
1205
|
+
server: i ?? ((h = f.data) == null ? void 0 : h.schema.url) ?? "https://example.com",
|
|
1206
|
+
...d,
|
|
1207
|
+
children: /* @__PURE__ */ t.jsxs(E, { className: "gap-2 items-center", variant: "outline", children: [
|
|
1208
1208
|
"Open in Playground ",
|
|
1209
|
-
/* @__PURE__ */
|
|
1209
|
+
/* @__PURE__ */ t.jsx(Le, { size: 16 })
|
|
1210
1210
|
] })
|
|
1211
1211
|
}
|
|
1212
1212
|
);
|
|
1213
1213
|
}
|
|
1214
1214
|
}),
|
|
1215
1215
|
getSidebar: async (r) => {
|
|
1216
|
-
if (!
|
|
1216
|
+
if (!Re({ path: n, end: !1 }, r))
|
|
1217
1217
|
return [];
|
|
1218
1218
|
try {
|
|
1219
|
-
const
|
|
1220
|
-
type:
|
|
1221
|
-
input:
|
|
1222
|
-
|
|
1219
|
+
const i = s.find((d) => r === he(n, d)) ?? Object.keys(e.input).at(0), u = (await a.fetch(Se, {
|
|
1220
|
+
type: e.type,
|
|
1221
|
+
input: e.type === "file" ? e.input[i] : e.input,
|
|
1222
|
+
version: i
|
|
1223
|
+
})).schema.tags.filter((d) => d.operations.length > 0).map((d) => ({
|
|
1223
1224
|
type: "category",
|
|
1224
|
-
label:
|
|
1225
|
+
label: d.name || "Other endpoints",
|
|
1225
1226
|
collapsible: !0,
|
|
1226
1227
|
collapsed: !1,
|
|
1227
|
-
items:
|
|
1228
|
+
items: d.operations.map((c) => ({
|
|
1228
1229
|
type: "link",
|
|
1229
1230
|
label: c.summary ?? c.path,
|
|
1230
1231
|
href: `#${c.slug}`,
|
|
@@ -1234,35 +1235,39 @@ const ne = (t) => Math.abs(
|
|
|
1234
1235
|
}
|
|
1235
1236
|
}))
|
|
1236
1237
|
}));
|
|
1237
|
-
return
|
|
1238
|
+
return u.unshift({
|
|
1238
1239
|
type: "link",
|
|
1239
1240
|
label: "Overview",
|
|
1240
1241
|
href: "#description"
|
|
1241
|
-
}),
|
|
1242
|
+
}), u;
|
|
1242
1243
|
} catch {
|
|
1243
1244
|
return [];
|
|
1244
1245
|
}
|
|
1245
1246
|
},
|
|
1246
1247
|
getRoutes: () => [
|
|
1247
1248
|
{
|
|
1249
|
+
path: n + "/:version?",
|
|
1248
1250
|
async lazy() {
|
|
1249
|
-
const { OpenApiRoute: r } = await import("./Route-
|
|
1251
|
+
const { OpenApiRoute: r } = await import("./Route-C8nwd9A2.js");
|
|
1250
1252
|
return {
|
|
1251
|
-
element: /* @__PURE__ */
|
|
1253
|
+
element: /* @__PURE__ */ t.jsx(
|
|
1254
|
+
r,
|
|
1255
|
+
{
|
|
1256
|
+
basePath: n,
|
|
1257
|
+
versions: s,
|
|
1258
|
+
client: a,
|
|
1259
|
+
config: e
|
|
1260
|
+
}
|
|
1261
|
+
)
|
|
1252
1262
|
};
|
|
1253
1263
|
},
|
|
1254
1264
|
children: [
|
|
1255
1265
|
{
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
{
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
const { OperationList: r } = await import("./OperationList-C7ac3kR5.js");
|
|
1262
|
-
return { element: /* @__PURE__ */ e.jsx(r, {}) };
|
|
1263
|
-
}
|
|
1264
|
-
}
|
|
1265
|
-
]
|
|
1266
|
+
index: !0,
|
|
1267
|
+
async lazy() {
|
|
1268
|
+
const { OperationList: r } = await import("./OperationList-wvY-BrxS.js");
|
|
1269
|
+
return { element: /* @__PURE__ */ t.jsx(r, {}) };
|
|
1270
|
+
}
|
|
1266
1271
|
}
|
|
1267
1272
|
]
|
|
1268
1273
|
}
|
|
@@ -1276,4 +1281,4 @@ export {
|
|
|
1276
1281
|
ft as g,
|
|
1277
1282
|
jn as o
|
|
1278
1283
|
};
|
|
1279
|
-
//# sourceMappingURL=index-
|
|
1284
|
+
//# sourceMappingURL=index-C_ul-2fb.js.map
|