@motiadev/plugin-endpoint 0.17.6-beta.188-259338 → 0.17.6-beta.188-853774
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/index.js +2147 -737
- package/dist/index.js.map +1 -1
- package/dist/plugin.js.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { c } from "react/compiler-runtime";
|
|
1
2
|
import { BackgroundEffect, Badge, Button, Checkbox, Input, Panel, Sidebar, Tabs, TabsContent, TabsList, TabsTrigger, cn, useThemeStore } from "@motiadev/ui";
|
|
2
3
|
import { Fragment, memo, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
3
4
|
import { AlertCircle, Book, Check, ChevronDown, CircleX, Copy, Download, Loader2, Plus, Search, Trash2, X } from "lucide-react";
|
|
@@ -14,31 +15,78 @@ import { Prism } from "react-syntax-highlighter";
|
|
|
14
15
|
import { atomDark, oneLight } from "react-syntax-highlighter/dist/esm/styles/prism";
|
|
15
16
|
|
|
16
17
|
//#region src/components/endpoints-search.tsx
|
|
17
|
-
const EndpointsSearch = (
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
18
|
+
const EndpointsSearch = (t0) => {
|
|
19
|
+
const $ = c(16);
|
|
20
|
+
if ($[0] !== "b04fe9fcf2dc81964e7b2f3a7fac01e0ffd66006443485e8e32bf9d2d88776cf") {
|
|
21
|
+
for (let $i = 0; $i < 16; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
22
|
+
$[0] = "b04fe9fcf2dc81964e7b2f3a7fac01e0ffd66006443485e8e32bf9d2d88776cf";
|
|
23
|
+
}
|
|
24
|
+
const { value, onChange, onClear } = t0;
|
|
25
|
+
let t1;
|
|
26
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
27
|
+
t1 = /* @__PURE__ */ jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground/50" });
|
|
28
|
+
$[1] = t1;
|
|
29
|
+
} else t1 = $[1];
|
|
30
|
+
let t2;
|
|
31
|
+
if ($[2] !== onChange) {
|
|
32
|
+
t2 = (e) => onChange(e.target.value);
|
|
33
|
+
$[2] = onChange;
|
|
34
|
+
$[3] = t2;
|
|
35
|
+
} else t2 = $[3];
|
|
36
|
+
let t3;
|
|
37
|
+
if ($[4] !== t2 || $[5] !== value) {
|
|
38
|
+
t3 = /* @__PURE__ */ jsx(Input, {
|
|
39
|
+
variant: "shade",
|
|
40
|
+
value,
|
|
41
|
+
onChange: t2,
|
|
42
|
+
className: "px-9! font-medium",
|
|
43
|
+
placeholder: "Search by Method or Path"
|
|
44
|
+
});
|
|
45
|
+
$[4] = t2;
|
|
46
|
+
$[5] = value;
|
|
47
|
+
$[6] = t3;
|
|
48
|
+
} else t3 = $[6];
|
|
49
|
+
const t4 = value !== "";
|
|
50
|
+
const t5 = value === "";
|
|
51
|
+
let t6;
|
|
52
|
+
if ($[7] !== t4 || $[8] !== t5) {
|
|
53
|
+
t6 = cn("cursor-pointer absolute right-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground/50 hover:text-muted-foreground", {
|
|
54
|
+
visible: t4,
|
|
55
|
+
invisible: t5
|
|
56
|
+
});
|
|
57
|
+
$[7] = t4;
|
|
58
|
+
$[8] = t5;
|
|
59
|
+
$[9] = t6;
|
|
60
|
+
} else t6 = $[9];
|
|
61
|
+
let t7;
|
|
62
|
+
if ($[10] !== onClear || $[11] !== t6) {
|
|
63
|
+
t7 = /* @__PURE__ */ jsx(X, {
|
|
64
|
+
className: t6,
|
|
65
|
+
onClick: onClear
|
|
66
|
+
});
|
|
67
|
+
$[10] = onClear;
|
|
68
|
+
$[11] = t6;
|
|
69
|
+
$[12] = t7;
|
|
70
|
+
} else t7 = $[12];
|
|
71
|
+
let t8;
|
|
72
|
+
if ($[13] !== t3 || $[14] !== t7) {
|
|
73
|
+
t8 = /* @__PURE__ */ jsx("div", {
|
|
74
|
+
className: "p-2 border-b gap-4",
|
|
75
|
+
"data-testid": "endpoints-search-container",
|
|
76
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
77
|
+
className: "relative",
|
|
78
|
+
children: [
|
|
79
|
+
t1,
|
|
80
|
+
t3,
|
|
81
|
+
t7
|
|
82
|
+
]
|
|
83
|
+
})
|
|
84
|
+
});
|
|
85
|
+
$[13] = t3;
|
|
86
|
+
$[14] = t7;
|
|
87
|
+
$[15] = t8;
|
|
88
|
+
} else t8 = $[15];
|
|
89
|
+
return t8;
|
|
42
90
|
};
|
|
43
91
|
|
|
44
92
|
//#endregion
|
|
@@ -55,129 +103,378 @@ const getMethodStyles = (method) => {
|
|
|
55
103
|
default: return "bg-[#258DC3]/15 text-[#258DC3]";
|
|
56
104
|
}
|
|
57
105
|
};
|
|
58
|
-
const EndpointBadge = memo((
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
106
|
+
const EndpointBadge = memo((t0) => {
|
|
107
|
+
const $ = c(11);
|
|
108
|
+
if ($[0] !== "1017d069da7af8d79b772819cd6ea273bc02186be5bf8c70750727fd63506daa") {
|
|
109
|
+
for (let $i = 0; $i < 11; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
110
|
+
$[0] = "1017d069da7af8d79b772819cd6ea273bc02186be5bf8c70750727fd63506daa";
|
|
111
|
+
}
|
|
112
|
+
let className;
|
|
113
|
+
let props;
|
|
114
|
+
let variant;
|
|
115
|
+
if ($[1] !== t0) {
|
|
116
|
+
({className, variant, ...props} = t0);
|
|
117
|
+
$[1] = t0;
|
|
118
|
+
$[2] = className;
|
|
119
|
+
$[3] = props;
|
|
120
|
+
$[4] = variant;
|
|
121
|
+
} else {
|
|
122
|
+
className = $[2];
|
|
123
|
+
props = $[3];
|
|
124
|
+
variant = $[4];
|
|
125
|
+
}
|
|
126
|
+
let t1;
|
|
127
|
+
if ($[5] !== className || $[6] !== variant) {
|
|
128
|
+
t1 = cn("rounded-lg px-2 py-0.5 text-xs font-mono font-bold transition-colors", getMethodStyles(variant), className);
|
|
129
|
+
$[5] = className;
|
|
130
|
+
$[6] = variant;
|
|
131
|
+
$[7] = t1;
|
|
132
|
+
} else t1 = $[7];
|
|
133
|
+
let t2;
|
|
134
|
+
if ($[8] !== props || $[9] !== t1) {
|
|
135
|
+
t2 = /* @__PURE__ */ jsx("div", {
|
|
136
|
+
className: t1,
|
|
137
|
+
...props
|
|
138
|
+
});
|
|
139
|
+
$[8] = props;
|
|
140
|
+
$[9] = t1;
|
|
141
|
+
$[10] = t2;
|
|
142
|
+
} else t2 = $[10];
|
|
143
|
+
return t2;
|
|
63
144
|
});
|
|
64
145
|
|
|
65
146
|
//#endregion
|
|
66
147
|
//#region src/components/endpoint-path.tsx
|
|
67
148
|
const PathSeparator = () => {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
149
|
+
const $ = c(2);
|
|
150
|
+
if ($[0] !== "603f796b38bb9b15093370b94bc9b921b7621c9f6baa94432316d5a5ca450c9c") {
|
|
151
|
+
for (let $i = 0; $i < 2; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
152
|
+
$[0] = "603f796b38bb9b15093370b94bc9b921b7621c9f6baa94432316d5a5ca450c9c";
|
|
153
|
+
}
|
|
154
|
+
let t0;
|
|
155
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
156
|
+
t0 = /* @__PURE__ */ jsx("div", {
|
|
157
|
+
className: "text-muted-foreground",
|
|
158
|
+
children: "/"
|
|
159
|
+
});
|
|
160
|
+
$[1] = t0;
|
|
161
|
+
} else t0 = $[1];
|
|
162
|
+
return t0;
|
|
72
163
|
};
|
|
73
|
-
const EndpointPath = (
|
|
74
|
-
const
|
|
164
|
+
const EndpointPath = (t0) => {
|
|
165
|
+
const $ = c(14);
|
|
166
|
+
if ($[0] !== "603f796b38bb9b15093370b94bc9b921b7621c9f6baa94432316d5a5ca450c9c") {
|
|
167
|
+
for (let $i = 0; $i < 14; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
168
|
+
$[0] = "603f796b38bb9b15093370b94bc9b921b7621c9f6baa94432316d5a5ca450c9c";
|
|
169
|
+
}
|
|
170
|
+
const { method, path } = t0;
|
|
171
|
+
let t1;
|
|
172
|
+
if ($[1] !== path) {
|
|
75
173
|
const parts = path.split("/").filter(Boolean);
|
|
76
174
|
const partsLength = parts.length - 1;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
175
|
+
let t2$1;
|
|
176
|
+
if ($[3] !== partsLength) {
|
|
177
|
+
t2$1 = (part, index) => {
|
|
178
|
+
const isLast = index === partsLength;
|
|
179
|
+
const key = `part-${part}-${index}`;
|
|
180
|
+
const separator = isLast ? void 0 : /* @__PURE__ */ jsx(PathSeparator, {}, `separator-${key}`);
|
|
181
|
+
if (part.startsWith(":")) return [/* @__PURE__ */ jsx("div", {
|
|
182
|
+
className: "bg-[#2862FE]/20 text-[#2862FE] rounded-sm px-1 py-0.5 text-sm font-mono font-bold font-medium",
|
|
183
|
+
children: part
|
|
184
|
+
}, key), separator];
|
|
185
|
+
return [/* @__PURE__ */ jsx("div", { children: part }, key), separator];
|
|
186
|
+
};
|
|
187
|
+
$[3] = partsLength;
|
|
188
|
+
$[4] = t2$1;
|
|
189
|
+
} else t2$1 = $[4];
|
|
190
|
+
t1 = parts.flatMap(t2$1);
|
|
191
|
+
$[1] = path;
|
|
192
|
+
$[2] = t1;
|
|
193
|
+
} else t1 = $[2];
|
|
194
|
+
const pathView = t1;
|
|
195
|
+
const t2 = method;
|
|
196
|
+
let t3;
|
|
197
|
+
if ($[5] !== method || $[6] !== t2) {
|
|
198
|
+
t3 = /* @__PURE__ */ jsx(EndpointBadge, {
|
|
199
|
+
variant: t2,
|
|
92
200
|
children: method
|
|
93
|
-
})
|
|
201
|
+
});
|
|
202
|
+
$[5] = method;
|
|
203
|
+
$[6] = t2;
|
|
204
|
+
$[7] = t3;
|
|
205
|
+
} else t3 = $[7];
|
|
206
|
+
let t4;
|
|
207
|
+
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
208
|
+
t4 = /* @__PURE__ */ jsx(PathSeparator, {});
|
|
209
|
+
$[8] = t4;
|
|
210
|
+
} else t4 = $[8];
|
|
211
|
+
let t5;
|
|
212
|
+
if ($[9] !== pathView) {
|
|
213
|
+
t5 = /* @__PURE__ */ jsxs("span", {
|
|
94
214
|
className: "font-mono font-bold whitespace-nowrap flex flex-row gap-2 items-center truncate",
|
|
95
|
-
children: [
|
|
96
|
-
})
|
|
97
|
-
|
|
215
|
+
children: [t4, pathView]
|
|
216
|
+
});
|
|
217
|
+
$[9] = pathView;
|
|
218
|
+
$[10] = t5;
|
|
219
|
+
} else t5 = $[10];
|
|
220
|
+
let t6;
|
|
221
|
+
if ($[11] !== t3 || $[12] !== t5) {
|
|
222
|
+
t6 = /* @__PURE__ */ jsxs("div", {
|
|
223
|
+
className: "grid grid-cols-[auto_1fr] gap-2 items-center",
|
|
224
|
+
children: [t3, t5]
|
|
225
|
+
});
|
|
226
|
+
$[11] = t3;
|
|
227
|
+
$[12] = t5;
|
|
228
|
+
$[13] = t6;
|
|
229
|
+
} else t6 = $[13];
|
|
230
|
+
return t6;
|
|
98
231
|
};
|
|
99
232
|
|
|
100
233
|
//#endregion
|
|
101
234
|
//#region src/components/endpoint-item.tsx
|
|
102
|
-
const EndpointItem = (
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
235
|
+
const EndpointItem = (t0) => {
|
|
236
|
+
const $ = c(22);
|
|
237
|
+
if ($[0] !== "29651f7b7dd25cd15fa149793a83da8eadabea6c1b2d872f1881f15627da1c3a") {
|
|
238
|
+
for (let $i = 0; $i < 22; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
239
|
+
$[0] = "29651f7b7dd25cd15fa149793a83da8eadabea6c1b2d872f1881f15627da1c3a";
|
|
240
|
+
}
|
|
241
|
+
const { endpoint, isSelected, isLast, onSelect } = t0;
|
|
242
|
+
const t1 = `endpoint-${endpoint.method}-${endpoint.path}`;
|
|
243
|
+
let t2;
|
|
244
|
+
if ($[1] !== endpoint.id || $[2] !== onSelect) {
|
|
245
|
+
t2 = () => onSelect(endpoint.id);
|
|
246
|
+
$[1] = endpoint.id;
|
|
247
|
+
$[2] = onSelect;
|
|
248
|
+
$[3] = t2;
|
|
249
|
+
} else t2 = $[3];
|
|
250
|
+
const t3 = isSelected && "bg-muted-foreground/10";
|
|
251
|
+
let t4;
|
|
252
|
+
if ($[4] !== t3) {
|
|
253
|
+
t4 = cn("grid grid-cols-[auto_1fr] items-center justify-center px-[17px] select-none hover:bg-muted-foreground/10 cursor-pointer", t3);
|
|
254
|
+
$[4] = t3;
|
|
255
|
+
$[5] = t4;
|
|
256
|
+
} else t4 = $[5];
|
|
257
|
+
let t5;
|
|
258
|
+
if ($[6] !== isLast) {
|
|
259
|
+
t5 = isLast ? /* @__PURE__ */ jsx("svg", {
|
|
260
|
+
width: "14",
|
|
261
|
+
height: "34",
|
|
262
|
+
viewBox: "0 0 12 34",
|
|
263
|
+
fill: "none",
|
|
264
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
265
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
266
|
+
d: "M6.5 16.5C6.50006 19.2614 8.7386 21.4999 11.5 21.5C11.7759 21.5003 12 21.724 12 22C12 22.276 11.7759 22.4997 11.5 22.5C8.18632 22.4999 5.50006 19.8137 5.5 16.5V0H6.5V16.5Z",
|
|
267
|
+
className: "fill-[#555]"
|
|
268
|
+
})
|
|
269
|
+
}) : /* @__PURE__ */ jsx("svg", {
|
|
270
|
+
width: "14",
|
|
271
|
+
height: "34",
|
|
272
|
+
viewBox: "0 0 12 34",
|
|
273
|
+
fill: "none",
|
|
274
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
275
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
276
|
+
d: "M6.5 0V11.5C6.50007 14.2614 8.73861 16.4999 11.5 16.5C11.7759 16.5003 12 16.724 12 17C12 17.276 11.7759 17.4997 11.5 17.5C9.41273 17.5 7.57486 16.4335 6.5 14.8164V34H5.5V0H6.5Z",
|
|
277
|
+
className: "fill-[#555]"
|
|
278
|
+
})
|
|
279
|
+
});
|
|
280
|
+
$[6] = isLast;
|
|
281
|
+
$[7] = t5;
|
|
282
|
+
} else t5 = $[7];
|
|
283
|
+
let t6;
|
|
284
|
+
if ($[8] !== endpoint.method || $[9] !== endpoint.path) {
|
|
285
|
+
t6 = /* @__PURE__ */ jsx(EndpointPath, {
|
|
129
286
|
method: endpoint.method,
|
|
130
287
|
path: endpoint.path
|
|
131
|
-
})
|
|
288
|
+
});
|
|
289
|
+
$[8] = endpoint.method;
|
|
290
|
+
$[9] = endpoint.path;
|
|
291
|
+
$[10] = t6;
|
|
292
|
+
} else t6 = $[10];
|
|
293
|
+
let t7;
|
|
294
|
+
if ($[11] !== endpoint.description) {
|
|
295
|
+
t7 = /* @__PURE__ */ jsx("span", {
|
|
132
296
|
className: "text-sm text-muted-foreground truncate",
|
|
133
297
|
children: endpoint.description
|
|
134
|
-
})
|
|
135
|
-
|
|
136
|
-
|
|
298
|
+
});
|
|
299
|
+
$[11] = endpoint.description;
|
|
300
|
+
$[12] = t7;
|
|
301
|
+
} else t7 = $[12];
|
|
302
|
+
let t8;
|
|
303
|
+
if ($[13] !== t6 || $[14] !== t7) {
|
|
304
|
+
t8 = /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs("div", {
|
|
305
|
+
className: "grid grid-cols-[auto_1fr] items-center gap-3 px-2",
|
|
306
|
+
children: [t6, t7]
|
|
307
|
+
}) });
|
|
308
|
+
$[13] = t6;
|
|
309
|
+
$[14] = t7;
|
|
310
|
+
$[15] = t8;
|
|
311
|
+
} else t8 = $[15];
|
|
312
|
+
let t9;
|
|
313
|
+
if ($[16] !== t1 || $[17] !== t2 || $[18] !== t4 || $[19] !== t5 || $[20] !== t8) {
|
|
314
|
+
t9 = /* @__PURE__ */ jsxs("div", {
|
|
315
|
+
"data-testid": t1,
|
|
316
|
+
onClick: t2,
|
|
317
|
+
className: t4,
|
|
318
|
+
children: [t5, t8]
|
|
319
|
+
});
|
|
320
|
+
$[16] = t1;
|
|
321
|
+
$[17] = t2;
|
|
322
|
+
$[18] = t4;
|
|
323
|
+
$[19] = t5;
|
|
324
|
+
$[20] = t8;
|
|
325
|
+
$[21] = t9;
|
|
326
|
+
} else t9 = $[21];
|
|
327
|
+
return t9;
|
|
328
|
+
};
|
|
137
329
|
|
|
138
330
|
//#endregion
|
|
139
331
|
//#region src/components/flow-group.tsx
|
|
140
|
-
const FlowGroup = (
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
332
|
+
const FlowGroup = (t0) => {
|
|
333
|
+
const $ = c(41);
|
|
334
|
+
if ($[0] !== "a80b3cb43bb62d012f095b7847fb01d92f2a4fcd29fc05244f6ae839f1f0b9de") {
|
|
335
|
+
for (let $i = 0; $i < 41; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
336
|
+
$[0] = "a80b3cb43bb62d012f095b7847fb01d92f2a4fcd29fc05244f6ae839f1f0b9de";
|
|
337
|
+
}
|
|
338
|
+
const { flow, endpoints, isOpen, isSelected, onToggle, onClearSelection, selectedEndpointId, onSelectEndpoint } = t0;
|
|
339
|
+
const t1 = `flow-group-${flow}`;
|
|
340
|
+
let t2;
|
|
341
|
+
if ($[1] !== flow || $[2] !== isSelected || $[3] !== onClearSelection || $[4] !== onToggle) {
|
|
342
|
+
t2 = () => {
|
|
343
|
+
if (isSelected) onClearSelection();
|
|
344
|
+
onToggle(flow);
|
|
345
|
+
};
|
|
346
|
+
$[1] = flow;
|
|
347
|
+
$[2] = isSelected;
|
|
348
|
+
$[3] = onClearSelection;
|
|
349
|
+
$[4] = onToggle;
|
|
350
|
+
$[5] = t2;
|
|
351
|
+
} else t2 = $[5];
|
|
352
|
+
let t3;
|
|
353
|
+
if ($[6] !== isOpen) {
|
|
354
|
+
t3 = cn("w-4 h-4 transition-transform duration-300 text-[#555]", { "rotate-180 mt-2.5": isOpen });
|
|
355
|
+
$[6] = isOpen;
|
|
356
|
+
$[7] = t3;
|
|
357
|
+
} else t3 = $[7];
|
|
358
|
+
let t4;
|
|
359
|
+
if ($[8] !== t3) {
|
|
360
|
+
t4 = /* @__PURE__ */ jsx(ChevronDown, {
|
|
361
|
+
className: t3,
|
|
362
|
+
strokeWidth: 1.5
|
|
363
|
+
});
|
|
364
|
+
$[8] = t3;
|
|
365
|
+
$[9] = t4;
|
|
366
|
+
} else t4 = $[9];
|
|
367
|
+
const t5 = !isOpen;
|
|
368
|
+
let t6;
|
|
369
|
+
if ($[10] !== t5) {
|
|
370
|
+
t6 = cn("ml-[7px]", { hidden: t5 });
|
|
371
|
+
$[10] = t5;
|
|
372
|
+
$[11] = t6;
|
|
373
|
+
} else t6 = $[11];
|
|
374
|
+
let t7;
|
|
375
|
+
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
376
|
+
t7 = /* @__PURE__ */ jsx("path", {
|
|
377
|
+
d: "M1.5 1C1.5 0.723858 1.27614 0.5 1 0.5C0.723858 0.5 0.5 0.723858 0.5 1H1H1.5ZM1 1H0.5V10H1H1.5V1H1Z",
|
|
378
|
+
className: "fill-[#555]"
|
|
379
|
+
});
|
|
380
|
+
$[12] = t7;
|
|
381
|
+
} else t7 = $[12];
|
|
382
|
+
let t8;
|
|
383
|
+
if ($[13] !== t6) {
|
|
384
|
+
t8 = /* @__PURE__ */ jsx("svg", {
|
|
385
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
386
|
+
width: "2",
|
|
387
|
+
height: "10",
|
|
388
|
+
viewBox: "0 0 2 10",
|
|
389
|
+
fill: "none",
|
|
390
|
+
className: t6,
|
|
391
|
+
children: t7
|
|
392
|
+
});
|
|
393
|
+
$[13] = t6;
|
|
394
|
+
$[14] = t8;
|
|
395
|
+
} else t8 = $[14];
|
|
396
|
+
let t9;
|
|
397
|
+
if ($[15] !== t4 || $[16] !== t8) {
|
|
398
|
+
t9 = /* @__PURE__ */ jsxs("div", {
|
|
399
|
+
className: "grid grid-cols-1",
|
|
400
|
+
children: [t4, t8]
|
|
401
|
+
});
|
|
402
|
+
$[15] = t4;
|
|
403
|
+
$[16] = t8;
|
|
404
|
+
$[17] = t9;
|
|
405
|
+
} else t9 = $[17];
|
|
406
|
+
let t10;
|
|
407
|
+
if ($[18] !== flow) {
|
|
408
|
+
t10 = /* @__PURE__ */ jsx("h3", {
|
|
409
|
+
className: "text-sm font-medium text-left",
|
|
410
|
+
children: flow
|
|
411
|
+
});
|
|
412
|
+
$[18] = flow;
|
|
413
|
+
$[19] = t10;
|
|
414
|
+
} else t10 = $[19];
|
|
415
|
+
let t11;
|
|
416
|
+
if ($[20] !== t1 || $[21] !== t10 || $[22] !== t2 || $[23] !== t9) {
|
|
417
|
+
t11 = /* @__PURE__ */ jsxs("button", {
|
|
418
|
+
"data-testid": t1,
|
|
145
419
|
className: "w-full grid grid-cols-[auto_1fr] items-center gap-3 hover:bg-muted/40 cursor-pointer min-h-8.5 select-none hover:bg-muted-foreground/10 px-4",
|
|
146
|
-
onClick:
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
}), /* @__PURE__ */ jsx("h3", {
|
|
168
|
-
className: "text-sm font-medium text-left",
|
|
169
|
-
children: flow
|
|
170
|
-
})]
|
|
171
|
-
}), /* @__PURE__ */ jsx("div", {
|
|
172
|
-
className: cn("grid grid-cols-1 items-center justify-center", { hidden: !isOpen }),
|
|
173
|
-
children: endpoints.map((endpoint, index) => /* @__PURE__ */ jsx(EndpointItem, {
|
|
420
|
+
onClick: t2,
|
|
421
|
+
children: [t9, t10]
|
|
422
|
+
});
|
|
423
|
+
$[20] = t1;
|
|
424
|
+
$[21] = t10;
|
|
425
|
+
$[22] = t2;
|
|
426
|
+
$[23] = t9;
|
|
427
|
+
$[24] = t11;
|
|
428
|
+
} else t11 = $[24];
|
|
429
|
+
const t12 = !isOpen;
|
|
430
|
+
let t13;
|
|
431
|
+
if ($[25] !== t12) {
|
|
432
|
+
t13 = cn("grid grid-cols-1 items-center justify-center", { hidden: t12 });
|
|
433
|
+
$[25] = t12;
|
|
434
|
+
$[26] = t13;
|
|
435
|
+
} else t13 = $[26];
|
|
436
|
+
let t14;
|
|
437
|
+
if ($[27] !== endpoints || $[28] !== onSelectEndpoint || $[29] !== selectedEndpointId) {
|
|
438
|
+
let t15$1;
|
|
439
|
+
if ($[31] !== endpoints.length || $[32] !== onSelectEndpoint || $[33] !== selectedEndpointId) {
|
|
440
|
+
t15$1 = (endpoint, index) => /* @__PURE__ */ jsx(EndpointItem, {
|
|
174
441
|
endpoint,
|
|
175
442
|
isSelected: selectedEndpointId === endpoint.id,
|
|
176
443
|
isLast: index === endpoints.length - 1,
|
|
177
444
|
onSelect: onSelectEndpoint
|
|
178
|
-
}, endpoint.id)
|
|
179
|
-
|
|
180
|
-
|
|
445
|
+
}, endpoint.id);
|
|
446
|
+
$[31] = endpoints.length;
|
|
447
|
+
$[32] = onSelectEndpoint;
|
|
448
|
+
$[33] = selectedEndpointId;
|
|
449
|
+
$[34] = t15$1;
|
|
450
|
+
} else t15$1 = $[34];
|
|
451
|
+
t14 = endpoints.map(t15$1);
|
|
452
|
+
$[27] = endpoints;
|
|
453
|
+
$[28] = onSelectEndpoint;
|
|
454
|
+
$[29] = selectedEndpointId;
|
|
455
|
+
$[30] = t14;
|
|
456
|
+
} else t14 = $[30];
|
|
457
|
+
let t15;
|
|
458
|
+
if ($[35] !== t13 || $[36] !== t14) {
|
|
459
|
+
t15 = /* @__PURE__ */ jsx("div", {
|
|
460
|
+
className: t13,
|
|
461
|
+
children: t14
|
|
462
|
+
});
|
|
463
|
+
$[35] = t13;
|
|
464
|
+
$[36] = t14;
|
|
465
|
+
$[37] = t15;
|
|
466
|
+
} else t15 = $[37];
|
|
467
|
+
let t16;
|
|
468
|
+
if ($[38] !== t11 || $[39] !== t15) {
|
|
469
|
+
t16 = /* @__PURE__ */ jsxs("div", {
|
|
470
|
+
className: "pt-2",
|
|
471
|
+
children: [t11, t15]
|
|
472
|
+
});
|
|
473
|
+
$[38] = t11;
|
|
474
|
+
$[39] = t15;
|
|
475
|
+
$[40] = t16;
|
|
476
|
+
} else t16 = $[40];
|
|
477
|
+
return t16;
|
|
181
478
|
};
|
|
182
479
|
|
|
183
480
|
//#endregion
|
|
@@ -324,27 +621,50 @@ const useEndpointConfiguration = create()(persist(devtools((set) => ({
|
|
|
324
621
|
//#endregion
|
|
325
622
|
//#region src/hooks/use-get-endpoints.ts
|
|
326
623
|
const useGetEndpoints = () => {
|
|
327
|
-
const
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
};
|
|
624
|
+
const $ = c(7);
|
|
625
|
+
if ($[0] !== "cadd8d3432dfc6d2432c646eaf1f90c044b70a708974ecf5f816ef36004b4da0") {
|
|
626
|
+
for (let $i = 0; $i < 7; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
627
|
+
$[0] = "cadd8d3432dfc6d2432c646eaf1f90c044b70a708974ecf5f816ef36004b4da0";
|
|
628
|
+
}
|
|
629
|
+
let t0;
|
|
630
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
631
|
+
t0 = {
|
|
632
|
+
streamName: "__motia.api-endpoints",
|
|
633
|
+
groupId: "default"
|
|
634
|
+
};
|
|
635
|
+
$[1] = t0;
|
|
636
|
+
} else t0 = $[1];
|
|
637
|
+
const { data: endpoints } = useStreamGroup(t0);
|
|
638
|
+
let t1;
|
|
639
|
+
if ($[2] !== endpoints) {
|
|
640
|
+
t1 = endpoints.reduce(_temp$8, {});
|
|
641
|
+
$[2] = endpoints;
|
|
642
|
+
$[3] = t1;
|
|
643
|
+
} else t1 = $[3];
|
|
644
|
+
const groupedEndpoints = t1;
|
|
645
|
+
let t2;
|
|
646
|
+
if ($[4] !== endpoints || $[5] !== groupedEndpoints) {
|
|
647
|
+
t2 = {
|
|
648
|
+
endpoints,
|
|
649
|
+
groupedEndpoints
|
|
650
|
+
};
|
|
651
|
+
$[4] = endpoints;
|
|
652
|
+
$[5] = groupedEndpoints;
|
|
653
|
+
$[6] = t2;
|
|
654
|
+
} else t2 = $[6];
|
|
655
|
+
return t2;
|
|
347
656
|
};
|
|
657
|
+
function _temp$8(acc, endpoint) {
|
|
658
|
+
if (endpoint.flows && endpoint.flows.length > 0) endpoint.flows.forEach((flow) => {
|
|
659
|
+
acc[flow] = acc[flow] || [];
|
|
660
|
+
acc[flow].push(endpoint);
|
|
661
|
+
});
|
|
662
|
+
else {
|
|
663
|
+
acc["no-flow"] = acc["no-flow"] || [];
|
|
664
|
+
acc["no-flow"].push(endpoint);
|
|
665
|
+
}
|
|
666
|
+
return acc;
|
|
667
|
+
}
|
|
348
668
|
|
|
349
669
|
//#endregion
|
|
350
670
|
//#region src/hooks/use-path-params.ts
|
|
@@ -399,93 +719,210 @@ const convertSchemaToJson = (schema, rootSchema) => {
|
|
|
399
719
|
//#endregion
|
|
400
720
|
//#region src/hooks/use-json-schema-to-json.tsx
|
|
401
721
|
const useJsonSchemaToJson = (schema) => {
|
|
722
|
+
const $ = c(6);
|
|
723
|
+
if ($[0] !== "ba29f15b5046bda288d763530dc1c4ad1bc3136b6950394508cecd61132b94a3") {
|
|
724
|
+
for (let $i = 0; $i < 6; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
725
|
+
$[0] = "ba29f15b5046bda288d763530dc1c4ad1bc3136b6950394508cecd61132b94a3";
|
|
726
|
+
}
|
|
402
727
|
const [body, setBody] = useState("");
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
728
|
+
let t0;
|
|
729
|
+
let t1;
|
|
730
|
+
if ($[1] !== schema) {
|
|
731
|
+
t0 = () => {
|
|
732
|
+
if (schema) setBody(JSON.stringify(convertSchemaToJson(schema), null, 2));
|
|
733
|
+
};
|
|
734
|
+
t1 = [schema];
|
|
735
|
+
$[1] = schema;
|
|
736
|
+
$[2] = t0;
|
|
737
|
+
$[3] = t1;
|
|
738
|
+
} else {
|
|
739
|
+
t0 = $[2];
|
|
740
|
+
t1 = $[3];
|
|
741
|
+
}
|
|
742
|
+
useEffect(t0, t1);
|
|
743
|
+
let t2;
|
|
744
|
+
if ($[4] !== body) {
|
|
745
|
+
t2 = {
|
|
746
|
+
body,
|
|
747
|
+
setBody
|
|
748
|
+
};
|
|
749
|
+
$[4] = body;
|
|
750
|
+
$[5] = t2;
|
|
751
|
+
} else t2 = $[5];
|
|
752
|
+
return t2;
|
|
410
753
|
};
|
|
411
754
|
|
|
412
755
|
//#endregion
|
|
413
756
|
//#region src/spec/spec-body-panel.tsx
|
|
414
|
-
const EndpointBodyPanel = (
|
|
757
|
+
const EndpointBodyPanel = (t0) => {
|
|
758
|
+
const $ = c(9);
|
|
759
|
+
if ($[0] !== "b8eff7f7ce8e9189baa5c639bfd152e5d0c4e2073eede72b1020744bec7ba947") {
|
|
760
|
+
for (let $i = 0; $i < 9; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
761
|
+
$[0] = "b8eff7f7ce8e9189baa5c639bfd152e5d0c4e2073eede72b1020744bec7ba947";
|
|
762
|
+
}
|
|
763
|
+
const { endpoint, panelName, value } = t0;
|
|
415
764
|
if (![
|
|
416
765
|
"post",
|
|
417
766
|
"put",
|
|
418
767
|
"patch"
|
|
419
768
|
].includes(endpoint.method.toLowerCase())) return null;
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
769
|
+
const t1 = `endpoint-body-panel__${panelName}`;
|
|
770
|
+
let t2;
|
|
771
|
+
if ($[1] !== value) {
|
|
772
|
+
t2 = value ? JSON.parse(value) : {};
|
|
773
|
+
$[1] = value;
|
|
774
|
+
$[2] = t2;
|
|
775
|
+
} else t2 = $[2];
|
|
776
|
+
let t3;
|
|
777
|
+
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
778
|
+
t3 = { backgroundColor: "transparent" };
|
|
779
|
+
$[3] = t3;
|
|
780
|
+
} else t3 = $[3];
|
|
781
|
+
let t4;
|
|
782
|
+
if ($[4] !== t2) {
|
|
783
|
+
t4 = /* @__PURE__ */ jsx(ReactJson, {
|
|
784
|
+
src: t2,
|
|
427
785
|
theme: "default",
|
|
428
786
|
enableClipboard: false,
|
|
429
|
-
style:
|
|
430
|
-
})
|
|
431
|
-
|
|
787
|
+
style: t3
|
|
788
|
+
});
|
|
789
|
+
$[4] = t2;
|
|
790
|
+
$[5] = t4;
|
|
791
|
+
} else t4 = $[5];
|
|
792
|
+
let t5;
|
|
793
|
+
if ($[6] !== t1 || $[7] !== t4) {
|
|
794
|
+
t5 = /* @__PURE__ */ jsx(Panel, {
|
|
795
|
+
title: "Body",
|
|
796
|
+
size: "sm",
|
|
797
|
+
contentClassName: "p-0",
|
|
798
|
+
"data-testid": t1,
|
|
799
|
+
children: t4
|
|
800
|
+
});
|
|
801
|
+
$[6] = t1;
|
|
802
|
+
$[7] = t4;
|
|
803
|
+
$[8] = t5;
|
|
804
|
+
} else t5 = $[8];
|
|
805
|
+
return t5;
|
|
432
806
|
};
|
|
433
807
|
|
|
434
808
|
//#endregion
|
|
435
809
|
//#region src/spec/spec-path-params-panel.tsx
|
|
436
|
-
const EndpointPathParamsPanel = (
|
|
810
|
+
const EndpointPathParamsPanel = (t0) => {
|
|
811
|
+
const $ = c(6);
|
|
812
|
+
if ($[0] !== "4b99c635b467b8c34956e7f3473f52521462aab54a3d1e16ce1af5ee24ede587") {
|
|
813
|
+
for (let $i = 0; $i < 6; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
814
|
+
$[0] = "4b99c635b467b8c34956e7f3473f52521462aab54a3d1e16ce1af5ee24ede587";
|
|
815
|
+
}
|
|
816
|
+
const { endpoint } = t0;
|
|
437
817
|
const pathParams = usePathParams(endpoint.path);
|
|
438
818
|
if (!pathParams.length) return null;
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
819
|
+
let t1;
|
|
820
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
821
|
+
t1 = { gridTemplateColumns: "1fr 2fr" };
|
|
822
|
+
$[1] = t1;
|
|
823
|
+
} else t1 = $[1];
|
|
824
|
+
let t2;
|
|
825
|
+
if ($[2] !== pathParams) {
|
|
826
|
+
t2 = pathParams.map(_temp$7);
|
|
827
|
+
$[2] = pathParams;
|
|
828
|
+
$[3] = t2;
|
|
829
|
+
} else t2 = $[3];
|
|
830
|
+
let t3;
|
|
831
|
+
if ($[4] !== t2) {
|
|
832
|
+
t3 = /* @__PURE__ */ jsx(Panel, {
|
|
833
|
+
title: "Path params",
|
|
834
|
+
size: "sm",
|
|
835
|
+
variant: "default",
|
|
836
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
837
|
+
className: "grid gap-3",
|
|
838
|
+
style: t1,
|
|
839
|
+
children: t2
|
|
840
|
+
})
|
|
841
|
+
});
|
|
842
|
+
$[4] = t2;
|
|
843
|
+
$[5] = t3;
|
|
844
|
+
} else t3 = $[5];
|
|
845
|
+
return t3;
|
|
452
846
|
};
|
|
847
|
+
function _temp$7(param) {
|
|
848
|
+
return /* @__PURE__ */ jsx("div", {
|
|
849
|
+
className: "font-bold leading-[36px] flex text-xs",
|
|
850
|
+
children: param
|
|
851
|
+
}, param);
|
|
852
|
+
}
|
|
453
853
|
|
|
454
854
|
//#endregion
|
|
455
855
|
//#region src/spec/spec-query-params-panel.tsx
|
|
456
|
-
const EndpointQueryParamsPanel = (
|
|
856
|
+
const EndpointQueryParamsPanel = (t0) => {
|
|
857
|
+
const $ = c(6);
|
|
858
|
+
if ($[0] !== "4e1364928f69469968044d4855a06c351178a75725f12806c407b9bdbee699b0") {
|
|
859
|
+
for (let $i = 0; $i < 6; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
860
|
+
$[0] = "4e1364928f69469968044d4855a06c351178a75725f12806c407b9bdbee699b0";
|
|
861
|
+
}
|
|
862
|
+
const { endpoint } = t0;
|
|
457
863
|
if (!endpoint.queryParams?.length) return null;
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
864
|
+
let t1;
|
|
865
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
866
|
+
t1 = {
|
|
867
|
+
gridTemplateColumns: "1fr 2fr",
|
|
868
|
+
gridTemplateRows: "1fr 1fr"
|
|
869
|
+
};
|
|
870
|
+
$[1] = t1;
|
|
871
|
+
} else t1 = $[1];
|
|
872
|
+
let t2;
|
|
873
|
+
if ($[2] !== endpoint.queryParams) {
|
|
874
|
+
t2 = endpoint.queryParams.map(_temp$6);
|
|
875
|
+
$[2] = endpoint.queryParams;
|
|
876
|
+
$[3] = t2;
|
|
877
|
+
} else t2 = $[3];
|
|
878
|
+
let t3;
|
|
879
|
+
if ($[4] !== t2) {
|
|
880
|
+
t3 = /* @__PURE__ */ jsx(Panel, {
|
|
881
|
+
title: "Query params",
|
|
882
|
+
size: "sm",
|
|
883
|
+
variant: "outlined",
|
|
884
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
885
|
+
className: "grid gap-3",
|
|
886
|
+
style: t1,
|
|
887
|
+
children: t2
|
|
888
|
+
})
|
|
889
|
+
});
|
|
890
|
+
$[4] = t2;
|
|
891
|
+
$[5] = t3;
|
|
892
|
+
} else t3 = $[5];
|
|
893
|
+
return t3;
|
|
477
894
|
};
|
|
895
|
+
function _temp$6(param) {
|
|
896
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
|
|
897
|
+
className: "font-bold leading-[36px] flex text-xs",
|
|
898
|
+
children: param.name
|
|
899
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
900
|
+
className: "flex items-center text-xs ",
|
|
901
|
+
children: /* @__PURE__ */ jsx("span", { children: param.description })
|
|
902
|
+
})] }, param.name);
|
|
903
|
+
}
|
|
478
904
|
|
|
479
905
|
//#endregion
|
|
480
906
|
//#region src/spec/spec-response-schema.tsx
|
|
481
|
-
const EndpointResponseSchemaItem = (
|
|
482
|
-
const
|
|
483
|
-
|
|
907
|
+
const EndpointResponseSchemaItem = (t0) => {
|
|
908
|
+
const $ = c(10);
|
|
909
|
+
if ($[0] !== "e4de7b36c48b33b1d8a3aa52a415bcc5b35556fbd21c0f6bc47983adc48a77ce") {
|
|
910
|
+
for (let $i = 0; $i < 10; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
911
|
+
$[0] = "e4de7b36c48b33b1d8a3aa52a415bcc5b35556fbd21c0f6bc47983adc48a77ce";
|
|
912
|
+
}
|
|
913
|
+
const { responseCode, bodySchema } = t0;
|
|
914
|
+
const theme = useThemeStore(_temp$5);
|
|
915
|
+
let t1;
|
|
916
|
+
if ($[1] !== bodySchema) {
|
|
917
|
+
t1 = convertSchemaToJson(bodySchema);
|
|
918
|
+
$[1] = bodySchema;
|
|
919
|
+
$[2] = t1;
|
|
920
|
+
} else t1 = $[2];
|
|
921
|
+
const schema = t1;
|
|
484
922
|
const description = typeof bodySchema.description === "string" ? bodySchema.description : "";
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
923
|
+
let t2;
|
|
924
|
+
if ($[3] !== description || $[4] !== schema || $[5] !== theme) {
|
|
925
|
+
t2 = /* @__PURE__ */ jsx("div", {
|
|
489
926
|
className: "text-xs font-mono rounded-lg whitespace-pre-wrap",
|
|
490
927
|
children: schema ? /* @__PURE__ */ jsx(ReactJson, {
|
|
491
928
|
src: schema,
|
|
@@ -496,315 +933,749 @@ const EndpointResponseSchemaItem = ({ responseCode, bodySchema }) => {
|
|
|
496
933
|
className: "text-xs font-mono rounded-lg whitespace-pre-wrap p-4",
|
|
497
934
|
children: description
|
|
498
935
|
})
|
|
499
|
-
})
|
|
500
|
-
|
|
936
|
+
});
|
|
937
|
+
$[3] = description;
|
|
938
|
+
$[4] = schema;
|
|
939
|
+
$[5] = theme;
|
|
940
|
+
$[6] = t2;
|
|
941
|
+
} else t2 = $[6];
|
|
942
|
+
let t3;
|
|
943
|
+
if ($[7] !== responseCode || $[8] !== t2) {
|
|
944
|
+
t3 = /* @__PURE__ */ jsx(TabsContent, {
|
|
945
|
+
value: responseCode,
|
|
946
|
+
className: "border-t",
|
|
947
|
+
children: t2
|
|
948
|
+
}, responseCode);
|
|
949
|
+
$[7] = responseCode;
|
|
950
|
+
$[8] = t2;
|
|
951
|
+
$[9] = t3;
|
|
952
|
+
} else t3 = $[9];
|
|
953
|
+
return t3;
|
|
501
954
|
};
|
|
502
|
-
const EndpointResponseSchema = (
|
|
955
|
+
const EndpointResponseSchema = (t0) => {
|
|
956
|
+
const $ = c(11);
|
|
957
|
+
if ($[0] !== "e4de7b36c48b33b1d8a3aa52a415bcc5b35556fbd21c0f6bc47983adc48a77ce") {
|
|
958
|
+
for (let $i = 0; $i < 11; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
959
|
+
$[0] = "e4de7b36c48b33b1d8a3aa52a415bcc5b35556fbd21c0f6bc47983adc48a77ce";
|
|
960
|
+
}
|
|
961
|
+
const { items } = t0;
|
|
503
962
|
if (items.length === 0) return null;
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
})
|
|
519
|
-
})
|
|
520
|
-
|
|
963
|
+
const t1 = items[0].responseCode;
|
|
964
|
+
let t2;
|
|
965
|
+
if ($[1] !== items) {
|
|
966
|
+
t2 = items.map(_temp2);
|
|
967
|
+
$[1] = items;
|
|
968
|
+
$[2] = t2;
|
|
969
|
+
} else t2 = $[2];
|
|
970
|
+
let t3;
|
|
971
|
+
if ($[3] !== t2) {
|
|
972
|
+
t3 = /* @__PURE__ */ jsx("div", {
|
|
973
|
+
className: "flex items-center justify-between bg-card",
|
|
974
|
+
children: /* @__PURE__ */ jsx(TabsList, {
|
|
975
|
+
className: "bg-transparent p-0",
|
|
976
|
+
children: t2
|
|
977
|
+
})
|
|
978
|
+
});
|
|
979
|
+
$[3] = t2;
|
|
980
|
+
$[4] = t3;
|
|
981
|
+
} else t3 = $[4];
|
|
982
|
+
let t4;
|
|
983
|
+
if ($[5] !== items) {
|
|
984
|
+
t4 = items.map(_temp3);
|
|
985
|
+
$[5] = items;
|
|
986
|
+
$[6] = t4;
|
|
987
|
+
} else t4 = $[6];
|
|
988
|
+
let t5;
|
|
989
|
+
if ($[7] !== items[0].responseCode || $[8] !== t3 || $[9] !== t4) {
|
|
990
|
+
t5 = /* @__PURE__ */ jsx("div", {
|
|
991
|
+
className: "flex flex-col rounded-lg border",
|
|
992
|
+
children: /* @__PURE__ */ jsxs(Tabs, {
|
|
993
|
+
defaultValue: t1,
|
|
994
|
+
children: [t3, t4]
|
|
995
|
+
})
|
|
996
|
+
});
|
|
997
|
+
$[7] = items[0].responseCode;
|
|
998
|
+
$[8] = t3;
|
|
999
|
+
$[9] = t4;
|
|
1000
|
+
$[10] = t5;
|
|
1001
|
+
} else t5 = $[10];
|
|
1002
|
+
return t5;
|
|
521
1003
|
};
|
|
1004
|
+
function _temp$5(store) {
|
|
1005
|
+
return store.theme;
|
|
1006
|
+
}
|
|
1007
|
+
function _temp2(item) {
|
|
1008
|
+
return /* @__PURE__ */ jsx(TabsTrigger, {
|
|
1009
|
+
value: item.responseCode,
|
|
1010
|
+
className: "text-xs font-bold cursor-pointer",
|
|
1011
|
+
children: item.responseCode
|
|
1012
|
+
}, item.responseCode);
|
|
1013
|
+
}
|
|
1014
|
+
function _temp3(props) {
|
|
1015
|
+
return /* @__PURE__ */ jsx(EndpointResponseSchemaItem, { ...props }, props.responseCode);
|
|
1016
|
+
}
|
|
522
1017
|
|
|
523
1018
|
//#endregion
|
|
524
1019
|
//#region src/spec/spec-side-panel.tsx
|
|
525
|
-
const SpecSidePanel = (
|
|
1020
|
+
const SpecSidePanel = (t0) => {
|
|
1021
|
+
const $ = c(26);
|
|
1022
|
+
if ($[0] !== "1460e2628753bf80967063f35b14988afbd9dd8b96c8778ac3b5ebba7a833fc1") {
|
|
1023
|
+
for (let $i = 0; $i < 26; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
1024
|
+
$[0] = "1460e2628753bf80967063f35b14988afbd9dd8b96c8778ac3b5ebba7a833fc1";
|
|
1025
|
+
}
|
|
1026
|
+
const { endpoint, onClose } = t0;
|
|
526
1027
|
const { body } = useJsonSchemaToJson(endpoint.bodySchema);
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
title: /* @__PURE__ */ jsx(EndpointPath, {
|
|
1028
|
+
let t1;
|
|
1029
|
+
if ($[1] !== endpoint.method || $[2] !== endpoint.path) {
|
|
1030
|
+
t1 = /* @__PURE__ */ jsx(EndpointPath, {
|
|
531
1031
|
method: endpoint.method,
|
|
532
1032
|
path: endpoint.path
|
|
533
|
-
})
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
1033
|
+
});
|
|
1034
|
+
$[1] = endpoint.method;
|
|
1035
|
+
$[2] = endpoint.path;
|
|
1036
|
+
$[3] = t1;
|
|
1037
|
+
} else t1 = $[3];
|
|
1038
|
+
let t2;
|
|
1039
|
+
if ($[4] !== onClose) {
|
|
1040
|
+
t2 = /* @__PURE__ */ jsx(X, {
|
|
1041
|
+
className: "cursor-pointer w-4 h-4",
|
|
540
1042
|
onClick: onClose
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
1043
|
+
});
|
|
1044
|
+
$[4] = onClose;
|
|
1045
|
+
$[5] = t2;
|
|
1046
|
+
} else t2 = $[5];
|
|
1047
|
+
let t3;
|
|
1048
|
+
if ($[6] !== onClose || $[7] !== t2) {
|
|
1049
|
+
t3 = [{
|
|
1050
|
+
icon: t2,
|
|
1051
|
+
onClick: onClose
|
|
1052
|
+
}];
|
|
1053
|
+
$[6] = onClose;
|
|
1054
|
+
$[7] = t2;
|
|
1055
|
+
$[8] = t3;
|
|
1056
|
+
} else t3 = $[8];
|
|
1057
|
+
let t4;
|
|
1058
|
+
let t5;
|
|
1059
|
+
if ($[9] !== endpoint) {
|
|
1060
|
+
t4 = /* @__PURE__ */ jsx(EndpointPathParamsPanel, { endpoint });
|
|
1061
|
+
t5 = /* @__PURE__ */ jsx(EndpointQueryParamsPanel, { endpoint });
|
|
1062
|
+
$[9] = endpoint;
|
|
1063
|
+
$[10] = t4;
|
|
1064
|
+
$[11] = t5;
|
|
1065
|
+
} else {
|
|
1066
|
+
t4 = $[10];
|
|
1067
|
+
t5 = $[11];
|
|
1068
|
+
}
|
|
1069
|
+
let t6;
|
|
1070
|
+
if ($[12] !== body || $[13] !== endpoint) {
|
|
1071
|
+
t6 = /* @__PURE__ */ jsx(EndpointBodyPanel, {
|
|
1072
|
+
endpoint,
|
|
1073
|
+
panelName: "details",
|
|
1074
|
+
value: body
|
|
1075
|
+
});
|
|
1076
|
+
$[12] = body;
|
|
1077
|
+
$[13] = endpoint;
|
|
1078
|
+
$[14] = t6;
|
|
1079
|
+
} else t6 = $[14];
|
|
1080
|
+
let t7;
|
|
1081
|
+
if ($[15] !== endpoint.responseSchema) {
|
|
1082
|
+
t7 = /* @__PURE__ */ jsx(EndpointResponseSchema, { items: Object.entries(endpoint?.responseSchema ?? {}).map(_temp$4) });
|
|
1083
|
+
$[15] = endpoint.responseSchema;
|
|
1084
|
+
$[16] = t7;
|
|
1085
|
+
} else t7 = $[16];
|
|
1086
|
+
let t8;
|
|
1087
|
+
if ($[17] !== endpoint.description || $[18] !== onClose || $[19] !== t1 || $[20] !== t3 || $[21] !== t4 || $[22] !== t5 || $[23] !== t6 || $[24] !== t7) {
|
|
1088
|
+
t8 = /* @__PURE__ */ jsxs(Sidebar, {
|
|
1089
|
+
initialWidth: 600,
|
|
1090
|
+
subtitle: endpoint.description,
|
|
1091
|
+
title: t1,
|
|
1092
|
+
onClose,
|
|
1093
|
+
actions: t3,
|
|
1094
|
+
children: [
|
|
1095
|
+
t4,
|
|
1096
|
+
t5,
|
|
1097
|
+
t6,
|
|
1098
|
+
t7
|
|
1099
|
+
]
|
|
1100
|
+
});
|
|
1101
|
+
$[17] = endpoint.description;
|
|
1102
|
+
$[18] = onClose;
|
|
1103
|
+
$[19] = t1;
|
|
1104
|
+
$[20] = t3;
|
|
1105
|
+
$[21] = t4;
|
|
1106
|
+
$[22] = t5;
|
|
1107
|
+
$[23] = t6;
|
|
1108
|
+
$[24] = t7;
|
|
1109
|
+
$[25] = t8;
|
|
1110
|
+
} else t8 = $[25];
|
|
1111
|
+
return t8;
|
|
556
1112
|
};
|
|
1113
|
+
function _temp$4(t0) {
|
|
1114
|
+
const [status, schema] = t0;
|
|
1115
|
+
return {
|
|
1116
|
+
responseCode: status,
|
|
1117
|
+
bodySchema: schema
|
|
1118
|
+
};
|
|
1119
|
+
}
|
|
557
1120
|
|
|
558
1121
|
//#endregion
|
|
559
1122
|
//#region src/components/json-editor.tsx
|
|
560
|
-
const JsonEditor = (
|
|
1123
|
+
const JsonEditor = (t0) => {
|
|
1124
|
+
const $ = c(41);
|
|
1125
|
+
if ($[0] !== "0b3355d4554a672310b1abdad893ca8974afca90f2334dd0d80cf3d8e960c55e") {
|
|
1126
|
+
for (let $i = 0; $i < 41; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
1127
|
+
$[0] = "0b3355d4554a672310b1abdad893ca8974afca90f2334dd0d80cf3d8e960c55e";
|
|
1128
|
+
}
|
|
1129
|
+
const { value, schema, onChange, onValidate, language: t1, readOnly: t2 } = t0;
|
|
1130
|
+
const language = t1 === void 0 ? "json" : t1;
|
|
1131
|
+
const readOnly = t2 === void 0 ? false : t2;
|
|
561
1132
|
const monaco = useMonaco();
|
|
562
|
-
const
|
|
563
|
-
const editorTheme = useMemo(() => theme === "dark" ? "transparent-dark" : "transparent-light", [theme]);
|
|
1133
|
+
const editorTheme = useThemeStore(_temp$3) === "dark" ? "transparent-dark" : "transparent-light";
|
|
564
1134
|
const [editor, setEditor] = useState(null);
|
|
565
1135
|
const resizeAnimationFrameRef = useRef(null);
|
|
566
1136
|
const isValidatingRef = useRef(false);
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
if (!monaco) return;
|
|
602
|
-
monaco.languages.typescript.javascriptDefaults.setCompilerOptions({ isolatedModules: true });
|
|
603
|
-
monaco.languages.json.jsonDefaults.setDiagnosticsOptions({ schemas: schema ? [{
|
|
604
|
-
uri: window.location.href,
|
|
605
|
-
fileMatch: ["*"],
|
|
606
|
-
schema
|
|
607
|
-
}] : [] });
|
|
608
|
-
}, [monaco, schema]);
|
|
609
|
-
useLayoutEffect(() => {
|
|
610
|
-
if (!monaco) return;
|
|
611
|
-
monaco.editor.setTheme(editorTheme);
|
|
612
|
-
}, [monaco, editorTheme]);
|
|
613
|
-
useEffect(() => {
|
|
614
|
-
if (!editor) return;
|
|
615
|
-
const container = editor.getContainerDomNode().parentElement?.parentElement;
|
|
616
|
-
if (!container) return;
|
|
617
|
-
const handleResize = () => {
|
|
618
|
-
if (resizeAnimationFrameRef.current !== null) cancelAnimationFrame(resizeAnimationFrameRef.current);
|
|
619
|
-
resizeAnimationFrameRef.current = requestAnimationFrame(() => {
|
|
620
|
-
const { width, height } = container.getBoundingClientRect();
|
|
621
|
-
editor.layout({
|
|
622
|
-
width,
|
|
623
|
-
height
|
|
624
|
-
});
|
|
625
|
-
resizeAnimationFrameRef.current = null;
|
|
1137
|
+
let t3;
|
|
1138
|
+
let t4;
|
|
1139
|
+
if ($[1] !== monaco) {
|
|
1140
|
+
t3 = () => {
|
|
1141
|
+
if (!monaco) return;
|
|
1142
|
+
monaco.editor.defineTheme("transparent-light", {
|
|
1143
|
+
base: "vs",
|
|
1144
|
+
inherit: true,
|
|
1145
|
+
rules: [],
|
|
1146
|
+
colors: {
|
|
1147
|
+
"editor.background": "#00000000",
|
|
1148
|
+
"editor.lineHighlightBackground": "#00000000",
|
|
1149
|
+
"editorLineNumber.foreground": "#999999",
|
|
1150
|
+
"editorLineNumber.activeForeground": "#000000",
|
|
1151
|
+
focusBorder: "#00000000",
|
|
1152
|
+
"widget.border": "#00000000",
|
|
1153
|
+
"editor.border": "#00000000",
|
|
1154
|
+
"editorWidget.border": "#00000000"
|
|
1155
|
+
}
|
|
1156
|
+
});
|
|
1157
|
+
monaco.editor.defineTheme("transparent-dark", {
|
|
1158
|
+
base: "vs-dark",
|
|
1159
|
+
inherit: true,
|
|
1160
|
+
rules: [],
|
|
1161
|
+
colors: {
|
|
1162
|
+
"editor.background": "#00000000",
|
|
1163
|
+
"editor.lineHighlightBackground": "#00000000",
|
|
1164
|
+
"editorLineNumber.foreground": "#666666",
|
|
1165
|
+
"editorLineNumber.activeForeground": "#ffffff",
|
|
1166
|
+
focusBorder: "#00000000",
|
|
1167
|
+
"widget.border": "#00000000",
|
|
1168
|
+
"editor.border": "#00000000",
|
|
1169
|
+
"editorWidget.border": "#00000000"
|
|
1170
|
+
}
|
|
626
1171
|
});
|
|
627
1172
|
};
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
1173
|
+
t4 = [monaco];
|
|
1174
|
+
$[1] = monaco;
|
|
1175
|
+
$[2] = t3;
|
|
1176
|
+
$[3] = t4;
|
|
1177
|
+
} else {
|
|
1178
|
+
t3 = $[2];
|
|
1179
|
+
t4 = $[3];
|
|
1180
|
+
}
|
|
1181
|
+
useLayoutEffect(t3, t4);
|
|
1182
|
+
let t5;
|
|
1183
|
+
let t6;
|
|
1184
|
+
if ($[4] !== monaco || $[5] !== schema) {
|
|
1185
|
+
t5 = () => {
|
|
1186
|
+
if (!monaco) return;
|
|
1187
|
+
monaco.languages.typescript.javascriptDefaults.setCompilerOptions({ isolatedModules: true });
|
|
1188
|
+
monaco.languages.json.jsonDefaults.setDiagnosticsOptions({ schemas: schema ? [{
|
|
1189
|
+
uri: window.location.href,
|
|
1190
|
+
fileMatch: ["*"],
|
|
1191
|
+
schema
|
|
1192
|
+
}] : [] });
|
|
634
1193
|
};
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
1194
|
+
t6 = [monaco, schema];
|
|
1195
|
+
$[4] = monaco;
|
|
1196
|
+
$[5] = schema;
|
|
1197
|
+
$[6] = t5;
|
|
1198
|
+
$[7] = t6;
|
|
1199
|
+
} else {
|
|
1200
|
+
t5 = $[6];
|
|
1201
|
+
t6 = $[7];
|
|
1202
|
+
}
|
|
1203
|
+
useEffect(t5, t6);
|
|
1204
|
+
let t7;
|
|
1205
|
+
let t8;
|
|
1206
|
+
if ($[8] !== editorTheme || $[9] !== monaco) {
|
|
1207
|
+
t7 = () => {
|
|
1208
|
+
if (!monaco) return;
|
|
1209
|
+
monaco.editor.setTheme(editorTheme);
|
|
1210
|
+
};
|
|
1211
|
+
t8 = [monaco, editorTheme];
|
|
1212
|
+
$[8] = editorTheme;
|
|
1213
|
+
$[9] = monaco;
|
|
1214
|
+
$[10] = t7;
|
|
1215
|
+
$[11] = t8;
|
|
1216
|
+
} else {
|
|
1217
|
+
t7 = $[10];
|
|
1218
|
+
t8 = $[11];
|
|
1219
|
+
}
|
|
1220
|
+
useLayoutEffect(t7, t8);
|
|
1221
|
+
let t10;
|
|
1222
|
+
let t9;
|
|
1223
|
+
if ($[12] !== editor) {
|
|
1224
|
+
t9 = () => {
|
|
1225
|
+
if (!editor) return;
|
|
1226
|
+
const container = editor.getContainerDomNode().parentElement?.parentElement;
|
|
1227
|
+
if (!container) return;
|
|
1228
|
+
const handleResize = () => {
|
|
1229
|
+
if (resizeAnimationFrameRef.current !== null) cancelAnimationFrame(resizeAnimationFrameRef.current);
|
|
1230
|
+
resizeAnimationFrameRef.current = requestAnimationFrame(() => {
|
|
1231
|
+
const { width, height } = container.getBoundingClientRect();
|
|
1232
|
+
editor.layout({
|
|
1233
|
+
width,
|
|
1234
|
+
height
|
|
1235
|
+
});
|
|
1236
|
+
resizeAnimationFrameRef.current = null;
|
|
1237
|
+
});
|
|
1238
|
+
};
|
|
1239
|
+
handleResize();
|
|
1240
|
+
const resizeObserver = new ResizeObserver(handleResize);
|
|
1241
|
+
resizeObserver.observe(container);
|
|
1242
|
+
return () => {
|
|
1243
|
+
resizeObserver.disconnect();
|
|
1244
|
+
if (resizeAnimationFrameRef.current !== null) cancelAnimationFrame(resizeAnimationFrameRef.current);
|
|
1245
|
+
};
|
|
1246
|
+
};
|
|
1247
|
+
t10 = [editor];
|
|
1248
|
+
$[12] = editor;
|
|
1249
|
+
$[13] = t10;
|
|
1250
|
+
$[14] = t9;
|
|
1251
|
+
} else {
|
|
1252
|
+
t10 = $[13];
|
|
1253
|
+
t9 = $[14];
|
|
1254
|
+
}
|
|
1255
|
+
useEffect(t9, t10);
|
|
1256
|
+
let t11;
|
|
1257
|
+
let t12;
|
|
1258
|
+
if ($[15] !== editor || $[16] !== monaco || $[17] !== onValidate || $[18] !== schema || $[19] !== value) {
|
|
1259
|
+
t11 = () => {
|
|
1260
|
+
if (!editor || !monaco || !onValidate || isValidatingRef.current) return;
|
|
1261
|
+
const model = editor.getModel();
|
|
1262
|
+
if (!model) return;
|
|
1263
|
+
if (schema && !value) {
|
|
1264
|
+
isValidatingRef.current = true;
|
|
1265
|
+
onValidate(false);
|
|
1266
|
+
isValidatingRef.current = false;
|
|
1267
|
+
return;
|
|
1268
|
+
}
|
|
641
1269
|
isValidatingRef.current = true;
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
}, 100);
|
|
651
|
-
return () => {
|
|
652
|
-
clearTimeout(timeoutId);
|
|
653
|
-
isValidatingRef.current = false;
|
|
1270
|
+
const timeoutId = setTimeout(() => {
|
|
1271
|
+
onValidate(monaco.editor.getModelMarkers({ resource: model.uri }).length === 0);
|
|
1272
|
+
isValidatingRef.current = false;
|
|
1273
|
+
}, 100);
|
|
1274
|
+
return () => {
|
|
1275
|
+
clearTimeout(timeoutId);
|
|
1276
|
+
isValidatingRef.current = false;
|
|
1277
|
+
};
|
|
654
1278
|
};
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
value
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
1279
|
+
t12 = [
|
|
1280
|
+
editor,
|
|
1281
|
+
monaco,
|
|
1282
|
+
onValidate,
|
|
1283
|
+
value,
|
|
1284
|
+
schema
|
|
1285
|
+
];
|
|
1286
|
+
$[15] = editor;
|
|
1287
|
+
$[16] = monaco;
|
|
1288
|
+
$[17] = onValidate;
|
|
1289
|
+
$[18] = schema;
|
|
1290
|
+
$[19] = value;
|
|
1291
|
+
$[20] = t11;
|
|
1292
|
+
$[21] = t12;
|
|
1293
|
+
} else {
|
|
1294
|
+
t11 = $[20];
|
|
1295
|
+
t12 = $[21];
|
|
1296
|
+
}
|
|
1297
|
+
useEffect(t11, t12);
|
|
1298
|
+
let t13;
|
|
1299
|
+
if ($[22] !== schema) {
|
|
1300
|
+
t13 = schema ? JSON.stringify(schema) : "no-schema";
|
|
1301
|
+
$[22] = schema;
|
|
1302
|
+
$[23] = t13;
|
|
1303
|
+
} else t13 = $[23];
|
|
1304
|
+
const editorKey = t13;
|
|
1305
|
+
let t14;
|
|
1306
|
+
if ($[24] !== onChange) {
|
|
1307
|
+
t14 = (value_0) => {
|
|
1308
|
+
onChange?.(value_0 ?? "");
|
|
1309
|
+
};
|
|
1310
|
+
$[24] = onChange;
|
|
1311
|
+
$[25] = t14;
|
|
1312
|
+
} else t14 = $[25];
|
|
1313
|
+
let t15;
|
|
1314
|
+
if ($[26] !== onValidate || $[27] !== schema || $[28] !== value) {
|
|
1315
|
+
t15 = (markers_0) => {
|
|
674
1316
|
if (!onValidate || isValidatingRef.current) return;
|
|
675
1317
|
isValidatingRef.current = true;
|
|
676
1318
|
if (schema && !value) onValidate(false);
|
|
677
|
-
else onValidate(
|
|
1319
|
+
else onValidate(markers_0.length === 0);
|
|
678
1320
|
isValidatingRef.current = false;
|
|
679
|
-
}
|
|
680
|
-
|
|
1321
|
+
};
|
|
1322
|
+
$[26] = onValidate;
|
|
1323
|
+
$[27] = schema;
|
|
1324
|
+
$[28] = value;
|
|
1325
|
+
$[29] = t15;
|
|
1326
|
+
} else t15 = $[29];
|
|
1327
|
+
let t16;
|
|
1328
|
+
if ($[30] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1329
|
+
t16 = { enabled: false };
|
|
1330
|
+
$[30] = t16;
|
|
1331
|
+
} else t16 = $[30];
|
|
1332
|
+
let t17;
|
|
1333
|
+
if ($[31] !== readOnly) {
|
|
1334
|
+
t17 = {
|
|
681
1335
|
automaticLayout: false,
|
|
682
1336
|
readOnly,
|
|
683
1337
|
scrollBeyondLastLine: false,
|
|
684
|
-
minimap:
|
|
1338
|
+
minimap: t16,
|
|
685
1339
|
overviewRulerLanes: 0
|
|
686
|
-
}
|
|
687
|
-
|
|
1340
|
+
};
|
|
1341
|
+
$[31] = readOnly;
|
|
1342
|
+
$[32] = t17;
|
|
1343
|
+
} else t17 = $[32];
|
|
1344
|
+
let t18;
|
|
1345
|
+
if ($[33] !== editorKey || $[34] !== editorTheme || $[35] !== language || $[36] !== t14 || $[37] !== t15 || $[38] !== t17 || $[39] !== value) {
|
|
1346
|
+
t18 = /* @__PURE__ */ jsx(Editor, {
|
|
1347
|
+
"data-testid": "json-editor",
|
|
1348
|
+
language,
|
|
1349
|
+
value,
|
|
1350
|
+
loading: "",
|
|
1351
|
+
theme: editorTheme,
|
|
1352
|
+
onMount: setEditor,
|
|
1353
|
+
onChange: t14,
|
|
1354
|
+
onValidate: t15,
|
|
1355
|
+
options: t17
|
|
1356
|
+
}, editorKey);
|
|
1357
|
+
$[33] = editorKey;
|
|
1358
|
+
$[34] = editorTheme;
|
|
1359
|
+
$[35] = language;
|
|
1360
|
+
$[36] = t14;
|
|
1361
|
+
$[37] = t15;
|
|
1362
|
+
$[38] = t17;
|
|
1363
|
+
$[39] = value;
|
|
1364
|
+
$[40] = t18;
|
|
1365
|
+
} else t18 = $[40];
|
|
1366
|
+
return t18;
|
|
688
1367
|
};
|
|
1368
|
+
function _temp$3(state) {
|
|
1369
|
+
return state.theme;
|
|
1370
|
+
}
|
|
689
1371
|
|
|
690
1372
|
//#endregion
|
|
691
1373
|
//#region src/play/side-panel-body-tab.tsx
|
|
692
|
-
const SidePanelBodyTab = memo((
|
|
1374
|
+
const SidePanelBodyTab = memo((t0) => {
|
|
1375
|
+
const $ = c(21);
|
|
1376
|
+
if ($[0] !== "15cdaf91612bb3c1ef34320b0f01a80a135e66606fb87beb7a4a2f7f95e53a69") {
|
|
1377
|
+
for (let $i = 0; $i < 21; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
1378
|
+
$[0] = "15cdaf91612bb3c1ef34320b0f01a80a135e66606fb87beb7a4a2f7f95e53a69";
|
|
1379
|
+
}
|
|
1380
|
+
const { schema } = t0;
|
|
693
1381
|
const { setBody, setBodyIsValid } = useEndpointConfiguration();
|
|
694
1382
|
const bodyIsValid = useEndpointConfiguration(useShallow(getBodyIsValidSelector));
|
|
695
1383
|
const body = useEndpointConfiguration(getBodySelector);
|
|
696
1384
|
const previousSchemaRef = useRef(schema);
|
|
697
1385
|
const userClearedRef = useRef(false);
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
1386
|
+
let t1;
|
|
1387
|
+
let t2;
|
|
1388
|
+
if ($[1] !== body || $[2] !== schema || $[3] !== setBody || $[4] !== setBodyIsValid) {
|
|
1389
|
+
t1 = () => {
|
|
1390
|
+
const schemaChanged = previousSchemaRef.current !== schema;
|
|
1391
|
+
previousSchemaRef.current = schema;
|
|
1392
|
+
if (schemaChanged) userClearedRef.current = false;
|
|
1393
|
+
if (schema && !body && !userClearedRef.current) {
|
|
1394
|
+
setBody(JSON.stringify(convertSchemaToJson(schema), null, 2));
|
|
1395
|
+
return;
|
|
1396
|
+
}
|
|
1397
|
+
if (!schema) {
|
|
1398
|
+
setBody(body || "");
|
|
1399
|
+
setBodyIsValid(true);
|
|
1400
|
+
}
|
|
1401
|
+
};
|
|
1402
|
+
t2 = [
|
|
1403
|
+
schema,
|
|
1404
|
+
body,
|
|
1405
|
+
setBody,
|
|
1406
|
+
setBodyIsValid
|
|
1407
|
+
];
|
|
1408
|
+
$[1] = body;
|
|
1409
|
+
$[2] = schema;
|
|
1410
|
+
$[3] = setBody;
|
|
1411
|
+
$[4] = setBodyIsValid;
|
|
1412
|
+
$[5] = t1;
|
|
1413
|
+
$[6] = t2;
|
|
1414
|
+
} else {
|
|
1415
|
+
t1 = $[5];
|
|
1416
|
+
t2 = $[6];
|
|
1417
|
+
}
|
|
1418
|
+
useEffect(t1, t2);
|
|
1419
|
+
let t3;
|
|
1420
|
+
if ($[7] !== schema || $[8] !== setBody || $[9] !== setBodyIsValid) {
|
|
1421
|
+
t3 = (value) => {
|
|
1422
|
+
setBody(value);
|
|
1423
|
+
if (schema && !value) {
|
|
1424
|
+
setBodyIsValid(false);
|
|
1425
|
+
userClearedRef.current = true;
|
|
1426
|
+
} else userClearedRef.current = false;
|
|
1427
|
+
};
|
|
1428
|
+
$[7] = schema;
|
|
1429
|
+
$[8] = setBody;
|
|
1430
|
+
$[9] = setBodyIsValid;
|
|
1431
|
+
$[10] = t3;
|
|
1432
|
+
} else t3 = $[10];
|
|
1433
|
+
const handleBodyChange = t3;
|
|
1434
|
+
let t4;
|
|
1435
|
+
if ($[11] !== body || $[12] !== handleBodyChange || $[13] !== schema || $[14] !== setBodyIsValid) {
|
|
1436
|
+
t4 = /* @__PURE__ */ jsx(JsonEditor, {
|
|
719
1437
|
value: body,
|
|
720
1438
|
schema,
|
|
721
|
-
onChange:
|
|
722
|
-
setBody(value);
|
|
723
|
-
if (schema && !value) {
|
|
724
|
-
setBodyIsValid(false);
|
|
725
|
-
userClearedRef.current = true;
|
|
726
|
-
} else userClearedRef.current = false;
|
|
727
|
-
}, [
|
|
728
|
-
setBody,
|
|
729
|
-
schema,
|
|
730
|
-
setBodyIsValid
|
|
731
|
-
]),
|
|
1439
|
+
onChange: handleBodyChange,
|
|
732
1440
|
onValidate: setBodyIsValid
|
|
733
|
-
})
|
|
1441
|
+
});
|
|
1442
|
+
$[11] = body;
|
|
1443
|
+
$[12] = handleBodyChange;
|
|
1444
|
+
$[13] = schema;
|
|
1445
|
+
$[14] = setBodyIsValid;
|
|
1446
|
+
$[15] = t4;
|
|
1447
|
+
} else t4 = $[15];
|
|
1448
|
+
let t5;
|
|
1449
|
+
if ($[16] !== bodyIsValid) {
|
|
1450
|
+
t5 = bodyIsValid === false && /* @__PURE__ */ jsxs("div", {
|
|
734
1451
|
className: "absolute bottom-0 left-0 right-0 border-t border-border p-3 text-sm dark:text-yellow-500 text-yellow-700 flex items-center gap-1 font-medium",
|
|
735
1452
|
"data-testid": "endpoint-body-tab-invalid",
|
|
736
1453
|
children: [/* @__PURE__ */ jsx(CircleX, { className: "w-4 h-4" }), "The body payload is invalid"]
|
|
737
|
-
})
|
|
738
|
-
|
|
1454
|
+
});
|
|
1455
|
+
$[16] = bodyIsValid;
|
|
1456
|
+
$[17] = t5;
|
|
1457
|
+
} else t5 = $[17];
|
|
1458
|
+
let t6;
|
|
1459
|
+
if ($[18] !== t4 || $[19] !== t5) {
|
|
1460
|
+
t6 = /* @__PURE__ */ jsxs("div", {
|
|
1461
|
+
className: "max-h-full h-full relative",
|
|
1462
|
+
children: [t4, t5]
|
|
1463
|
+
});
|
|
1464
|
+
$[18] = t4;
|
|
1465
|
+
$[19] = t5;
|
|
1466
|
+
$[20] = t6;
|
|
1467
|
+
} else t6 = $[20];
|
|
1468
|
+
return t6;
|
|
739
1469
|
});
|
|
740
1470
|
|
|
741
1471
|
//#endregion
|
|
742
1472
|
//#region src/components/configuration-list-item.tsx
|
|
743
|
-
const ConfigurationListItem = memo((
|
|
1473
|
+
const ConfigurationListItem = memo((t0) => {
|
|
1474
|
+
const $ = c(59);
|
|
1475
|
+
if ($[0] !== "49b457e4243ed5368ffc15725d84d290ce5fe7173cb1a11ee0a1be10ae181259") {
|
|
1476
|
+
for (let $i = 0; $i < 59; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
1477
|
+
$[0] = "49b457e4243ed5368ffc15725d84d290ce5fe7173cb1a11ee0a1be10ae181259";
|
|
1478
|
+
}
|
|
1479
|
+
const { value, id, onUpdate, onRemove, required: t1 } = t0;
|
|
1480
|
+
const required = t1 === void 0 ? false : t1;
|
|
744
1481
|
const [activeConfiguration, setActiveConfiguration] = useState(null);
|
|
745
1482
|
const [valueToDelete, setValueToDelete] = useState(null);
|
|
746
1483
|
const deleteTimeout = useRef(void 0);
|
|
747
1484
|
const isActive = activeConfiguration === id;
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
setValueToDelete(
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
}
|
|
759
|
-
const
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
1485
|
+
let t2;
|
|
1486
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1487
|
+
t2 = (key) => {
|
|
1488
|
+
clearTimeout(deleteTimeout.current);
|
|
1489
|
+
setValueToDelete(key);
|
|
1490
|
+
deleteTimeout.current = setTimeout(() => {
|
|
1491
|
+
setValueToDelete(null);
|
|
1492
|
+
}, 5e3);
|
|
1493
|
+
};
|
|
1494
|
+
$[1] = t2;
|
|
1495
|
+
} else t2 = $[1];
|
|
1496
|
+
const onDelete = t2;
|
|
1497
|
+
let t3;
|
|
1498
|
+
if ($[2] !== id || $[3] !== required) {
|
|
1499
|
+
t3 = () => {
|
|
1500
|
+
if (required) return;
|
|
1501
|
+
setActiveConfiguration(id);
|
|
1502
|
+
};
|
|
1503
|
+
$[2] = id;
|
|
1504
|
+
$[3] = required;
|
|
1505
|
+
$[4] = t3;
|
|
1506
|
+
} else t3 = $[4];
|
|
1507
|
+
const onMouseOver = t3;
|
|
1508
|
+
let t4;
|
|
1509
|
+
if ($[5] !== required) {
|
|
1510
|
+
t4 = () => {
|
|
1511
|
+
if (required) return;
|
|
1512
|
+
setActiveConfiguration(null);
|
|
1513
|
+
};
|
|
1514
|
+
$[5] = required;
|
|
1515
|
+
$[6] = t4;
|
|
1516
|
+
} else t4 = $[6];
|
|
1517
|
+
const onMouseLeave = t4;
|
|
1518
|
+
const t5 = isActive && "bg-card";
|
|
1519
|
+
let t6;
|
|
1520
|
+
if ($[7] !== t5) {
|
|
1521
|
+
t6 = cn("grid grid-cols-[auto_1fr_auto] items-center py-2 px-4 bg-muted/30 rounded-lg gap-2", t5);
|
|
1522
|
+
$[7] = t5;
|
|
1523
|
+
$[8] = t6;
|
|
1524
|
+
} else t6 = $[8];
|
|
1525
|
+
let t7;
|
|
1526
|
+
if ($[9] !== id || $[10] !== onUpdate) {
|
|
1527
|
+
t7 = (checked) => onUpdate(id, "active", checked);
|
|
1528
|
+
$[9] = id;
|
|
1529
|
+
$[10] = onUpdate;
|
|
1530
|
+
$[11] = t7;
|
|
1531
|
+
} else t7 = $[11];
|
|
1532
|
+
let t8;
|
|
1533
|
+
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1534
|
+
t8 = /* @__PURE__ */ jsx(Check, { className: "h-3 w-3" });
|
|
1535
|
+
$[12] = t8;
|
|
1536
|
+
} else t8 = $[12];
|
|
1537
|
+
let t9;
|
|
1538
|
+
if ($[13] !== required || $[14] !== t7 || $[15] !== value.active) {
|
|
1539
|
+
t9 = /* @__PURE__ */ jsx(Checkbox, {
|
|
1540
|
+
checked: value.active,
|
|
1541
|
+
onCheckedChange: t7,
|
|
1542
|
+
disabled: required,
|
|
1543
|
+
children: t8
|
|
1544
|
+
});
|
|
1545
|
+
$[13] = required;
|
|
1546
|
+
$[14] = t7;
|
|
1547
|
+
$[15] = value.active;
|
|
1548
|
+
$[16] = t9;
|
|
1549
|
+
} else t9 = $[16];
|
|
1550
|
+
const t10 = !value.active;
|
|
1551
|
+
const t11 = required ? "outlineReadonly" : "outline";
|
|
1552
|
+
const t12 = `name-${id}`;
|
|
1553
|
+
let t13;
|
|
1554
|
+
if ($[17] !== id || $[18] !== onUpdate) {
|
|
1555
|
+
t13 = (e) => onUpdate(id, "name", e.target.value);
|
|
1556
|
+
$[17] = id;
|
|
1557
|
+
$[18] = onUpdate;
|
|
1558
|
+
$[19] = t13;
|
|
1559
|
+
} else t13 = $[19];
|
|
1560
|
+
let t14;
|
|
1561
|
+
if ($[20] !== required || $[21] !== t10 || $[22] !== t11 || $[23] !== t12 || $[24] !== t13 || $[25] !== value.name) {
|
|
1562
|
+
t14 = /* @__PURE__ */ jsx(Input, {
|
|
1563
|
+
readOnly: required,
|
|
1564
|
+
disabled: t10,
|
|
1565
|
+
variant: t11,
|
|
1566
|
+
id: t12,
|
|
1567
|
+
defaultValue: value.name,
|
|
1568
|
+
onBlur: t13,
|
|
1569
|
+
placeholder: "Name",
|
|
1570
|
+
className: "h-8"
|
|
1571
|
+
});
|
|
1572
|
+
$[20] = required;
|
|
1573
|
+
$[21] = t10;
|
|
1574
|
+
$[22] = t11;
|
|
1575
|
+
$[23] = t12;
|
|
1576
|
+
$[24] = t13;
|
|
1577
|
+
$[25] = value.name;
|
|
1578
|
+
$[26] = t14;
|
|
1579
|
+
} else t14 = $[26];
|
|
1580
|
+
const t15 = !value.active;
|
|
1581
|
+
const t16 = `value-${id}`;
|
|
1582
|
+
let t17;
|
|
1583
|
+
if ($[27] !== id || $[28] !== onUpdate) {
|
|
1584
|
+
t17 = (e_0) => onUpdate(id, "value", e_0.target.value);
|
|
1585
|
+
$[27] = id;
|
|
1586
|
+
$[28] = onUpdate;
|
|
1587
|
+
$[29] = t17;
|
|
1588
|
+
} else t17 = $[29];
|
|
1589
|
+
let t18;
|
|
1590
|
+
if ($[30] !== t15 || $[31] !== t16 || $[32] !== t17 || $[33] !== value.value) {
|
|
1591
|
+
t18 = /* @__PURE__ */ jsx(Input, {
|
|
1592
|
+
disabled: t15,
|
|
1593
|
+
variant: "outline",
|
|
1594
|
+
id: t16,
|
|
1595
|
+
defaultValue: value.value,
|
|
1596
|
+
onBlur: t17,
|
|
1597
|
+
placeholder: "Value",
|
|
1598
|
+
className: "h-8"
|
|
1599
|
+
});
|
|
1600
|
+
$[30] = t15;
|
|
1601
|
+
$[31] = t16;
|
|
1602
|
+
$[32] = t17;
|
|
1603
|
+
$[33] = value.value;
|
|
1604
|
+
$[34] = t18;
|
|
1605
|
+
} else t18 = $[34];
|
|
1606
|
+
let t19;
|
|
1607
|
+
if ($[35] !== t14 || $[36] !== t18) {
|
|
1608
|
+
t19 = /* @__PURE__ */ jsxs("div", {
|
|
1609
|
+
className: "grid grid-cols-2 gap-2",
|
|
1610
|
+
children: [t14, t18]
|
|
1611
|
+
});
|
|
1612
|
+
$[35] = t14;
|
|
1613
|
+
$[36] = t18;
|
|
1614
|
+
$[37] = t19;
|
|
1615
|
+
} else t19 = $[37];
|
|
1616
|
+
let t20;
|
|
1617
|
+
if ($[38] !== id || $[39] !== onRemove || $[40] !== valueToDelete) {
|
|
1618
|
+
t20 = () => {
|
|
1619
|
+
if (valueToDelete === id) onRemove?.(id);
|
|
1620
|
+
else onDelete(id);
|
|
1621
|
+
};
|
|
1622
|
+
$[38] = id;
|
|
1623
|
+
$[39] = onRemove;
|
|
1624
|
+
$[40] = valueToDelete;
|
|
1625
|
+
$[41] = t20;
|
|
1626
|
+
} else t20 = $[41];
|
|
1627
|
+
const t21 = isActive && "opacity-100";
|
|
1628
|
+
let t22;
|
|
1629
|
+
if ($[42] !== t21) {
|
|
1630
|
+
t22 = cn("h-6 w-6 opacity-0 transition-opacity duration-200", t21);
|
|
1631
|
+
$[42] = t21;
|
|
1632
|
+
$[43] = t22;
|
|
1633
|
+
} else t22 = $[43];
|
|
1634
|
+
const t23 = valueToDelete === id && isActive ? "Click again to remove" : "Remove";
|
|
1635
|
+
let t24;
|
|
1636
|
+
if ($[44] !== id || $[45] !== valueToDelete) {
|
|
1637
|
+
t24 = valueToDelete === id ? /* @__PURE__ */ jsx(AlertCircle, { className: "h-3 w-3 text-destructive" }) : /* @__PURE__ */ jsx(Trash2, { className: "h-3 w-3" });
|
|
1638
|
+
$[44] = id;
|
|
1639
|
+
$[45] = valueToDelete;
|
|
1640
|
+
$[46] = t24;
|
|
1641
|
+
} else t24 = $[46];
|
|
1642
|
+
let t25;
|
|
1643
|
+
if ($[47] !== t20 || $[48] !== t22 || $[49] !== t23 || $[50] !== t24) {
|
|
1644
|
+
t25 = /* @__PURE__ */ jsx(Button, {
|
|
1645
|
+
variant: "ghost",
|
|
1646
|
+
size: "icon",
|
|
1647
|
+
onClick: t20,
|
|
1648
|
+
className: t22,
|
|
1649
|
+
title: t23,
|
|
1650
|
+
children: t24
|
|
1651
|
+
});
|
|
1652
|
+
$[47] = t20;
|
|
1653
|
+
$[48] = t22;
|
|
1654
|
+
$[49] = t23;
|
|
1655
|
+
$[50] = t24;
|
|
1656
|
+
$[51] = t25;
|
|
1657
|
+
} else t25 = $[51];
|
|
1658
|
+
let t26;
|
|
1659
|
+
if ($[52] !== onMouseLeave || $[53] !== onMouseOver || $[54] !== t19 || $[55] !== t25 || $[56] !== t6 || $[57] !== t9) {
|
|
1660
|
+
t26 = /* @__PURE__ */ jsxs("div", {
|
|
1661
|
+
className: t6,
|
|
1662
|
+
onMouseOver,
|
|
1663
|
+
onMouseLeave,
|
|
1664
|
+
children: [
|
|
1665
|
+
t9,
|
|
1666
|
+
t19,
|
|
1667
|
+
t25
|
|
1668
|
+
]
|
|
1669
|
+
});
|
|
1670
|
+
$[52] = onMouseLeave;
|
|
1671
|
+
$[53] = onMouseOver;
|
|
1672
|
+
$[54] = t19;
|
|
1673
|
+
$[55] = t25;
|
|
1674
|
+
$[56] = t6;
|
|
1675
|
+
$[57] = t9;
|
|
1676
|
+
$[58] = t26;
|
|
1677
|
+
} else t26 = $[58];
|
|
1678
|
+
return t26;
|
|
808
1679
|
});
|
|
809
1680
|
|
|
810
1681
|
//#endregion
|
|
@@ -844,12 +1715,12 @@ const SidePanelHeadersTab = () => {
|
|
|
844
1715
|
})
|
|
845
1716
|
}), /* @__PURE__ */ jsxs("div", {
|
|
846
1717
|
className: "p-2",
|
|
847
|
-
children: [Object.entries(headers).map(([
|
|
1718
|
+
children: [Object.entries(headers).map(([key_0, header]) => /* @__PURE__ */ jsx(ConfigurationListItem, {
|
|
848
1719
|
value: header,
|
|
849
|
-
id:
|
|
1720
|
+
id: key_0,
|
|
850
1721
|
onUpdate: updateHeader,
|
|
851
1722
|
onRemove: removeHeaders
|
|
852
|
-
},
|
|
1723
|
+
}, key_0)), Object.entries(headers).length === 0 && /* @__PURE__ */ jsx("div", {
|
|
853
1724
|
className: "grid grid-cols-1 items-center h-full",
|
|
854
1725
|
children: /* @__PURE__ */ jsx("div", {
|
|
855
1726
|
className: "text-sm text-muted-foreground text-center",
|
|
@@ -864,57 +1735,127 @@ const SidePanelHeadersTab = () => {
|
|
|
864
1735
|
//#region src/hooks/use-path-url.ts
|
|
865
1736
|
const queryParamsSelector = (state) => Object.values(getQueryParamsSelector(state)).filter((param) => param.active && param.value !== "" && param.name !== "");
|
|
866
1737
|
const usePathUrl = (path) => {
|
|
1738
|
+
const $ = c(6);
|
|
1739
|
+
if ($[0] !== "7e3e8f17b13eb81e00060ed9f39b6042cd1d077a2d43f0c27437d6309314f3aa") {
|
|
1740
|
+
for (let $i = 0; $i < 6; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
1741
|
+
$[0] = "7e3e8f17b13eb81e00060ed9f39b6042cd1d077a2d43f0c27437d6309314f3aa";
|
|
1742
|
+
}
|
|
867
1743
|
const pathParams = useEndpointConfiguration(useShallow(getPathParamsSelector));
|
|
868
1744
|
const queryParams = useEndpointConfiguration(useShallow(queryParamsSelector));
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
}
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
1745
|
+
let t0;
|
|
1746
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1747
|
+
t0 = /:(\w+)/g;
|
|
1748
|
+
$[1] = t0;
|
|
1749
|
+
} else t0 = $[1];
|
|
1750
|
+
let t1;
|
|
1751
|
+
if ($[2] !== pathParams) {
|
|
1752
|
+
t1 = (match, p1) => pathParams[p1]?.value || match;
|
|
1753
|
+
$[2] = pathParams;
|
|
1754
|
+
$[3] = t1;
|
|
1755
|
+
} else t1 = $[3];
|
|
1756
|
+
const url = path.replace(t0, t1);
|
|
1757
|
+
let t2;
|
|
1758
|
+
if ($[4] !== queryParams) {
|
|
1759
|
+
t2 = queryParams.length > 0 ? `?${queryParams.map(_temp$2).join("&")}` : "";
|
|
1760
|
+
$[4] = queryParams;
|
|
1761
|
+
$[5] = t2;
|
|
1762
|
+
} else t2 = $[5];
|
|
1763
|
+
return url + t2;
|
|
878
1764
|
};
|
|
1765
|
+
function _temp$2(param) {
|
|
1766
|
+
return `${param.name}=${param.value}`;
|
|
1767
|
+
}
|
|
879
1768
|
|
|
880
1769
|
//#endregion
|
|
881
1770
|
//#region src/components/endpoint-path-preview.tsx
|
|
882
|
-
const EndpointPathPreview = (
|
|
883
|
-
const
|
|
1771
|
+
const EndpointPathPreview = (t0) => {
|
|
1772
|
+
const $ = c(17);
|
|
1773
|
+
if ($[0] !== "d28e3e9329232a2b4ad7f30814822a8f9a40f9e19a3e5c4e80f13d7dbd0fed07") {
|
|
1774
|
+
for (let $i = 0; $i < 17; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
1775
|
+
$[0] = "d28e3e9329232a2b4ad7f30814822a8f9a40f9e19a3e5c4e80f13d7dbd0fed07";
|
|
1776
|
+
}
|
|
1777
|
+
const { path, baseUrl: t1 } = t0;
|
|
1778
|
+
const fullUrl = `${t1 === void 0 ? window.location.origin : t1}${usePathUrl(path)}`;
|
|
884
1779
|
const [copied, setCopied] = useState(false);
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
1780
|
+
let t2;
|
|
1781
|
+
if ($[1] !== fullUrl) {
|
|
1782
|
+
t2 = async () => {
|
|
1783
|
+
try {
|
|
1784
|
+
await navigator.clipboard.writeText(fullUrl);
|
|
1785
|
+
setCopied(true);
|
|
1786
|
+
setTimeout(() => setCopied(false), 2e3);
|
|
1787
|
+
} catch (t3$1) {
|
|
1788
|
+
const err = t3$1;
|
|
1789
|
+
console.error("Failed to copy URL:", err);
|
|
1790
|
+
}
|
|
1791
|
+
};
|
|
1792
|
+
$[1] = fullUrl;
|
|
1793
|
+
$[2] = t2;
|
|
1794
|
+
} else t2 = $[2];
|
|
1795
|
+
const handleCopy = t2;
|
|
1796
|
+
let t3;
|
|
1797
|
+
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1798
|
+
t3 = /* @__PURE__ */ jsx("div", {
|
|
897
1799
|
className: "text-sm font-medium py-2",
|
|
898
1800
|
children: "URL Preview"
|
|
899
|
-
})
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
1801
|
+
});
|
|
1802
|
+
$[3] = t3;
|
|
1803
|
+
} else t3 = $[3];
|
|
1804
|
+
let t4;
|
|
1805
|
+
if ($[4] !== fullUrl) {
|
|
1806
|
+
t4 = /* @__PURE__ */ jsx("div", {
|
|
1807
|
+
className: "min-w-0",
|
|
1808
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
1809
|
+
className: "font-medium text-xs text-muted-foreground truncate",
|
|
1810
|
+
title: fullUrl,
|
|
1811
|
+
children: fullUrl
|
|
1812
|
+
})
|
|
1813
|
+
});
|
|
1814
|
+
$[4] = fullUrl;
|
|
1815
|
+
$[5] = t4;
|
|
1816
|
+
} else t4 = $[5];
|
|
1817
|
+
const t5 = copied ? "text-green-400" : "text-muted-foreground";
|
|
1818
|
+
let t6;
|
|
1819
|
+
if ($[6] !== t5) {
|
|
1820
|
+
t6 = cn("w-3 h-3 grid place-items-center transition-colors cursor-pointer", t5);
|
|
1821
|
+
$[6] = t5;
|
|
1822
|
+
$[7] = t6;
|
|
1823
|
+
} else t6 = $[7];
|
|
1824
|
+
let t7;
|
|
1825
|
+
if ($[8] !== copied) {
|
|
1826
|
+
t7 = copied ? /* @__PURE__ */ jsx(Check, { className: "w-2.5 h-2.5" }) : /* @__PURE__ */ jsx(Copy, { className: "w-2.5 h-2.5" });
|
|
1827
|
+
$[8] = copied;
|
|
1828
|
+
$[9] = t7;
|
|
1829
|
+
} else t7 = $[9];
|
|
1830
|
+
let t8;
|
|
1831
|
+
if ($[10] !== handleCopy || $[11] !== t6 || $[12] !== t7) {
|
|
1832
|
+
t8 = /* @__PURE__ */ jsx(Button, {
|
|
1833
|
+
onClick: handleCopy,
|
|
1834
|
+
className: t6,
|
|
1835
|
+
variant: "icon",
|
|
1836
|
+
size: "sm",
|
|
1837
|
+
"aria-label": "Copy URL",
|
|
1838
|
+
children: t7
|
|
1839
|
+
});
|
|
1840
|
+
$[10] = handleCopy;
|
|
1841
|
+
$[11] = t6;
|
|
1842
|
+
$[12] = t7;
|
|
1843
|
+
$[13] = t8;
|
|
1844
|
+
} else t8 = $[13];
|
|
1845
|
+
let t9;
|
|
1846
|
+
if ($[14] !== t4 || $[15] !== t8) {
|
|
1847
|
+
t9 = /* @__PURE__ */ jsxs("div", {
|
|
1848
|
+
className: "grid grid-cols-[auto_1fr] items-center gap-5 px-5 relative border-b border-border",
|
|
1849
|
+
children: [t3, /* @__PURE__ */ jsxs("div", {
|
|
1850
|
+
className: "bg-muted-foreground/10 box-border grid grid-cols-[1fr_auto] gap-1 h-6 items-center px-2 py-1 rounded border border-border",
|
|
1851
|
+
children: [t4, t8]
|
|
915
1852
|
})]
|
|
916
|
-
})
|
|
917
|
-
|
|
1853
|
+
});
|
|
1854
|
+
$[14] = t4;
|
|
1855
|
+
$[15] = t8;
|
|
1856
|
+
$[16] = t9;
|
|
1857
|
+
} else t9 = $[16];
|
|
1858
|
+
return t9;
|
|
918
1859
|
};
|
|
919
1860
|
|
|
920
1861
|
//#endregion
|
|
@@ -953,13 +1894,13 @@ const SidePanelParamsTab = ({ path }) => {
|
|
|
953
1894
|
}
|
|
954
1895
|
});
|
|
955
1896
|
}, [queryParams, setQueryParams]);
|
|
956
|
-
const updatePathParam = useCallback((
|
|
957
|
-
if (!
|
|
1897
|
+
const updatePathParam = useCallback((key_0, field_0, value_0) => {
|
|
1898
|
+
if (!key_0) return;
|
|
958
1899
|
setPathParams({
|
|
959
1900
|
...pathParams,
|
|
960
|
-
[
|
|
961
|
-
...pathParams[
|
|
962
|
-
[
|
|
1901
|
+
[key_0]: {
|
|
1902
|
+
...pathParams[key_0],
|
|
1903
|
+
[field_0]: value_0
|
|
963
1904
|
}
|
|
964
1905
|
});
|
|
965
1906
|
}, [pathParams, setPathParams]);
|
|
@@ -999,12 +1940,12 @@ const SidePanelParamsTab = ({ path }) => {
|
|
|
999
1940
|
className: "text-sm font-medium pl-3",
|
|
1000
1941
|
children: "Query parameters"
|
|
1001
1942
|
}),
|
|
1002
|
-
Object.entries(queryParams).map(([
|
|
1003
|
-
value:
|
|
1004
|
-
id:
|
|
1943
|
+
Object.entries(queryParams).map(([key_1, param_0]) => /* @__PURE__ */ jsx(ConfigurationListItem, {
|
|
1944
|
+
value: param_0,
|
|
1945
|
+
id: key_1,
|
|
1005
1946
|
onUpdate: updateParam,
|
|
1006
1947
|
onRemove: removeQueryParams
|
|
1007
|
-
},
|
|
1948
|
+
}, key_1)),
|
|
1008
1949
|
Object.entries(queryParams).length === 0 && /* @__PURE__ */ jsx("div", {
|
|
1009
1950
|
className: "grid grid-cols-1 items-center h-full",
|
|
1010
1951
|
children: /* @__PURE__ */ jsx("div", {
|
|
@@ -1022,19 +1963,64 @@ const SidePanelParamsTab = ({ path }) => {
|
|
|
1022
1963
|
//#endregion
|
|
1023
1964
|
//#region src/hooks/use-state-stream.ts
|
|
1024
1965
|
const useStateStream = (object) => {
|
|
1025
|
-
const
|
|
1966
|
+
const $ = c(15);
|
|
1967
|
+
if ($[0] !== "285f0ed50e2dd4fc3015728ea5aa13d2c7f564b6cdec2adc1e1f9b84c6cc298a") {
|
|
1968
|
+
for (let $i = 0; $i < 15; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
1969
|
+
$[0] = "285f0ed50e2dd4fc3015728ea5aa13d2c7f564b6cdec2adc1e1f9b84c6cc298a";
|
|
1970
|
+
}
|
|
1971
|
+
let t0;
|
|
1972
|
+
if ($[1] !== object) {
|
|
1973
|
+
t0 = typeof object === "string" ? {} : object || {};
|
|
1974
|
+
$[1] = object;
|
|
1975
|
+
$[2] = t0;
|
|
1976
|
+
} else t0 = $[2];
|
|
1977
|
+
let __motia;
|
|
1978
|
+
let rest;
|
|
1979
|
+
if ($[3] !== t0) {
|
|
1980
|
+
({__motia, ...rest} = t0);
|
|
1981
|
+
$[3] = t0;
|
|
1982
|
+
$[4] = __motia;
|
|
1983
|
+
$[5] = rest;
|
|
1984
|
+
} else {
|
|
1985
|
+
__motia = $[4];
|
|
1986
|
+
rest = $[5];
|
|
1987
|
+
}
|
|
1026
1988
|
const { data } = useStreamItem(__motia);
|
|
1027
1989
|
const originalData = Array.isArray(object) ? object : rest || object;
|
|
1028
|
-
if (typeof object === "string")
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1990
|
+
if (typeof object === "string") {
|
|
1991
|
+
let t1$1;
|
|
1992
|
+
if ($[6] !== object) {
|
|
1993
|
+
t1$1 = {
|
|
1994
|
+
data: object,
|
|
1995
|
+
originalData: object,
|
|
1996
|
+
isStreamed: false
|
|
1997
|
+
};
|
|
1998
|
+
$[6] = object;
|
|
1999
|
+
$[7] = t1$1;
|
|
2000
|
+
} else t1$1 = $[7];
|
|
2001
|
+
return t1$1;
|
|
2002
|
+
}
|
|
2003
|
+
let t1;
|
|
2004
|
+
if ($[8] !== data || $[9] !== originalData) {
|
|
2005
|
+
t1 = JSON.stringify(data || originalData, null, 2);
|
|
2006
|
+
$[8] = data;
|
|
2007
|
+
$[9] = originalData;
|
|
2008
|
+
$[10] = t1;
|
|
2009
|
+
} else t1 = $[10];
|
|
2010
|
+
const t2 = !!__motia;
|
|
2011
|
+
let t3;
|
|
2012
|
+
if ($[11] !== originalData || $[12] !== t1 || $[13] !== t2) {
|
|
2013
|
+
t3 = {
|
|
2014
|
+
data: t1,
|
|
2015
|
+
originalData,
|
|
2016
|
+
isStreamed: t2
|
|
2017
|
+
};
|
|
2018
|
+
$[11] = originalData;
|
|
2019
|
+
$[12] = t1;
|
|
2020
|
+
$[13] = t2;
|
|
2021
|
+
$[14] = t3;
|
|
2022
|
+
} else t3 = $[14];
|
|
2023
|
+
return t3;
|
|
1038
2024
|
};
|
|
1039
2025
|
|
|
1040
2026
|
//#endregion
|
|
@@ -1109,19 +2095,59 @@ const getStatusMessage = (statusCode) => {
|
|
|
1109
2095
|
|
|
1110
2096
|
//#endregion
|
|
1111
2097
|
//#region src/play/response-code.tsx
|
|
1112
|
-
const ResponseCode = (
|
|
1113
|
-
const
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
]
|
|
1124
|
-
}
|
|
2098
|
+
const ResponseCode = (t0) => {
|
|
2099
|
+
const $ = c(13);
|
|
2100
|
+
if ($[0] !== "0a8e4c92b858ecb81d25d971cc42d057e6dc5a30e6757fd87f3755a59a3871b2") {
|
|
2101
|
+
for (let $i = 0; $i < 13; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
2102
|
+
$[0] = "0a8e4c92b858ecb81d25d971cc42d057e6dc5a30e6757fd87f3755a59a3871b2";
|
|
2103
|
+
}
|
|
2104
|
+
const { statusCode } = t0;
|
|
2105
|
+
let t1;
|
|
2106
|
+
if ($[1] !== statusCode) {
|
|
2107
|
+
t1 = getStatusMessage(statusCode);
|
|
2108
|
+
$[1] = statusCode;
|
|
2109
|
+
$[2] = t1;
|
|
2110
|
+
} else t1 = $[2];
|
|
2111
|
+
const statusMessage = t1;
|
|
2112
|
+
const isSuccess = statusCode > 0 && statusCode < 400;
|
|
2113
|
+
const isWarning = statusCode >= 400 && statusCode < 500;
|
|
2114
|
+
const isError = statusCode >= 500;
|
|
2115
|
+
const t2 = isWarning && "dark:bg-[#EAB71F]/20 dark:text-[#EAB71F] bg-[#EAB71F] text-white";
|
|
2116
|
+
const t3 = isError && "dark:bg-[#F8367D]/20 dark:text-[#F8367D] bg-[#F8367D] text-white";
|
|
2117
|
+
const t4 = isSuccess && "dark:bg-accent-200 dark:text-primary bg-accent text-white";
|
|
2118
|
+
let t5;
|
|
2119
|
+
if ($[3] !== t2 || $[4] !== t3 || $[5] !== t4) {
|
|
2120
|
+
t5 = cn("px-2 py-1 rounded-sm flex items-center gap-1", t2, t3, t4);
|
|
2121
|
+
$[3] = t2;
|
|
2122
|
+
$[4] = t3;
|
|
2123
|
+
$[5] = t4;
|
|
2124
|
+
$[6] = t5;
|
|
2125
|
+
} else t5 = $[6];
|
|
2126
|
+
let t6;
|
|
2127
|
+
if ($[7] !== statusCode) {
|
|
2128
|
+
t6 = /* @__PURE__ */ jsx("span", {
|
|
2129
|
+
className: "font-bold font-mono",
|
|
2130
|
+
children: statusCode
|
|
2131
|
+
});
|
|
2132
|
+
$[7] = statusCode;
|
|
2133
|
+
$[8] = t6;
|
|
2134
|
+
} else t6 = $[8];
|
|
2135
|
+
let t7;
|
|
2136
|
+
if ($[9] !== statusMessage || $[10] !== t5 || $[11] !== t6) {
|
|
2137
|
+
t7 = /* @__PURE__ */ jsxs("div", {
|
|
2138
|
+
className: t5,
|
|
2139
|
+
children: [
|
|
2140
|
+
t6,
|
|
2141
|
+
" ",
|
|
2142
|
+
statusMessage
|
|
2143
|
+
]
|
|
2144
|
+
});
|
|
2145
|
+
$[9] = statusMessage;
|
|
2146
|
+
$[10] = t5;
|
|
2147
|
+
$[11] = t6;
|
|
2148
|
+
$[12] = t7;
|
|
2149
|
+
} else t7 = $[12];
|
|
2150
|
+
return t7;
|
|
1125
2151
|
};
|
|
1126
2152
|
|
|
1127
2153
|
//#endregion
|
|
@@ -1140,25 +2166,44 @@ const useLanguage = (contentType) => {
|
|
|
1140
2166
|
if (contentType?.includes("html")) return "html";
|
|
1141
2167
|
return "text";
|
|
1142
2168
|
};
|
|
1143
|
-
const ResponseContent = (
|
|
1144
|
-
const
|
|
2169
|
+
const ResponseContent = (t0) => {
|
|
2170
|
+
const $ = c(14);
|
|
2171
|
+
if ($[0] !== "51b73d23c1291874f81ba55f0a6e81eecd3ad0cede326e91ed482cd0ab995a8f") {
|
|
2172
|
+
for (let $i = 0; $i < 14; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
2173
|
+
$[0] = "51b73d23c1291874f81ba55f0a6e81eecd3ad0cede326e91ed482cd0ab995a8f";
|
|
2174
|
+
}
|
|
2175
|
+
const { code, blob, contentType } = t0;
|
|
2176
|
+
const themeStyle = useThemeStore(_temp$1) === "dark" ? atomDark : oneLight;
|
|
1145
2177
|
const language = useLanguage(contentType);
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
2178
|
+
let t1;
|
|
2179
|
+
if ($[1] !== blob) {
|
|
2180
|
+
t1 = () => {
|
|
2181
|
+
if (blob) {
|
|
2182
|
+
const url = URL.createObjectURL(blob);
|
|
2183
|
+
window.open(url, "_blank");
|
|
2184
|
+
}
|
|
2185
|
+
};
|
|
2186
|
+
$[1] = blob;
|
|
2187
|
+
$[2] = t1;
|
|
2188
|
+
} else t1 = $[2];
|
|
2189
|
+
const onDownload = t1;
|
|
2190
|
+
let t2;
|
|
2191
|
+
if ($[3] !== blob || $[4] !== onDownload) {
|
|
2192
|
+
t2 = blob && /* @__PURE__ */ jsx("div", {
|
|
1155
2193
|
className: "flex p-8 justify-center",
|
|
1156
2194
|
children: /* @__PURE__ */ jsxs(Button, {
|
|
1157
2195
|
variant: "default",
|
|
1158
2196
|
onClick: onDownload,
|
|
1159
2197
|
children: [/* @__PURE__ */ jsx(Download, { className: "h-4 w-4" }), " Download"]
|
|
1160
2198
|
})
|
|
1161
|
-
})
|
|
2199
|
+
});
|
|
2200
|
+
$[3] = blob;
|
|
2201
|
+
$[4] = onDownload;
|
|
2202
|
+
$[5] = t2;
|
|
2203
|
+
} else t2 = $[5];
|
|
2204
|
+
let t3;
|
|
2205
|
+
if ($[6] !== blob || $[7] !== code || $[8] !== language || $[9] !== themeStyle) {
|
|
2206
|
+
t3 = !blob && code && /* @__PURE__ */ jsx(Prism, {
|
|
1162
2207
|
showLineNumbers: true,
|
|
1163
2208
|
language,
|
|
1164
2209
|
style: themeStyle,
|
|
@@ -1166,76 +2211,182 @@ const ResponseContent = ({ code, blob, contentType }) => {
|
|
|
1166
2211
|
customStyle,
|
|
1167
2212
|
wrapLines: true,
|
|
1168
2213
|
children: code
|
|
1169
|
-
})
|
|
1170
|
-
|
|
2214
|
+
});
|
|
2215
|
+
$[6] = blob;
|
|
2216
|
+
$[7] = code;
|
|
2217
|
+
$[8] = language;
|
|
2218
|
+
$[9] = themeStyle;
|
|
2219
|
+
$[10] = t3;
|
|
2220
|
+
} else t3 = $[10];
|
|
2221
|
+
let t4;
|
|
2222
|
+
if ($[11] !== t2 || $[12] !== t3) {
|
|
2223
|
+
t4 = /* @__PURE__ */ jsxs("div", {
|
|
2224
|
+
className: "flex flex-col h-full overflow-y-auto",
|
|
2225
|
+
children: [t2, t3]
|
|
2226
|
+
});
|
|
2227
|
+
$[11] = t2;
|
|
2228
|
+
$[12] = t3;
|
|
2229
|
+
$[13] = t4;
|
|
2230
|
+
} else t4 = $[13];
|
|
2231
|
+
return t4;
|
|
1171
2232
|
};
|
|
2233
|
+
function _temp$1(state) {
|
|
2234
|
+
return state.theme;
|
|
2235
|
+
}
|
|
1172
2236
|
|
|
1173
2237
|
//#endregion
|
|
1174
2238
|
//#region src/play/side-panel-response.tsx
|
|
1175
2239
|
const SidePanelResponse = memo(() => {
|
|
2240
|
+
const $ = c(29);
|
|
2241
|
+
if ($[0] !== "c41d9d0c255bfb25883f458c9673498cbc698b0e44623ab8537e78707a43852c") {
|
|
2242
|
+
for (let $i = 0; $i < 29; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
2243
|
+
$[0] = "c41d9d0c255bfb25883f458c9673498cbc698b0e44623ab8537e78707a43852c";
|
|
2244
|
+
}
|
|
1176
2245
|
const { setResponse } = useEndpointConfiguration();
|
|
1177
2246
|
const response = useEndpointConfiguration(getResponseSelector);
|
|
1178
2247
|
const { data } = useStateStream(response?.body instanceof Blob ? void 0 : response?.body);
|
|
1179
2248
|
const [activeTab, setActiveTab] = useState("preview");
|
|
1180
|
-
|
|
2249
|
+
let t0;
|
|
2250
|
+
if ($[1] !== setResponse) {
|
|
2251
|
+
t0 = () => setResponse(void 0);
|
|
2252
|
+
$[1] = setResponse;
|
|
2253
|
+
$[2] = t0;
|
|
2254
|
+
} else t0 = $[2];
|
|
2255
|
+
const onClose = t0;
|
|
1181
2256
|
if (!response) return null;
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
})
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
2257
|
+
let t1;
|
|
2258
|
+
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2259
|
+
t1 = (value) => setActiveTab(value);
|
|
2260
|
+
$[3] = t1;
|
|
2261
|
+
} else t1 = $[3];
|
|
2262
|
+
let t2;
|
|
2263
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2264
|
+
t2 = /* @__PURE__ */ jsxs(TabsList, { children: [/* @__PURE__ */ jsx(TabsTrigger, {
|
|
2265
|
+
value: "preview",
|
|
2266
|
+
className: "cursor-pointer",
|
|
2267
|
+
children: "Preview"
|
|
2268
|
+
}), /* @__PURE__ */ jsx(TabsTrigger, {
|
|
2269
|
+
value: "headers",
|
|
2270
|
+
className: "grid grid-cols-[auto_auto] gap-2 items-center cursor-pointer",
|
|
2271
|
+
children: "Headers"
|
|
2272
|
+
})] });
|
|
2273
|
+
$[4] = t2;
|
|
2274
|
+
} else t2 = $[4];
|
|
2275
|
+
let t3;
|
|
2276
|
+
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2277
|
+
t3 = /* @__PURE__ */ jsx(X, { className: "h-4 w-4" });
|
|
2278
|
+
$[5] = t3;
|
|
2279
|
+
} else t3 = $[5];
|
|
2280
|
+
let t4;
|
|
2281
|
+
if ($[6] !== onClose) {
|
|
2282
|
+
t4 = /* @__PURE__ */ jsxs("div", {
|
|
2283
|
+
className: "grid grid-cols-[1fr_auto] items-center h-10 border-b px-5 bg-card",
|
|
2284
|
+
children: [t2, /* @__PURE__ */ jsx(Button, {
|
|
2285
|
+
variant: "ghost",
|
|
2286
|
+
size: "icon",
|
|
2287
|
+
onClick: onClose,
|
|
2288
|
+
children: t3
|
|
2289
|
+
})]
|
|
2290
|
+
});
|
|
2291
|
+
$[6] = onClose;
|
|
2292
|
+
$[7] = t4;
|
|
2293
|
+
} else t4 = $[7];
|
|
2294
|
+
let t5;
|
|
2295
|
+
if ($[8] !== response.statusCode) {
|
|
2296
|
+
t5 = /* @__PURE__ */ jsx(ResponseCode, { statusCode: response.statusCode });
|
|
2297
|
+
$[8] = response.statusCode;
|
|
2298
|
+
$[9] = t5;
|
|
2299
|
+
} else t5 = $[9];
|
|
2300
|
+
let t6;
|
|
2301
|
+
if ($[10] !== response.executionTime) {
|
|
2302
|
+
t6 = !!response.executionTime && /* @__PURE__ */ jsxs("div", {
|
|
2303
|
+
className: "text-muted-foreground bg-muted-foreground/10 px-2 py-1 rounded-sm",
|
|
2304
|
+
children: [response.executionTime, "ms"]
|
|
2305
|
+
});
|
|
2306
|
+
$[10] = response.executionTime;
|
|
2307
|
+
$[11] = t6;
|
|
2308
|
+
} else t6 = $[11];
|
|
2309
|
+
let t7;
|
|
2310
|
+
if ($[12] !== t5 || $[13] !== t6) {
|
|
2311
|
+
t7 = /* @__PURE__ */ jsx("div", {
|
|
2312
|
+
className: "sticky bottom-0 border-b border-border p-3 text-sm flex items-center gap-1 font-medium",
|
|
2313
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
2314
|
+
className: "flex flex-row items-center flex-1 gap-3",
|
|
2315
|
+
children: [t5, t6]
|
|
1235
2316
|
})
|
|
1236
|
-
|
|
1237
|
-
|
|
2317
|
+
});
|
|
2318
|
+
$[12] = t5;
|
|
2319
|
+
$[13] = t6;
|
|
2320
|
+
$[14] = t7;
|
|
2321
|
+
} else t7 = $[14];
|
|
2322
|
+
const t8 = response?.body instanceof Blob ? response.body : void 0;
|
|
2323
|
+
const t9 = response.headers["content-type"];
|
|
2324
|
+
let t10;
|
|
2325
|
+
if ($[15] !== data || $[16] !== t8 || $[17] !== t9) {
|
|
2326
|
+
t10 = /* @__PURE__ */ jsx(TabsContent, {
|
|
2327
|
+
value: "preview",
|
|
2328
|
+
children: /* @__PURE__ */ jsx(ResponseContent, {
|
|
2329
|
+
code: data,
|
|
2330
|
+
blob: t8,
|
|
2331
|
+
contentType: t9
|
|
2332
|
+
})
|
|
2333
|
+
});
|
|
2334
|
+
$[15] = data;
|
|
2335
|
+
$[16] = t8;
|
|
2336
|
+
$[17] = t9;
|
|
2337
|
+
$[18] = t10;
|
|
2338
|
+
} else t10 = $[18];
|
|
2339
|
+
let t11;
|
|
2340
|
+
if ($[19] !== response.headers) {
|
|
2341
|
+
t11 = response.headers && Object.entries(response.headers).map(_temp);
|
|
2342
|
+
$[19] = response.headers;
|
|
2343
|
+
$[20] = t11;
|
|
2344
|
+
} else t11 = $[20];
|
|
2345
|
+
let t12;
|
|
2346
|
+
if ($[21] !== t11) {
|
|
2347
|
+
t12 = /* @__PURE__ */ jsx(TabsContent, {
|
|
2348
|
+
value: "headers",
|
|
2349
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
2350
|
+
className: "grid grid-cols-[auto_minmax(0,1fr)] gap-4 p-4 overflow-auto auto-rows-max h-full",
|
|
2351
|
+
children: t11
|
|
2352
|
+
})
|
|
2353
|
+
});
|
|
2354
|
+
$[21] = t11;
|
|
2355
|
+
$[22] = t12;
|
|
2356
|
+
} else t12 = $[22];
|
|
2357
|
+
let t13;
|
|
2358
|
+
if ($[23] !== activeTab || $[24] !== t10 || $[25] !== t12 || $[26] !== t4 || $[27] !== t7) {
|
|
2359
|
+
t13 = /* @__PURE__ */ jsxs(Tabs, {
|
|
2360
|
+
value: activeTab,
|
|
2361
|
+
onValueChange: t1,
|
|
2362
|
+
className: "border-l border-border",
|
|
2363
|
+
"data-testid": "endpoint-response-container",
|
|
2364
|
+
children: [
|
|
2365
|
+
t4,
|
|
2366
|
+
t7,
|
|
2367
|
+
t10,
|
|
2368
|
+
t12
|
|
2369
|
+
]
|
|
2370
|
+
});
|
|
2371
|
+
$[23] = activeTab;
|
|
2372
|
+
$[24] = t10;
|
|
2373
|
+
$[25] = t12;
|
|
2374
|
+
$[26] = t4;
|
|
2375
|
+
$[27] = t7;
|
|
2376
|
+
$[28] = t13;
|
|
2377
|
+
} else t13 = $[28];
|
|
2378
|
+
return t13;
|
|
1238
2379
|
});
|
|
2380
|
+
function _temp(t0) {
|
|
2381
|
+
const [key, value_0] = t0;
|
|
2382
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
|
|
2383
|
+
className: "font-bold text-sm h-8 items-center grid whitespace-nowrap",
|
|
2384
|
+
children: key
|
|
2385
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
2386
|
+
className: "text-sm text-muted-foreground h-8 items-center grid whitespace-nowrap",
|
|
2387
|
+
children: value_0
|
|
2388
|
+
})] });
|
|
2389
|
+
}
|
|
1239
2390
|
|
|
1240
2391
|
//#endregion
|
|
1241
2392
|
//#region src/play/trigger-button.tsx
|
|
@@ -1248,8 +2399,8 @@ const TriggerButton = memo(({ method, path }) => {
|
|
|
1248
2399
|
const onClick = async () => {
|
|
1249
2400
|
try {
|
|
1250
2401
|
setIsLoading(true);
|
|
1251
|
-
const _headers = Object.values(headers).filter((header) => header.active && header.name !== "" && header.value !== "").reduce((acc,
|
|
1252
|
-
acc[
|
|
2402
|
+
const _headers = Object.values(headers).filter((header) => header.active && header.name !== "" && header.value !== "").reduce((acc, header_0) => {
|
|
2403
|
+
acc[header_0.name.toLowerCase()] = header_0.value;
|
|
1253
2404
|
return acc;
|
|
1254
2405
|
}, {});
|
|
1255
2406
|
const startTime = Date.now();
|
|
@@ -1284,157 +2435,416 @@ const TriggerButton = memo(({ method, path }) => {
|
|
|
1284
2435
|
const headersCountSelector = (state) => Object.keys(getHeadersSelector(state)).length;
|
|
1285
2436
|
const hasResponseSelector = (state) => getResponseSelector(state) !== void 0;
|
|
1286
2437
|
const paramsCountSelector = (state) => Object.keys(getQueryParamsSelector(state)).length;
|
|
1287
|
-
const SidePanel = memo((
|
|
2438
|
+
const SidePanel = memo((t0) => {
|
|
2439
|
+
const $ = c(62);
|
|
2440
|
+
if ($[0] !== "0020adea1162c54cf5aae85d8c5ed34a7262d6cfdf90ef6b8d89094328918944") {
|
|
2441
|
+
for (let $i = 0; $i < 62; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
2442
|
+
$[0] = "0020adea1162c54cf5aae85d8c5ed34a7262d6cfdf90ef6b8d89094328918944";
|
|
2443
|
+
}
|
|
2444
|
+
const { endpoint, onClose } = t0;
|
|
1288
2445
|
const [activeTab, setActiveTab] = useState(endpoint.method === "GET" || endpoint.method === "DELETE" ? "params" : "body");
|
|
1289
2446
|
const [isSpecOpen, setIsSpecOpen] = useState(false);
|
|
1290
2447
|
const headersCount = useEndpointConfiguration(useShallow(headersCountSelector));
|
|
1291
2448
|
const hasResponse = useEndpointConfiguration(useShallow(hasResponseSelector));
|
|
1292
2449
|
const pathParamsCount = usePathParams(endpoint.path).length;
|
|
1293
2450
|
const paramsCount = useEndpointConfiguration(useShallow(paramsCountSelector)) + pathParamsCount;
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
/* @__PURE__ */ jsx(TabsTrigger, {
|
|
1350
|
-
value: "body",
|
|
1351
|
-
className: "cursor-pointer",
|
|
1352
|
-
"data-testid": "endpoint-body-tab",
|
|
1353
|
-
children: "Body"
|
|
1354
|
-
}),
|
|
1355
|
-
/* @__PURE__ */ jsxs(TabsTrigger, {
|
|
1356
|
-
value: "headers",
|
|
1357
|
-
className: "grid grid-cols-[auto_auto] gap-2 items-center cursor-pointer",
|
|
1358
|
-
"data-testid": "endpoint-headers-tab",
|
|
1359
|
-
children: ["Headers", /* @__PURE__ */ jsx(Badge, {
|
|
1360
|
-
variant: "outline",
|
|
1361
|
-
className: "h-4 px-1.5 text-xs",
|
|
1362
|
-
children: headersCount
|
|
1363
|
-
})]
|
|
1364
|
-
})
|
|
1365
|
-
] }), /* @__PURE__ */ jsx(TriggerButton, {
|
|
1366
|
-
method: endpoint.method,
|
|
1367
|
-
path: endpoint.path.toString()
|
|
1368
|
-
})]
|
|
1369
|
-
}),
|
|
1370
|
-
/* @__PURE__ */ jsx(TabsContent, {
|
|
1371
|
-
value: "params",
|
|
1372
|
-
children: /* @__PURE__ */ jsx(SidePanelParamsTab, { path: endpoint.path })
|
|
1373
|
-
}),
|
|
1374
|
-
/* @__PURE__ */ jsx(TabsContent, {
|
|
1375
|
-
value: "body",
|
|
1376
|
-
children: /* @__PURE__ */ jsx(SidePanelBodyTab, { schema: endpoint.bodySchema })
|
|
1377
|
-
}),
|
|
1378
|
-
/* @__PURE__ */ jsx(TabsContent, {
|
|
1379
|
-
value: "headers",
|
|
1380
|
-
children: /* @__PURE__ */ jsx(SidePanelHeadersTab, {})
|
|
1381
|
-
})
|
|
1382
|
-
]
|
|
1383
|
-
}), /* @__PURE__ */ jsx(SidePanelResponse, {})]
|
|
1384
|
-
}),
|
|
1385
|
-
isSpecOpen && /* @__PURE__ */ jsx(SpecSidePanel, {
|
|
1386
|
-
endpoint,
|
|
1387
|
-
onClose: () => setIsSpecOpen(false)
|
|
2451
|
+
let t1;
|
|
2452
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2453
|
+
t1 = /* @__PURE__ */ jsx(BackgroundEffect, {});
|
|
2454
|
+
$[1] = t1;
|
|
2455
|
+
} else t1 = $[1];
|
|
2456
|
+
let t2;
|
|
2457
|
+
if ($[2] !== endpoint.method || $[3] !== endpoint.path) {
|
|
2458
|
+
t2 = /* @__PURE__ */ jsx(EndpointPath, {
|
|
2459
|
+
method: endpoint.method,
|
|
2460
|
+
path: endpoint.path
|
|
2461
|
+
});
|
|
2462
|
+
$[2] = endpoint.method;
|
|
2463
|
+
$[3] = endpoint.path;
|
|
2464
|
+
$[4] = t2;
|
|
2465
|
+
} else t2 = $[4];
|
|
2466
|
+
let t3;
|
|
2467
|
+
if ($[5] !== endpoint.description) {
|
|
2468
|
+
t3 = endpoint.description && /* @__PURE__ */ jsx("p", {
|
|
2469
|
+
className: "text-sm text-muted-foreground",
|
|
2470
|
+
children: endpoint.description
|
|
2471
|
+
});
|
|
2472
|
+
$[5] = endpoint.description;
|
|
2473
|
+
$[6] = t3;
|
|
2474
|
+
} else t3 = $[6];
|
|
2475
|
+
let t4;
|
|
2476
|
+
if ($[7] !== t2 || $[8] !== t3) {
|
|
2477
|
+
t4 = /* @__PURE__ */ jsxs("div", {
|
|
2478
|
+
className: "grid grid-rows-2 gap-2",
|
|
2479
|
+
children: [t2, t3]
|
|
2480
|
+
});
|
|
2481
|
+
$[7] = t2;
|
|
2482
|
+
$[8] = t3;
|
|
2483
|
+
$[9] = t4;
|
|
2484
|
+
} else t4 = $[9];
|
|
2485
|
+
let t5;
|
|
2486
|
+
if ($[10] !== isSpecOpen) {
|
|
2487
|
+
t5 = () => setIsSpecOpen(!isSpecOpen);
|
|
2488
|
+
$[10] = isSpecOpen;
|
|
2489
|
+
$[11] = t5;
|
|
2490
|
+
} else t5 = $[11];
|
|
2491
|
+
let t6;
|
|
2492
|
+
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2493
|
+
t6 = /* @__PURE__ */ jsx(Book, {});
|
|
2494
|
+
$[12] = t6;
|
|
2495
|
+
} else t6 = $[12];
|
|
2496
|
+
let t7;
|
|
2497
|
+
if ($[13] !== t5) {
|
|
2498
|
+
t7 = /* @__PURE__ */ jsx("div", {
|
|
2499
|
+
className: "flex items-end justify-end",
|
|
2500
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
2501
|
+
variant: "icon",
|
|
2502
|
+
size: "icon",
|
|
2503
|
+
onClick: t5,
|
|
2504
|
+
"data-testid": "endpoint-spec-button",
|
|
2505
|
+
children: t6
|
|
1388
2506
|
})
|
|
1389
|
-
|
|
1390
|
-
|
|
2507
|
+
});
|
|
2508
|
+
$[13] = t5;
|
|
2509
|
+
$[14] = t7;
|
|
2510
|
+
} else t7 = $[14];
|
|
2511
|
+
let t8;
|
|
2512
|
+
if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2513
|
+
t8 = /* @__PURE__ */ jsx(X, {});
|
|
2514
|
+
$[15] = t8;
|
|
2515
|
+
} else t8 = $[15];
|
|
2516
|
+
let t9;
|
|
2517
|
+
if ($[16] !== onClose) {
|
|
2518
|
+
t9 = /* @__PURE__ */ jsx(Button, {
|
|
2519
|
+
variant: "icon",
|
|
2520
|
+
size: "icon",
|
|
2521
|
+
onClick: onClose,
|
|
2522
|
+
children: t8
|
|
2523
|
+
});
|
|
2524
|
+
$[16] = onClose;
|
|
2525
|
+
$[17] = t9;
|
|
2526
|
+
} else t9 = $[17];
|
|
2527
|
+
let t10;
|
|
2528
|
+
if ($[18] !== t4 || $[19] !== t7 || $[20] !== t9) {
|
|
2529
|
+
t10 = /* @__PURE__ */ jsxs("div", {
|
|
2530
|
+
className: "grid grid-cols-[1fr_1fr_auto] items-start gap-4 px-5 py-4 border-b bg-card w-full",
|
|
2531
|
+
children: [
|
|
2532
|
+
t4,
|
|
2533
|
+
t7,
|
|
2534
|
+
t9
|
|
2535
|
+
]
|
|
2536
|
+
});
|
|
2537
|
+
$[18] = t4;
|
|
2538
|
+
$[19] = t7;
|
|
2539
|
+
$[20] = t9;
|
|
2540
|
+
$[21] = t10;
|
|
2541
|
+
} else t10 = $[21];
|
|
2542
|
+
const t11 = !hasResponse && "grid-cols-1";
|
|
2543
|
+
let t12;
|
|
2544
|
+
if ($[22] !== t11) {
|
|
2545
|
+
t12 = cn("grid grid-cols-[minmax(380px,1fr)_minmax(auto,1fr)]", t11);
|
|
2546
|
+
$[22] = t11;
|
|
2547
|
+
$[23] = t12;
|
|
2548
|
+
} else t12 = $[23];
|
|
2549
|
+
let t13;
|
|
2550
|
+
if ($[24] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2551
|
+
t13 = (value) => setActiveTab(value);
|
|
2552
|
+
$[24] = t13;
|
|
2553
|
+
} else t13 = $[24];
|
|
2554
|
+
let t14;
|
|
2555
|
+
if ($[25] !== paramsCount) {
|
|
2556
|
+
t14 = /* @__PURE__ */ jsxs(TabsTrigger, {
|
|
2557
|
+
value: "params",
|
|
2558
|
+
className: "grid grid-cols-[auto_auto] gap-2 items-center cursor-pointer",
|
|
2559
|
+
"data-testid": "endpoint-params-tab",
|
|
2560
|
+
children: ["Params", /* @__PURE__ */ jsx(Badge, {
|
|
2561
|
+
variant: "outline",
|
|
2562
|
+
className: "h-4 px-1.5 text-xs",
|
|
2563
|
+
children: paramsCount
|
|
2564
|
+
})]
|
|
2565
|
+
});
|
|
2566
|
+
$[25] = paramsCount;
|
|
2567
|
+
$[26] = t14;
|
|
2568
|
+
} else t14 = $[26];
|
|
2569
|
+
let t15;
|
|
2570
|
+
if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2571
|
+
t15 = /* @__PURE__ */ jsx(TabsTrigger, {
|
|
2572
|
+
value: "body",
|
|
2573
|
+
className: "cursor-pointer",
|
|
2574
|
+
"data-testid": "endpoint-body-tab",
|
|
2575
|
+
children: "Body"
|
|
2576
|
+
});
|
|
2577
|
+
$[27] = t15;
|
|
2578
|
+
} else t15 = $[27];
|
|
2579
|
+
let t16;
|
|
2580
|
+
if ($[28] !== headersCount) {
|
|
2581
|
+
t16 = /* @__PURE__ */ jsxs(TabsTrigger, {
|
|
2582
|
+
value: "headers",
|
|
2583
|
+
className: "grid grid-cols-[auto_auto] gap-2 items-center cursor-pointer",
|
|
2584
|
+
"data-testid": "endpoint-headers-tab",
|
|
2585
|
+
children: ["Headers", /* @__PURE__ */ jsx(Badge, {
|
|
2586
|
+
variant: "outline",
|
|
2587
|
+
className: "h-4 px-1.5 text-xs",
|
|
2588
|
+
children: headersCount
|
|
2589
|
+
})]
|
|
2590
|
+
});
|
|
2591
|
+
$[28] = headersCount;
|
|
2592
|
+
$[29] = t16;
|
|
2593
|
+
} else t16 = $[29];
|
|
2594
|
+
let t17;
|
|
2595
|
+
if ($[30] !== t14 || $[31] !== t16) {
|
|
2596
|
+
t17 = /* @__PURE__ */ jsxs(TabsList, { children: [
|
|
2597
|
+
t14,
|
|
2598
|
+
t15,
|
|
2599
|
+
t16
|
|
2600
|
+
] });
|
|
2601
|
+
$[30] = t14;
|
|
2602
|
+
$[31] = t16;
|
|
2603
|
+
$[32] = t17;
|
|
2604
|
+
} else t17 = $[32];
|
|
2605
|
+
const t18 = endpoint.method;
|
|
2606
|
+
let t19;
|
|
2607
|
+
if ($[33] !== endpoint.path) {
|
|
2608
|
+
t19 = endpoint.path.toString();
|
|
2609
|
+
$[33] = endpoint.path;
|
|
2610
|
+
$[34] = t19;
|
|
2611
|
+
} else t19 = $[34];
|
|
2612
|
+
let t20;
|
|
2613
|
+
if ($[35] !== endpoint.method || $[36] !== t19) {
|
|
2614
|
+
t20 = /* @__PURE__ */ jsx(TriggerButton, {
|
|
2615
|
+
method: t18,
|
|
2616
|
+
path: t19
|
|
2617
|
+
});
|
|
2618
|
+
$[35] = endpoint.method;
|
|
2619
|
+
$[36] = t19;
|
|
2620
|
+
$[37] = t20;
|
|
2621
|
+
} else t20 = $[37];
|
|
2622
|
+
let t21;
|
|
2623
|
+
if ($[38] !== t17 || $[39] !== t20) {
|
|
2624
|
+
t21 = /* @__PURE__ */ jsxs("div", {
|
|
2625
|
+
className: "grid grid-cols-[1fr_auto] items-center h-10 border-b px-5 bg-card",
|
|
2626
|
+
children: [t17, t20]
|
|
2627
|
+
});
|
|
2628
|
+
$[38] = t17;
|
|
2629
|
+
$[39] = t20;
|
|
2630
|
+
$[40] = t21;
|
|
2631
|
+
} else t21 = $[40];
|
|
2632
|
+
let t22;
|
|
2633
|
+
if ($[41] !== endpoint.path) {
|
|
2634
|
+
t22 = /* @__PURE__ */ jsx(TabsContent, {
|
|
2635
|
+
value: "params",
|
|
2636
|
+
children: /* @__PURE__ */ jsx(SidePanelParamsTab, { path: endpoint.path })
|
|
2637
|
+
});
|
|
2638
|
+
$[41] = endpoint.path;
|
|
2639
|
+
$[42] = t22;
|
|
2640
|
+
} else t22 = $[42];
|
|
2641
|
+
let t23;
|
|
2642
|
+
if ($[43] !== endpoint.bodySchema) {
|
|
2643
|
+
t23 = /* @__PURE__ */ jsx(TabsContent, {
|
|
2644
|
+
value: "body",
|
|
2645
|
+
children: /* @__PURE__ */ jsx(SidePanelBodyTab, { schema: endpoint.bodySchema })
|
|
2646
|
+
});
|
|
2647
|
+
$[43] = endpoint.bodySchema;
|
|
2648
|
+
$[44] = t23;
|
|
2649
|
+
} else t23 = $[44];
|
|
2650
|
+
let t24;
|
|
2651
|
+
if ($[45] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2652
|
+
t24 = /* @__PURE__ */ jsx(TabsContent, {
|
|
2653
|
+
value: "headers",
|
|
2654
|
+
children: /* @__PURE__ */ jsx(SidePanelHeadersTab, {})
|
|
2655
|
+
});
|
|
2656
|
+
$[45] = t24;
|
|
2657
|
+
} else t24 = $[45];
|
|
2658
|
+
let t25;
|
|
2659
|
+
if ($[46] !== activeTab || $[47] !== t21 || $[48] !== t22 || $[49] !== t23) {
|
|
2660
|
+
t25 = /* @__PURE__ */ jsxs(Tabs, {
|
|
2661
|
+
value: activeTab,
|
|
2662
|
+
onValueChange: t13,
|
|
2663
|
+
children: [
|
|
2664
|
+
t21,
|
|
2665
|
+
t22,
|
|
2666
|
+
t23,
|
|
2667
|
+
t24
|
|
2668
|
+
]
|
|
2669
|
+
});
|
|
2670
|
+
$[46] = activeTab;
|
|
2671
|
+
$[47] = t21;
|
|
2672
|
+
$[48] = t22;
|
|
2673
|
+
$[49] = t23;
|
|
2674
|
+
$[50] = t25;
|
|
2675
|
+
} else t25 = $[50];
|
|
2676
|
+
let t26;
|
|
2677
|
+
if ($[51] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2678
|
+
t26 = /* @__PURE__ */ jsx(SidePanelResponse, {});
|
|
2679
|
+
$[51] = t26;
|
|
2680
|
+
} else t26 = $[51];
|
|
2681
|
+
let t27;
|
|
2682
|
+
if ($[52] !== t12 || $[53] !== t25) {
|
|
2683
|
+
t27 = /* @__PURE__ */ jsxs("div", {
|
|
2684
|
+
className: t12,
|
|
2685
|
+
children: [t25, t26]
|
|
2686
|
+
});
|
|
2687
|
+
$[52] = t12;
|
|
2688
|
+
$[53] = t25;
|
|
2689
|
+
$[54] = t27;
|
|
2690
|
+
} else t27 = $[54];
|
|
2691
|
+
let t28;
|
|
2692
|
+
if ($[55] !== endpoint || $[56] !== isSpecOpen) {
|
|
2693
|
+
t28 = isSpecOpen && /* @__PURE__ */ jsx(SpecSidePanel, {
|
|
2694
|
+
endpoint,
|
|
2695
|
+
onClose: () => setIsSpecOpen(false)
|
|
2696
|
+
});
|
|
2697
|
+
$[55] = endpoint;
|
|
2698
|
+
$[56] = isSpecOpen;
|
|
2699
|
+
$[57] = t28;
|
|
2700
|
+
} else t28 = $[57];
|
|
2701
|
+
let t29;
|
|
2702
|
+
if ($[58] !== t10 || $[59] !== t27 || $[60] !== t28) {
|
|
2703
|
+
t29 = /* @__PURE__ */ jsxs("div", {
|
|
2704
|
+
className: "isolate grid grid-cols-1 overflow-y-auto min-w-0 grid-rows-[auto_1fr] border-l border-border",
|
|
2705
|
+
"data-testid": "endpoint-details-panel",
|
|
2706
|
+
children: [
|
|
2707
|
+
t1,
|
|
2708
|
+
t10,
|
|
2709
|
+
t27,
|
|
2710
|
+
t28
|
|
2711
|
+
]
|
|
2712
|
+
});
|
|
2713
|
+
$[58] = t10;
|
|
2714
|
+
$[59] = t27;
|
|
2715
|
+
$[60] = t28;
|
|
2716
|
+
$[61] = t29;
|
|
2717
|
+
} else t29 = $[61];
|
|
2718
|
+
return t29;
|
|
1391
2719
|
});
|
|
1392
2720
|
|
|
1393
2721
|
//#endregion
|
|
1394
2722
|
//#region src/endpoints-page.tsx
|
|
1395
2723
|
const EndpointsPage = () => {
|
|
2724
|
+
const $ = c(33);
|
|
2725
|
+
if ($[0] !== "198b8272767e037dafaba995069a2aa9f7c2ab3fe909e2acb55498bc6d00f981") {
|
|
2726
|
+
for (let $i = 0; $i < 33; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
2727
|
+
$[0] = "198b8272767e037dafaba995069a2aa9f7c2ab3fe909e2acb55498bc6d00f981";
|
|
2728
|
+
}
|
|
1396
2729
|
const { endpoints, groupedEndpoints } = useGetEndpoints();
|
|
1397
2730
|
const { selectedEndpointId, setSelectedEndpointId, toggleFlowGroupStatus, flowGroupStatus } = useEndpointConfiguration();
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
2731
|
+
let t0;
|
|
2732
|
+
if ($[1] !== endpoints || $[2] !== selectedEndpointId) {
|
|
2733
|
+
let t1$1;
|
|
2734
|
+
if ($[4] !== selectedEndpointId) {
|
|
2735
|
+
t1$1 = (endpoint) => endpoint.id === selectedEndpointId;
|
|
2736
|
+
$[4] = selectedEndpointId;
|
|
2737
|
+
$[5] = t1$1;
|
|
2738
|
+
} else t1$1 = $[5];
|
|
2739
|
+
t0 = endpoints.find(t1$1);
|
|
2740
|
+
$[1] = endpoints;
|
|
2741
|
+
$[2] = selectedEndpointId;
|
|
2742
|
+
$[3] = t0;
|
|
2743
|
+
} else t0 = $[3];
|
|
2744
|
+
const selectedEndpoint = t0;
|
|
2745
|
+
let t1;
|
|
2746
|
+
if ($[6] !== setSelectedEndpointId) {
|
|
2747
|
+
t1 = () => {
|
|
2748
|
+
setSelectedEndpointId("");
|
|
2749
|
+
};
|
|
2750
|
+
$[6] = setSelectedEndpointId;
|
|
2751
|
+
$[7] = t1;
|
|
2752
|
+
} else t1 = $[7];
|
|
2753
|
+
const onClose = t1;
|
|
1402
2754
|
const [search, setSearch] = useState("");
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
2755
|
+
let t2;
|
|
2756
|
+
if ($[8] !== groupedEndpoints || $[9] !== search) {
|
|
2757
|
+
t2 = Object.entries(groupedEndpoints).filter((t3$1) => {
|
|
2758
|
+
const [, endpoints_0] = t3$1;
|
|
2759
|
+
return endpoints_0.some((endpoint_0) => endpoint_0.method?.toLowerCase().includes(search.toLowerCase()) || endpoint_0.path?.toLowerCase().includes(search.toLowerCase()));
|
|
1406
2760
|
});
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
2761
|
+
$[8] = groupedEndpoints;
|
|
2762
|
+
$[9] = search;
|
|
2763
|
+
$[10] = t2;
|
|
2764
|
+
} else t2 = $[10];
|
|
2765
|
+
const filteredEndpoints = t2;
|
|
2766
|
+
const t3 = selectedEndpoint ? "grid-cols-[300px_1fr] " : "grid-cols-1";
|
|
2767
|
+
let t4;
|
|
2768
|
+
if ($[11] !== t3) {
|
|
2769
|
+
t4 = cn("grid h-full max-h-full", t3);
|
|
2770
|
+
$[11] = t3;
|
|
2771
|
+
$[12] = t4;
|
|
2772
|
+
} else t4 = $[12];
|
|
2773
|
+
let t5;
|
|
2774
|
+
if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2775
|
+
t5 = () => setSearch("");
|
|
2776
|
+
$[13] = t5;
|
|
2777
|
+
} else t5 = $[13];
|
|
2778
|
+
let t6;
|
|
2779
|
+
if ($[14] !== search) {
|
|
2780
|
+
t6 = /* @__PURE__ */ jsx(EndpointsSearch, {
|
|
2781
|
+
value: search,
|
|
2782
|
+
onChange: setSearch,
|
|
2783
|
+
onClear: t5
|
|
2784
|
+
});
|
|
2785
|
+
$[14] = search;
|
|
2786
|
+
$[15] = t6;
|
|
2787
|
+
} else t6 = $[15];
|
|
2788
|
+
let t7;
|
|
2789
|
+
if ($[16] !== filteredEndpoints || $[17] !== flowGroupStatus || $[18] !== search || $[19] !== selectedEndpointId || $[20] !== setSelectedEndpointId || $[21] !== toggleFlowGroupStatus) {
|
|
2790
|
+
t7 = /* @__PURE__ */ jsx("div", {
|
|
2791
|
+
className: "grid grid-cols-1 auto-rows-max overflow-auto min-w-0",
|
|
2792
|
+
children: filteredEndpoints.map((t8$1) => {
|
|
2793
|
+
const [flow, endpoints_1] = t8$1;
|
|
2794
|
+
const isSelected = endpoints_1.some((endpoint_1) => endpoint_1.id === selectedEndpointId);
|
|
2795
|
+
return /* @__PURE__ */ jsx(FlowGroup, {
|
|
2796
|
+
flow,
|
|
2797
|
+
endpoints: endpoints_1,
|
|
2798
|
+
isOpen: !flowGroupStatus[flow] || isSelected || search !== "",
|
|
2799
|
+
isSelected,
|
|
2800
|
+
onToggle: toggleFlowGroupStatus,
|
|
2801
|
+
onClearSelection: () => setSelectedEndpointId(""),
|
|
2802
|
+
selectedEndpointId,
|
|
2803
|
+
onSelectEndpoint: setSelectedEndpointId
|
|
2804
|
+
}, flow);
|
|
2805
|
+
})
|
|
2806
|
+
});
|
|
2807
|
+
$[16] = filteredEndpoints;
|
|
2808
|
+
$[17] = flowGroupStatus;
|
|
2809
|
+
$[18] = search;
|
|
2810
|
+
$[19] = selectedEndpointId;
|
|
2811
|
+
$[20] = setSelectedEndpointId;
|
|
2812
|
+
$[21] = toggleFlowGroupStatus;
|
|
2813
|
+
$[22] = t7;
|
|
2814
|
+
} else t7 = $[22];
|
|
2815
|
+
let t8;
|
|
2816
|
+
if ($[23] !== t6 || $[24] !== t7) {
|
|
2817
|
+
t8 = /* @__PURE__ */ jsxs("div", {
|
|
1412
2818
|
className: "grid grid-rows-[auto_1fr] h-full overflow-auto min-w-0",
|
|
1413
|
-
children: [
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
flow,
|
|
1423
|
-
endpoints: endpoints$1,
|
|
1424
|
-
isOpen: !flowGroupStatus[flow] || isSelected || search !== "",
|
|
1425
|
-
isSelected,
|
|
1426
|
-
onToggle: toggleFlowGroupStatus,
|
|
1427
|
-
onClearSelection: () => setSelectedEndpointId(""),
|
|
1428
|
-
selectedEndpointId,
|
|
1429
|
-
onSelectEndpoint: setSelectedEndpointId
|
|
1430
|
-
}, flow);
|
|
1431
|
-
})
|
|
1432
|
-
})]
|
|
1433
|
-
}), selectedEndpoint && /* @__PURE__ */ jsx(SidePanel, {
|
|
2819
|
+
children: [t6, t7]
|
|
2820
|
+
});
|
|
2821
|
+
$[23] = t6;
|
|
2822
|
+
$[24] = t7;
|
|
2823
|
+
$[25] = t8;
|
|
2824
|
+
} else t8 = $[25];
|
|
2825
|
+
let t9;
|
|
2826
|
+
if ($[26] !== onClose || $[27] !== selectedEndpoint) {
|
|
2827
|
+
t9 = selectedEndpoint && /* @__PURE__ */ jsx(SidePanel, {
|
|
1434
2828
|
endpoint: selectedEndpoint,
|
|
1435
2829
|
onClose
|
|
1436
|
-
})
|
|
1437
|
-
|
|
2830
|
+
});
|
|
2831
|
+
$[26] = onClose;
|
|
2832
|
+
$[27] = selectedEndpoint;
|
|
2833
|
+
$[28] = t9;
|
|
2834
|
+
} else t9 = $[28];
|
|
2835
|
+
let t10;
|
|
2836
|
+
if ($[29] !== t4 || $[30] !== t8 || $[31] !== t9) {
|
|
2837
|
+
t10 = /* @__PURE__ */ jsxs("div", {
|
|
2838
|
+
className: t4,
|
|
2839
|
+
"data-testid": "endpoints-list",
|
|
2840
|
+
children: [t8, t9]
|
|
2841
|
+
});
|
|
2842
|
+
$[29] = t4;
|
|
2843
|
+
$[30] = t8;
|
|
2844
|
+
$[31] = t9;
|
|
2845
|
+
$[32] = t10;
|
|
2846
|
+
} else t10 = $[32];
|
|
2847
|
+
return t10;
|
|
1438
2848
|
};
|
|
1439
2849
|
|
|
1440
2850
|
//#endregion
|