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