zudoku 0.17.0 → 0.18.0
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/app/demo.js +0 -2
- package/dist/app/demo.js.map +1 -1
- package/dist/app/entry.client.js +14 -0
- package/dist/app/entry.client.js.map +1 -1
- package/dist/app/entry.server.js +5 -4
- package/dist/app/entry.server.js.map +1 -1
- package/dist/app/standalone.js +0 -2
- package/dist/app/standalone.js.map +1 -1
- package/dist/codegen.d.ts +3 -0
- package/dist/codegen.js +45 -0
- package/dist/codegen.js.map +1 -0
- package/dist/config/validators/InputSidebarSchema.d.ts +10 -10
- package/dist/config/validators/validate.d.ts +74 -74
- package/dist/lib/authentication/hook.d.ts +5 -4
- package/dist/lib/authentication/hook.js +1 -3
- package/dist/lib/authentication/hook.js.map +1 -1
- package/dist/lib/authentication/providers/auth0.js +11 -11
- package/dist/lib/authentication/providers/auth0.js.map +1 -1
- package/dist/lib/authentication/providers/openid.d.ts +0 -1
- package/dist/lib/authentication/providers/openid.js +11 -26
- package/dist/lib/authentication/providers/openid.js.map +1 -1
- package/dist/lib/authentication/state.d.ts +25 -4
- package/dist/lib/authentication/state.js +28 -5
- package/dist/lib/authentication/state.js.map +1 -1
- package/dist/lib/components/Bootstrap.d.ts +3 -1
- package/dist/lib/components/Bootstrap.js +11 -3
- package/dist/lib/components/Bootstrap.js.map +1 -1
- package/dist/lib/components/DeveloperHint.js +2 -1
- package/dist/lib/components/DeveloperHint.js.map +1 -1
- package/dist/lib/components/Header.js +3 -7
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/Heading.d.ts +1 -1
- package/dist/lib/components/Layout.js +11 -3
- package/dist/lib/components/Layout.js.map +1 -1
- package/dist/lib/components/MobileTopNavigation.js +6 -7
- package/dist/lib/components/MobileTopNavigation.js.map +1 -1
- package/dist/lib/components/SyntaxHighlight.js +16 -12
- package/dist/lib/components/SyntaxHighlight.js.map +1 -1
- package/dist/lib/components/ThemeSwitch.d.ts +1 -0
- package/dist/lib/components/ThemeSwitch.js +13 -0
- package/dist/lib/components/ThemeSwitch.js.map +1 -0
- package/dist/lib/components/TopNavigation.d.ts +2 -0
- package/dist/lib/components/TopNavigation.js +13 -7
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/Zudoku.js +4 -5
- package/dist/lib/components/Zudoku.js.map +1 -1
- package/dist/lib/components/context/ZudokuContext.d.ts +3 -3
- package/dist/lib/components/context/ZudokuContext.js +7 -12
- package/dist/lib/components/context/ZudokuContext.js.map +1 -1
- package/dist/lib/components/index.d.ts +14 -3
- package/dist/lib/components/navigation/Sidebar.js +1 -1
- package/dist/lib/components/navigation/Sidebar.js.map +1 -1
- package/dist/lib/components/navigation/utils.js +2 -2
- package/dist/lib/components/navigation/utils.js.map +1 -1
- package/dist/lib/core/ZudokuContext.d.ts +0 -4
- package/dist/lib/core/ZudokuContext.js +0 -5
- package/dist/lib/core/ZudokuContext.js.map +1 -1
- package/dist/lib/errors/ErrorAlert.js +1 -1
- package/dist/lib/errors/ErrorAlert.js.map +1 -1
- package/dist/lib/plugins/openapi/ColorizedParam.js +13 -9
- package/dist/lib/plugins/openapi/ColorizedParam.js.map +1 -1
- package/dist/lib/plugins/openapi/Endpoint.d.ts +1 -1
- package/dist/lib/plugins/openapi/Endpoint.js +5 -9
- package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.d.ts +2 -2
- package/dist/lib/plugins/openapi/OperationList.js +6 -21
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/Route.d.ts +4 -4
- package/dist/lib/plugins/openapi/Route.js +2 -4
- package/dist/lib/plugins/openapi/Route.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.d.ts +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js +8 -11
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/client/GraphQLClient.d.ts +8 -0
- package/dist/lib/plugins/openapi/client/GraphQLClient.js +102 -0
- package/dist/lib/plugins/openapi/client/GraphQLClient.js.map +1 -0
- package/dist/lib/plugins/openapi/client/GraphQLContext.d.ts +7 -0
- package/dist/lib/plugins/openapi/client/GraphQLContext.js +5 -0
- package/dist/lib/plugins/openapi/client/GraphQLContext.js.map +1 -0
- package/dist/lib/plugins/openapi/client/createServer.d.ts +1 -0
- package/dist/lib/plugins/openapi/client/useCreateQuery.d.ts +5 -0
- package/dist/lib/plugins/openapi/client/useCreateQuery.js +13 -0
- package/dist/lib/plugins/openapi/client/useCreateQuery.js.map +1 -0
- package/dist/lib/plugins/openapi/client/worker.d.ts +4 -1
- package/dist/lib/plugins/openapi/client/worker.js +23 -14
- package/dist/lib/plugins/openapi/client/worker.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/fragment-masking.d.ts +3 -3
- package/dist/lib/plugins/openapi/graphql/fragment-masking.js +3 -4
- package/dist/lib/plugins/openapi/graphql/fragment-masking.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.d.ts +5 -52
- package/dist/lib/plugins/openapi/graphql/gql.js +2 -1
- package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/graphql.d.ts +134 -9
- package/dist/lib/plugins/openapi/graphql/graphql.js +194 -778
- package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
- package/dist/lib/plugins/openapi/index.js +40 -53
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
- package/dist/lib/plugins/openapi-worker.d.ts +1 -1
- package/dist/lib/plugins/openapi-worker.js +7 -1
- package/dist/lib/plugins/openapi-worker.js.map +1 -1
- package/dist/lib/util/MdxComponents.d.ts +1 -1
- package/dist/vite/config.js +0 -1
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/html.js +0 -2
- package/dist/vite/html.js.map +1 -1
- package/dist/vite/plugin-component.js +1 -1
- package/dist/vite/plugin-component.js.map +1 -1
- package/dist/vite/plugin-mdx.js +3 -2
- package/dist/vite/plugin-mdx.js.map +1 -1
- package/dist/vite/plugin.js +0 -2
- package/dist/vite/plugin.js.map +1 -1
- package/dist/vite/remarkStaticGeneration.d.ts +3 -0
- package/dist/vite/remarkStaticGeneration.js +125 -0
- package/dist/vite/remarkStaticGeneration.js.map +1 -0
- package/lib/{AnchorLink-DYbUOP9U.js → AnchorLink-CDlhr8gL.js} +11 -10
- package/lib/{AnchorLink-DYbUOP9U.js.map → AnchorLink-CDlhr8gL.js.map} +1 -1
- package/lib/{AuthenticationPlugin-bqGAKfot.js → AuthenticationPlugin-DeGDVa1r.js} +6 -5
- package/lib/{AuthenticationPlugin-bqGAKfot.js.map → AuthenticationPlugin-DeGDVa1r.js.map} +1 -1
- package/lib/{Spinner-ChOGyPls.js → Button-jK0EsymC.js} +12 -15
- package/lib/Button-jK0EsymC.js.map +1 -0
- package/lib/Markdown-ievDDhFT.js +15192 -0
- package/lib/Markdown-ievDDhFT.js.map +1 -0
- package/lib/{MdxPage-DRKqyn2b.js → MdxPage-Bwn-VSsH.js} +5 -5
- package/lib/{MdxPage-DRKqyn2b.js.map → MdxPage-Bwn-VSsH.js.map} +1 -1
- package/lib/OperationList-BwBl1xrD.js +4691 -0
- package/lib/OperationList-BwBl1xrD.js.map +1 -0
- package/lib/Route-DlG_HTMu.js +11 -0
- package/lib/Route-DlG_HTMu.js.map +1 -0
- package/lib/{Select-DYKDahHt.js → Select-O9ZM3ZgX.js} +7 -7
- package/lib/Select-O9ZM3ZgX.js.map +1 -0
- package/lib/SidebarBadge-DxFJcJ6V.js +51 -0
- package/lib/SidebarBadge-DxFJcJ6V.js.map +1 -0
- package/lib/SlotletProvider-DyomlzGx.js +252 -0
- package/lib/SlotletProvider-DyomlzGx.js.map +1 -0
- package/lib/Spinner-3cQDBVGr.js +7 -0
- package/lib/Spinner-3cQDBVGr.js.map +1 -0
- package/lib/SyntaxHighlight-DkLOsjHS.js +2983 -0
- package/lib/SyntaxHighlight-DkLOsjHS.js.map +1 -0
- package/lib/assets/{worker-YA-aCP3P.js → worker-CPsGZsve.js} +24 -22
- package/lib/assets/{worker-YA-aCP3P.js.map → worker-CPsGZsve.js.map} +1 -1
- package/lib/context-D1nXWxm7.js +22 -0
- package/lib/context-D1nXWxm7.js.map +1 -0
- package/lib/createServer-DK-g7kbB.js +16089 -0
- package/lib/createServer-DK-g7kbB.js.map +1 -0
- package/lib/{hook-CjQERPa7.js → hook-hEqe7fPB.js} +12 -14
- package/lib/hook-hEqe7fPB.js.map +1 -0
- package/lib/index-Czzd9rjU.js +899 -0
- package/lib/index-Czzd9rjU.js.map +1 -0
- package/lib/index-DNxQ_rCt.js +1273 -0
- package/lib/index-DNxQ_rCt.js.map +1 -0
- package/lib/index-Yn8c3UWE.js +921 -0
- package/lib/index-Yn8c3UWE.js.map +1 -0
- package/lib/{router-BsfSoK2j.js → router-lfyopgBI.js} +23 -23
- package/lib/{router-BsfSoK2j.js.map → router-lfyopgBI.js.map} +1 -1
- package/lib/state-tsXBLONe.js +203 -0
- package/lib/state-tsXBLONe.js.map +1 -0
- package/lib/ui/ActionButton.js +11 -10
- package/lib/ui/ActionButton.js.map +1 -1
- package/lib/useExposedProps-CTPtylCV.js +10 -0
- package/lib/{useExposedProps-BxyHjPNN.js.map → useExposedProps-CTPtylCV.js.map} +1 -1
- package/lib/{utils-DNAltzXc.js → utils-DcpDOncX.js} +197 -202
- package/lib/utils-DcpDOncX.js.map +1 -0
- package/lib/zudoku.auth-auth0.js +24 -18
- package/lib/zudoku.auth-auth0.js.map +1 -1
- package/lib/zudoku.auth-clerk.js +2 -2
- package/lib/zudoku.auth-openid.js +124 -138
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +1133 -992
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.openapi-worker.js +10 -16346
- package/lib/zudoku.openapi-worker.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +18 -18
- package/lib/zudoku.plugin-custom-pages.js +2 -2
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-openapi.js +5 -9
- package/lib/zudoku.plugin-openapi.js.map +1 -1
- package/lib/zudoku.plugin-redirect.js +1 -1
- package/package.json +14 -4
- package/src/app/demo.tsx +0 -3
- package/src/app/entry.client.tsx +14 -0
- package/src/app/entry.server.tsx +59 -57
- package/src/app/standalone.tsx +0 -3
- package/src/lib/authentication/hook.ts +1 -3
- package/src/lib/authentication/providers/auth0.tsx +16 -11
- package/src/lib/authentication/providers/openid.tsx +12 -30
- package/src/lib/authentication/state.ts +44 -10
- package/src/lib/components/Bootstrap.tsx +36 -9
- package/src/lib/components/DeveloperHint.tsx +6 -1
- package/src/lib/components/Header.tsx +31 -42
- package/src/lib/components/Layout.tsx +48 -36
- package/src/lib/components/MobileTopNavigation.tsx +15 -18
- package/src/lib/components/SyntaxHighlight.tsx +81 -46
- package/src/lib/components/ThemeSwitch.tsx +26 -0
- package/src/lib/components/TopNavigation.tsx +27 -19
- package/src/lib/components/Zudoku.tsx +5 -10
- package/src/lib/components/context/ZudokuContext.ts +8 -13
- package/src/lib/components/navigation/Sidebar.tsx +3 -3
- package/src/lib/components/navigation/utils.ts +2 -2
- package/src/lib/core/ZudokuContext.ts +0 -8
- package/src/lib/errors/ErrorAlert.tsx +2 -1
- package/src/lib/plugins/openapi/ColorizedParam.tsx +23 -14
- package/src/lib/plugins/openapi/Endpoint.tsx +5 -10
- package/src/lib/plugins/openapi/OperationList.tsx +5 -40
- package/src/lib/plugins/openapi/Route.tsx +11 -12
- package/src/lib/plugins/openapi/Sidecar.tsx +10 -13
- package/src/lib/plugins/openapi/client/GraphQLClient.tsx +140 -0
- package/src/lib/plugins/openapi/client/GraphQLContext.tsx +16 -0
- package/src/lib/plugins/openapi/client/createServer.ts +2 -0
- package/src/lib/plugins/openapi/client/useCreateQuery.ts +18 -0
- package/src/lib/plugins/openapi/client/worker.ts +38 -24
- package/src/lib/plugins/openapi/graphql/fragment-masking.ts +11 -18
- package/src/lib/plugins/openapi/graphql/gql.ts +7 -25
- package/src/lib/plugins/openapi/graphql/graphql.ts +351 -782
- package/src/lib/plugins/openapi/index.tsx +40 -63
- package/src/lib/plugins/openapi/schema/SchemaView.tsx +1 -1
- package/src/lib/plugins/openapi-worker.ts +11 -1
- package/dist/lib/components/context/ThemeContext.d.ts +0 -2
- package/dist/lib/components/context/ThemeContext.js +0 -7
- package/dist/lib/components/context/ThemeContext.js.map +0 -1
- package/dist/lib/components/context/ThemeProvider.d.ts +0 -4
- package/dist/lib/components/context/ThemeProvider.js +0 -23
- package/dist/lib/components/context/ThemeProvider.js.map +0 -1
- package/dist/lib/plugins/openapi/client/createMemoryClient.d.ts +0 -9
- package/dist/lib/plugins/openapi/client/createMemoryClient.js +0 -54
- package/dist/lib/plugins/openapi/client/createMemoryClient.js.map +0 -1
- package/dist/lib/plugins/openapi/client/createWorkerClient.d.ts +0 -10
- package/dist/lib/plugins/openapi/client/createWorkerClient.js +0 -62
- package/dist/lib/plugins/openapi/client/createWorkerClient.js.map +0 -1
- package/dist/lib/plugins/openapi/client/interfaces.d.ts +0 -4
- package/dist/lib/plugins/openapi/client/interfaces.js +0 -2
- package/dist/lib/plugins/openapi/client/interfaces.js.map +0 -1
- package/dist/lib/themeToggle.d.ts +0 -1
- package/dist/lib/themeToggle.js +0 -7
- package/dist/lib/themeToggle.js.map +0 -1
- package/dist/lib/util/createWaitForNotify.d.ts +0 -1
- package/dist/lib/util/createWaitForNotify.js +0 -15
- package/dist/lib/util/createWaitForNotify.js.map +0 -1
- package/dist/vite/plugin-html-transform.d.ts +0 -2
- package/dist/vite/plugin-html-transform.js +0 -15
- package/dist/vite/plugin-html-transform.js.map +0 -1
- package/lib/DeveloperHint-DHdLXGHA.js +0 -16
- package/lib/DeveloperHint-DHdLXGHA.js.map +0 -1
- package/lib/Markdown-D6UxMbZm.js +0 -18059
- package/lib/Markdown-D6UxMbZm.js.map +0 -1
- package/lib/OperationList-BHUBGM0c.js +0 -621
- package/lib/OperationList-BHUBGM0c.js.map +0 -1
- package/lib/Route-B0XuN1oC.js +0 -13
- package/lib/Route-B0XuN1oC.js.map +0 -1
- package/lib/Select-DYKDahHt.js.map +0 -1
- package/lib/SidebarBadge-Bbt92M5K.js +0 -38
- package/lib/SidebarBadge-Bbt92M5K.js.map +0 -1
- package/lib/SlotletProvider-mhjLPG44.js +0 -241
- package/lib/SlotletProvider-mhjLPG44.js.map +0 -1
- package/lib/Spinner-ChOGyPls.js.map +0 -1
- package/lib/StaggeredRender-DDHSzQKE.js +0 -17
- package/lib/StaggeredRender-DDHSzQKE.js.map +0 -1
- package/lib/hook-CjQERPa7.js.map +0 -1
- package/lib/index-BRg5pi5D.js +0 -5902
- package/lib/index-BRg5pi5D.js.map +0 -1
- package/lib/index-DM9hrcCG.js +0 -1783
- package/lib/index-DM9hrcCG.js.map +0 -1
- package/lib/state-BsPrOUAh.js +0 -252
- package/lib/state-BsPrOUAh.js.map +0 -1
- package/lib/urql-core-35Qt_U4i.js +0 -1511
- package/lib/urql-core-35Qt_U4i.js.map +0 -1
- package/lib/useExposedProps-BxyHjPNN.js +0 -9
- package/lib/utils-DNAltzXc.js.map +0 -1
- package/src/lib/components/context/ThemeContext.tsx +0 -8
- package/src/lib/components/context/ThemeProvider.tsx +0 -27
- package/src/lib/plugins/openapi/client/createMemoryClient.ts +0 -65
- package/src/lib/plugins/openapi/client/createWorkerClient.ts +0 -79
- package/src/lib/plugins/openapi/client/interfaces.ts +0 -5
- package/src/lib/themeToggle.ts +0 -7
- package/src/lib/util/createWaitForNotify.ts +0 -18
|
@@ -0,0 +1,1273 @@
|
|
|
1
|
+
var ke = Object.defineProperty;
|
|
2
|
+
var me = (t) => {
|
|
3
|
+
throw TypeError(t);
|
|
4
|
+
};
|
|
5
|
+
var Ie = (t, n, s) => n in t ? ke(t, n, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[n] = s;
|
|
6
|
+
var W = (t, n, s) => Ie(t, typeof n != "symbol" ? n + "" : n, s), pe = (t, n, s) => n.has(t) || me("Cannot " + s);
|
|
7
|
+
var x = (t, n, s) => (pe(t, n, "read from private field"), s ? s.call(t) : n.get(t)), R = (t, n, s) => n.has(t) ? me("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(t) : n.set(t, s), M = (t, n, s, r) => (pe(t, n, "write to private field"), r ? r.call(t, s) : n.set(t, s), s);
|
|
8
|
+
import { j as e } from "./jsx-runtime-B6kdoens.js";
|
|
9
|
+
import { i as qe, j as Re, k as Me } from "./utils-DcpDOncX.js";
|
|
10
|
+
import { XIcon as Ae, EraserIcon as Se, ChevronsUpDownIcon as Ve, LogInIcon as ze, CirclePlayIcon as Fe } from "lucide-react";
|
|
11
|
+
import { u as Le } from "./hook-hEqe7fPB.js";
|
|
12
|
+
import { Button as E } from "./ui/Button.js";
|
|
13
|
+
import { initializeWorker as De } from "zudoku/openapi-worker";
|
|
14
|
+
import { Z as Ge } from "./invariant-Caa8-XvF.js";
|
|
15
|
+
import { VisuallyHidden as Be } from "@radix-ui/react-visually-hidden";
|
|
16
|
+
import * as he from "react";
|
|
17
|
+
import { useRef as Ce, useEffect as $e, useState as Te, useTransition as Je, Fragment as Z } from "react";
|
|
18
|
+
import { D as He, b as Qe, a as Ue, c as We } from "./Dialog-k70Qfukb.js";
|
|
19
|
+
import { u as Ze, S as fe, a as xe, b as ye, c as ge, e as K } from "./Select-O9ZM3ZgX.js";
|
|
20
|
+
import { b as oe, C as $, u as Ke, a as Xe, F as Ye } from "./index.esm-C5mr_sKO.js";
|
|
21
|
+
import { a as et } from "./state-tsXBLONe.js";
|
|
22
|
+
import { S as ve } from "./Spinner-3cQDBVGr.js";
|
|
23
|
+
import { Callout as tt } from "./ui/Callout.js";
|
|
24
|
+
import { Card as ae, CardHeader as nt, CardTitle as st, CardContent as rt } from "./ui/Card.js";
|
|
25
|
+
import { Tabs as je, TabsList as be, TabsTrigger as A, TabsContent as V } from "./ui/Tabs.js";
|
|
26
|
+
import { z as at, S as ot } from "./SyntaxHighlight-DkLOsjHS.js";
|
|
27
|
+
import { c as P } from "./cn-BmFQLtkS.js";
|
|
28
|
+
import { Input as H } from "./ui/Input.js";
|
|
29
|
+
import { Slot as it } from "@radix-ui/react-slot";
|
|
30
|
+
import { m as lt } from "./router-lfyopgBI.js";
|
|
31
|
+
class L extends String {
|
|
32
|
+
constructor(s, r) {
|
|
33
|
+
super(s);
|
|
34
|
+
W(this, "__apiType");
|
|
35
|
+
this.value = s, this.__meta__ = r;
|
|
36
|
+
}
|
|
37
|
+
toString() {
|
|
38
|
+
return this.value;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
const ct = new L(
|
|
42
|
+
`
|
|
43
|
+
fragment OperationsFragment on OperationItem {
|
|
44
|
+
slug
|
|
45
|
+
summary
|
|
46
|
+
method
|
|
47
|
+
description
|
|
48
|
+
operationId
|
|
49
|
+
contentTypes
|
|
50
|
+
path
|
|
51
|
+
parameters {
|
|
52
|
+
name
|
|
53
|
+
in
|
|
54
|
+
description
|
|
55
|
+
required
|
|
56
|
+
schema
|
|
57
|
+
style
|
|
58
|
+
examples {
|
|
59
|
+
name
|
|
60
|
+
description
|
|
61
|
+
externalValue
|
|
62
|
+
value
|
|
63
|
+
summary
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
requestBody {
|
|
67
|
+
content {
|
|
68
|
+
mediaType
|
|
69
|
+
encoding {
|
|
70
|
+
name
|
|
71
|
+
}
|
|
72
|
+
examples {
|
|
73
|
+
name
|
|
74
|
+
description
|
|
75
|
+
externalValue
|
|
76
|
+
value
|
|
77
|
+
summary
|
|
78
|
+
}
|
|
79
|
+
schema
|
|
80
|
+
}
|
|
81
|
+
description
|
|
82
|
+
required
|
|
83
|
+
}
|
|
84
|
+
responses {
|
|
85
|
+
statusCode
|
|
86
|
+
links
|
|
87
|
+
description
|
|
88
|
+
content {
|
|
89
|
+
examples {
|
|
90
|
+
name
|
|
91
|
+
description
|
|
92
|
+
externalValue
|
|
93
|
+
value
|
|
94
|
+
summary
|
|
95
|
+
}
|
|
96
|
+
mediaType
|
|
97
|
+
encoding {
|
|
98
|
+
name
|
|
99
|
+
}
|
|
100
|
+
schema
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
`,
|
|
105
|
+
{ fragmentName: "OperationsFragment" }
|
|
106
|
+
), dt = new L(`
|
|
107
|
+
query ServersQuery($input: JSON!, $type: SchemaType!) {
|
|
108
|
+
schema(input: $input, type: $type) {
|
|
109
|
+
url
|
|
110
|
+
servers {
|
|
111
|
+
url
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
`), ut = new L(`
|
|
116
|
+
query AllOperations($input: JSON!, $type: SchemaType!) {
|
|
117
|
+
schema(input: $input, type: $type) {
|
|
118
|
+
description
|
|
119
|
+
title
|
|
120
|
+
url
|
|
121
|
+
version
|
|
122
|
+
tags {
|
|
123
|
+
name
|
|
124
|
+
description
|
|
125
|
+
operations {
|
|
126
|
+
slug
|
|
127
|
+
...OperationsFragment
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
fragment OperationsFragment on OperationItem {
|
|
133
|
+
slug
|
|
134
|
+
summary
|
|
135
|
+
method
|
|
136
|
+
description
|
|
137
|
+
operationId
|
|
138
|
+
contentTypes
|
|
139
|
+
path
|
|
140
|
+
parameters {
|
|
141
|
+
name
|
|
142
|
+
in
|
|
143
|
+
description
|
|
144
|
+
required
|
|
145
|
+
schema
|
|
146
|
+
style
|
|
147
|
+
examples {
|
|
148
|
+
name
|
|
149
|
+
description
|
|
150
|
+
externalValue
|
|
151
|
+
value
|
|
152
|
+
summary
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
requestBody {
|
|
156
|
+
content {
|
|
157
|
+
mediaType
|
|
158
|
+
encoding {
|
|
159
|
+
name
|
|
160
|
+
}
|
|
161
|
+
examples {
|
|
162
|
+
name
|
|
163
|
+
description
|
|
164
|
+
externalValue
|
|
165
|
+
value
|
|
166
|
+
summary
|
|
167
|
+
}
|
|
168
|
+
schema
|
|
169
|
+
}
|
|
170
|
+
description
|
|
171
|
+
required
|
|
172
|
+
}
|
|
173
|
+
responses {
|
|
174
|
+
statusCode
|
|
175
|
+
links
|
|
176
|
+
description
|
|
177
|
+
content {
|
|
178
|
+
examples {
|
|
179
|
+
name
|
|
180
|
+
description
|
|
181
|
+
externalValue
|
|
182
|
+
value
|
|
183
|
+
summary
|
|
184
|
+
}
|
|
185
|
+
mediaType
|
|
186
|
+
encoding {
|
|
187
|
+
name
|
|
188
|
+
}
|
|
189
|
+
schema
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}`), mt = new L(`
|
|
193
|
+
query getServerQuery($input: JSON!, $type: SchemaType!) {
|
|
194
|
+
schema(input: $input, type: $type) {
|
|
195
|
+
url
|
|
196
|
+
servers {
|
|
197
|
+
url
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
`), pt = new L(`
|
|
202
|
+
query GetCategories($input: JSON!, $type: SchemaType!) {
|
|
203
|
+
schema(input: $input, type: $type) {
|
|
204
|
+
url
|
|
205
|
+
tags {
|
|
206
|
+
__typename
|
|
207
|
+
name
|
|
208
|
+
operations {
|
|
209
|
+
__typename
|
|
210
|
+
slug
|
|
211
|
+
deprecated
|
|
212
|
+
method
|
|
213
|
+
summary
|
|
214
|
+
operationId
|
|
215
|
+
path
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
`), ht = {
|
|
221
|
+
"\n query ServersQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n servers {\n url\n }\n }\n }\n": dt,
|
|
222
|
+
"\n fragment OperationsFragment on OperationItem {\n slug\n summary\n method\n description\n operationId\n contentTypes\n path\n parameters {\n name\n in\n description\n required\n schema\n style\n examples {\n name\n description\n externalValue\n value\n summary\n }\n }\n requestBody {\n content {\n mediaType\n encoding {\n name\n }\n examples {\n name\n description\n externalValue\n value\n summary\n }\n schema\n }\n description\n required\n }\n responses {\n statusCode\n links\n description\n content {\n examples {\n name\n description\n externalValue\n value\n summary\n }\n mediaType\n encoding {\n name\n }\n schema\n }\n }\n }\n": ct,
|
|
223
|
+
"\n query AllOperations($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n description\n title\n url\n version\n tags {\n name\n description\n operations {\n slug\n ...OperationsFragment\n }\n }\n }\n }\n": ut,
|
|
224
|
+
"\n query getServerQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n servers {\n url\n }\n }\n }\n": mt,
|
|
225
|
+
"\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
|
|
226
|
+
};
|
|
227
|
+
function ft(t) {
|
|
228
|
+
return ht[t] ?? {};
|
|
229
|
+
}
|
|
230
|
+
function X(t) {
|
|
231
|
+
if (!ie(t))
|
|
232
|
+
throw new Error("Parameter was not an error");
|
|
233
|
+
}
|
|
234
|
+
function ie(t) {
|
|
235
|
+
return !!t && typeof t == "object" && xt(t) === "[object Error]" || t instanceof Error;
|
|
236
|
+
}
|
|
237
|
+
function xt(t) {
|
|
238
|
+
return Object.prototype.toString.call(t);
|
|
239
|
+
}
|
|
240
|
+
const yt = "Layerr";
|
|
241
|
+
let gt = yt;
|
|
242
|
+
function vt() {
|
|
243
|
+
return gt;
|
|
244
|
+
}
|
|
245
|
+
function jt(t) {
|
|
246
|
+
let n, s = "";
|
|
247
|
+
if (t.length === 0)
|
|
248
|
+
n = {};
|
|
249
|
+
else if (ie(t[0]))
|
|
250
|
+
n = {
|
|
251
|
+
cause: t[0]
|
|
252
|
+
}, s = t.slice(1).join(" ") || "";
|
|
253
|
+
else if (t[0] && typeof t[0] == "object")
|
|
254
|
+
n = Object.assign({}, t[0]), s = t.slice(1).join(" ") || "";
|
|
255
|
+
else if (typeof t[0] == "string")
|
|
256
|
+
n = {}, s = s = t.join(" ") || "";
|
|
257
|
+
else
|
|
258
|
+
throw new Error("Invalid arguments passed to Layerr");
|
|
259
|
+
return {
|
|
260
|
+
options: n,
|
|
261
|
+
shortMessage: s
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
class y extends Error {
|
|
265
|
+
constructor(n, s) {
|
|
266
|
+
const r = [...arguments], { options: o, shortMessage: l } = jt(r);
|
|
267
|
+
let i = l;
|
|
268
|
+
if (o.cause && (i = `${i}: ${o.cause.message}`), super(i), this.message = i, o.name && typeof o.name == "string" ? this.name = o.name : this.name = vt(), o.cause && Object.defineProperty(this, "_cause", { value: o.cause }), Object.defineProperty(this, "_info", { value: {} }), o.info && typeof o.info == "object" && Object.assign(this._info, o.info), Error.captureStackTrace) {
|
|
269
|
+
const c = o.constructorOpt || this.constructor;
|
|
270
|
+
Error.captureStackTrace(this, c);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
static cause(n) {
|
|
274
|
+
return X(n), n._cause && ie(n._cause) ? n._cause : null;
|
|
275
|
+
}
|
|
276
|
+
static fullStack(n) {
|
|
277
|
+
X(n);
|
|
278
|
+
const s = y.cause(n);
|
|
279
|
+
return s ? `${n.stack}
|
|
280
|
+
caused by: ${y.fullStack(s)}` : n.stack ?? "";
|
|
281
|
+
}
|
|
282
|
+
static info(n) {
|
|
283
|
+
X(n);
|
|
284
|
+
const s = {}, r = y.cause(n);
|
|
285
|
+
return r && Object.assign(s, y.info(r)), n._info && Object.assign(s, n._info), s;
|
|
286
|
+
}
|
|
287
|
+
toString() {
|
|
288
|
+
let n = this.name || this.constructor.name || this.constructor.prototype.name;
|
|
289
|
+
return this.message && (n = `${n}: ${this.message}`), n;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
const Ee = "0123456789ABCDEFGHJKMNPQRSTVWXYZ", F = 32, Ne = 281474976710655, bt = 10, Nt = 16, z = Object.freeze({
|
|
293
|
+
source: "ulid"
|
|
294
|
+
});
|
|
295
|
+
function wt(t) {
|
|
296
|
+
const n = St(), s = n && (n.crypto || n.msCrypto) || null;
|
|
297
|
+
if (typeof (s == null ? void 0 : s.getRandomValues) == "function")
|
|
298
|
+
return () => {
|
|
299
|
+
const r = new Uint8Array(1);
|
|
300
|
+
return s.getRandomValues(r), r[0] / 255;
|
|
301
|
+
};
|
|
302
|
+
if (typeof (s == null ? void 0 : s.randomBytes) == "function")
|
|
303
|
+
return () => s.randomBytes(1).readUInt8() / 255;
|
|
304
|
+
throw new y({
|
|
305
|
+
info: {
|
|
306
|
+
code: "PRNG_DETECT",
|
|
307
|
+
...z
|
|
308
|
+
}
|
|
309
|
+
}, "Failed to find a reliable PRNG");
|
|
310
|
+
}
|
|
311
|
+
function St() {
|
|
312
|
+
return Tt() ? self : typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : null;
|
|
313
|
+
}
|
|
314
|
+
function Ct(t, n) {
|
|
315
|
+
let s = "";
|
|
316
|
+
for (; t > 0; t--)
|
|
317
|
+
s = Et(n) + s;
|
|
318
|
+
return s;
|
|
319
|
+
}
|
|
320
|
+
function $t(t, n) {
|
|
321
|
+
if (isNaN(t))
|
|
322
|
+
throw new y({
|
|
323
|
+
info: {
|
|
324
|
+
code: "ENC_TIME_NAN",
|
|
325
|
+
...z
|
|
326
|
+
}
|
|
327
|
+
}, `Time must be a number: ${t}`);
|
|
328
|
+
if (t > Ne)
|
|
329
|
+
throw new y({
|
|
330
|
+
info: {
|
|
331
|
+
code: "ENC_TIME_SIZE_EXCEED",
|
|
332
|
+
...z
|
|
333
|
+
}
|
|
334
|
+
}, `Cannot encode a time larger than ${Ne}: ${t}`);
|
|
335
|
+
if (t < 0)
|
|
336
|
+
throw new y({
|
|
337
|
+
info: {
|
|
338
|
+
code: "ENC_TIME_NEG",
|
|
339
|
+
...z
|
|
340
|
+
}
|
|
341
|
+
}, `Time must be positive: ${t}`);
|
|
342
|
+
if (Number.isInteger(t) === !1)
|
|
343
|
+
throw new y({
|
|
344
|
+
info: {
|
|
345
|
+
code: "ENC_TIME_TYPE",
|
|
346
|
+
...z
|
|
347
|
+
}
|
|
348
|
+
}, `Time must be an integer: ${t}`);
|
|
349
|
+
let s, r = "";
|
|
350
|
+
for (let o = n; o > 0; o--)
|
|
351
|
+
s = t % F, r = Ee.charAt(s) + r, t = (t - s) / F;
|
|
352
|
+
return r;
|
|
353
|
+
}
|
|
354
|
+
function Tt() {
|
|
355
|
+
return typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope;
|
|
356
|
+
}
|
|
357
|
+
function Et(t) {
|
|
358
|
+
let n = Math.floor(t() * F);
|
|
359
|
+
return n === F && (n = F - 1), Ee.charAt(n);
|
|
360
|
+
}
|
|
361
|
+
function Pt(t, n) {
|
|
362
|
+
const s = wt(), r = isNaN(t) ? Date.now() : t;
|
|
363
|
+
return $t(r, bt) + Ct(Nt, s);
|
|
364
|
+
}
|
|
365
|
+
let Y, ee;
|
|
366
|
+
const te = (t) => {
|
|
367
|
+
var n;
|
|
368
|
+
if ((n = t.errors) != null && n[0])
|
|
369
|
+
throw new Ge(t.errors[0].message, {
|
|
370
|
+
developerHint: "Check your configuration value `apis.type` and `apis.input` in the Zudoku config."
|
|
371
|
+
});
|
|
372
|
+
};
|
|
373
|
+
var T, O, N, Q;
|
|
374
|
+
class Ot {
|
|
375
|
+
constructor(n) {
|
|
376
|
+
R(this, T);
|
|
377
|
+
R(this, O, /* @__PURE__ */ new Map());
|
|
378
|
+
R(this, N);
|
|
379
|
+
R(this, Q, () => import("./createServer-DK-g7kbB.js").then((n) => n.createServer()));
|
|
380
|
+
W(this, "fetch", async (n, ...[s]) => {
|
|
381
|
+
var l;
|
|
382
|
+
const r = (l = n.match(/query (\w+)/)) == null ? void 0 : l[1], o = JSON.stringify({ query: n, variables: s, operationName: r });
|
|
383
|
+
switch (x(this, T)) {
|
|
384
|
+
case "remote": {
|
|
385
|
+
const i = await fetch(this.config.server, {
|
|
386
|
+
method: "POST",
|
|
387
|
+
body: o,
|
|
388
|
+
headers: { "Content-Type": "application/json" }
|
|
389
|
+
});
|
|
390
|
+
if (!i.ok)
|
|
391
|
+
throw new Error("Network response was not ok");
|
|
392
|
+
const c = await i.json();
|
|
393
|
+
return te(c), c.data;
|
|
394
|
+
}
|
|
395
|
+
case "in-memory": {
|
|
396
|
+
Y || (Y = x(this, Q).call(this));
|
|
397
|
+
const i = await Y;
|
|
398
|
+
if (!i) throw new Error("Local server not initialized");
|
|
399
|
+
const c = await i.fetch(
|
|
400
|
+
new Request("http://localhost/graphql", {
|
|
401
|
+
method: "POST",
|
|
402
|
+
body: o,
|
|
403
|
+
headers: { "Content-Type": "application/json" }
|
|
404
|
+
})
|
|
405
|
+
);
|
|
406
|
+
if (!c.ok)
|
|
407
|
+
throw new Error("Network response was not ok");
|
|
408
|
+
const u = await c.json();
|
|
409
|
+
return te(u), u.data;
|
|
410
|
+
}
|
|
411
|
+
case "worker": {
|
|
412
|
+
if (ee || (ee = De()), !x(this, N)) {
|
|
413
|
+
const d = new MessageChannel();
|
|
414
|
+
ee.port.postMessage({ port: d.port2 }, [d.port2]), M(this, N, d.port1), x(this, N).onmessage = (h) => {
|
|
415
|
+
const { id: g, body: j } = h.data, b = x(this, O).get(g);
|
|
416
|
+
if (b) {
|
|
417
|
+
const w = JSON.parse(j);
|
|
418
|
+
b(w), x(this, O).delete(g);
|
|
419
|
+
} else
|
|
420
|
+
console.error(`No pending request found for id: ${g}`);
|
|
421
|
+
}, x(this, N).start();
|
|
422
|
+
}
|
|
423
|
+
const i = Pt(), u = await new Promise(
|
|
424
|
+
(d) => {
|
|
425
|
+
x(this, O).set(i, d), x(this, N).postMessage({ id: i, body: o });
|
|
426
|
+
}
|
|
427
|
+
);
|
|
428
|
+
return te(u), u.data;
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
});
|
|
432
|
+
this.config = n, n.server ? M(this, T, "remote") : n.inMemory || typeof SharedWorker > "u" ? M(this, T, "in-memory") : M(this, T, "worker");
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
T = new WeakMap(), O = new WeakMap(), N = new WeakMap(), Q = new WeakMap();
|
|
436
|
+
const ne = (t) => Math.abs(
|
|
437
|
+
isNaN(parseInt(t)) ? t.toLowerCase().charCodeAt(0) - 96 : isNaN(parseInt(t)) ? 0 : parseInt(t)
|
|
438
|
+
), se = (t) => t.length > 1 ? parseInt(t.split("").reduce((n, s) => `${ne(n) + ne(s)}`)) : ne(t), _t = (t, n = {}) => {
|
|
439
|
+
const s = (3 * se(t) + 2 * se(t) + se(t)) % 360, { saturation: r = 75, lightness: o = 60 } = n;
|
|
440
|
+
return `${s}deg ${r}% ${o}%`;
|
|
441
|
+
}, re = "data-linked-param", kt = (t) => {
|
|
442
|
+
const { resolvedTheme: n } = at();
|
|
443
|
+
return _t(
|
|
444
|
+
t,
|
|
445
|
+
n === "light" ? { saturation: 85, lightness: 50 } : void 0
|
|
446
|
+
);
|
|
447
|
+
}, Pe = ({
|
|
448
|
+
name: t,
|
|
449
|
+
className: n,
|
|
450
|
+
backgroundOpacity: s = "100%",
|
|
451
|
+
borderOpacity: r = "100%",
|
|
452
|
+
slug: o,
|
|
453
|
+
children: l,
|
|
454
|
+
onClick: i
|
|
455
|
+
}) => {
|
|
456
|
+
const c = Ce(null), u = t.replace(/[{}]/g, ""), d = o == null ? void 0 : o.replace(/[{}]/g, ""), h = kt(u), g = `hsl(${h} / ${r})`, j = `hsl(${h} / ${s})`;
|
|
457
|
+
return $e(() => {
|
|
458
|
+
if (!d || !c.current) return;
|
|
459
|
+
const b = () => {
|
|
460
|
+
document.querySelectorAll(`[${re}="${d}"]`).forEach((S) => {
|
|
461
|
+
S instanceof HTMLElement && (S.dataset.active = "true");
|
|
462
|
+
});
|
|
463
|
+
}, w = () => {
|
|
464
|
+
document.querySelectorAll(`[${re}="${d}"]`).forEach((S) => {
|
|
465
|
+
S instanceof HTMLElement && (S.dataset.active = "false");
|
|
466
|
+
});
|
|
467
|
+
}, v = c.current;
|
|
468
|
+
return v.addEventListener("mouseenter", b), v.addEventListener("mouseleave", w), () => {
|
|
469
|
+
v.removeEventListener("mouseenter", b), v.removeEventListener("mouseleave", w);
|
|
470
|
+
};
|
|
471
|
+
}, [d]), /* @__PURE__ */ e.jsx(
|
|
472
|
+
"span",
|
|
473
|
+
{
|
|
474
|
+
[re]: d,
|
|
475
|
+
className: P(
|
|
476
|
+
"relative after:rounded after:absolute after:inset-0 after:-bottom-0.5 after:border-b-2 after:transition-opacity after:duration-200",
|
|
477
|
+
"after:pointer-events-none after:border-[--border-color] after:opacity-30 after:data-[active=true]:opacity-100",
|
|
478
|
+
n
|
|
479
|
+
),
|
|
480
|
+
suppressHydrationWarning: !0,
|
|
481
|
+
ref: c,
|
|
482
|
+
onClick: i,
|
|
483
|
+
style: {
|
|
484
|
+
"--border-color": g,
|
|
485
|
+
"--background-color": j
|
|
486
|
+
},
|
|
487
|
+
children: l ?? t
|
|
488
|
+
}
|
|
489
|
+
);
|
|
490
|
+
}, It = (t, n, s) => {
|
|
491
|
+
const r = n.replace(/(:\w+|\{\w+})/g, (l) => {
|
|
492
|
+
var u;
|
|
493
|
+
const i = l.replace(/[:{}]/g, "");
|
|
494
|
+
return ((u = s.pathParams.find((d) => d.name === i)) == null ? void 0 : u.value) ?? l;
|
|
495
|
+
}), o = new URL(
|
|
496
|
+
r.replace(/^\//, ""),
|
|
497
|
+
t.endsWith("/") ? t : `${t}/`
|
|
498
|
+
);
|
|
499
|
+
return s.queryParams.filter((l) => l.active).forEach((l) => {
|
|
500
|
+
o.searchParams.set(l.name, l.value);
|
|
501
|
+
}), o;
|
|
502
|
+
}, qt = ({
|
|
503
|
+
control: t,
|
|
504
|
+
register: n
|
|
505
|
+
}) => {
|
|
506
|
+
const { fields: s, append: r, remove: o } = oe({
|
|
507
|
+
control: t,
|
|
508
|
+
name: "headers"
|
|
509
|
+
});
|
|
510
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
511
|
+
/* @__PURE__ */ e.jsx("table", { className: "w-full [&_td]:border [&_td]:p-1.5 [&_td]:px-2", children: /* @__PURE__ */ e.jsx("tbody", { children: s.map((l, i) => /* @__PURE__ */ e.jsxs(
|
|
512
|
+
"tr",
|
|
513
|
+
{
|
|
514
|
+
className: "group has-[:focus]:bg-muted/50 hover:bg-muted/50",
|
|
515
|
+
children: [
|
|
516
|
+
/* @__PURE__ */ e.jsx("td", { className: "flex gap-2 items-center", children: /* @__PURE__ */ e.jsx(
|
|
517
|
+
H,
|
|
518
|
+
{
|
|
519
|
+
...n(`headers.${i}.name`),
|
|
520
|
+
placeholder: "Name",
|
|
521
|
+
className: "border-0 shadow-none text-xs font-mono",
|
|
522
|
+
autoComplete: "off"
|
|
523
|
+
}
|
|
524
|
+
) }),
|
|
525
|
+
/* @__PURE__ */ e.jsx("td", { children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
526
|
+
/* @__PURE__ */ e.jsx(
|
|
527
|
+
H,
|
|
528
|
+
{
|
|
529
|
+
placeholder: "Value",
|
|
530
|
+
className: "border-0 shadow-none text-xs font-mono",
|
|
531
|
+
...n(`headers.${i}.value`),
|
|
532
|
+
autoComplete: "off"
|
|
533
|
+
}
|
|
534
|
+
),
|
|
535
|
+
/* @__PURE__ */ e.jsx(
|
|
536
|
+
E,
|
|
537
|
+
{
|
|
538
|
+
size: "icon",
|
|
539
|
+
variant: "ghost",
|
|
540
|
+
className: "text-muted-foreground opacity-0 group-hover:opacity-100",
|
|
541
|
+
onClick: () => {
|
|
542
|
+
o(i);
|
|
543
|
+
},
|
|
544
|
+
type: "button",
|
|
545
|
+
children: /* @__PURE__ */ e.jsx(Ae, { size: 16 })
|
|
546
|
+
}
|
|
547
|
+
)
|
|
548
|
+
] }) })
|
|
549
|
+
]
|
|
550
|
+
},
|
|
551
|
+
l.id
|
|
552
|
+
)) }) }),
|
|
553
|
+
/* @__PURE__ */ e.jsx("div", { className: "text-end", children: /* @__PURE__ */ e.jsx(
|
|
554
|
+
E,
|
|
555
|
+
{
|
|
556
|
+
className: "",
|
|
557
|
+
onClick: () => r({ name: "", value: "" }),
|
|
558
|
+
type: "button",
|
|
559
|
+
children: "Add header"
|
|
560
|
+
}
|
|
561
|
+
) })
|
|
562
|
+
] });
|
|
563
|
+
}, Rt = ({
|
|
564
|
+
control: t
|
|
565
|
+
}) => {
|
|
566
|
+
const { fields: n } = oe({
|
|
567
|
+
control: t,
|
|
568
|
+
name: "pathParams"
|
|
569
|
+
});
|
|
570
|
+
return /* @__PURE__ */ e.jsx("table", { className: "w-full table-auto [&_td]:border [&_td]:py-1 [&_td]:px-2", children: /* @__PURE__ */ e.jsx("tbody", { children: n.map((s, r) => /* @__PURE__ */ e.jsxs("tr", { className: "hover:bg-accent/40", children: [
|
|
571
|
+
/* @__PURE__ */ e.jsx("td", { children: /* @__PURE__ */ e.jsx(
|
|
572
|
+
$,
|
|
573
|
+
{
|
|
574
|
+
control: t,
|
|
575
|
+
name: `pathParams.${r}.value`,
|
|
576
|
+
render: ({ field: o }) => /* @__PURE__ */ e.jsxs("div", { children: [
|
|
577
|
+
/* @__PURE__ */ e.jsx(
|
|
578
|
+
Pe,
|
|
579
|
+
{
|
|
580
|
+
slug: s.name,
|
|
581
|
+
name: s.name,
|
|
582
|
+
backgroundOpacity: "25%",
|
|
583
|
+
borderOpacity: o.value ? "100%" : "0",
|
|
584
|
+
className: P(
|
|
585
|
+
"font-mono text-xs m-2",
|
|
586
|
+
!o.value && "opacity-60"
|
|
587
|
+
)
|
|
588
|
+
}
|
|
589
|
+
),
|
|
590
|
+
"*"
|
|
591
|
+
] })
|
|
592
|
+
}
|
|
593
|
+
) }),
|
|
594
|
+
/* @__PURE__ */ e.jsx("td", { children: /* @__PURE__ */ e.jsxs("div", { className: "flex justify-between items-center", children: [
|
|
595
|
+
/* @__PURE__ */ e.jsx(
|
|
596
|
+
$,
|
|
597
|
+
{
|
|
598
|
+
control: t,
|
|
599
|
+
name: `pathParams.${r}.value`,
|
|
600
|
+
render: ({ field: o }) => /* @__PURE__ */ e.jsx(
|
|
601
|
+
H,
|
|
602
|
+
{
|
|
603
|
+
...o,
|
|
604
|
+
placeholder: "Enter value",
|
|
605
|
+
className: "border-0 shadow-none ring-0 font-mono text-xs"
|
|
606
|
+
}
|
|
607
|
+
)
|
|
608
|
+
}
|
|
609
|
+
),
|
|
610
|
+
/* @__PURE__ */ e.jsx(
|
|
611
|
+
$,
|
|
612
|
+
{
|
|
613
|
+
control: t,
|
|
614
|
+
name: `pathParams.${r}.value`,
|
|
615
|
+
render: ({ field: o }) => /* @__PURE__ */ e.jsx(
|
|
616
|
+
E,
|
|
617
|
+
{
|
|
618
|
+
size: "icon",
|
|
619
|
+
type: "button",
|
|
620
|
+
variant: "ghost",
|
|
621
|
+
"aria-label": "Clear value",
|
|
622
|
+
className: P(
|
|
623
|
+
"ms-2",
|
|
624
|
+
o.value.length === 0 ? "opacity-0 pointer-events-none" : "opacity-100"
|
|
625
|
+
),
|
|
626
|
+
title: "Clear value",
|
|
627
|
+
onClick: () => o.onChange(""),
|
|
628
|
+
children: /* @__PURE__ */ e.jsx(Se, { size: 16 })
|
|
629
|
+
}
|
|
630
|
+
)
|
|
631
|
+
}
|
|
632
|
+
)
|
|
633
|
+
] }) })
|
|
634
|
+
] }, s.id)) }) });
|
|
635
|
+
}, Mt = (t, n) => {
|
|
636
|
+
const s = he.forwardRef(({ className: r, asChild: o, ...l }, i) => {
|
|
637
|
+
const c = o ? it : t;
|
|
638
|
+
return he.createElement(c, {
|
|
639
|
+
...l,
|
|
640
|
+
ref: i,
|
|
641
|
+
className: P(n, r)
|
|
642
|
+
});
|
|
643
|
+
});
|
|
644
|
+
return s.displayName = `VariantComponent(${t})`, s;
|
|
645
|
+
}, At = Mt(
|
|
646
|
+
"input",
|
|
647
|
+
"px-2 bg-transparent h-6 font-mono text-xs m-2"
|
|
648
|
+
), Vt = ({
|
|
649
|
+
control: t,
|
|
650
|
+
queryParams: n
|
|
651
|
+
}) => {
|
|
652
|
+
const { fields: s } = oe({
|
|
653
|
+
control: t,
|
|
654
|
+
name: "queryParams"
|
|
655
|
+
}), r = Ke(), o = n.map((c) => !!c.isRequired), i = r.watch("identity") !== J;
|
|
656
|
+
return /* @__PURE__ */ e.jsx("div", { className: "", children: /* @__PURE__ */ e.jsx("table", { className: "w-full [&_td]:border [&_td]:p-1.5 [&_td]:px-2", children: /* @__PURE__ */ e.jsx("tbody", { children: s.filter(
|
|
657
|
+
// TODO remove this hack for Accu or make it more generic
|
|
658
|
+
(c) => !(i && c.name === "apikey")
|
|
659
|
+
).map((c, u) => /* @__PURE__ */ e.jsxs("tr", { className: "hover:bg-accent/40", children: [
|
|
660
|
+
/* @__PURE__ */ e.jsx("td", { className: "text-center", children: /* @__PURE__ */ e.jsx(
|
|
661
|
+
$,
|
|
662
|
+
{
|
|
663
|
+
control: t,
|
|
664
|
+
name: `queryParams.${u}.active`,
|
|
665
|
+
render: ({ field: d }) => /* @__PURE__ */ e.jsx(
|
|
666
|
+
"input",
|
|
667
|
+
{
|
|
668
|
+
type: "checkbox",
|
|
669
|
+
id: `queryParams.${u}.active`,
|
|
670
|
+
checked: d.value,
|
|
671
|
+
onChange: d.onChange
|
|
672
|
+
}
|
|
673
|
+
)
|
|
674
|
+
}
|
|
675
|
+
) }),
|
|
676
|
+
/* @__PURE__ */ e.jsx("td", { children: /* @__PURE__ */ e.jsx(
|
|
677
|
+
$,
|
|
678
|
+
{
|
|
679
|
+
control: t,
|
|
680
|
+
render: ({ field: d }) => /* @__PURE__ */ e.jsx(At, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
681
|
+
"label",
|
|
682
|
+
{
|
|
683
|
+
className: "flex items-center cursor-pointer",
|
|
684
|
+
htmlFor: `queryParams.${u}.active`,
|
|
685
|
+
title: o[u] ? "Required field" : void 0,
|
|
686
|
+
children: [
|
|
687
|
+
d.value,
|
|
688
|
+
o[u] && /* @__PURE__ */ e.jsx("sup", { children: " *" })
|
|
689
|
+
]
|
|
690
|
+
}
|
|
691
|
+
) }),
|
|
692
|
+
name: `queryParams.${u}.name`
|
|
693
|
+
}
|
|
694
|
+
) }),
|
|
695
|
+
/* @__PURE__ */ e.jsx("td", { children: /* @__PURE__ */ e.jsxs("div", { className: "flex justify-between items-center", children: [
|
|
696
|
+
/* @__PURE__ */ e.jsx(
|
|
697
|
+
$,
|
|
698
|
+
{
|
|
699
|
+
control: t,
|
|
700
|
+
render: ({ field: d }) => /* @__PURE__ */ e.jsx(
|
|
701
|
+
H,
|
|
702
|
+
{
|
|
703
|
+
...d,
|
|
704
|
+
onChange: (h) => {
|
|
705
|
+
d.onChange(h.target.value), h.target.value.length > 0 && r.setValue(`queryParams.${u}.active`, !0);
|
|
706
|
+
},
|
|
707
|
+
placeholder: "Enter value",
|
|
708
|
+
className: "w-full border-0 shadow-none text-xs font-mono"
|
|
709
|
+
}
|
|
710
|
+
),
|
|
711
|
+
name: `queryParams.${u}.value`
|
|
712
|
+
}
|
|
713
|
+
),
|
|
714
|
+
/* @__PURE__ */ e.jsx(
|
|
715
|
+
$,
|
|
716
|
+
{
|
|
717
|
+
control: t,
|
|
718
|
+
render: ({ field: d }) => /* @__PURE__ */ e.jsx(
|
|
719
|
+
E,
|
|
720
|
+
{
|
|
721
|
+
size: "icon",
|
|
722
|
+
type: "button",
|
|
723
|
+
variant: "ghost",
|
|
724
|
+
"aria-label": "Clear value",
|
|
725
|
+
className: P(
|
|
726
|
+
"ms-2",
|
|
727
|
+
d.value.length === 0 ? "opacity-0 pointer-events-none" : "opacity-100"
|
|
728
|
+
),
|
|
729
|
+
title: "Clear value",
|
|
730
|
+
onClick: () => d.onChange(""),
|
|
731
|
+
children: /* @__PURE__ */ e.jsx(Se, { size: 16 })
|
|
732
|
+
}
|
|
733
|
+
),
|
|
734
|
+
name: `queryParams.${u}.value`
|
|
735
|
+
}
|
|
736
|
+
)
|
|
737
|
+
] }) })
|
|
738
|
+
] }, c.id)) }) }) });
|
|
739
|
+
}, zt = ({
|
|
740
|
+
value: t,
|
|
741
|
+
onChange: n,
|
|
742
|
+
className: s,
|
|
743
|
+
options: r,
|
|
744
|
+
showChevrons: o = !0
|
|
745
|
+
}) => /* @__PURE__ */ e.jsxs("div", { className: "grid", children: [
|
|
746
|
+
/* @__PURE__ */ e.jsx(
|
|
747
|
+
"select",
|
|
748
|
+
{
|
|
749
|
+
className: P(
|
|
750
|
+
"row-start-1 col-start-1 border border-input text-foreground px-2 py-1 pe-6",
|
|
751
|
+
"rounded-md appearance-none bg-zinc-50 hover:bg-white dark:bg-zinc-800 hover:dark:bg-zinc-800/75",
|
|
752
|
+
s
|
|
753
|
+
),
|
|
754
|
+
value: t,
|
|
755
|
+
onChange: n,
|
|
756
|
+
children: r.map((l) => /* @__PURE__ */ e.jsx("option", { value: l.value, children: l.label }, l.value))
|
|
757
|
+
}
|
|
758
|
+
),
|
|
759
|
+
/* @__PURE__ */ e.jsx(
|
|
760
|
+
"div",
|
|
761
|
+
{
|
|
762
|
+
className: P(
|
|
763
|
+
!o && "hidden",
|
|
764
|
+
"row-start-1 col-start-1 self-center justify-self-end relative end-2 pointer-events-none"
|
|
765
|
+
),
|
|
766
|
+
children: /* @__PURE__ */ e.jsx(Ve, { size: 14 })
|
|
767
|
+
}
|
|
768
|
+
)
|
|
769
|
+
] }), Ft = (t) => {
|
|
770
|
+
var s;
|
|
771
|
+
return (s = Object.entries({
|
|
772
|
+
"application/json": "json",
|
|
773
|
+
"text/json": "json",
|
|
774
|
+
"text/html": "html",
|
|
775
|
+
"text/css": "css",
|
|
776
|
+
"text/javascript": "javascript",
|
|
777
|
+
"application/xml": "xml",
|
|
778
|
+
"application/xhtml+xml": "xhtml"
|
|
779
|
+
}).find(
|
|
780
|
+
([r]) => t.includes(r)
|
|
781
|
+
)) == null ? void 0 : s[1];
|
|
782
|
+
}, Lt = (t) => {
|
|
783
|
+
const n = t.get("Content-Type") || "";
|
|
784
|
+
return Ft(n);
|
|
785
|
+
}, Dt = (t) => {
|
|
786
|
+
try {
|
|
787
|
+
return JSON.stringify(JSON.parse(t), null, 2);
|
|
788
|
+
} catch {
|
|
789
|
+
return null;
|
|
790
|
+
}
|
|
791
|
+
}, Gt = ({
|
|
792
|
+
body: t = "",
|
|
793
|
+
headers: n
|
|
794
|
+
}) => {
|
|
795
|
+
const s = Lt(n), r = Dt(t), o = r || t, [l, i] = Te(
|
|
796
|
+
r ? "formatted" : "raw"
|
|
797
|
+
);
|
|
798
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
799
|
+
/* @__PURE__ */ e.jsx(ae, { className: "shadow-none", children: /* @__PURE__ */ e.jsx(
|
|
800
|
+
ot,
|
|
801
|
+
{
|
|
802
|
+
language: l === "raw" ? r ? "plain" : s : "json",
|
|
803
|
+
noBackground: !0,
|
|
804
|
+
className: "overflow-x-auto p-4 text-xs max-h-[calc(83.333vh-180px)]",
|
|
805
|
+
code: l === "raw" ? t : o
|
|
806
|
+
}
|
|
807
|
+
) }),
|
|
808
|
+
r && /* @__PURE__ */ e.jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ e.jsx(
|
|
809
|
+
zt,
|
|
810
|
+
{
|
|
811
|
+
value: l,
|
|
812
|
+
onChange: (c) => i(c.target.value),
|
|
813
|
+
options: [
|
|
814
|
+
{ value: "formatted", label: "Formatted" },
|
|
815
|
+
{ value: "raw", label: "Raw" }
|
|
816
|
+
]
|
|
817
|
+
}
|
|
818
|
+
) })
|
|
819
|
+
] });
|
|
820
|
+
}, J = "__none", Bt = {
|
|
821
|
+
200: "OK",
|
|
822
|
+
201: "Created",
|
|
823
|
+
202: "Accepted",
|
|
824
|
+
204: "No Content",
|
|
825
|
+
400: "Bad Request",
|
|
826
|
+
401: "Unauthorized",
|
|
827
|
+
403: "Forbidden",
|
|
828
|
+
404: "Not Found",
|
|
829
|
+
405: "Method Not Allowed",
|
|
830
|
+
500: "Internal Server Error"
|
|
831
|
+
}, Jt = ({
|
|
832
|
+
server: t,
|
|
833
|
+
servers: n,
|
|
834
|
+
url: s,
|
|
835
|
+
method: r,
|
|
836
|
+
headers: o = [],
|
|
837
|
+
queryParams: l = [],
|
|
838
|
+
pathParams: i = [],
|
|
839
|
+
defaultBody: c = ""
|
|
840
|
+
}) => {
|
|
841
|
+
var de, ue;
|
|
842
|
+
const { selectedServer: u, setSelectedServer: d } = et(), [, h] = Je(), { register: g, control: j, handleSubmit: b, watch: w, setValue: v, ...S } = Xe({
|
|
843
|
+
defaultValues: {
|
|
844
|
+
body: c,
|
|
845
|
+
queryParams: l.map((a) => ({
|
|
846
|
+
name: a.name,
|
|
847
|
+
value: a.defaultValue ?? "",
|
|
848
|
+
active: a.defaultActive ?? !1
|
|
849
|
+
})),
|
|
850
|
+
pathParams: i.map((a) => ({
|
|
851
|
+
name: a.name,
|
|
852
|
+
value: a.defaultValue ?? ""
|
|
853
|
+
})),
|
|
854
|
+
headers: o.map((a) => ({
|
|
855
|
+
name: a.name,
|
|
856
|
+
value: a.defaultValue ?? ""
|
|
857
|
+
})),
|
|
858
|
+
identity: J
|
|
859
|
+
}
|
|
860
|
+
}), C = w(), _ = qe(), le = Ce(!1);
|
|
861
|
+
$e(() => {
|
|
862
|
+
var f;
|
|
863
|
+
if (le.current) return;
|
|
864
|
+
const a = (f = _.data) == null ? void 0 : f.at(0);
|
|
865
|
+
a && (v("identity", a.id), le.current = !0);
|
|
866
|
+
}, [v, _.data]);
|
|
867
|
+
const p = Ze({
|
|
868
|
+
mutationFn: async (a) => {
|
|
869
|
+
var I, q;
|
|
870
|
+
const f = It(u ?? t, s, a), k = performance.now(), D = new Request(f, {
|
|
871
|
+
method: r.toUpperCase(),
|
|
872
|
+
headers: Object.fromEntries(
|
|
873
|
+
a.headers.filter((m) => m.name).map((m) => [m.name, m.value])
|
|
874
|
+
),
|
|
875
|
+
body: a.body ? a.body : void 0
|
|
876
|
+
});
|
|
877
|
+
a.identity !== J && ((q = (I = _.data) == null ? void 0 : I.find((m) => m.id === a.identity)) == null || q.authorizeRequest(D));
|
|
878
|
+
try {
|
|
879
|
+
const m = await fetch(D, {
|
|
880
|
+
signal: AbortSignal.timeout(5e3)
|
|
881
|
+
}), G = performance.now() - k, B = await m.text();
|
|
882
|
+
return {
|
|
883
|
+
status: m.status,
|
|
884
|
+
headers: m.headers,
|
|
885
|
+
size: B.length,
|
|
886
|
+
body: B,
|
|
887
|
+
time: G
|
|
888
|
+
};
|
|
889
|
+
} catch (m) {
|
|
890
|
+
throw m instanceof TypeError ? new Error(
|
|
891
|
+
"The request failed, possibly due to network issues or CORS policy."
|
|
892
|
+
) : m;
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
}), Oe = s.split("/").map((a, f, k) => {
|
|
896
|
+
var G;
|
|
897
|
+
const D = a.startsWith("{") && a.endsWith("}") || a.startsWith(":"), I = a.replace(/[:{}]/g, ""), q = (G = C.pathParams.find((B) => B.name === I)) == null ? void 0 : G.value, m = q ? /* @__PURE__ */ e.jsx(Pe, { backgroundOpacity: "25%", name: a, slug: a, children: encodeURIComponent(q) }) : /* @__PURE__ */ e.jsx(
|
|
898
|
+
"span",
|
|
899
|
+
{
|
|
900
|
+
className: "underline decoration-wavy decoration-red-500",
|
|
901
|
+
title: `Missing value for path parameter \`${I}\``,
|
|
902
|
+
children: a
|
|
903
|
+
}
|
|
904
|
+
);
|
|
905
|
+
return (
|
|
906
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
907
|
+
/* @__PURE__ */ e.jsxs(Z, { children: [
|
|
908
|
+
D ? m : a,
|
|
909
|
+
f < k.length - 1 && "/",
|
|
910
|
+
/* @__PURE__ */ e.jsx("wbr", {})
|
|
911
|
+
] }, a + f)
|
|
912
|
+
);
|
|
913
|
+
}), U = Array.from(((de = p.data) == null ? void 0 : de.headers.entries()) ?? []), ce = C.queryParams.filter((a) => a.active).map((a, f, k) => /* @__PURE__ */ e.jsxs(Z, { children: [
|
|
914
|
+
a.name,
|
|
915
|
+
"=",
|
|
916
|
+
encodeURIComponent(a.value).replaceAll("%20", "+"),
|
|
917
|
+
f < k.length - 1 && "&",
|
|
918
|
+
/* @__PURE__ */ e.jsx("wbr", {})
|
|
919
|
+
] }, a.name)), _e = /* @__PURE__ */ e.jsx("div", { className: "inline-block opacity-50 hover:opacity-100 transition", children: n && n.length > 1 ? /* @__PURE__ */ e.jsxs(
|
|
920
|
+
fe,
|
|
921
|
+
{
|
|
922
|
+
onValueChange: (a) => {
|
|
923
|
+
h(() => {
|
|
924
|
+
d(a);
|
|
925
|
+
});
|
|
926
|
+
},
|
|
927
|
+
value: u,
|
|
928
|
+
children: [
|
|
929
|
+
/* @__PURE__ */ e.jsx(xe, { className: "p-0 border-none flex-row-reverse bg-transparent text-xs gap-0.5 h-auto", children: /* @__PURE__ */ e.jsx(ye, {}) }),
|
|
930
|
+
/* @__PURE__ */ e.jsx(ge, { children: n.map((a) => /* @__PURE__ */ e.jsx(K, { value: a, children: a.replace(/^https?:\/\//, "") }, a)) })
|
|
931
|
+
]
|
|
932
|
+
}
|
|
933
|
+
) : /* @__PURE__ */ e.jsx("span", { children: t.replace(/^https?:\/\//, "") }) });
|
|
934
|
+
return /* @__PURE__ */ e.jsx(
|
|
935
|
+
Ye,
|
|
936
|
+
{
|
|
937
|
+
register: g,
|
|
938
|
+
control: j,
|
|
939
|
+
handleSubmit: b,
|
|
940
|
+
watch: w,
|
|
941
|
+
setValue: v,
|
|
942
|
+
...S,
|
|
943
|
+
children: /* @__PURE__ */ e.jsx("form", { onSubmit: b((a) => p.mutateAsync(a)), children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-[8fr_7fr] text-sm h-full", children: [
|
|
944
|
+
/* @__PURE__ */ e.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: [
|
|
945
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 items-stretch", children: [
|
|
946
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-1 items-center w-full border rounded-md", children: [
|
|
947
|
+
/* @__PURE__ */ e.jsx("div", { className: "border-r p-2 bg-muted rounded-l-md self-stretch font-semibold font-mono", children: r.toUpperCase() }),
|
|
948
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center flex-wrap p-2 font-mono text-xs", children: [
|
|
949
|
+
_e,
|
|
950
|
+
Oe,
|
|
951
|
+
ce.length > 0 ? "?" : "",
|
|
952
|
+
ce
|
|
953
|
+
] })
|
|
954
|
+
] }),
|
|
955
|
+
/* @__PURE__ */ e.jsx(E, { type: "submit", className: "h-auto flex gap-1", children: "Send" })
|
|
956
|
+
] }),
|
|
957
|
+
/* @__PURE__ */ e.jsxs(
|
|
958
|
+
je,
|
|
959
|
+
{
|
|
960
|
+
defaultValue: l.length + i.length > 0 ? "parameters" : "headers",
|
|
961
|
+
children: [
|
|
962
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-wrap gap-1 justify-between", children: [
|
|
963
|
+
/* @__PURE__ */ e.jsxs(be, { children: [
|
|
964
|
+
l.length + i.length > 0 && /* @__PURE__ */ e.jsx(A, { value: "parameters", children: "Parameters" }),
|
|
965
|
+
/* @__PURE__ */ e.jsxs(A, { value: "headers", children: [
|
|
966
|
+
"Headers",
|
|
967
|
+
" ",
|
|
968
|
+
C.headers.length > 0 && `(${C.headers.length})`
|
|
969
|
+
] }),
|
|
970
|
+
/* @__PURE__ */ e.jsx(
|
|
971
|
+
A,
|
|
972
|
+
{
|
|
973
|
+
value: "body",
|
|
974
|
+
disabled: !["POST", "PUT", "PATCH", "DELETE"].includes(
|
|
975
|
+
r.toUpperCase()
|
|
976
|
+
),
|
|
977
|
+
children: "Body"
|
|
978
|
+
}
|
|
979
|
+
)
|
|
980
|
+
] }),
|
|
981
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 items-center", children: [
|
|
982
|
+
"Auth:",
|
|
983
|
+
/* @__PURE__ */ e.jsxs(
|
|
984
|
+
fe,
|
|
985
|
+
{
|
|
986
|
+
onValueChange: (a) => v("identity", a),
|
|
987
|
+
value: C.identity,
|
|
988
|
+
defaultValue: C.identity,
|
|
989
|
+
children: [
|
|
990
|
+
/* @__PURE__ */ e.jsx(xe, { className: "w-[180px] flex", children: _.isPending ? /* @__PURE__ */ e.jsx(ve, {}) : /* @__PURE__ */ e.jsx(ye, {}) }),
|
|
991
|
+
/* @__PURE__ */ e.jsxs(ge, { align: "center", children: [
|
|
992
|
+
/* @__PURE__ */ e.jsx(K, { value: J, children: "None" }),
|
|
993
|
+
(ue = _.data) == null ? void 0 : ue.map((a) => /* @__PURE__ */ e.jsx(K, { value: a.id, children: a.label }, a.id))
|
|
994
|
+
] })
|
|
995
|
+
]
|
|
996
|
+
}
|
|
997
|
+
)
|
|
998
|
+
] })
|
|
999
|
+
] }),
|
|
1000
|
+
/* @__PURE__ */ e.jsx(V, { value: "headers", children: /* @__PURE__ */ e.jsx(qt, { control: j, register: g }) }),
|
|
1001
|
+
/* @__PURE__ */ e.jsxs(V, { value: "parameters", children: [
|
|
1002
|
+
i.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4 my-4", children: [
|
|
1003
|
+
/* @__PURE__ */ e.jsx("span", { className: "font-semibold", children: "Path Parameters" }),
|
|
1004
|
+
/* @__PURE__ */ e.jsx(Rt, { control: j })
|
|
1005
|
+
] }),
|
|
1006
|
+
l.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4 my-4", children: [
|
|
1007
|
+
/* @__PURE__ */ e.jsx("span", { className: "font-semibold", children: "Query Parameters" }),
|
|
1008
|
+
/* @__PURE__ */ e.jsx(Vt, { control: j, queryParams: l })
|
|
1009
|
+
] })
|
|
1010
|
+
] }),
|
|
1011
|
+
/* @__PURE__ */ e.jsx(V, { value: "body", children: /* @__PURE__ */ e.jsx(
|
|
1012
|
+
"textarea",
|
|
1013
|
+
{
|
|
1014
|
+
...g("body"),
|
|
1015
|
+
className: "border w-full rounded p-2 bg-muted h-40"
|
|
1016
|
+
}
|
|
1017
|
+
) })
|
|
1018
|
+
]
|
|
1019
|
+
}
|
|
1020
|
+
)
|
|
1021
|
+
] }),
|
|
1022
|
+
/* @__PURE__ */ e.jsx("div", { className: "min-w-0 p-8 bg-muted/70", children: p.error ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
1023
|
+
C.pathParams.some((a) => a.value === "") && /* @__PURE__ */ e.jsx(tt, { type: "caution", children: "Some path parameters are missing values. Please fill them in to ensure the request is sent correctly." }),
|
|
1024
|
+
/* @__PURE__ */ e.jsxs(ae, { children: [
|
|
1025
|
+
/* @__PURE__ */ e.jsx(nt, { children: /* @__PURE__ */ e.jsx(st, { children: "Request failed" }) }),
|
|
1026
|
+
/* @__PURE__ */ e.jsxs(rt, { children: [
|
|
1027
|
+
"Error:",
|
|
1028
|
+
" ",
|
|
1029
|
+
p.error.message || String(p.error) || "Unexpected error"
|
|
1030
|
+
] })
|
|
1031
|
+
] })
|
|
1032
|
+
] }) : p.data ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
1033
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex gap-2", children: /* @__PURE__ */ e.jsxs("div", { className: "flex text-xs gap-6", children: [
|
|
1034
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
1035
|
+
"Status: ",
|
|
1036
|
+
p.data.status,
|
|
1037
|
+
" ",
|
|
1038
|
+
Bt[p.data.status] ?? ""
|
|
1039
|
+
] }),
|
|
1040
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
1041
|
+
"Time: ",
|
|
1042
|
+
p.data.time.toFixed(0),
|
|
1043
|
+
"ms"
|
|
1044
|
+
] }),
|
|
1045
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
1046
|
+
"Size: ",
|
|
1047
|
+
p.data.size,
|
|
1048
|
+
" B"
|
|
1049
|
+
] })
|
|
1050
|
+
] }) }),
|
|
1051
|
+
/* @__PURE__ */ e.jsxs(je, { defaultValue: "response", children: [
|
|
1052
|
+
/* @__PURE__ */ e.jsxs(be, { children: [
|
|
1053
|
+
/* @__PURE__ */ e.jsx(A, { value: "response", children: "Response" }),
|
|
1054
|
+
/* @__PURE__ */ e.jsx(A, { value: "headers", children: U.length ? `Headers (${U.length})` : "No headers" })
|
|
1055
|
+
] }),
|
|
1056
|
+
/* @__PURE__ */ e.jsx(V, { value: "response", children: /* @__PURE__ */ e.jsx(
|
|
1057
|
+
Gt,
|
|
1058
|
+
{
|
|
1059
|
+
headers: p.data.headers,
|
|
1060
|
+
body: p.data.body
|
|
1061
|
+
}
|
|
1062
|
+
) }),
|
|
1063
|
+
/* @__PURE__ */ e.jsx(V, { value: "headers", children: /* @__PURE__ */ e.jsxs(
|
|
1064
|
+
ae,
|
|
1065
|
+
{
|
|
1066
|
+
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",
|
|
1067
|
+
children: [
|
|
1068
|
+
/* @__PURE__ */ e.jsx("div", { className: "font-semibold", children: "Key" }),
|
|
1069
|
+
/* @__PURE__ */ e.jsx("div", { className: "font-semibold", children: "Value" }),
|
|
1070
|
+
U.map(([a, f]) => /* @__PURE__ */ e.jsxs(Z, { children: [
|
|
1071
|
+
/* @__PURE__ */ e.jsx("div", { children: a }),
|
|
1072
|
+
/* @__PURE__ */ e.jsx("div", { className: "break-words", children: f })
|
|
1073
|
+
] }, a))
|
|
1074
|
+
]
|
|
1075
|
+
}
|
|
1076
|
+
) })
|
|
1077
|
+
] })
|
|
1078
|
+
] }) : /* @__PURE__ */ e.jsx("div", { className: "grid place-items-center h-full", children: /* @__PURE__ */ e.jsx("span", { className: "text-[16px] font-semibold text-muted-foreground", children: p.isPending ? /* @__PURE__ */ e.jsx(ve, {}) : "Send a request first to see the response here" }) }) })
|
|
1079
|
+
] }) })
|
|
1080
|
+
}
|
|
1081
|
+
);
|
|
1082
|
+
}, Ht = ({
|
|
1083
|
+
className: t,
|
|
1084
|
+
size: n = 16
|
|
1085
|
+
}) => /* @__PURE__ */ e.jsx(
|
|
1086
|
+
"svg",
|
|
1087
|
+
{
|
|
1088
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1089
|
+
viewBox: "0 0 24 24",
|
|
1090
|
+
fill: "currentColor",
|
|
1091
|
+
className: t,
|
|
1092
|
+
width: n,
|
|
1093
|
+
height: n,
|
|
1094
|
+
children: /* @__PURE__ */ e.jsx(
|
|
1095
|
+
"path",
|
|
1096
|
+
{
|
|
1097
|
+
fillRule: "evenodd",
|
|
1098
|
+
d: "M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm14.024-.983a1.125 1.125 0 0 1 0 1.966l-5.603 3.113A1.125 1.125 0 0 1 9 15.113V8.887c0-.857.921-1.4 1.671-.983l5.603 3.113Z",
|
|
1099
|
+
clipRule: "evenodd"
|
|
1100
|
+
}
|
|
1101
|
+
)
|
|
1102
|
+
}
|
|
1103
|
+
), Qt = (t) => {
|
|
1104
|
+
const [n, s] = Te(!1);
|
|
1105
|
+
return /* @__PURE__ */ e.jsxs(He, { onOpenChange: (r) => s(r), children: [
|
|
1106
|
+
/* @__PURE__ */ e.jsx(Qe, { asChild: !0, children: t.children ?? /* @__PURE__ */ e.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: [
|
|
1107
|
+
"Test",
|
|
1108
|
+
/* @__PURE__ */ e.jsx(Ht, { className: "", size: 14 })
|
|
1109
|
+
] }) }),
|
|
1110
|
+
/* @__PURE__ */ e.jsxs(
|
|
1111
|
+
Ue,
|
|
1112
|
+
{
|
|
1113
|
+
className: "max-w-screen-xl w-full h-5/6 overflow-auto p-0",
|
|
1114
|
+
"aria-describedby": void 0,
|
|
1115
|
+
children: [
|
|
1116
|
+
/* @__PURE__ */ e.jsx(Be, { children: /* @__PURE__ */ e.jsx(We, { children: "Playground" }) }),
|
|
1117
|
+
n && /* @__PURE__ */ e.jsx(Jt, { ...t })
|
|
1118
|
+
]
|
|
1119
|
+
}
|
|
1120
|
+
)
|
|
1121
|
+
] });
|
|
1122
|
+
}, we = ft(`
|
|
1123
|
+
query GetCategories($input: JSON!, $type: SchemaType!) {
|
|
1124
|
+
schema(input: $input, type: $type) {
|
|
1125
|
+
url
|
|
1126
|
+
tags {
|
|
1127
|
+
__typename
|
|
1128
|
+
name
|
|
1129
|
+
operations {
|
|
1130
|
+
__typename
|
|
1131
|
+
slug
|
|
1132
|
+
deprecated
|
|
1133
|
+
method
|
|
1134
|
+
summary
|
|
1135
|
+
operationId
|
|
1136
|
+
path
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
`), Ut = {
|
|
1142
|
+
get: "green",
|
|
1143
|
+
post: "blue",
|
|
1144
|
+
put: "yellow",
|
|
1145
|
+
delete: "red",
|
|
1146
|
+
patch: "purple",
|
|
1147
|
+
options: "gray",
|
|
1148
|
+
head: "gray"
|
|
1149
|
+
}, vn = (t) => {
|
|
1150
|
+
const n = Re(t.navigationId ?? "/reference"), s = new Ot(t);
|
|
1151
|
+
return {
|
|
1152
|
+
getHead: () => {
|
|
1153
|
+
if (t.type === "url" && !t.skipPreload)
|
|
1154
|
+
return /* @__PURE__ */ e.jsx(
|
|
1155
|
+
"link",
|
|
1156
|
+
{
|
|
1157
|
+
rel: "preload",
|
|
1158
|
+
href: t.input,
|
|
1159
|
+
as: "fetch",
|
|
1160
|
+
crossOrigin: "anonymous"
|
|
1161
|
+
}
|
|
1162
|
+
);
|
|
1163
|
+
if (t.server)
|
|
1164
|
+
return /* @__PURE__ */ e.jsx("link", { rel: "preconnect", href: t.server });
|
|
1165
|
+
},
|
|
1166
|
+
getMdxComponents: () => ({
|
|
1167
|
+
OpenPlaygroundButton: ({
|
|
1168
|
+
requireAuth: r,
|
|
1169
|
+
server: o,
|
|
1170
|
+
method: l,
|
|
1171
|
+
url: i,
|
|
1172
|
+
...c
|
|
1173
|
+
}) => {
|
|
1174
|
+
var h;
|
|
1175
|
+
const u = Le(), d = Me({
|
|
1176
|
+
queryFn: () => s.fetch(we, {
|
|
1177
|
+
type: t.type,
|
|
1178
|
+
input: t.input
|
|
1179
|
+
}),
|
|
1180
|
+
enabled: !o,
|
|
1181
|
+
queryKey: ["playground-server"]
|
|
1182
|
+
});
|
|
1183
|
+
return r && !u.isAuthenticated ? /* @__PURE__ */ e.jsxs(
|
|
1184
|
+
E,
|
|
1185
|
+
{
|
|
1186
|
+
className: "gap-2 items-center",
|
|
1187
|
+
variant: "outline",
|
|
1188
|
+
onClick: u.login,
|
|
1189
|
+
children: [
|
|
1190
|
+
"Login to open in Playground ",
|
|
1191
|
+
/* @__PURE__ */ e.jsx(ze, { size: 16 })
|
|
1192
|
+
]
|
|
1193
|
+
}
|
|
1194
|
+
) : /* @__PURE__ */ e.jsx(
|
|
1195
|
+
Qt,
|
|
1196
|
+
{
|
|
1197
|
+
url: i ?? "/",
|
|
1198
|
+
method: l ?? "get",
|
|
1199
|
+
server: o ?? ((h = d.data) == null ? void 0 : h.schema.url) ?? "https://example.com",
|
|
1200
|
+
...c,
|
|
1201
|
+
children: /* @__PURE__ */ e.jsxs(E, { className: "gap-2 items-center", variant: "outline", children: [
|
|
1202
|
+
"Open in Playground ",
|
|
1203
|
+
/* @__PURE__ */ e.jsx(Fe, { size: 16 })
|
|
1204
|
+
] })
|
|
1205
|
+
}
|
|
1206
|
+
);
|
|
1207
|
+
}
|
|
1208
|
+
}),
|
|
1209
|
+
getSidebar: async (r) => {
|
|
1210
|
+
if (!lt({ path: n, end: !1 }, r))
|
|
1211
|
+
return [];
|
|
1212
|
+
try {
|
|
1213
|
+
const l = (await s.fetch(we, {
|
|
1214
|
+
type: t.type,
|
|
1215
|
+
input: t.input
|
|
1216
|
+
})).schema.tags.filter((i) => i.operations.length > 0).map((i) => ({
|
|
1217
|
+
type: "category",
|
|
1218
|
+
label: i.name || "Other endpoints",
|
|
1219
|
+
collapsible: !0,
|
|
1220
|
+
collapsed: !1,
|
|
1221
|
+
items: i.operations.map((c) => ({
|
|
1222
|
+
type: "link",
|
|
1223
|
+
label: c.summary ?? c.path,
|
|
1224
|
+
href: `#${c.slug}`,
|
|
1225
|
+
badge: {
|
|
1226
|
+
label: c.method,
|
|
1227
|
+
color: Ut[c.method.toLowerCase()]
|
|
1228
|
+
}
|
|
1229
|
+
}))
|
|
1230
|
+
}));
|
|
1231
|
+
return l.unshift({
|
|
1232
|
+
type: "link",
|
|
1233
|
+
label: "Overview",
|
|
1234
|
+
href: "#description"
|
|
1235
|
+
}), l;
|
|
1236
|
+
} catch {
|
|
1237
|
+
return [];
|
|
1238
|
+
}
|
|
1239
|
+
},
|
|
1240
|
+
getRoutes: () => [
|
|
1241
|
+
{
|
|
1242
|
+
async lazy() {
|
|
1243
|
+
const { OpenApiRoute: r } = await import("./Route-DlG_HTMu.js");
|
|
1244
|
+
return {
|
|
1245
|
+
element: /* @__PURE__ */ e.jsx(r, { client: s, config: t })
|
|
1246
|
+
};
|
|
1247
|
+
},
|
|
1248
|
+
children: [
|
|
1249
|
+
{
|
|
1250
|
+
path: n,
|
|
1251
|
+
children: [
|
|
1252
|
+
{
|
|
1253
|
+
index: !0,
|
|
1254
|
+
async lazy() {
|
|
1255
|
+
const { OperationList: r } = await import("./OperationList-BwBl1xrD.js");
|
|
1256
|
+
return { element: /* @__PURE__ */ e.jsx(r, {}) };
|
|
1257
|
+
}
|
|
1258
|
+
}
|
|
1259
|
+
]
|
|
1260
|
+
}
|
|
1261
|
+
]
|
|
1262
|
+
}
|
|
1263
|
+
]
|
|
1264
|
+
};
|
|
1265
|
+
};
|
|
1266
|
+
export {
|
|
1267
|
+
Pe as C,
|
|
1268
|
+
Qt as P,
|
|
1269
|
+
zt as S,
|
|
1270
|
+
ft as g,
|
|
1271
|
+
vn as o
|
|
1272
|
+
};
|
|
1273
|
+
//# sourceMappingURL=index-DNxQ_rCt.js.map
|