@nice2dev/ui-api 1.0.27 → 1.0.29
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/CHANGELOG.md +15 -0
- package/dist/index.cjs +4 -4
- package/dist/index.mjs +1217 -1128
- package/dist/style.css +1 -1
- package/package.json +3 -2
package/dist/index.mjs
CHANGED
|
@@ -1,18 +1,88 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useContext as
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { jsxs as t, jsx as e, Fragment as F } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as ue, useContext as be, createContext as D, memo as Te, useState as v, useEffect as he, useCallback as R, useRef as oe, useMemo as Ee } from "react";
|
|
3
|
+
const de = ue(
|
|
4
|
+
({
|
|
5
|
+
menubar: r,
|
|
6
|
+
toolbar: a,
|
|
7
|
+
sidebar: i,
|
|
8
|
+
sidebarWidth: n = 220,
|
|
9
|
+
rightSidebar: c,
|
|
10
|
+
rightSidebarWidth: u = 280,
|
|
11
|
+
children: l,
|
|
12
|
+
bottomPanel: y,
|
|
13
|
+
bottomPanelHeight: b,
|
|
14
|
+
statusBar: d,
|
|
15
|
+
height: h = "100%",
|
|
16
|
+
flush: S = !1,
|
|
17
|
+
className: m,
|
|
18
|
+
style: k,
|
|
19
|
+
id: g,
|
|
20
|
+
"data-testid": P
|
|
21
|
+
}, C) => {
|
|
22
|
+
const O = `nice-app-shell__sidebar${S ? " nice-app-shell__sidebar--flush" : ""}`;
|
|
23
|
+
return /* @__PURE__ */ t(
|
|
24
|
+
"div",
|
|
25
|
+
{
|
|
26
|
+
ref: C,
|
|
27
|
+
id: g,
|
|
28
|
+
"data-testid": P,
|
|
29
|
+
className: `nice-app-shell${m ? ` ${m}` : ""}`,
|
|
30
|
+
style: { height: h, ...k },
|
|
31
|
+
children: [
|
|
32
|
+
r != null && /* @__PURE__ */ e(
|
|
33
|
+
"div",
|
|
34
|
+
{
|
|
35
|
+
className: `nice-app-shell__menubar${S ? " nice-app-shell__chrome--flush" : ""}`,
|
|
36
|
+
children: r
|
|
37
|
+
}
|
|
38
|
+
),
|
|
39
|
+
a != null && /* @__PURE__ */ e(
|
|
40
|
+
"div",
|
|
41
|
+
{
|
|
42
|
+
className: `nice-app-shell__toolbar${S ? " nice-app-shell__chrome--flush" : ""}`,
|
|
43
|
+
children: a
|
|
44
|
+
}
|
|
45
|
+
),
|
|
46
|
+
/* @__PURE__ */ t("div", { className: "nice-app-shell__body", children: [
|
|
47
|
+
i != null && /* @__PURE__ */ e("aside", { className: O, style: S ? void 0 : { width: n }, children: i }),
|
|
48
|
+
/* @__PURE__ */ e("main", { className: "nice-app-shell__content", children: l }),
|
|
49
|
+
c != null && /* @__PURE__ */ e(
|
|
50
|
+
"aside",
|
|
51
|
+
{
|
|
52
|
+
className: `${O} nice-app-shell__sidebar--right`,
|
|
53
|
+
style: S ? void 0 : { width: u },
|
|
54
|
+
children: c
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
] }),
|
|
58
|
+
y != null && /* @__PURE__ */ e(
|
|
59
|
+
"div",
|
|
60
|
+
{
|
|
61
|
+
className: `nice-app-shell__bottom${S ? " nice-app-shell__bottom--flush" : ""}`,
|
|
62
|
+
style: b != null ? { height: b } : void 0,
|
|
63
|
+
children: y
|
|
64
|
+
}
|
|
65
|
+
),
|
|
66
|
+
d != null && /* @__PURE__ */ e("div", { className: "nice-app-shell__status", children: d })
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
de.displayName = "NiceAppShell";
|
|
73
|
+
const Ae = (r, a) => a, Re = D(Ae);
|
|
74
|
+
function Pe() {
|
|
75
|
+
return { t: be(Re) };
|
|
6
76
|
}
|
|
7
|
-
|
|
77
|
+
D({
|
|
8
78
|
dir: "ltr",
|
|
9
79
|
isRTL: !1,
|
|
10
|
-
flip: (
|
|
11
|
-
value: (
|
|
80
|
+
flip: (r) => r,
|
|
81
|
+
value: (r) => r.ltr
|
|
12
82
|
});
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const
|
|
83
|
+
D(null);
|
|
84
|
+
D(null);
|
|
85
|
+
const De = {
|
|
16
86
|
radius: "md",
|
|
17
87
|
shadow: "md",
|
|
18
88
|
fill: "solid",
|
|
@@ -29,79 +99,79 @@ const Pe = {
|
|
|
29
99
|
animation: "normal",
|
|
30
100
|
density: "normal"
|
|
31
101
|
};
|
|
32
|
-
|
|
102
|
+
D({
|
|
33
103
|
displayStyle: "default",
|
|
34
|
-
variantConfig:
|
|
104
|
+
variantConfig: De,
|
|
35
105
|
setDisplayStyle: () => {
|
|
36
106
|
}
|
|
37
107
|
});
|
|
38
|
-
|
|
39
|
-
|
|
108
|
+
D({});
|
|
109
|
+
D({
|
|
40
110
|
direction: "ltr",
|
|
41
111
|
isRTL: !1,
|
|
42
|
-
flip: (
|
|
43
|
-
flipStyle: (
|
|
112
|
+
flip: (r) => r,
|
|
113
|
+
flipStyle: (r, a) => ({ [r]: a })
|
|
44
114
|
});
|
|
45
|
-
|
|
115
|
+
D({
|
|
46
116
|
permissions: {},
|
|
47
117
|
getAccessMode: () => "full"
|
|
48
118
|
});
|
|
49
|
-
|
|
50
|
-
const
|
|
51
|
-
let
|
|
52
|
-
enabled:
|
|
119
|
+
D(null);
|
|
120
|
+
const $e = process.env.NODE_ENV === "development";
|
|
121
|
+
let ge = {
|
|
122
|
+
enabled: $e,
|
|
53
123
|
slowRenderThreshold: 16
|
|
54
124
|
};
|
|
55
|
-
const
|
|
125
|
+
const ve = [], le = /* @__PURE__ */ new Map(), _e = /* @__PURE__ */ new Map();
|
|
56
126
|
function Ie() {
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
function $e(e) {
|
|
60
|
-
const a = ue.slowRenderThreshold;
|
|
61
|
-
return be.filter((i) => i.actualDuration > a);
|
|
127
|
+
ve.length = 0, le.clear(), _e.clear();
|
|
62
128
|
}
|
|
63
|
-
function
|
|
64
|
-
|
|
129
|
+
function Oe(r) {
|
|
130
|
+
const a = ge.slowRenderThreshold;
|
|
131
|
+
return ve.filter((i) => i.actualDuration > a);
|
|
65
132
|
}
|
|
66
|
-
function
|
|
67
|
-
|
|
68
|
-
return { stats: e, slowRenders: a, totalRenders: i, avgRenderTime: n, marks: s };
|
|
133
|
+
function z(r) {
|
|
134
|
+
return r < 1 ? `${(r * 1e3).toFixed(0)}μs` : r < 1e3 ? `${r.toFixed(2)}ms` : `${(r / 1e3).toFixed(2)}s`;
|
|
69
135
|
}
|
|
70
136
|
function Me() {
|
|
71
|
-
const
|
|
137
|
+
const r = Array.from(le.values()), a = Oe(), i = r.reduce((u, l) => u + l.renderCount, 0), n = r.length > 0 ? r.reduce((u, l) => u + l.avgRenderTime, 0) / r.length : 0, c = Array.from(_e.values());
|
|
138
|
+
return { stats: r, slowRenders: a, totalRenders: i, avgRenderTime: n, marks: c };
|
|
139
|
+
}
|
|
140
|
+
function Le() {
|
|
141
|
+
const r = Me();
|
|
72
142
|
console.group(
|
|
73
143
|
"%c[Nice2Dev Performance Report]",
|
|
74
144
|
"color: var(--nice-info, #6366f1); font-weight: bold; font-size: 14px"
|
|
75
|
-
), console.log(`Total renders: ${
|
|
76
|
-
|
|
145
|
+
), console.log(`Total renders: ${r.totalRenders}`), console.log(`Average render time: ${z(r.avgRenderTime)}`), console.log(`Slow renders: ${r.slowRenders.length}`), console.group("Component Stats"), console.table(
|
|
146
|
+
r.stats.sort((a, i) => i.totalRenderTime - a.totalRenderTime).map((a) => ({
|
|
77
147
|
Name: a.componentName,
|
|
78
148
|
Renders: a.renderCount,
|
|
79
|
-
"Avg Time":
|
|
80
|
-
"Max Time":
|
|
81
|
-
"Total Time":
|
|
149
|
+
"Avg Time": z(a.avgRenderTime),
|
|
150
|
+
"Max Time": z(a.maxRenderTime),
|
|
151
|
+
"Total Time": z(a.totalRenderTime),
|
|
82
152
|
"Slow Renders": a.slowRenderCount
|
|
83
153
|
}))
|
|
84
|
-
), console.groupEnd(),
|
|
85
|
-
|
|
154
|
+
), console.groupEnd(), r.slowRenders.length > 0 && (console.group("Slow Renders (last 10)"), console.table(
|
|
155
|
+
r.slowRenders.slice(-10).map((a) => ({
|
|
86
156
|
Component: a.componentName,
|
|
87
157
|
Phase: a.phase,
|
|
88
|
-
Duration:
|
|
158
|
+
Duration: z(a.actualDuration),
|
|
89
159
|
Time: new Date(a.timestamp).toLocaleTimeString()
|
|
90
160
|
}))
|
|
91
|
-
), console.groupEnd()),
|
|
92
|
-
|
|
161
|
+
), console.groupEnd()), r.marks.length > 0 && (console.group("Custom Marks"), console.table(
|
|
162
|
+
r.marks.filter((a) => a.duration).map((a) => ({
|
|
93
163
|
Name: a.name,
|
|
94
|
-
Duration:
|
|
164
|
+
Duration: z(a.duration)
|
|
95
165
|
}))
|
|
96
166
|
), console.groupEnd()), console.groupEnd();
|
|
97
167
|
}
|
|
98
|
-
const
|
|
99
|
-
({ position:
|
|
100
|
-
const [i, n] =
|
|
101
|
-
if (
|
|
168
|
+
const Ue = Te(
|
|
169
|
+
({ position: r = "bottom-right", defaultCollapsed: a = !0 }) => {
|
|
170
|
+
const [i, n] = v(a), [c, u] = v([]), [l, y] = v({ used: 0, total: 0 });
|
|
171
|
+
if (he(() => {
|
|
102
172
|
const d = () => {
|
|
103
|
-
const
|
|
104
|
-
u(
|
|
173
|
+
const S = Array.from(le.values());
|
|
174
|
+
u(S.sort((k, g) => g.totalRenderTime - k.totalRenderTime).slice(0, 10));
|
|
105
175
|
const m = window.performance;
|
|
106
176
|
m.memory && y({
|
|
107
177
|
used: m.memory.usedJSHeapSize / 1024 / 1024,
|
|
@@ -109,15 +179,15 @@ const Le = He(
|
|
|
109
179
|
});
|
|
110
180
|
};
|
|
111
181
|
d();
|
|
112
|
-
const
|
|
113
|
-
return () => clearInterval(
|
|
114
|
-
}, []), !
|
|
182
|
+
const h = setInterval(d, 2e3);
|
|
183
|
+
return () => clearInterval(h);
|
|
184
|
+
}, []), !ge.enabled)
|
|
115
185
|
return null;
|
|
116
186
|
const b = {
|
|
117
187
|
position: "fixed",
|
|
118
188
|
zIndex: 99999,
|
|
119
|
-
...
|
|
120
|
-
...
|
|
189
|
+
...r.includes("top") ? { top: 8 } : { bottom: 8 },
|
|
190
|
+
...r.includes("left") ? { left: 8 } : { right: 8 }
|
|
121
191
|
};
|
|
122
192
|
return /* @__PURE__ */ t(
|
|
123
193
|
"div",
|
|
@@ -141,26 +211,26 @@ const Le = He(
|
|
|
141
211
|
style: { cursor: "pointer", display: "flex", alignItems: "center", gap: 8 },
|
|
142
212
|
onClick: () => n((d) => !d),
|
|
143
213
|
children: [
|
|
144
|
-
/* @__PURE__ */
|
|
145
|
-
/* @__PURE__ */
|
|
146
|
-
|
|
214
|
+
/* @__PURE__ */ e("span", { style: { color: "var(--color-success, #22c55e)" }, children: "●" }),
|
|
215
|
+
/* @__PURE__ */ e("span", { children: "Profiler" }),
|
|
216
|
+
l.used > 0 && /* @__PURE__ */ t(
|
|
147
217
|
"span",
|
|
148
218
|
{
|
|
149
219
|
style: {
|
|
150
|
-
color:
|
|
220
|
+
color: l.used > 100 ? "var(--color-warning, #f59e0b)" : "var(--text-muted, #64748b)"
|
|
151
221
|
},
|
|
152
222
|
children: [
|
|
153
|
-
|
|
223
|
+
l.used.toFixed(0),
|
|
154
224
|
"MB"
|
|
155
225
|
]
|
|
156
226
|
}
|
|
157
227
|
),
|
|
158
|
-
/* @__PURE__ */
|
|
228
|
+
/* @__PURE__ */ e("span", { style: { marginLeft: "auto", opacity: 0.5 }, children: i ? "▼" : "▲" })
|
|
159
229
|
]
|
|
160
230
|
}
|
|
161
231
|
),
|
|
162
232
|
!i && /* @__PURE__ */ t("div", { style: { marginTop: 8 }, children: [
|
|
163
|
-
/* @__PURE__ */
|
|
233
|
+
/* @__PURE__ */ e(
|
|
164
234
|
"div",
|
|
165
235
|
{
|
|
166
236
|
style: {
|
|
@@ -168,18 +238,18 @@ const Le = He(
|
|
|
168
238
|
paddingBottom: 4,
|
|
169
239
|
marginBottom: 8
|
|
170
240
|
},
|
|
171
|
-
children: /* @__PURE__ */
|
|
241
|
+
children: /* @__PURE__ */ e("strong", { children: "Top Components" })
|
|
172
242
|
}
|
|
173
243
|
),
|
|
174
|
-
|
|
175
|
-
/* @__PURE__ */
|
|
176
|
-
/* @__PURE__ */
|
|
244
|
+
c.map((d) => /* @__PURE__ */ t("div", { style: { marginBottom: 4, display: "flex", gap: 8 }, children: [
|
|
245
|
+
/* @__PURE__ */ e("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis" }, children: d.componentName }),
|
|
246
|
+
/* @__PURE__ */ e(
|
|
177
247
|
"span",
|
|
178
248
|
{
|
|
179
249
|
style: {
|
|
180
250
|
color: d.avgRenderTime > 16 ? "var(--color-warning, #f59e0b)" : "var(--color-success, #22c55e)"
|
|
181
251
|
},
|
|
182
|
-
children:
|
|
252
|
+
children: z(d.avgRenderTime)
|
|
183
253
|
}
|
|
184
254
|
),
|
|
185
255
|
/* @__PURE__ */ t(
|
|
@@ -194,10 +264,10 @@ const Le = He(
|
|
|
194
264
|
)
|
|
195
265
|
] }, d.componentName)),
|
|
196
266
|
/* @__PURE__ */ t("div", { style: { marginTop: 8, display: "flex", gap: 8 }, children: [
|
|
197
|
-
/* @__PURE__ */
|
|
267
|
+
/* @__PURE__ */ e(
|
|
198
268
|
"button",
|
|
199
269
|
{
|
|
200
|
-
onClick:
|
|
270
|
+
onClick: Le,
|
|
201
271
|
style: {
|
|
202
272
|
flex: 1,
|
|
203
273
|
padding: "4px 8px",
|
|
@@ -211,7 +281,7 @@ const Le = He(
|
|
|
211
281
|
children: "Print Report"
|
|
212
282
|
}
|
|
213
283
|
),
|
|
214
|
-
/* @__PURE__ */
|
|
284
|
+
/* @__PURE__ */ e(
|
|
215
285
|
"button",
|
|
216
286
|
{
|
|
217
287
|
onClick: Ie,
|
|
@@ -235,30 +305,30 @@ const Le = He(
|
|
|
235
305
|
);
|
|
236
306
|
}
|
|
237
307
|
);
|
|
238
|
-
|
|
308
|
+
Ue.displayName = "ProfilerOverlay";
|
|
239
309
|
process.env.NODE_ENV;
|
|
240
|
-
|
|
241
|
-
const
|
|
310
|
+
D(null);
|
|
311
|
+
const je = D({
|
|
242
312
|
enabled: !0,
|
|
243
313
|
active: !1,
|
|
244
314
|
run: () => {
|
|
245
315
|
}
|
|
246
316
|
});
|
|
247
317
|
function Ke() {
|
|
248
|
-
return
|
|
318
|
+
return be(je);
|
|
249
319
|
}
|
|
250
|
-
function
|
|
251
|
-
if (!
|
|
320
|
+
function ae(r, a) {
|
|
321
|
+
if (!r)
|
|
252
322
|
return null;
|
|
253
|
-
if (
|
|
323
|
+
if (r === !0)
|
|
254
324
|
return a && a.length > 0 ? a : null;
|
|
255
|
-
if (Array.isArray(
|
|
256
|
-
return
|
|
257
|
-
const i =
|
|
325
|
+
if (Array.isArray(r))
|
|
326
|
+
return r.length > 0 ? r : null;
|
|
327
|
+
const i = r.steps ?? a;
|
|
258
328
|
return i && i.length > 0 ? i : null;
|
|
259
329
|
}
|
|
260
|
-
function
|
|
261
|
-
return
|
|
330
|
+
function qe(r, a) {
|
|
331
|
+
return r.map((i) => ({
|
|
262
332
|
target: i.target,
|
|
263
333
|
title: i.titleKey ? a(i.titleKey, i.title ?? "") : i.title ?? "",
|
|
264
334
|
content: i.contentKey ? a(i.contentKey, i.content ?? "") : i.content ?? "",
|
|
@@ -269,36 +339,36 @@ function je(e, a) {
|
|
|
269
339
|
disableInteraction: i.disableInteraction
|
|
270
340
|
}));
|
|
271
341
|
}
|
|
272
|
-
const
|
|
273
|
-
steps:
|
|
342
|
+
const ie = ({
|
|
343
|
+
steps: r,
|
|
274
344
|
autoStart: a,
|
|
275
345
|
label: i,
|
|
276
346
|
size: n = "md",
|
|
277
|
-
className:
|
|
347
|
+
className: c,
|
|
278
348
|
style: u,
|
|
279
|
-
"data-testid":
|
|
349
|
+
"data-testid": l
|
|
280
350
|
}) => {
|
|
281
|
-
const { enabled: y, run: b } = Ke(), { t: d } =
|
|
282
|
-
if (!y || !
|
|
351
|
+
const { enabled: y, run: b } = Ke(), { t: d } = Pe();
|
|
352
|
+
if (!y || !r || r.length === 0)
|
|
283
353
|
return null;
|
|
284
|
-
const
|
|
285
|
-
return /* @__PURE__ */
|
|
354
|
+
const h = i ?? d("tutorial.startAria", "Start tutorial");
|
|
355
|
+
return /* @__PURE__ */ e(
|
|
286
356
|
"button",
|
|
287
357
|
{
|
|
288
358
|
type: "button",
|
|
289
|
-
className: `nice-tutorial-button nice-tutorial-button--${n}` + (
|
|
359
|
+
className: `nice-tutorial-button nice-tutorial-button--${n}` + (c ? ` ${c}` : ""),
|
|
290
360
|
style: u,
|
|
291
|
-
"data-testid":
|
|
292
|
-
"aria-label":
|
|
293
|
-
title:
|
|
294
|
-
onClick: () => b(
|
|
361
|
+
"data-testid": l,
|
|
362
|
+
"aria-label": h,
|
|
363
|
+
title: h,
|
|
364
|
+
onClick: () => b(qe(r, d), { autoStart: a }),
|
|
295
365
|
children: "?"
|
|
296
366
|
}
|
|
297
367
|
);
|
|
298
|
-
},
|
|
299
|
-
if (typeof document < "u" && !document.getElementById(
|
|
300
|
-
const
|
|
301
|
-
|
|
368
|
+
}, fe = "nice-tutorial-button-styles";
|
|
369
|
+
if (typeof document < "u" && !document.getElementById(fe)) {
|
|
370
|
+
const r = document.createElement("style");
|
|
371
|
+
r.id = fe, r.textContent = `
|
|
302
372
|
.nice-tutorial-button {
|
|
303
373
|
display: inline-flex;
|
|
304
374
|
align-items: center;
|
|
@@ -324,12 +394,12 @@ if (typeof document < "u" && !document.getElementById(de)) {
|
|
|
324
394
|
}
|
|
325
395
|
.nice-tutorial-button--sm { width: 16px; height: 16px; font-size: 11px; }
|
|
326
396
|
.nice-tutorial-button--md { width: 20px; height: 20px; font-size: 12px; }
|
|
327
|
-
`, document.head.appendChild(
|
|
397
|
+
`, document.head.appendChild(r);
|
|
328
398
|
}
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
const
|
|
399
|
+
D(null);
|
|
400
|
+
D(null);
|
|
401
|
+
D(null);
|
|
402
|
+
const we = {
|
|
333
403
|
space1: "4px",
|
|
334
404
|
space2: "8px",
|
|
335
405
|
space3: "12px",
|
|
@@ -337,7 +407,7 @@ const ge = {
|
|
|
337
407
|
space5: "20px",
|
|
338
408
|
space6: "24px",
|
|
339
409
|
space8: "32px"
|
|
340
|
-
},
|
|
410
|
+
}, Ne = {
|
|
341
411
|
fontFamily: "'Inter', system-ui, -apple-system, sans-serif",
|
|
342
412
|
fontSizeXs: "0.75rem",
|
|
343
413
|
fontSizeSm: "0.8125rem",
|
|
@@ -349,27 +419,27 @@ const ge = {
|
|
|
349
419
|
fontWeightSemibold: 600,
|
|
350
420
|
fontWeightBold: 700,
|
|
351
421
|
lineHeight: 1.5
|
|
352
|
-
},
|
|
353
|
-
color:
|
|
422
|
+
}, xe = { fast: "120ms ease", normal: "200ms ease", slow: "300ms ease" }, Se = (r) => ({
|
|
423
|
+
color: r,
|
|
354
424
|
radiusSm: "4px",
|
|
355
425
|
radiusMd: "6px",
|
|
356
426
|
radiusLg: "8px",
|
|
357
427
|
radiusXl: "12px",
|
|
358
428
|
radiusFull: "9999px"
|
|
359
|
-
}),
|
|
429
|
+
}), Be = {
|
|
360
430
|
sm: "0 1px 2px rgba(0,0,0,0.05)",
|
|
361
431
|
md: "0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",
|
|
362
432
|
lg: "0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",
|
|
363
433
|
xl: "0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)"
|
|
364
|
-
},
|
|
434
|
+
}, Ve = {
|
|
365
435
|
sm: "0 1px 2px rgba(0,0,0,0.3)",
|
|
366
436
|
md: "0 4px 6px -1px rgba(0,0,0,0.4)",
|
|
367
437
|
lg: "0 10px 15px -3px rgba(0,0,0,0.4)",
|
|
368
438
|
xl: "0 20px 25px -5px rgba(0,0,0,0.4)"
|
|
369
439
|
};
|
|
370
|
-
function
|
|
440
|
+
function f(r, a, i, n, c) {
|
|
371
441
|
return {
|
|
372
|
-
name:
|
|
442
|
+
name: r,
|
|
373
443
|
darkMode: "light",
|
|
374
444
|
colors: {
|
|
375
445
|
...a,
|
|
@@ -383,16 +453,16 @@ function l(e, a, i, n, s) {
|
|
|
383
453
|
canvas: i.canvas ?? i.primary
|
|
384
454
|
},
|
|
385
455
|
text: { ...n, inverse: n.inverse ?? "#ffffff" },
|
|
386
|
-
borders:
|
|
387
|
-
shadows:
|
|
388
|
-
spacing:
|
|
389
|
-
typography:
|
|
390
|
-
transitions:
|
|
456
|
+
borders: Se(c),
|
|
457
|
+
shadows: Be,
|
|
458
|
+
spacing: we,
|
|
459
|
+
typography: Ne,
|
|
460
|
+
transitions: xe
|
|
391
461
|
};
|
|
392
462
|
}
|
|
393
|
-
function
|
|
463
|
+
function T(r, a, i, n, c) {
|
|
394
464
|
return {
|
|
395
|
-
name:
|
|
465
|
+
name: r,
|
|
396
466
|
darkMode: "dark",
|
|
397
467
|
colors: {
|
|
398
468
|
...a,
|
|
@@ -406,14 +476,14 @@ function A(e, a, i, n, s) {
|
|
|
406
476
|
canvas: i.canvas ?? i.primary
|
|
407
477
|
},
|
|
408
478
|
text: { ...n, inverse: n.inverse ?? "#0f172a" },
|
|
409
|
-
borders:
|
|
410
|
-
shadows:
|
|
411
|
-
spacing:
|
|
412
|
-
typography:
|
|
413
|
-
transitions:
|
|
479
|
+
borders: Se(c),
|
|
480
|
+
shadows: Ve,
|
|
481
|
+
spacing: we,
|
|
482
|
+
typography: Ne,
|
|
483
|
+
transitions: xe
|
|
414
484
|
};
|
|
415
485
|
}
|
|
416
|
-
|
|
486
|
+
f(
|
|
417
487
|
"Slate",
|
|
418
488
|
{
|
|
419
489
|
primary: "#64748b",
|
|
@@ -427,7 +497,7 @@ l(
|
|
|
427
497
|
{ primary: "#1e293b", secondary: "#475569", muted: "#94a3b8" },
|
|
428
498
|
"#cbd5e1"
|
|
429
499
|
);
|
|
430
|
-
|
|
500
|
+
f(
|
|
431
501
|
"Zinc",
|
|
432
502
|
{
|
|
433
503
|
primary: "#71717a",
|
|
@@ -441,7 +511,7 @@ l(
|
|
|
441
511
|
{ primary: "#18181b", secondary: "#3f3f46", muted: "#a1a1aa" },
|
|
442
512
|
"#d4d4d8"
|
|
443
513
|
);
|
|
444
|
-
|
|
514
|
+
f(
|
|
445
515
|
"Stone",
|
|
446
516
|
{
|
|
447
517
|
primary: "#78716c",
|
|
@@ -455,7 +525,7 @@ l(
|
|
|
455
525
|
{ primary: "#1c1917", secondary: "#44403c", muted: "#a8a29e" },
|
|
456
526
|
"#d6d3d1"
|
|
457
527
|
);
|
|
458
|
-
|
|
528
|
+
f(
|
|
459
529
|
"Cool Gray",
|
|
460
530
|
{
|
|
461
531
|
primary: "#6b7280",
|
|
@@ -469,7 +539,7 @@ l(
|
|
|
469
539
|
{ primary: "#111827", secondary: "#374151", muted: "#9ca3af" },
|
|
470
540
|
"#d1d5db"
|
|
471
541
|
);
|
|
472
|
-
|
|
542
|
+
f(
|
|
473
543
|
"Warm Gray",
|
|
474
544
|
{
|
|
475
545
|
primary: "#7c7568",
|
|
@@ -483,7 +553,7 @@ l(
|
|
|
483
553
|
{ primary: "#1f1d19", secondary: "#4a463d", muted: "#a09888" },
|
|
484
554
|
"#d4d0c8"
|
|
485
555
|
);
|
|
486
|
-
|
|
556
|
+
f(
|
|
487
557
|
"Silver",
|
|
488
558
|
{
|
|
489
559
|
primary: "#94a3b8",
|
|
@@ -497,7 +567,7 @@ l(
|
|
|
497
567
|
{ primary: "#334155", secondary: "#64748b", muted: "#94a3b8" },
|
|
498
568
|
"#cbd5e1"
|
|
499
569
|
);
|
|
500
|
-
|
|
570
|
+
f(
|
|
501
571
|
"Charcoal",
|
|
502
572
|
{
|
|
503
573
|
primary: "#374151",
|
|
@@ -511,7 +581,7 @@ l(
|
|
|
511
581
|
{ primary: "#111827", secondary: "#374151", muted: "#6b7280" },
|
|
512
582
|
"#d1d5db"
|
|
513
583
|
);
|
|
514
|
-
|
|
584
|
+
f(
|
|
515
585
|
"Ivory",
|
|
516
586
|
{
|
|
517
587
|
primary: "#92876d",
|
|
@@ -525,7 +595,7 @@ l(
|
|
|
525
595
|
{ primary: "#2b2517", secondary: "#5c5340", muted: "#9c9280" },
|
|
526
596
|
"#ddd8c4"
|
|
527
597
|
);
|
|
528
|
-
|
|
598
|
+
f(
|
|
529
599
|
"Rose",
|
|
530
600
|
{
|
|
531
601
|
primary: "#e11d48",
|
|
@@ -539,7 +609,7 @@ l(
|
|
|
539
609
|
{ primary: "#4c0519", secondary: "#881337", muted: "#f43f5e" },
|
|
540
610
|
"#fda4af"
|
|
541
611
|
);
|
|
542
|
-
|
|
612
|
+
f(
|
|
543
613
|
"Emerald",
|
|
544
614
|
{
|
|
545
615
|
primary: "#059669",
|
|
@@ -553,7 +623,7 @@ l(
|
|
|
553
623
|
{ primary: "#064e3b", secondary: "#065f46", muted: "#34d399" },
|
|
554
624
|
"#6ee7b7"
|
|
555
625
|
);
|
|
556
|
-
|
|
626
|
+
f(
|
|
557
627
|
"Amber",
|
|
558
628
|
{
|
|
559
629
|
primary: "#d97706",
|
|
@@ -567,7 +637,7 @@ l(
|
|
|
567
637
|
{ primary: "#451a03", secondary: "#78350f", muted: "#f59e0b" },
|
|
568
638
|
"#fcd34d"
|
|
569
639
|
);
|
|
570
|
-
|
|
640
|
+
f(
|
|
571
641
|
"Violet",
|
|
572
642
|
{
|
|
573
643
|
primary: "#7c3aed",
|
|
@@ -581,7 +651,7 @@ l(
|
|
|
581
651
|
{ primary: "#2e1065", secondary: "#4c1d95", muted: "#a78bfa" },
|
|
582
652
|
"#c4b5fd"
|
|
583
653
|
);
|
|
584
|
-
|
|
654
|
+
f(
|
|
585
655
|
"Teal",
|
|
586
656
|
{
|
|
587
657
|
primary: "#0d9488",
|
|
@@ -595,7 +665,7 @@ l(
|
|
|
595
665
|
{ primary: "#134e4a", secondary: "#115e59", muted: "#2dd4bf" },
|
|
596
666
|
"#5eead4"
|
|
597
667
|
);
|
|
598
|
-
|
|
668
|
+
f(
|
|
599
669
|
"Indigo",
|
|
600
670
|
{
|
|
601
671
|
primary: "#4f46e5",
|
|
@@ -609,7 +679,7 @@ l(
|
|
|
609
679
|
{ primary: "#1e1b4b", secondary: "#312e81", muted: "#818cf8" },
|
|
610
680
|
"#a5b4fc"
|
|
611
681
|
);
|
|
612
|
-
|
|
682
|
+
f(
|
|
613
683
|
"Cyan",
|
|
614
684
|
{
|
|
615
685
|
primary: "#0891b2",
|
|
@@ -623,7 +693,7 @@ l(
|
|
|
623
693
|
{ primary: "#164e63", secondary: "#155e75", muted: "#22d3ee" },
|
|
624
694
|
"#67e8f9"
|
|
625
695
|
);
|
|
626
|
-
|
|
696
|
+
f(
|
|
627
697
|
"Lime",
|
|
628
698
|
{
|
|
629
699
|
primary: "#65a30d",
|
|
@@ -637,7 +707,7 @@ l(
|
|
|
637
707
|
{ primary: "#1a2e05", secondary: "#365314", muted: "#84cc16" },
|
|
638
708
|
"#bef264"
|
|
639
709
|
);
|
|
640
|
-
|
|
710
|
+
f(
|
|
641
711
|
"Pink",
|
|
642
712
|
{
|
|
643
713
|
primary: "#db2777",
|
|
@@ -651,7 +721,7 @@ l(
|
|
|
651
721
|
{ primary: "#500724", secondary: "#831843", muted: "#f472b6" },
|
|
652
722
|
"#f9a8d4"
|
|
653
723
|
);
|
|
654
|
-
|
|
724
|
+
f(
|
|
655
725
|
"Orange",
|
|
656
726
|
{
|
|
657
727
|
primary: "#ea580c",
|
|
@@ -665,7 +735,7 @@ l(
|
|
|
665
735
|
{ primary: "#431407", secondary: "#7c2d12", muted: "#fb923c" },
|
|
666
736
|
"#fdba74"
|
|
667
737
|
);
|
|
668
|
-
|
|
738
|
+
f(
|
|
669
739
|
"Fuchsia",
|
|
670
740
|
{
|
|
671
741
|
primary: "#c026d3",
|
|
@@ -679,7 +749,7 @@ l(
|
|
|
679
749
|
{ primary: "#4a044e", secondary: "#701a75", muted: "#d946ef" },
|
|
680
750
|
"#e879f9"
|
|
681
751
|
);
|
|
682
|
-
|
|
752
|
+
f(
|
|
683
753
|
"Sky",
|
|
684
754
|
{
|
|
685
755
|
primary: "#0284c7",
|
|
@@ -693,7 +763,7 @@ l(
|
|
|
693
763
|
{ primary: "#0c4a6e", secondary: "#075985", muted: "#38bdf8" },
|
|
694
764
|
"#7dd3fc"
|
|
695
765
|
);
|
|
696
|
-
|
|
766
|
+
f(
|
|
697
767
|
"Ruby",
|
|
698
768
|
{
|
|
699
769
|
primary: "#be123c",
|
|
@@ -707,7 +777,7 @@ l(
|
|
|
707
777
|
{ primary: "#4c0519", secondary: "#881337", muted: "#fb7185" },
|
|
708
778
|
"#fda4af"
|
|
709
779
|
);
|
|
710
|
-
|
|
780
|
+
f(
|
|
711
781
|
"Coral",
|
|
712
782
|
{
|
|
713
783
|
primary: "#f97316",
|
|
@@ -721,7 +791,7 @@ l(
|
|
|
721
791
|
{ primary: "#431407", secondary: "#9a3412", muted: "#fb923c" },
|
|
722
792
|
"#fdba74"
|
|
723
793
|
);
|
|
724
|
-
|
|
794
|
+
T(
|
|
725
795
|
"Midnight",
|
|
726
796
|
{
|
|
727
797
|
primary: "#818cf8",
|
|
@@ -735,7 +805,7 @@ A(
|
|
|
735
805
|
{ primary: "#f1f5f9", secondary: "#94a3b8", muted: "#475569" },
|
|
736
806
|
"#1e293b"
|
|
737
807
|
);
|
|
738
|
-
|
|
808
|
+
T(
|
|
739
809
|
"Obsidian",
|
|
740
810
|
{
|
|
741
811
|
primary: "#a78bfa",
|
|
@@ -749,7 +819,7 @@ A(
|
|
|
749
819
|
{ primary: "#fafafa", secondary: "#a1a1aa", muted: "#52525b" },
|
|
750
820
|
"#3f3f46"
|
|
751
821
|
);
|
|
752
|
-
|
|
822
|
+
T(
|
|
753
823
|
"Eclipse",
|
|
754
824
|
{
|
|
755
825
|
primary: "#c084fc",
|
|
@@ -763,7 +833,7 @@ A(
|
|
|
763
833
|
{ primary: "#f5f3ff", secondary: "#a78bfa", muted: "#6d5eac" },
|
|
764
834
|
"#3b3266"
|
|
765
835
|
);
|
|
766
|
-
|
|
836
|
+
T(
|
|
767
837
|
"Onyx",
|
|
768
838
|
{
|
|
769
839
|
primary: "#60a5fa",
|
|
@@ -777,7 +847,7 @@ A(
|
|
|
777
847
|
{ primary: "#ffffff", secondary: "#a3a3a3", muted: "#525252" },
|
|
778
848
|
"#262626"
|
|
779
849
|
);
|
|
780
|
-
|
|
850
|
+
T(
|
|
781
851
|
"Carbon",
|
|
782
852
|
{
|
|
783
853
|
primary: "#38bdf8",
|
|
@@ -791,7 +861,7 @@ A(
|
|
|
791
861
|
{ primary: "#f4f4f4", secondary: "#c6c6c6", muted: "#6f6f6f" },
|
|
792
862
|
"#525252"
|
|
793
863
|
);
|
|
794
|
-
|
|
864
|
+
T(
|
|
795
865
|
"Cosmos",
|
|
796
866
|
{
|
|
797
867
|
primary: "#6366f1",
|
|
@@ -805,7 +875,7 @@ A(
|
|
|
805
875
|
{ primary: "#e5e7eb", secondary: "#9ca3af", muted: "#4b5563" },
|
|
806
876
|
"#374151"
|
|
807
877
|
);
|
|
808
|
-
|
|
878
|
+
T(
|
|
809
879
|
"Nebula",
|
|
810
880
|
{
|
|
811
881
|
primary: "#e879f9",
|
|
@@ -819,7 +889,7 @@ A(
|
|
|
819
889
|
{ primary: "#fae8ff", secondary: "#d8b4fe", muted: "#7c3aed" },
|
|
820
890
|
"#581c87"
|
|
821
891
|
);
|
|
822
|
-
|
|
892
|
+
T(
|
|
823
893
|
"Abyss",
|
|
824
894
|
{
|
|
825
895
|
primary: "#22d3ee",
|
|
@@ -833,7 +903,7 @@ A(
|
|
|
833
903
|
{ primary: "#e0f2fe", secondary: "#7dd3fc", muted: "#0369a1" },
|
|
834
904
|
"#075985"
|
|
835
905
|
);
|
|
836
|
-
|
|
906
|
+
T(
|
|
837
907
|
"Shadow",
|
|
838
908
|
{
|
|
839
909
|
primary: "#a3a3a3",
|
|
@@ -847,7 +917,7 @@ A(
|
|
|
847
917
|
{ primary: "#e5e5e5", secondary: "#a3a3a3", muted: "#525252" },
|
|
848
918
|
"#404040"
|
|
849
919
|
);
|
|
850
|
-
|
|
920
|
+
T(
|
|
851
921
|
"Emerald Dark",
|
|
852
922
|
{
|
|
853
923
|
primary: "#34d399",
|
|
@@ -861,7 +931,7 @@ A(
|
|
|
861
931
|
{ primary: "#ecfdf5", secondary: "#6ee7b7", muted: "#047857" },
|
|
862
932
|
"#047857"
|
|
863
933
|
);
|
|
864
|
-
|
|
934
|
+
f(
|
|
865
935
|
"Forest",
|
|
866
936
|
{
|
|
867
937
|
primary: "#166534",
|
|
@@ -875,7 +945,7 @@ l(
|
|
|
875
945
|
{ primary: "#052e16", secondary: "#166534", muted: "#4ade80" },
|
|
876
946
|
"#86efac"
|
|
877
947
|
);
|
|
878
|
-
|
|
948
|
+
f(
|
|
879
949
|
"Ocean",
|
|
880
950
|
{
|
|
881
951
|
primary: "#0369a1",
|
|
@@ -889,7 +959,7 @@ l(
|
|
|
889
959
|
{ primary: "#0c4a6e", secondary: "#0369a1", muted: "#38bdf8" },
|
|
890
960
|
"#7dd3fc"
|
|
891
961
|
);
|
|
892
|
-
|
|
962
|
+
f(
|
|
893
963
|
"Desert",
|
|
894
964
|
{
|
|
895
965
|
primary: "#b45309",
|
|
@@ -903,7 +973,7 @@ l(
|
|
|
903
973
|
{ primary: "#422006", secondary: "#713f12", muted: "#ca8a04" },
|
|
904
974
|
"#fde047"
|
|
905
975
|
);
|
|
906
|
-
|
|
976
|
+
f(
|
|
907
977
|
"Sunset",
|
|
908
978
|
{
|
|
909
979
|
primary: "#ea580c",
|
|
@@ -917,7 +987,7 @@ l(
|
|
|
917
987
|
{ primary: "#431407", secondary: "#9a3412", muted: "#f97316" },
|
|
918
988
|
"#fdba74"
|
|
919
989
|
);
|
|
920
|
-
|
|
990
|
+
f(
|
|
921
991
|
"Aurora",
|
|
922
992
|
{
|
|
923
993
|
primary: "#0d9488",
|
|
@@ -931,7 +1001,7 @@ l(
|
|
|
931
1001
|
{ primary: "#134e4a", secondary: "#115e59", muted: "#2dd4bf" },
|
|
932
1002
|
"#5eead4"
|
|
933
1003
|
);
|
|
934
|
-
|
|
1004
|
+
f(
|
|
935
1005
|
"Lavender",
|
|
936
1006
|
{
|
|
937
1007
|
primary: "#7e22ce",
|
|
@@ -945,7 +1015,7 @@ l(
|
|
|
945
1015
|
{ primary: "#3b0764", secondary: "#581c87", muted: "#a855f7" },
|
|
946
1016
|
"#d8b4fe"
|
|
947
1017
|
);
|
|
948
|
-
|
|
1018
|
+
f(
|
|
949
1019
|
"Autumn",
|
|
950
1020
|
{
|
|
951
1021
|
primary: "#c2410c",
|
|
@@ -959,7 +1029,7 @@ l(
|
|
|
959
1029
|
{ primary: "#450a0a", secondary: "#7f1d1d", muted: "#f87171" },
|
|
960
1030
|
"#fca5a5"
|
|
961
1031
|
);
|
|
962
|
-
|
|
1032
|
+
f(
|
|
963
1033
|
"Spring",
|
|
964
1034
|
{
|
|
965
1035
|
primary: "#16a34a",
|
|
@@ -973,7 +1043,7 @@ l(
|
|
|
973
1043
|
{ primary: "#14532d", secondary: "#166534", muted: "#4ade80" },
|
|
974
1044
|
"#86efac"
|
|
975
1045
|
);
|
|
976
|
-
|
|
1046
|
+
f(
|
|
977
1047
|
"Arctic",
|
|
978
1048
|
{
|
|
979
1049
|
primary: "#0ea5e9",
|
|
@@ -987,7 +1057,7 @@ l(
|
|
|
987
1057
|
{ primary: "#0c4a6e", secondary: "#0369a1", muted: "#7dd3fc" },
|
|
988
1058
|
"#bae6fd"
|
|
989
1059
|
);
|
|
990
|
-
|
|
1060
|
+
f(
|
|
991
1061
|
"Tropical",
|
|
992
1062
|
{
|
|
993
1063
|
primary: "#0d9488",
|
|
@@ -1001,7 +1071,7 @@ l(
|
|
|
1001
1071
|
{ primary: "#064e3b", secondary: "#065f46", muted: "#6ee7b7" },
|
|
1002
1072
|
"#a7f3d0"
|
|
1003
1073
|
);
|
|
1004
|
-
|
|
1074
|
+
f(
|
|
1005
1075
|
"Pastel Rose",
|
|
1006
1076
|
{
|
|
1007
1077
|
primary: "#f472b6",
|
|
@@ -1015,7 +1085,7 @@ l(
|
|
|
1015
1085
|
{ primary: "#831843", secondary: "#9d174d", muted: "#f9a8d4" },
|
|
1016
1086
|
"#f9a8d4"
|
|
1017
1087
|
);
|
|
1018
|
-
|
|
1088
|
+
f(
|
|
1019
1089
|
"Pastel Sky",
|
|
1020
1090
|
{
|
|
1021
1091
|
primary: "#38bdf8",
|
|
@@ -1029,7 +1099,7 @@ l(
|
|
|
1029
1099
|
{ primary: "#075985", secondary: "#0369a1", muted: "#7dd3fc" },
|
|
1030
1100
|
"#bae6fd"
|
|
1031
1101
|
);
|
|
1032
|
-
|
|
1102
|
+
f(
|
|
1033
1103
|
"Pastel Mint",
|
|
1034
1104
|
{
|
|
1035
1105
|
primary: "#34d399",
|
|
@@ -1043,7 +1113,7 @@ l(
|
|
|
1043
1113
|
{ primary: "#065f46", secondary: "#047857", muted: "#6ee7b7" },
|
|
1044
1114
|
"#a7f3d0"
|
|
1045
1115
|
);
|
|
1046
|
-
|
|
1116
|
+
f(
|
|
1047
1117
|
"Pastel Peach",
|
|
1048
1118
|
{
|
|
1049
1119
|
primary: "#fb923c",
|
|
@@ -1057,7 +1127,7 @@ l(
|
|
|
1057
1127
|
{ primary: "#7c2d12", secondary: "#9a3412", muted: "#fdba74" },
|
|
1058
1128
|
"#fed7aa"
|
|
1059
1129
|
);
|
|
1060
|
-
|
|
1130
|
+
f(
|
|
1061
1131
|
"Pastel Lavender",
|
|
1062
1132
|
{
|
|
1063
1133
|
primary: "#a78bfa",
|
|
@@ -1071,7 +1141,7 @@ l(
|
|
|
1071
1141
|
{ primary: "#4c1d95", secondary: "#5b21b6", muted: "#c4b5fd" },
|
|
1072
1142
|
"#ddd6fe"
|
|
1073
1143
|
);
|
|
1074
|
-
|
|
1144
|
+
f(
|
|
1075
1145
|
"Pastel Lemon",
|
|
1076
1146
|
{
|
|
1077
1147
|
primary: "#facc15",
|
|
@@ -1085,7 +1155,7 @@ l(
|
|
|
1085
1155
|
{ primary: "#713f12", secondary: "#854d0e", muted: "#fde047" },
|
|
1086
1156
|
"#fef08a"
|
|
1087
1157
|
);
|
|
1088
|
-
|
|
1158
|
+
f(
|
|
1089
1159
|
"Pastel Sage",
|
|
1090
1160
|
{
|
|
1091
1161
|
primary: "#86efac",
|
|
@@ -1099,7 +1169,7 @@ l(
|
|
|
1099
1169
|
{ primary: "#166534", secondary: "#15803d", muted: "#86efac" },
|
|
1100
1170
|
"#bbf7d0"
|
|
1101
1171
|
);
|
|
1102
|
-
|
|
1172
|
+
f(
|
|
1103
1173
|
"Pastel Coral",
|
|
1104
1174
|
{
|
|
1105
1175
|
primary: "#fb7185",
|
|
@@ -1113,7 +1183,7 @@ l(
|
|
|
1113
1183
|
{ primary: "#881337", secondary: "#9f1239", muted: "#fda4af" },
|
|
1114
1184
|
"#fecdd3"
|
|
1115
1185
|
);
|
|
1116
|
-
|
|
1186
|
+
f(
|
|
1117
1187
|
"Banking",
|
|
1118
1188
|
{
|
|
1119
1189
|
primary: "#1e3a5f",
|
|
@@ -1127,7 +1197,7 @@ l(
|
|
|
1127
1197
|
{ primary: "#0f172a", secondary: "#334155", muted: "#94a3b8" },
|
|
1128
1198
|
"#cbd5e1"
|
|
1129
1199
|
);
|
|
1130
|
-
|
|
1200
|
+
f(
|
|
1131
1201
|
"Healthcare",
|
|
1132
1202
|
{
|
|
1133
1203
|
primary: "#0891b2",
|
|
@@ -1141,7 +1211,7 @@ l(
|
|
|
1141
1211
|
{ primary: "#134e4a", secondary: "#1a6b6a", muted: "#80cbc4" },
|
|
1142
1212
|
"#b2dfdb"
|
|
1143
1213
|
);
|
|
1144
|
-
|
|
1214
|
+
f(
|
|
1145
1215
|
"Legal",
|
|
1146
1216
|
{
|
|
1147
1217
|
primary: "#1e293b",
|
|
@@ -1155,7 +1225,7 @@ l(
|
|
|
1155
1225
|
{ primary: "#0f172a", secondary: "#44403c", muted: "#a8a29e" },
|
|
1156
1226
|
"#d6d3d1"
|
|
1157
1227
|
);
|
|
1158
|
-
|
|
1228
|
+
f(
|
|
1159
1229
|
"Tech Startup",
|
|
1160
1230
|
{
|
|
1161
1231
|
primary: "#7c3aed",
|
|
@@ -1169,7 +1239,7 @@ l(
|
|
|
1169
1239
|
{ primary: "#1e1b4b", secondary: "#4c1d95", muted: "#a78bfa" },
|
|
1170
1240
|
"#c4b5fd"
|
|
1171
1241
|
);
|
|
1172
|
-
|
|
1242
|
+
f(
|
|
1173
1243
|
"Enterprise",
|
|
1174
1244
|
{
|
|
1175
1245
|
primary: "#1e40af",
|
|
@@ -1183,7 +1253,7 @@ l(
|
|
|
1183
1253
|
{ primary: "#1e3a5f", secondary: "#1e40af", muted: "#60a5fa" },
|
|
1184
1254
|
"#93c5fd"
|
|
1185
1255
|
);
|
|
1186
|
-
|
|
1256
|
+
f(
|
|
1187
1257
|
"Government",
|
|
1188
1258
|
{
|
|
1189
1259
|
primary: "#1d4ed8",
|
|
@@ -1197,7 +1267,7 @@ l(
|
|
|
1197
1267
|
{ primary: "#0f172a", secondary: "#1e293b", muted: "#64748b" },
|
|
1198
1268
|
"#cbd5e1"
|
|
1199
1269
|
);
|
|
1200
|
-
|
|
1270
|
+
f(
|
|
1201
1271
|
"Education",
|
|
1202
1272
|
{
|
|
1203
1273
|
primary: "#059669",
|
|
@@ -1211,7 +1281,7 @@ l(
|
|
|
1211
1281
|
{ primary: "#064e3b", secondary: "#065f46", muted: "#6ee7b7" },
|
|
1212
1282
|
"#a7f3d0"
|
|
1213
1283
|
);
|
|
1214
|
-
|
|
1284
|
+
f(
|
|
1215
1285
|
"Real Estate",
|
|
1216
1286
|
{
|
|
1217
1287
|
primary: "#92400e",
|
|
@@ -1225,7 +1295,7 @@ l(
|
|
|
1225
1295
|
{ primary: "#422006", secondary: "#713f12", muted: "#d97706" },
|
|
1226
1296
|
"#fcd34d"
|
|
1227
1297
|
);
|
|
1228
|
-
|
|
1298
|
+
f(
|
|
1229
1299
|
"Nord",
|
|
1230
1300
|
{
|
|
1231
1301
|
primary: "#5e81ac",
|
|
@@ -1239,7 +1309,7 @@ l(
|
|
|
1239
1309
|
{ primary: "#2e3440", secondary: "#3b4252", muted: "#4c566a" },
|
|
1240
1310
|
"#d8dee9"
|
|
1241
1311
|
);
|
|
1242
|
-
|
|
1312
|
+
T(
|
|
1243
1313
|
"Dracula",
|
|
1244
1314
|
{
|
|
1245
1315
|
primary: "#bd93f9",
|
|
@@ -1253,7 +1323,7 @@ A(
|
|
|
1253
1323
|
{ primary: "#f8f8f2", secondary: "#c0c0c0", muted: "#6272a4" },
|
|
1254
1324
|
"#44475a"
|
|
1255
1325
|
);
|
|
1256
|
-
|
|
1326
|
+
f(
|
|
1257
1327
|
"Solarized Light",
|
|
1258
1328
|
{
|
|
1259
1329
|
primary: "#268bd2",
|
|
@@ -1267,7 +1337,7 @@ l(
|
|
|
1267
1337
|
{ primary: "#073642", secondary: "#586e75", muted: "#93a1a1" },
|
|
1268
1338
|
"#eee8d5"
|
|
1269
1339
|
);
|
|
1270
|
-
|
|
1340
|
+
T(
|
|
1271
1341
|
"Solarized Dark",
|
|
1272
1342
|
{
|
|
1273
1343
|
primary: "#268bd2",
|
|
@@ -1281,7 +1351,7 @@ A(
|
|
|
1281
1351
|
{ primary: "#eee8d5", secondary: "#93a1a1", muted: "#586e75" },
|
|
1282
1352
|
"#073642"
|
|
1283
1353
|
);
|
|
1284
|
-
|
|
1354
|
+
T(
|
|
1285
1355
|
"Monokai",
|
|
1286
1356
|
{
|
|
1287
1357
|
primary: "#66d9ef",
|
|
@@ -1295,7 +1365,7 @@ A(
|
|
|
1295
1365
|
{ primary: "#f8f8f2", secondary: "#cfcfc2", muted: "#75715e" },
|
|
1296
1366
|
"#3e3d32"
|
|
1297
1367
|
);
|
|
1298
|
-
|
|
1368
|
+
T(
|
|
1299
1369
|
"One Dark",
|
|
1300
1370
|
{
|
|
1301
1371
|
primary: "#61afef",
|
|
@@ -1309,7 +1379,7 @@ A(
|
|
|
1309
1379
|
{ primary: "#abb2bf", secondary: "#828997", muted: "#545862" },
|
|
1310
1380
|
"#3e4452"
|
|
1311
1381
|
);
|
|
1312
|
-
|
|
1382
|
+
T(
|
|
1313
1383
|
"Synthwave",
|
|
1314
1384
|
{
|
|
1315
1385
|
primary: "#ff7edb",
|
|
@@ -1323,7 +1393,7 @@ A(
|
|
|
1323
1393
|
{ primary: "#f0e4fc", secondary: "#b4a0cc", muted: "#6c5c84" },
|
|
1324
1394
|
"#4a3866"
|
|
1325
1395
|
);
|
|
1326
|
-
|
|
1396
|
+
f(
|
|
1327
1397
|
"Vaporwave",
|
|
1328
1398
|
{
|
|
1329
1399
|
primary: "#ff71ce",
|
|
@@ -1337,7 +1407,7 @@ l(
|
|
|
1337
1407
|
{ primary: "#4a1a4e", secondary: "#7b3f7d", muted: "#c080c0" },
|
|
1338
1408
|
"#d8a8e8"
|
|
1339
1409
|
);
|
|
1340
|
-
|
|
1410
|
+
T(
|
|
1341
1411
|
"Terminal Green",
|
|
1342
1412
|
{
|
|
1343
1413
|
primary: "#00ff41",
|
|
@@ -1351,7 +1421,7 @@ A(
|
|
|
1351
1421
|
{ primary: "#00ff41", secondary: "#00cc33", muted: "#008822" },
|
|
1352
1422
|
"#003300"
|
|
1353
1423
|
);
|
|
1354
|
-
|
|
1424
|
+
f(
|
|
1355
1425
|
"Sepia",
|
|
1356
1426
|
{
|
|
1357
1427
|
primary: "#8b6914",
|
|
@@ -1365,7 +1435,7 @@ l(
|
|
|
1365
1435
|
{ primary: "#3e2723", secondary: "#5d4037", muted: "#a1887f" },
|
|
1366
1436
|
"#d7ccc8"
|
|
1367
1437
|
);
|
|
1368
|
-
|
|
1438
|
+
f(
|
|
1369
1439
|
"Vintage",
|
|
1370
1440
|
{
|
|
1371
1441
|
primary: "#8d6e63",
|
|
@@ -1379,7 +1449,7 @@ l(
|
|
|
1379
1449
|
{ primary: "#3e2723", secondary: "#5d4037", muted: "#a1887f" },
|
|
1380
1450
|
"#bcaaa4"
|
|
1381
1451
|
);
|
|
1382
|
-
|
|
1452
|
+
T(
|
|
1383
1453
|
"Cyberpunk",
|
|
1384
1454
|
{
|
|
1385
1455
|
primary: "#00f0ff",
|
|
@@ -1393,7 +1463,7 @@ A(
|
|
|
1393
1463
|
{ primary: "#e0fbfc", secondary: "#80d4dd", muted: "#3a6b72" },
|
|
1394
1464
|
"#1c3a44"
|
|
1395
1465
|
);
|
|
1396
|
-
|
|
1466
|
+
T(
|
|
1397
1467
|
"Neon",
|
|
1398
1468
|
{
|
|
1399
1469
|
primary: "#ff00ff",
|
|
@@ -1407,7 +1477,7 @@ A(
|
|
|
1407
1477
|
{ primary: "#ffffff", secondary: "#cccccc", muted: "#666666" },
|
|
1408
1478
|
"#333333"
|
|
1409
1479
|
);
|
|
1410
|
-
|
|
1480
|
+
T(
|
|
1411
1481
|
"Retrowave",
|
|
1412
1482
|
{
|
|
1413
1483
|
primary: "#f77fbe",
|
|
@@ -1421,7 +1491,7 @@ A(
|
|
|
1421
1491
|
{ primary: "#ffe6f7", secondary: "#c9a0c9", muted: "#6b4c7a" },
|
|
1422
1492
|
"#4a2d66"
|
|
1423
1493
|
);
|
|
1424
|
-
|
|
1494
|
+
f(
|
|
1425
1495
|
"Christmas",
|
|
1426
1496
|
{
|
|
1427
1497
|
primary: "#c41e3a",
|
|
@@ -1435,7 +1505,7 @@ l(
|
|
|
1435
1505
|
{ primary: "#3b0a0a", secondary: "#7f1d1d", muted: "#dc6868" },
|
|
1436
1506
|
"#e8a0a0"
|
|
1437
1507
|
);
|
|
1438
|
-
|
|
1508
|
+
T(
|
|
1439
1509
|
"Halloween",
|
|
1440
1510
|
{
|
|
1441
1511
|
primary: "#ff6600",
|
|
@@ -1449,7 +1519,7 @@ A(
|
|
|
1449
1519
|
{ primary: "#ffedd5", secondary: "#fdba74", muted: "#9a5c28" },
|
|
1450
1520
|
"#5c3400"
|
|
1451
1521
|
);
|
|
1452
|
-
|
|
1522
|
+
f(
|
|
1453
1523
|
"Valentine",
|
|
1454
1524
|
{
|
|
1455
1525
|
primary: "#e11d48",
|
|
@@ -1463,7 +1533,7 @@ l(
|
|
|
1463
1533
|
{ primary: "#4c0519", secondary: "#881337", muted: "#f9a8d4" },
|
|
1464
1534
|
"#fda4af"
|
|
1465
1535
|
);
|
|
1466
|
-
|
|
1536
|
+
f(
|
|
1467
1537
|
"Easter",
|
|
1468
1538
|
{
|
|
1469
1539
|
primary: "#a78bfa",
|
|
@@ -1477,7 +1547,7 @@ l(
|
|
|
1477
1547
|
{ primary: "#581c87", secondary: "#6d28d9", muted: "#c4b5fd" },
|
|
1478
1548
|
"#ddd6fe"
|
|
1479
1549
|
);
|
|
1480
|
-
|
|
1550
|
+
f(
|
|
1481
1551
|
"Summer Beach",
|
|
1482
1552
|
{
|
|
1483
1553
|
primary: "#0ea5e9",
|
|
@@ -1491,7 +1561,7 @@ l(
|
|
|
1491
1561
|
{ primary: "#0c4a6e", secondary: "#0369a1", muted: "#7dd3fc" },
|
|
1492
1562
|
"#fcd34d"
|
|
1493
1563
|
);
|
|
1494
|
-
|
|
1564
|
+
f(
|
|
1495
1565
|
"Winter Frost",
|
|
1496
1566
|
{
|
|
1497
1567
|
primary: "#3b82f6",
|
|
@@ -1505,7 +1575,7 @@ l(
|
|
|
1505
1575
|
{ primary: "#1e3a5f", secondary: "#1e40af", muted: "#93c5fd" },
|
|
1506
1576
|
"#bfdbfe"
|
|
1507
1577
|
);
|
|
1508
|
-
|
|
1578
|
+
f(
|
|
1509
1579
|
"Cherry Blossom",
|
|
1510
1580
|
{
|
|
1511
1581
|
primary: "#ec4899",
|
|
@@ -1519,7 +1589,7 @@ l(
|
|
|
1519
1589
|
{ primary: "#831843", secondary: "#9d174d", muted: "#f9a8d4" },
|
|
1520
1590
|
"#fbcfe8"
|
|
1521
1591
|
);
|
|
1522
|
-
|
|
1592
|
+
f(
|
|
1523
1593
|
"Harvest",
|
|
1524
1594
|
{
|
|
1525
1595
|
primary: "#b45309",
|
|
@@ -1533,7 +1603,7 @@ l(
|
|
|
1533
1603
|
{ primary: "#451a03", secondary: "#78350f", muted: "#d97706" },
|
|
1534
1604
|
"#fcd34d"
|
|
1535
1605
|
);
|
|
1536
|
-
|
|
1606
|
+
f(
|
|
1537
1607
|
"Japanese Zen",
|
|
1538
1608
|
{
|
|
1539
1609
|
primary: "#6b7280",
|
|
@@ -1547,7 +1617,7 @@ l(
|
|
|
1547
1617
|
{ primary: "#2c2c2c", secondary: "#5c5c5c", muted: "#a0998a" },
|
|
1548
1618
|
"#d5cec0"
|
|
1549
1619
|
);
|
|
1550
|
-
|
|
1620
|
+
f(
|
|
1551
1621
|
"Moroccan",
|
|
1552
1622
|
{
|
|
1553
1623
|
primary: "#c2410c",
|
|
@@ -1561,7 +1631,7 @@ l(
|
|
|
1561
1631
|
{ primary: "#3a1a00", secondary: "#7c2d12", muted: "#d97706" },
|
|
1562
1632
|
"#f5d0a0"
|
|
1563
1633
|
);
|
|
1564
|
-
|
|
1634
|
+
f(
|
|
1565
1635
|
"Scandinavian",
|
|
1566
1636
|
{
|
|
1567
1637
|
primary: "#4b5563",
|
|
@@ -1575,7 +1645,7 @@ l(
|
|
|
1575
1645
|
{ primary: "#111827", secondary: "#374151", muted: "#9ca3af" },
|
|
1576
1646
|
"#e5e7eb"
|
|
1577
1647
|
);
|
|
1578
|
-
|
|
1648
|
+
f(
|
|
1579
1649
|
"Mediterranean",
|
|
1580
1650
|
{
|
|
1581
1651
|
primary: "#1e40af",
|
|
@@ -1589,7 +1659,7 @@ l(
|
|
|
1589
1659
|
{ primary: "#1e3a5f", secondary: "#2563eb", muted: "#93c5fd" },
|
|
1590
1660
|
"#bfdbfe"
|
|
1591
1661
|
);
|
|
1592
|
-
|
|
1662
|
+
f(
|
|
1593
1663
|
"Chinese New Year",
|
|
1594
1664
|
{
|
|
1595
1665
|
primary: "#dc2626",
|
|
@@ -1603,7 +1673,7 @@ l(
|
|
|
1603
1673
|
{ primary: "#450a0a", secondary: "#991b1b", muted: "#f87171" },
|
|
1604
1674
|
"#fca5a5"
|
|
1605
1675
|
);
|
|
1606
|
-
|
|
1676
|
+
f(
|
|
1607
1677
|
"Indian Festive",
|
|
1608
1678
|
{
|
|
1609
1679
|
primary: "#d97706",
|
|
@@ -1617,7 +1687,7 @@ l(
|
|
|
1617
1687
|
{ primary: "#451a03", secondary: "#92400e", muted: "#f59e0b" },
|
|
1618
1688
|
"#fcd34d"
|
|
1619
1689
|
);
|
|
1620
|
-
|
|
1690
|
+
f(
|
|
1621
1691
|
"Brazilian Carnival",
|
|
1622
1692
|
{
|
|
1623
1693
|
primary: "#16a34a",
|
|
@@ -1631,7 +1701,7 @@ l(
|
|
|
1631
1701
|
{ primary: "#052e16", secondary: "#166534", muted: "#4ade80" },
|
|
1632
1702
|
"#86efac"
|
|
1633
1703
|
);
|
|
1634
|
-
|
|
1704
|
+
f(
|
|
1635
1705
|
"African Earth",
|
|
1636
1706
|
{
|
|
1637
1707
|
primary: "#92400e",
|
|
@@ -1645,7 +1715,7 @@ l(
|
|
|
1645
1715
|
{ primary: "#2b1a0e", secondary: "#5c3d1e", muted: "#a08060" },
|
|
1646
1716
|
"#d4b896"
|
|
1647
1717
|
);
|
|
1648
|
-
|
|
1718
|
+
T(
|
|
1649
1719
|
"High Contrast Dark",
|
|
1650
1720
|
{
|
|
1651
1721
|
primary: "#ffff00",
|
|
@@ -1659,7 +1729,7 @@ A(
|
|
|
1659
1729
|
{ primary: "#ffffff", secondary: "#ffffff", muted: "#cccccc" },
|
|
1660
1730
|
"#ffffff"
|
|
1661
1731
|
);
|
|
1662
|
-
|
|
1732
|
+
f(
|
|
1663
1733
|
"Monochrome",
|
|
1664
1734
|
{
|
|
1665
1735
|
primary: "#404040",
|
|
@@ -1673,7 +1743,7 @@ l(
|
|
|
1673
1743
|
{ primary: "#1a1a1a", secondary: "#404040", muted: "#808080" },
|
|
1674
1744
|
"#c0c0c0"
|
|
1675
1745
|
);
|
|
1676
|
-
|
|
1746
|
+
f(
|
|
1677
1747
|
"Enhanced Contrast",
|
|
1678
1748
|
{
|
|
1679
1749
|
primary: "#0050b3",
|
|
@@ -1687,7 +1757,7 @@ l(
|
|
|
1687
1757
|
{ primary: "#000000", secondary: "#1a1a1a", muted: "#595959" },
|
|
1688
1758
|
"#8c8c8c"
|
|
1689
1759
|
);
|
|
1690
|
-
|
|
1760
|
+
f(
|
|
1691
1761
|
"Minimalist",
|
|
1692
1762
|
{
|
|
1693
1763
|
primary: "#18181b",
|
|
@@ -1701,7 +1771,7 @@ l(
|
|
|
1701
1771
|
{ primary: "#0a0a0a", secondary: "#404040", muted: "#a3a3a3" },
|
|
1702
1772
|
"#e5e5e5"
|
|
1703
1773
|
);
|
|
1704
|
-
|
|
1774
|
+
T(
|
|
1705
1775
|
"Warm Dark",
|
|
1706
1776
|
{
|
|
1707
1777
|
primary: "#f59e0b",
|
|
@@ -1715,7 +1785,7 @@ A(
|
|
|
1715
1785
|
{ primary: "#fafaf9", secondary: "#d6d3d1", muted: "#78716c" },
|
|
1716
1786
|
"#57534e"
|
|
1717
1787
|
);
|
|
1718
|
-
|
|
1788
|
+
T(
|
|
1719
1789
|
"Soft Dark",
|
|
1720
1790
|
{
|
|
1721
1791
|
primary: "#a78bfa",
|
|
@@ -1729,7 +1799,7 @@ A(
|
|
|
1729
1799
|
{ primary: "#e8e8f0", secondary: "#a0a0b8", muted: "#5c5c74" },
|
|
1730
1800
|
"#3e3e58"
|
|
1731
1801
|
);
|
|
1732
|
-
|
|
1802
|
+
f(
|
|
1733
1803
|
"Coffee",
|
|
1734
1804
|
{
|
|
1735
1805
|
primary: "#6f4e37",
|
|
@@ -1743,7 +1813,7 @@ l(
|
|
|
1743
1813
|
{ primary: "#2c1a0e", secondary: "#5c3d28", muted: "#a08868" },
|
|
1744
1814
|
"#d4c4a8"
|
|
1745
1815
|
);
|
|
1746
|
-
|
|
1816
|
+
f(
|
|
1747
1817
|
"Wine",
|
|
1748
1818
|
{
|
|
1749
1819
|
primary: "#7f1d1d",
|
|
@@ -1757,8 +1827,9 @@ l(
|
|
|
1757
1827
|
{ primary: "#3b0a0a", secondary: "#7f1d1d", muted: "#dc6868" },
|
|
1758
1828
|
"#e8a0a0"
|
|
1759
1829
|
);
|
|
1760
|
-
|
|
1761
|
-
|
|
1830
|
+
D(null);
|
|
1831
|
+
D(null);
|
|
1832
|
+
const ze = [
|
|
1762
1833
|
{
|
|
1763
1834
|
target: ".nice-api-designer",
|
|
1764
1835
|
titleKey: "tutorial.apiDesigner.intro.title",
|
|
@@ -1767,7 +1838,7 @@ const Ve = [
|
|
|
1767
1838
|
content: "Define endpoints, parameters, request/response schemas and security for your OpenAPI document.",
|
|
1768
1839
|
placement: "auto"
|
|
1769
1840
|
}
|
|
1770
|
-
],
|
|
1841
|
+
], Fe = {
|
|
1771
1842
|
openapi: "3.0.3",
|
|
1772
1843
|
info: {
|
|
1773
1844
|
title: "New API",
|
|
@@ -1780,44 +1851,44 @@ const Ve = [
|
|
|
1780
1851
|
securitySchemes: {}
|
|
1781
1852
|
},
|
|
1782
1853
|
tags: []
|
|
1783
|
-
},
|
|
1784
|
-
function
|
|
1854
|
+
}, He = ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD"];
|
|
1855
|
+
function pe(r) {
|
|
1785
1856
|
var i, n;
|
|
1786
1857
|
const a = [];
|
|
1787
|
-
return
|
|
1788
|
-
|
|
1789
|
-
const y = u[
|
|
1858
|
+
return r.openapi || a.push({ path: "openapi", message: "OpenAPI version is required", severity: "error" }), (i = r.info) != null && i.title || a.push({ path: "info.title", message: "API title is required", severity: "error" }), (n = r.info) != null && n.version || a.push({ path: "info.version", message: "API version is required", severity: "error" }), Object.entries(r.paths || {}).forEach(([c, u]) => {
|
|
1859
|
+
c.startsWith("/") || a.push({ path: `paths.${c}`, message: "Path must start with /", severity: "error" }), He.forEach((l) => {
|
|
1860
|
+
const y = u[l.toLowerCase()];
|
|
1790
1861
|
y && !y.responses && a.push({
|
|
1791
|
-
path: `paths.${
|
|
1862
|
+
path: `paths.${c}.${l.toLowerCase()}.responses`,
|
|
1792
1863
|
message: "Responses are required",
|
|
1793
1864
|
severity: "error"
|
|
1794
1865
|
});
|
|
1795
1866
|
});
|
|
1796
1867
|
}), a;
|
|
1797
1868
|
}
|
|
1798
|
-
function
|
|
1799
|
-
schema:
|
|
1869
|
+
function wr({
|
|
1870
|
+
schema: r,
|
|
1800
1871
|
onChange: a,
|
|
1801
1872
|
onSave: i,
|
|
1802
1873
|
readOnly: n = !1,
|
|
1803
|
-
className:
|
|
1874
|
+
className: c = "",
|
|
1804
1875
|
tutorial: u
|
|
1805
1876
|
}) {
|
|
1806
|
-
var
|
|
1807
|
-
const [
|
|
1877
|
+
var I, j;
|
|
1878
|
+
const [l, y] = v(r || Fe), [b, d] = v(null), [h, S] = v(null), [m, k] = v("info"), [g, P] = v([]), C = R(
|
|
1808
1879
|
(w) => {
|
|
1809
|
-
y((
|
|
1810
|
-
const
|
|
1811
|
-
return a == null || a(
|
|
1880
|
+
y((N) => {
|
|
1881
|
+
const x = w(N);
|
|
1882
|
+
return a == null || a(x), P(pe(x)), x;
|
|
1812
1883
|
});
|
|
1813
1884
|
},
|
|
1814
1885
|
[a]
|
|
1815
|
-
),
|
|
1886
|
+
), O = R(() => {
|
|
1816
1887
|
const w = "/new-endpoint";
|
|
1817
|
-
|
|
1818
|
-
...
|
|
1888
|
+
C((N) => ({
|
|
1889
|
+
...N,
|
|
1819
1890
|
paths: {
|
|
1820
|
-
...
|
|
1891
|
+
...N.paths,
|
|
1821
1892
|
[w]: {
|
|
1822
1893
|
get: {
|
|
1823
1894
|
summary: "New endpoint",
|
|
@@ -1825,204 +1896,213 @@ function _r({
|
|
|
1825
1896
|
}
|
|
1826
1897
|
}
|
|
1827
1898
|
}
|
|
1828
|
-
})), d(w),
|
|
1829
|
-
}, [
|
|
1899
|
+
})), d(w), S("get");
|
|
1900
|
+
}, [C]), U = R(
|
|
1830
1901
|
(w) => {
|
|
1831
|
-
|
|
1832
|
-
const { [w]:
|
|
1833
|
-
return { ...
|
|
1834
|
-
}), d(null),
|
|
1902
|
+
C((N) => {
|
|
1903
|
+
const { [w]: x, ...K } = N.paths;
|
|
1904
|
+
return { ...N, paths: K };
|
|
1905
|
+
}), d(null), S(null);
|
|
1835
1906
|
},
|
|
1836
|
-
[
|
|
1837
|
-
),
|
|
1907
|
+
[C]
|
|
1908
|
+
), W = R(() => {
|
|
1838
1909
|
const w = "NewSchema";
|
|
1839
|
-
|
|
1840
|
-
var
|
|
1910
|
+
C((N) => {
|
|
1911
|
+
var x;
|
|
1841
1912
|
return {
|
|
1842
|
-
...
|
|
1913
|
+
...N,
|
|
1843
1914
|
components: {
|
|
1844
|
-
...
|
|
1915
|
+
...N.components,
|
|
1845
1916
|
schemas: {
|
|
1846
|
-
...(
|
|
1917
|
+
...(x = N.components) == null ? void 0 : x.schemas,
|
|
1847
1918
|
[w]: { type: "object", properties: {} }
|
|
1848
1919
|
}
|
|
1849
1920
|
}
|
|
1850
1921
|
};
|
|
1851
1922
|
});
|
|
1852
|
-
}, [
|
|
1853
|
-
const w =
|
|
1854
|
-
|
|
1855
|
-
}, [
|
|
1856
|
-
([w,
|
|
1857
|
-
(
|
|
1923
|
+
}, [C]), $ = R(() => {
|
|
1924
|
+
const w = pe(l);
|
|
1925
|
+
P(w), w.filter((N) => N.severity === "error").length === 0 && (i == null || i(l));
|
|
1926
|
+
}, [l, i]), L = Object.entries(l.paths).flatMap(
|
|
1927
|
+
([w, N]) => He.filter((x) => N[x.toLowerCase()]).map(
|
|
1928
|
+
(x) => ({
|
|
1858
1929
|
path: w,
|
|
1859
|
-
method:
|
|
1860
|
-
operation: x
|
|
1930
|
+
method: x,
|
|
1931
|
+
operation: N[x.toLowerCase()]
|
|
1861
1932
|
})
|
|
1862
1933
|
)
|
|
1863
1934
|
);
|
|
1864
|
-
return /* @__PURE__ */ t("div", {
|
|
1865
|
-
u && /* @__PURE__ */
|
|
1866
|
-
/* @__PURE__ */
|
|
1867
|
-
|
|
1868
|
-
"button",
|
|
1869
|
-
{
|
|
1870
|
-
className: `nice-api-designer__tab ${m === w ? "nice-api-designer__tab--active" : ""}`,
|
|
1871
|
-
onClick: () => T(w),
|
|
1872
|
-
children: w.charAt(0).toUpperCase() + w.slice(1)
|
|
1873
|
-
},
|
|
1874
|
-
w
|
|
1875
|
-
)) }),
|
|
1876
|
-
!n && /* @__PURE__ */ r("button", { className: "nice-api-designer__save-btn", onClick: $, children: "Save" })
|
|
1877
|
-
] }),
|
|
1878
|
-
_.length > 0 && /* @__PURE__ */ r("div", { className: "nice-api-designer__errors", children: _.map((w, x) => /* @__PURE__ */ t(
|
|
1879
|
-
"div",
|
|
1935
|
+
return /* @__PURE__ */ t("div", { style: { position: "relative", height: "100%" }, children: [
|
|
1936
|
+
u && /* @__PURE__ */ e("div", { style: { position: "absolute", top: 8, right: 8, zIndex: 5 }, children: /* @__PURE__ */ e(ie, { steps: ae(u, ze) }) }),
|
|
1937
|
+
/* @__PURE__ */ e(
|
|
1938
|
+
de,
|
|
1880
1939
|
{
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
]
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
{
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1940
|
+
flush: !0,
|
|
1941
|
+
className: `nice-api-designer ${c}`,
|
|
1942
|
+
height: "100%",
|
|
1943
|
+
style: { minHeight: 600 },
|
|
1944
|
+
toolbar: /* @__PURE__ */ t("div", { className: "nice-api-designer__toolbar", children: [
|
|
1945
|
+
/* @__PURE__ */ e("div", { className: "nice-api-designer__tabs", children: ["info", "paths", "schemas", "security", "preview"].map((w) => /* @__PURE__ */ e(
|
|
1946
|
+
"button",
|
|
1947
|
+
{
|
|
1948
|
+
className: `nice-api-designer__tab ${m === w ? "nice-api-designer__tab--active" : ""}`,
|
|
1949
|
+
onClick: () => k(w),
|
|
1950
|
+
children: w.charAt(0).toUpperCase() + w.slice(1)
|
|
1951
|
+
},
|
|
1952
|
+
w
|
|
1953
|
+
)) }),
|
|
1954
|
+
!n && /* @__PURE__ */ e("button", { className: "nice-api-designer__save-btn", onClick: $, children: "Save" })
|
|
1955
|
+
] }),
|
|
1956
|
+
bottomPanel: g.length > 0 ? /* @__PURE__ */ e("div", { className: "nice-api-designer__errors", children: g.map((w, N) => /* @__PURE__ */ t(
|
|
1957
|
+
"div",
|
|
1958
|
+
{
|
|
1959
|
+
className: `nice-api-designer__error nice-api-designer__error--${w.severity}`,
|
|
1960
|
+
children: [
|
|
1961
|
+
/* @__PURE__ */ t("strong", { children: [
|
|
1962
|
+
w.path,
|
|
1963
|
+
":"
|
|
1964
|
+
] }),
|
|
1965
|
+
" ",
|
|
1966
|
+
w.message
|
|
1967
|
+
]
|
|
1904
1968
|
},
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
readOnly: n
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1969
|
+
N
|
|
1970
|
+
)) }) : void 0,
|
|
1971
|
+
children: /* @__PURE__ */ t("div", { className: "nice-api-designer__content", children: [
|
|
1972
|
+
m === "info" && /* @__PURE__ */ e(We, { schema: l, onChange: C, readOnly: n }),
|
|
1973
|
+
m === "paths" && /* @__PURE__ */ e(
|
|
1974
|
+
Je,
|
|
1975
|
+
{
|
|
1976
|
+
endpoints: L,
|
|
1977
|
+
schema: l,
|
|
1978
|
+
selectedPath: b,
|
|
1979
|
+
selectedMethod: h,
|
|
1980
|
+
onSelectEndpoint: (w, N) => {
|
|
1981
|
+
d(w), S(N);
|
|
1982
|
+
},
|
|
1983
|
+
onAdd: O,
|
|
1984
|
+
onDelete: U,
|
|
1985
|
+
onChange: C,
|
|
1986
|
+
readOnly: n
|
|
1987
|
+
}
|
|
1988
|
+
),
|
|
1989
|
+
m === "schemas" && /* @__PURE__ */ e(
|
|
1990
|
+
Ge,
|
|
1991
|
+
{
|
|
1992
|
+
schemas: ((I = l.components) == null ? void 0 : I.schemas) || {},
|
|
1993
|
+
onAdd: W,
|
|
1994
|
+
onChange: (w) => C((N) => ({
|
|
1995
|
+
...N,
|
|
1996
|
+
components: { ...N.components, schemas: w }
|
|
1997
|
+
})),
|
|
1998
|
+
readOnly: n
|
|
1999
|
+
}
|
|
2000
|
+
),
|
|
2001
|
+
m === "security" && /* @__PURE__ */ e(
|
|
2002
|
+
Xe,
|
|
2003
|
+
{
|
|
2004
|
+
schemes: ((j = l.components) == null ? void 0 : j.securitySchemes) || {},
|
|
2005
|
+
onChange: (w) => C((N) => ({
|
|
2006
|
+
...N,
|
|
2007
|
+
components: { ...N.components, securitySchemes: w }
|
|
2008
|
+
})),
|
|
2009
|
+
readOnly: n
|
|
2010
|
+
}
|
|
2011
|
+
),
|
|
2012
|
+
m === "preview" && /* @__PURE__ */ e(Ye, { schema: l })
|
|
2013
|
+
] })
|
|
2014
|
+
}
|
|
2015
|
+
)
|
|
1936
2016
|
] });
|
|
1937
2017
|
}
|
|
1938
|
-
function
|
|
2018
|
+
function We({ schema: r, onChange: a, readOnly: i }) {
|
|
1939
2019
|
return /* @__PURE__ */ t("div", { className: "nice-api-designer__info-editor", children: [
|
|
1940
|
-
/* @__PURE__ */
|
|
2020
|
+
/* @__PURE__ */ e("h3", { children: "API Information" }),
|
|
1941
2021
|
/* @__PURE__ */ t("div", { className: "nice-api-designer__field", children: [
|
|
1942
|
-
/* @__PURE__ */
|
|
1943
|
-
/* @__PURE__ */
|
|
2022
|
+
/* @__PURE__ */ e("label", { children: "Title" }),
|
|
2023
|
+
/* @__PURE__ */ e(
|
|
1944
2024
|
"input",
|
|
1945
2025
|
{
|
|
1946
2026
|
type: "text",
|
|
1947
|
-
value:
|
|
1948
|
-
onChange: (n) => a((
|
|
1949
|
-
...
|
|
1950
|
-
info: { ...
|
|
2027
|
+
value: r.info.title,
|
|
2028
|
+
onChange: (n) => a((c) => ({
|
|
2029
|
+
...c,
|
|
2030
|
+
info: { ...c.info, title: n.target.value }
|
|
1951
2031
|
})),
|
|
1952
2032
|
disabled: i
|
|
1953
2033
|
}
|
|
1954
2034
|
)
|
|
1955
2035
|
] }),
|
|
1956
2036
|
/* @__PURE__ */ t("div", { className: "nice-api-designer__field", children: [
|
|
1957
|
-
/* @__PURE__ */
|
|
1958
|
-
/* @__PURE__ */
|
|
2037
|
+
/* @__PURE__ */ e("label", { children: "Version" }),
|
|
2038
|
+
/* @__PURE__ */ e(
|
|
1959
2039
|
"input",
|
|
1960
2040
|
{
|
|
1961
2041
|
type: "text",
|
|
1962
|
-
value:
|
|
1963
|
-
onChange: (n) => a((
|
|
1964
|
-
...
|
|
1965
|
-
info: { ...
|
|
2042
|
+
value: r.info.version,
|
|
2043
|
+
onChange: (n) => a((c) => ({
|
|
2044
|
+
...c,
|
|
2045
|
+
info: { ...c.info, version: n.target.value }
|
|
1966
2046
|
})),
|
|
1967
2047
|
disabled: i
|
|
1968
2048
|
}
|
|
1969
2049
|
)
|
|
1970
2050
|
] }),
|
|
1971
2051
|
/* @__PURE__ */ t("div", { className: "nice-api-designer__field", children: [
|
|
1972
|
-
/* @__PURE__ */
|
|
1973
|
-
/* @__PURE__ */
|
|
2052
|
+
/* @__PURE__ */ e("label", { children: "Description" }),
|
|
2053
|
+
/* @__PURE__ */ e(
|
|
1974
2054
|
"textarea",
|
|
1975
2055
|
{
|
|
1976
|
-
value:
|
|
1977
|
-
onChange: (n) => a((
|
|
1978
|
-
...
|
|
1979
|
-
info: { ...
|
|
2056
|
+
value: r.info.description || "",
|
|
2057
|
+
onChange: (n) => a((c) => ({
|
|
2058
|
+
...c,
|
|
2059
|
+
info: { ...c.info, description: n.target.value }
|
|
1980
2060
|
})),
|
|
1981
2061
|
disabled: i,
|
|
1982
2062
|
rows: 5
|
|
1983
2063
|
}
|
|
1984
2064
|
)
|
|
1985
2065
|
] }),
|
|
1986
|
-
/* @__PURE__ */
|
|
1987
|
-
(
|
|
1988
|
-
/* @__PURE__ */
|
|
2066
|
+
/* @__PURE__ */ e("h4", { children: "Servers" }),
|
|
2067
|
+
(r.servers || []).map((n, c) => /* @__PURE__ */ t("div", { className: "nice-api-designer__server", children: [
|
|
2068
|
+
/* @__PURE__ */ e(
|
|
1989
2069
|
"input",
|
|
1990
2070
|
{
|
|
1991
2071
|
type: "text",
|
|
1992
2072
|
value: n.url,
|
|
1993
2073
|
placeholder: "Server URL",
|
|
1994
|
-
onChange: (u) => a((
|
|
2074
|
+
onChange: (u) => a((l) => {
|
|
1995
2075
|
var y;
|
|
1996
2076
|
return {
|
|
1997
|
-
...
|
|
1998
|
-
servers: (y =
|
|
1999
|
-
(b, d) => d ===
|
|
2077
|
+
...l,
|
|
2078
|
+
servers: (y = l.servers) == null ? void 0 : y.map(
|
|
2079
|
+
(b, d) => d === c ? { ...b, url: u.target.value } : b
|
|
2000
2080
|
)
|
|
2001
2081
|
};
|
|
2002
2082
|
}),
|
|
2003
2083
|
disabled: i
|
|
2004
2084
|
}
|
|
2005
2085
|
),
|
|
2006
|
-
/* @__PURE__ */
|
|
2086
|
+
/* @__PURE__ */ e(
|
|
2007
2087
|
"input",
|
|
2008
2088
|
{
|
|
2009
2089
|
type: "text",
|
|
2010
2090
|
value: n.description || "",
|
|
2011
2091
|
placeholder: "Description",
|
|
2012
|
-
onChange: (u) => a((
|
|
2092
|
+
onChange: (u) => a((l) => {
|
|
2013
2093
|
var y;
|
|
2014
2094
|
return {
|
|
2015
|
-
...
|
|
2016
|
-
servers: (y =
|
|
2017
|
-
(b, d) => d ===
|
|
2095
|
+
...l,
|
|
2096
|
+
servers: (y = l.servers) == null ? void 0 : y.map(
|
|
2097
|
+
(b, d) => d === c ? { ...b, description: u.target.value } : b
|
|
2018
2098
|
)
|
|
2019
2099
|
};
|
|
2020
2100
|
}),
|
|
2021
2101
|
disabled: i
|
|
2022
2102
|
}
|
|
2023
2103
|
)
|
|
2024
|
-
] },
|
|
2025
|
-
!i && /* @__PURE__ */
|
|
2104
|
+
] }, c)),
|
|
2105
|
+
!i && /* @__PURE__ */ e(
|
|
2026
2106
|
"button",
|
|
2027
2107
|
{
|
|
2028
2108
|
onClick: () => a((n) => ({
|
|
@@ -2034,42 +2114,42 @@ function Fe({ schema: e, onChange: a, readOnly: i }) {
|
|
|
2034
2114
|
)
|
|
2035
2115
|
] });
|
|
2036
2116
|
}
|
|
2037
|
-
function
|
|
2038
|
-
endpoints:
|
|
2117
|
+
function Je({
|
|
2118
|
+
endpoints: r,
|
|
2039
2119
|
schema: a,
|
|
2040
2120
|
selectedPath: i,
|
|
2041
2121
|
selectedMethod: n,
|
|
2042
|
-
onSelectEndpoint:
|
|
2122
|
+
onSelectEndpoint: c,
|
|
2043
2123
|
onAdd: u,
|
|
2044
|
-
onDelete:
|
|
2124
|
+
onDelete: l,
|
|
2045
2125
|
onChange: y,
|
|
2046
2126
|
readOnly: b
|
|
2047
2127
|
}) {
|
|
2048
|
-
var
|
|
2049
|
-
const d = i && n ? (
|
|
2128
|
+
var h;
|
|
2129
|
+
const d = i && n ? (h = a.paths[i]) == null ? void 0 : h[n] : null;
|
|
2050
2130
|
return /* @__PURE__ */ t("div", { className: "nice-api-designer__paths-editor", children: [
|
|
2051
2131
|
/* @__PURE__ */ t("div", { className: "nice-api-designer__endpoints-list", children: [
|
|
2052
2132
|
/* @__PURE__ */ t("div", { className: "nice-api-designer__list-header", children: [
|
|
2053
|
-
/* @__PURE__ */
|
|
2054
|
-
!b && /* @__PURE__ */
|
|
2133
|
+
/* @__PURE__ */ e("h3", { children: "Endpoints" }),
|
|
2134
|
+
!b && /* @__PURE__ */ e("button", { onClick: u, children: "+ Add" })
|
|
2055
2135
|
] }),
|
|
2056
|
-
|
|
2136
|
+
r.map(({ path: S, method: m }) => /* @__PURE__ */ t(
|
|
2057
2137
|
"div",
|
|
2058
2138
|
{
|
|
2059
|
-
className: `nice-api-designer__endpoint ${i ===
|
|
2060
|
-
onClick: () =>
|
|
2139
|
+
className: `nice-api-designer__endpoint ${i === S && n === m.toLowerCase() ? "nice-api-designer__endpoint--selected" : ""}`,
|
|
2140
|
+
onClick: () => c(S, m.toLowerCase()),
|
|
2061
2141
|
children: [
|
|
2062
|
-
/* @__PURE__ */
|
|
2142
|
+
/* @__PURE__ */ e(
|
|
2063
2143
|
"span",
|
|
2064
2144
|
{
|
|
2065
2145
|
className: `nice-api-designer__method nice-api-designer__method--${m.toLowerCase()}`,
|
|
2066
2146
|
children: m
|
|
2067
2147
|
}
|
|
2068
2148
|
),
|
|
2069
|
-
/* @__PURE__ */
|
|
2149
|
+
/* @__PURE__ */ e("span", { className: "nice-api-designer__path", children: S })
|
|
2070
2150
|
]
|
|
2071
2151
|
},
|
|
2072
|
-
`${m}-${
|
|
2152
|
+
`${m}-${S}`
|
|
2073
2153
|
))
|
|
2074
2154
|
] }),
|
|
2075
2155
|
d && i && n && /* @__PURE__ */ t("div", { className: "nice-api-designer__operation-editor", children: [
|
|
@@ -2079,13 +2159,13 @@ function We({
|
|
|
2079
2159
|
i
|
|
2080
2160
|
] }),
|
|
2081
2161
|
/* @__PURE__ */ t("div", { className: "nice-api-designer__field", children: [
|
|
2082
|
-
/* @__PURE__ */
|
|
2083
|
-
/* @__PURE__ */
|
|
2162
|
+
/* @__PURE__ */ e("label", { children: "Summary" }),
|
|
2163
|
+
/* @__PURE__ */ e(
|
|
2084
2164
|
"input",
|
|
2085
2165
|
{
|
|
2086
2166
|
type: "text",
|
|
2087
2167
|
value: d.summary || "",
|
|
2088
|
-
onChange: (
|
|
2168
|
+
onChange: (S) => y((m) => ({
|
|
2089
2169
|
...m,
|
|
2090
2170
|
paths: {
|
|
2091
2171
|
...m.paths,
|
|
@@ -2093,7 +2173,7 @@ function We({
|
|
|
2093
2173
|
...m.paths[i],
|
|
2094
2174
|
[n]: {
|
|
2095
2175
|
...d,
|
|
2096
|
-
summary:
|
|
2176
|
+
summary: S.target.value
|
|
2097
2177
|
}
|
|
2098
2178
|
}
|
|
2099
2179
|
}
|
|
@@ -2103,12 +2183,12 @@ function We({
|
|
|
2103
2183
|
)
|
|
2104
2184
|
] }),
|
|
2105
2185
|
/* @__PURE__ */ t("div", { className: "nice-api-designer__field", children: [
|
|
2106
|
-
/* @__PURE__ */
|
|
2107
|
-
/* @__PURE__ */
|
|
2186
|
+
/* @__PURE__ */ e("label", { children: "Description" }),
|
|
2187
|
+
/* @__PURE__ */ e(
|
|
2108
2188
|
"textarea",
|
|
2109
2189
|
{
|
|
2110
2190
|
value: d.description || "",
|
|
2111
|
-
onChange: (
|
|
2191
|
+
onChange: (S) => y((m) => ({
|
|
2112
2192
|
...m,
|
|
2113
2193
|
paths: {
|
|
2114
2194
|
...m.paths,
|
|
@@ -2116,7 +2196,7 @@ function We({
|
|
|
2116
2196
|
...m.paths[i],
|
|
2117
2197
|
[n]: {
|
|
2118
2198
|
...d,
|
|
2119
|
-
description:
|
|
2199
|
+
description: S.target.value
|
|
2120
2200
|
}
|
|
2121
2201
|
}
|
|
2122
2202
|
}
|
|
@@ -2127,13 +2207,13 @@ function We({
|
|
|
2127
2207
|
)
|
|
2128
2208
|
] }),
|
|
2129
2209
|
/* @__PURE__ */ t("div", { className: "nice-api-designer__field", children: [
|
|
2130
|
-
/* @__PURE__ */
|
|
2131
|
-
/* @__PURE__ */
|
|
2210
|
+
/* @__PURE__ */ e("label", { children: "Operation ID" }),
|
|
2211
|
+
/* @__PURE__ */ e(
|
|
2132
2212
|
"input",
|
|
2133
2213
|
{
|
|
2134
2214
|
type: "text",
|
|
2135
2215
|
value: d.operationId || "",
|
|
2136
|
-
onChange: (
|
|
2216
|
+
onChange: (S) => y((m) => ({
|
|
2137
2217
|
...m,
|
|
2138
2218
|
paths: {
|
|
2139
2219
|
...m.paths,
|
|
@@ -2141,7 +2221,7 @@ function We({
|
|
|
2141
2221
|
...m.paths[i],
|
|
2142
2222
|
[n]: {
|
|
2143
2223
|
...d,
|
|
2144
|
-
operationId:
|
|
2224
|
+
operationId: S.target.value
|
|
2145
2225
|
}
|
|
2146
2226
|
}
|
|
2147
2227
|
}
|
|
@@ -2150,76 +2230,76 @@ function We({
|
|
|
2150
2230
|
}
|
|
2151
2231
|
)
|
|
2152
2232
|
] }),
|
|
2153
|
-
!b && /* @__PURE__ */
|
|
2233
|
+
!b && /* @__PURE__ */ e(
|
|
2154
2234
|
"button",
|
|
2155
2235
|
{
|
|
2156
2236
|
className: "nice-api-designer__delete-btn",
|
|
2157
|
-
onClick: () =>
|
|
2237
|
+
onClick: () => l(i),
|
|
2158
2238
|
children: "Delete Endpoint"
|
|
2159
2239
|
}
|
|
2160
2240
|
)
|
|
2161
2241
|
] })
|
|
2162
2242
|
] });
|
|
2163
2243
|
}
|
|
2164
|
-
function
|
|
2165
|
-
schemas:
|
|
2244
|
+
function Ge({
|
|
2245
|
+
schemas: r,
|
|
2166
2246
|
onAdd: a,
|
|
2167
2247
|
onChange: i,
|
|
2168
2248
|
readOnly: n
|
|
2169
2249
|
}) {
|
|
2170
|
-
const [
|
|
2250
|
+
const [c, u] = v(null);
|
|
2171
2251
|
return /* @__PURE__ */ t("div", { className: "nice-api-designer__schemas-editor", children: [
|
|
2172
2252
|
/* @__PURE__ */ t("div", { className: "nice-api-designer__schemas-list", children: [
|
|
2173
2253
|
/* @__PURE__ */ t("div", { className: "nice-api-designer__list-header", children: [
|
|
2174
|
-
/* @__PURE__ */
|
|
2175
|
-
!n && /* @__PURE__ */
|
|
2254
|
+
/* @__PURE__ */ e("h3", { children: "Schemas" }),
|
|
2255
|
+
!n && /* @__PURE__ */ e("button", { onClick: a, children: "+ Add" })
|
|
2176
2256
|
] }),
|
|
2177
|
-
Object.keys(
|
|
2257
|
+
Object.keys(r).map((l) => /* @__PURE__ */ e(
|
|
2178
2258
|
"div",
|
|
2179
2259
|
{
|
|
2180
|
-
className: `nice-api-designer__schema-item ${
|
|
2181
|
-
onClick: () => u(
|
|
2182
|
-
children:
|
|
2260
|
+
className: `nice-api-designer__schema-item ${c === l ? "nice-api-designer__schema-item--selected" : ""}`,
|
|
2261
|
+
onClick: () => u(l),
|
|
2262
|
+
children: l
|
|
2183
2263
|
},
|
|
2184
|
-
|
|
2264
|
+
l
|
|
2185
2265
|
))
|
|
2186
2266
|
] }),
|
|
2187
|
-
|
|
2188
|
-
/* @__PURE__ */
|
|
2267
|
+
c && r[c] && /* @__PURE__ */ t("div", { className: "nice-api-designer__schema-editor", children: [
|
|
2268
|
+
/* @__PURE__ */ e("h3", { children: c }),
|
|
2189
2269
|
/* @__PURE__ */ t("div", { className: "nice-api-designer__field", children: [
|
|
2190
|
-
/* @__PURE__ */
|
|
2270
|
+
/* @__PURE__ */ e("label", { children: "Type" }),
|
|
2191
2271
|
/* @__PURE__ */ t(
|
|
2192
2272
|
"select",
|
|
2193
2273
|
{
|
|
2194
|
-
value:
|
|
2195
|
-
onChange: (
|
|
2196
|
-
...
|
|
2197
|
-
[
|
|
2198
|
-
...
|
|
2199
|
-
type:
|
|
2274
|
+
value: r[c].type || "object",
|
|
2275
|
+
onChange: (l) => i({
|
|
2276
|
+
...r,
|
|
2277
|
+
[c]: {
|
|
2278
|
+
...r[c],
|
|
2279
|
+
type: l.target.value
|
|
2200
2280
|
}
|
|
2201
2281
|
}),
|
|
2202
2282
|
disabled: n,
|
|
2203
2283
|
children: [
|
|
2204
|
-
/* @__PURE__ */
|
|
2205
|
-
/* @__PURE__ */
|
|
2206
|
-
/* @__PURE__ */
|
|
2207
|
-
/* @__PURE__ */
|
|
2208
|
-
/* @__PURE__ */
|
|
2209
|
-
/* @__PURE__ */
|
|
2284
|
+
/* @__PURE__ */ e("option", { value: "object", children: "object" }),
|
|
2285
|
+
/* @__PURE__ */ e("option", { value: "array", children: "array" }),
|
|
2286
|
+
/* @__PURE__ */ e("option", { value: "string", children: "string" }),
|
|
2287
|
+
/* @__PURE__ */ e("option", { value: "number", children: "number" }),
|
|
2288
|
+
/* @__PURE__ */ e("option", { value: "integer", children: "integer" }),
|
|
2289
|
+
/* @__PURE__ */ e("option", { value: "boolean", children: "boolean" })
|
|
2210
2290
|
]
|
|
2211
2291
|
}
|
|
2212
2292
|
)
|
|
2213
2293
|
] }),
|
|
2214
2294
|
/* @__PURE__ */ t("div", { className: "nice-api-designer__field", children: [
|
|
2215
|
-
/* @__PURE__ */
|
|
2216
|
-
/* @__PURE__ */
|
|
2295
|
+
/* @__PURE__ */ e("label", { children: "Description" }),
|
|
2296
|
+
/* @__PURE__ */ e(
|
|
2217
2297
|
"textarea",
|
|
2218
2298
|
{
|
|
2219
|
-
value:
|
|
2220
|
-
onChange: (
|
|
2221
|
-
...
|
|
2222
|
-
[
|
|
2299
|
+
value: r[c].description || "",
|
|
2300
|
+
onChange: (l) => i({
|
|
2301
|
+
...r,
|
|
2302
|
+
[c]: { ...r[c], description: l.target.value }
|
|
2223
2303
|
}),
|
|
2224
2304
|
disabled: n,
|
|
2225
2305
|
rows: 3
|
|
@@ -2227,15 +2307,15 @@ function Je({
|
|
|
2227
2307
|
)
|
|
2228
2308
|
] }),
|
|
2229
2309
|
/* @__PURE__ */ t("div", { className: "nice-api-designer__field", children: [
|
|
2230
|
-
/* @__PURE__ */
|
|
2231
|
-
/* @__PURE__ */
|
|
2310
|
+
/* @__PURE__ */ e("label", { children: "JSON Schema" }),
|
|
2311
|
+
/* @__PURE__ */ e(
|
|
2232
2312
|
"textarea",
|
|
2233
2313
|
{
|
|
2234
|
-
value: JSON.stringify(
|
|
2235
|
-
onChange: (
|
|
2314
|
+
value: JSON.stringify(r[c], null, 2),
|
|
2315
|
+
onChange: (l) => {
|
|
2236
2316
|
try {
|
|
2237
|
-
const y = JSON.parse(
|
|
2238
|
-
i({ ...
|
|
2317
|
+
const y = JSON.parse(l.target.value);
|
|
2318
|
+
i({ ...r, [c]: y });
|
|
2239
2319
|
} catch {
|
|
2240
2320
|
}
|
|
2241
2321
|
},
|
|
@@ -2248,30 +2328,30 @@ function Je({
|
|
|
2248
2328
|
] })
|
|
2249
2329
|
] });
|
|
2250
2330
|
}
|
|
2251
|
-
function
|
|
2331
|
+
function Xe({ schemes: r, onChange: a, readOnly: i }) {
|
|
2252
2332
|
return /* @__PURE__ */ t("div", { className: "nice-api-designer__security-editor", children: [
|
|
2253
2333
|
/* @__PURE__ */ t("div", { className: "nice-api-designer__list-header", children: [
|
|
2254
|
-
/* @__PURE__ */
|
|
2255
|
-
!i && /* @__PURE__ */
|
|
2334
|
+
/* @__PURE__ */ e("h3", { children: "Security Schemes" }),
|
|
2335
|
+
!i && /* @__PURE__ */ e("button", { onClick: () => {
|
|
2256
2336
|
a({
|
|
2257
|
-
...
|
|
2337
|
+
...r,
|
|
2258
2338
|
newScheme: { type: "apiKey", name: "X-API-Key", in: "header" }
|
|
2259
2339
|
});
|
|
2260
2340
|
}, children: "+ Add" })
|
|
2261
2341
|
] }),
|
|
2262
|
-
Object.entries(
|
|
2263
|
-
/* @__PURE__ */
|
|
2264
|
-
/* @__PURE__ */
|
|
2265
|
-
] },
|
|
2342
|
+
Object.entries(r).map(([c, u]) => /* @__PURE__ */ t("div", { className: "nice-api-designer__security-item", children: [
|
|
2343
|
+
/* @__PURE__ */ e("h4", { children: c }),
|
|
2344
|
+
/* @__PURE__ */ e("pre", { children: JSON.stringify(u, null, 2) })
|
|
2345
|
+
] }, c))
|
|
2266
2346
|
] });
|
|
2267
2347
|
}
|
|
2268
|
-
function
|
|
2348
|
+
function Ye({ schema: r }) {
|
|
2269
2349
|
return /* @__PURE__ */ t("div", { className: "nice-api-designer__json-preview", children: [
|
|
2270
|
-
/* @__PURE__ */
|
|
2271
|
-
/* @__PURE__ */
|
|
2350
|
+
/* @__PURE__ */ e("h3", { children: "OpenAPI Specification" }),
|
|
2351
|
+
/* @__PURE__ */ e("pre", { className: "nice-api-designer__code", children: JSON.stringify(r, null, 2) })
|
|
2272
2352
|
] });
|
|
2273
2353
|
}
|
|
2274
|
-
const
|
|
2354
|
+
const Qe = [
|
|
2275
2355
|
{
|
|
2276
2356
|
target: ".nice-api-tester",
|
|
2277
2357
|
titleKey: "tutorial.apiTester.intro.title",
|
|
@@ -2280,7 +2360,7 @@ const Ye = [
|
|
|
2280
2360
|
content: "Build requests with collections and environment variables, send them and assert on the responses.",
|
|
2281
2361
|
placement: "auto"
|
|
2282
2362
|
}
|
|
2283
|
-
],
|
|
2363
|
+
], Ze = ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD"], er = {
|
|
2284
2364
|
id: "",
|
|
2285
2365
|
name: "New Request",
|
|
2286
2366
|
method: "GET",
|
|
@@ -2288,302 +2368,302 @@ const Ye = [
|
|
|
2288
2368
|
headers: {},
|
|
2289
2369
|
queryParams: {}
|
|
2290
2370
|
};
|
|
2291
|
-
function
|
|
2292
|
-
return
|
|
2371
|
+
function se(r, a) {
|
|
2372
|
+
return r.replace(/\{\{(\w+)\}\}/g, (i, n) => a[n] || `{{${n}}}`);
|
|
2293
2373
|
}
|
|
2294
|
-
function
|
|
2295
|
-
const i = Object.entries(a).filter(([, n]) => n).map(([n,
|
|
2296
|
-
return i ? `${
|
|
2374
|
+
function rr(r, a) {
|
|
2375
|
+
const i = Object.entries(a).filter(([, n]) => n).map(([n, c]) => `${encodeURIComponent(n)}=${encodeURIComponent(c)}`).join("&");
|
|
2376
|
+
return i ? `${r}?${i}` : r;
|
|
2297
2377
|
}
|
|
2298
|
-
function
|
|
2299
|
-
collections:
|
|
2378
|
+
function Nr({
|
|
2379
|
+
collections: r = [],
|
|
2300
2380
|
environments: a = [],
|
|
2301
2381
|
onRequest: i,
|
|
2302
2382
|
onSaveCollection: n,
|
|
2303
|
-
className:
|
|
2383
|
+
className: c = "",
|
|
2304
2384
|
tutorial: u
|
|
2305
2385
|
}) {
|
|
2306
|
-
const [
|
|
2307
|
-
a.find((
|
|
2308
|
-
), [m,
|
|
2309
|
-
...
|
|
2386
|
+
const [l, y] = v(r), [b, d] = v(a), [h, S] = v(
|
|
2387
|
+
a.find((s) => s.isActive) || null
|
|
2388
|
+
), [m, k] = v({
|
|
2389
|
+
...er,
|
|
2310
2390
|
id: crypto.randomUUID()
|
|
2311
|
-
}), [
|
|
2391
|
+
}), [g, P] = v(null), [C, O] = v(!1), [U, W] = v("none"), [$, L] = v(
|
|
2312
2392
|
"params"
|
|
2313
|
-
), [
|
|
2314
|
-
var
|
|
2393
|
+
), [I, j] = v("body"), [w, N] = v(""), [x, K] = v(""), [q, B] = v([]), [M, J] = v([]), V = oe(null), Y = R(async () => {
|
|
2394
|
+
var E;
|
|
2315
2395
|
if (!m.url)
|
|
2316
2396
|
return;
|
|
2317
|
-
|
|
2318
|
-
const
|
|
2319
|
-
Object.entries((
|
|
2397
|
+
O(!0), P(null), B([]);
|
|
2398
|
+
const s = Object.fromEntries(
|
|
2399
|
+
Object.entries((h == null ? void 0 : h.variables) || {}).map(([H, A]) => [H, A.value])
|
|
2320
2400
|
), o = {
|
|
2321
2401
|
...m,
|
|
2322
|
-
url:
|
|
2402
|
+
url: se(m.url, s),
|
|
2323
2403
|
headers: Object.fromEntries(
|
|
2324
|
-
Object.entries(m.headers).map(([
|
|
2404
|
+
Object.entries(m.headers).map(([H, A]) => [H, se(A, s)])
|
|
2325
2405
|
),
|
|
2326
2406
|
queryParams: Object.fromEntries(
|
|
2327
|
-
Object.entries(m.queryParams).map(([
|
|
2328
|
-
|
|
2329
|
-
|
|
2407
|
+
Object.entries(m.queryParams).map(([H, A]) => [
|
|
2408
|
+
H,
|
|
2409
|
+
se(A, s)
|
|
2330
2410
|
])
|
|
2331
2411
|
)
|
|
2332
|
-
},
|
|
2412
|
+
}, _ = performance.now();
|
|
2333
2413
|
try {
|
|
2334
|
-
let
|
|
2414
|
+
let H;
|
|
2335
2415
|
if (i)
|
|
2336
|
-
|
|
2416
|
+
H = await i(o);
|
|
2337
2417
|
else {
|
|
2338
|
-
|
|
2339
|
-
const
|
|
2340
|
-
m.auth &&
|
|
2341
|
-
const
|
|
2418
|
+
V.current = new AbortController();
|
|
2419
|
+
const A = { ...o.headers };
|
|
2420
|
+
m.auth && ar(A, m.auth);
|
|
2421
|
+
const ee = rr(o.url, o.queryParams), X = {
|
|
2342
2422
|
method: o.method,
|
|
2343
|
-
headers:
|
|
2344
|
-
signal:
|
|
2423
|
+
headers: A,
|
|
2424
|
+
signal: V.current.signal
|
|
2345
2425
|
};
|
|
2346
|
-
["POST", "PUT", "PATCH"].includes(o.method) && ((
|
|
2347
|
-
const
|
|
2348
|
-
let
|
|
2426
|
+
["POST", "PUT", "PATCH"].includes(o.method) && ((E = m.body) != null && E.content) && (X.body = typeof m.body.content == "string" ? m.body.content : JSON.stringify(m.body.content), m.body.type === "json" && (A["Content-Type"] = "application/json"));
|
|
2427
|
+
const re = await fetch(ee, X), ne = await re.text();
|
|
2428
|
+
let te;
|
|
2349
2429
|
try {
|
|
2350
|
-
|
|
2430
|
+
te = JSON.parse(ne);
|
|
2351
2431
|
} catch {
|
|
2352
|
-
|
|
2432
|
+
te = ne;
|
|
2353
2433
|
}
|
|
2354
|
-
const
|
|
2355
|
-
|
|
2356
|
-
status:
|
|
2357
|
-
statusText:
|
|
2358
|
-
headers: Object.fromEntries(
|
|
2359
|
-
body:
|
|
2360
|
-
time: Math.round(
|
|
2361
|
-
size: new Blob([
|
|
2434
|
+
const ke = performance.now();
|
|
2435
|
+
H = {
|
|
2436
|
+
status: re.status,
|
|
2437
|
+
statusText: re.statusText,
|
|
2438
|
+
headers: Object.fromEntries(re.headers.entries()),
|
|
2439
|
+
body: te,
|
|
2440
|
+
time: Math.round(ke - _),
|
|
2441
|
+
size: new Blob([ne]).size,
|
|
2362
2442
|
timestamp: /* @__PURE__ */ new Date()
|
|
2363
2443
|
};
|
|
2364
2444
|
}
|
|
2365
|
-
if (
|
|
2366
|
-
(
|
|
2367
|
-
),
|
|
2368
|
-
const
|
|
2369
|
-
|
|
2445
|
+
if (P(H), J(
|
|
2446
|
+
(A) => [...A, { request: m, response: H }].slice(-50)
|
|
2447
|
+
), x) {
|
|
2448
|
+
const A = nr(x, H);
|
|
2449
|
+
B(A);
|
|
2370
2450
|
}
|
|
2371
|
-
} catch (
|
|
2372
|
-
|
|
2451
|
+
} catch (H) {
|
|
2452
|
+
H.name !== "AbortError" && P({
|
|
2373
2453
|
status: 0,
|
|
2374
2454
|
statusText: "Error",
|
|
2375
2455
|
headers: {},
|
|
2376
|
-
body: { error:
|
|
2377
|
-
time: Math.round(performance.now() -
|
|
2456
|
+
body: { error: H.message },
|
|
2457
|
+
time: Math.round(performance.now() - _),
|
|
2378
2458
|
size: 0,
|
|
2379
2459
|
timestamp: /* @__PURE__ */ new Date()
|
|
2380
2460
|
});
|
|
2381
2461
|
} finally {
|
|
2382
|
-
|
|
2462
|
+
O(!1), V.current = null;
|
|
2383
2463
|
}
|
|
2384
|
-
}, [m,
|
|
2385
|
-
var
|
|
2386
|
-
(
|
|
2387
|
-
}, []),
|
|
2388
|
-
|
|
2389
|
-
...
|
|
2390
|
-
headers: { ...
|
|
2464
|
+
}, [m, h, i, x]), G = R(() => {
|
|
2465
|
+
var s;
|
|
2466
|
+
(s = V.current) == null || s.abort(), O(!1);
|
|
2467
|
+
}, []), Q = R(() => {
|
|
2468
|
+
k((s) => ({
|
|
2469
|
+
...s,
|
|
2470
|
+
headers: { ...s.headers, "": "" }
|
|
2391
2471
|
}));
|
|
2392
|
-
}, []),
|
|
2393
|
-
|
|
2394
|
-
...
|
|
2395
|
-
queryParams: { ...
|
|
2472
|
+
}, []), Z = R(() => {
|
|
2473
|
+
k((s) => ({
|
|
2474
|
+
...s,
|
|
2475
|
+
queryParams: { ...s.queryParams, "": "" }
|
|
2396
2476
|
}));
|
|
2397
|
-
}, []),
|
|
2398
|
-
if (
|
|
2399
|
-
const
|
|
2477
|
+
}, []), p = R(() => {
|
|
2478
|
+
if (l.length === 0) {
|
|
2479
|
+
const s = {
|
|
2400
2480
|
id: crypto.randomUUID(),
|
|
2401
2481
|
name: "My Collection",
|
|
2402
2482
|
requests: [m]
|
|
2403
2483
|
};
|
|
2404
|
-
y([
|
|
2484
|
+
y([s]), n == null || n(s);
|
|
2405
2485
|
} else {
|
|
2406
|
-
const
|
|
2407
|
-
...
|
|
2408
|
-
requests: [...
|
|
2486
|
+
const s = {
|
|
2487
|
+
...l[0],
|
|
2488
|
+
requests: [...l[0].requests, m]
|
|
2409
2489
|
};
|
|
2410
|
-
y((o) => [
|
|
2490
|
+
y((o) => [s, ...o.slice(1)]), n == null || n(s);
|
|
2411
2491
|
}
|
|
2412
|
-
}, [
|
|
2413
|
-
return /* @__PURE__ */ t("div", { className: `nice-api-tester ${
|
|
2414
|
-
u && /* @__PURE__ */
|
|
2415
|
-
/* @__PURE__ */
|
|
2492
|
+
}, [l, m, n]);
|
|
2493
|
+
return /* @__PURE__ */ t("div", { className: `nice-api-tester ${c}`, style: { position: "relative" }, children: [
|
|
2494
|
+
u && /* @__PURE__ */ e("div", { style: { position: "absolute", top: 8, right: 8, zIndex: 5 }, children: /* @__PURE__ */ e(ie, { steps: ae(u, Qe) }) }),
|
|
2495
|
+
/* @__PURE__ */ e("div", { className: "nice-api-tester__toolbar", children: /* @__PURE__ */ e("div", { className: "nice-api-tester__env-selector", children: /* @__PURE__ */ t(
|
|
2416
2496
|
"select",
|
|
2417
2497
|
{
|
|
2418
|
-
value: (
|
|
2419
|
-
onChange: (
|
|
2498
|
+
value: (h == null ? void 0 : h.id) || "",
|
|
2499
|
+
onChange: (s) => S(b.find((o) => o.id === s.target.value) || null),
|
|
2420
2500
|
children: [
|
|
2421
|
-
/* @__PURE__ */
|
|
2422
|
-
b.map((
|
|
2501
|
+
/* @__PURE__ */ e("option", { value: "", children: "No Environment" }),
|
|
2502
|
+
b.map((s) => /* @__PURE__ */ e("option", { value: s.id, children: s.name }, s.id))
|
|
2423
2503
|
]
|
|
2424
2504
|
}
|
|
2425
2505
|
) }) }),
|
|
2426
2506
|
/* @__PURE__ */ t("div", { className: "nice-api-tester__request-bar", children: [
|
|
2427
|
-
/* @__PURE__ */
|
|
2507
|
+
/* @__PURE__ */ e(
|
|
2428
2508
|
"select",
|
|
2429
2509
|
{
|
|
2430
2510
|
value: m.method,
|
|
2431
|
-
onChange: (
|
|
2511
|
+
onChange: (s) => k((o) => ({
|
|
2432
2512
|
...o,
|
|
2433
|
-
method:
|
|
2513
|
+
method: s.target.value
|
|
2434
2514
|
})),
|
|
2435
2515
|
className: `nice-api-tester__method nice-api-tester__method--${m.method.toLowerCase()}`,
|
|
2436
|
-
children:
|
|
2516
|
+
children: Ze.map((s) => /* @__PURE__ */ e("option", { value: s, children: s }, s))
|
|
2437
2517
|
}
|
|
2438
2518
|
),
|
|
2439
|
-
/* @__PURE__ */
|
|
2519
|
+
/* @__PURE__ */ e(
|
|
2440
2520
|
"input",
|
|
2441
2521
|
{
|
|
2442
2522
|
type: "text",
|
|
2443
2523
|
value: m.url,
|
|
2444
|
-
onChange: (
|
|
2524
|
+
onChange: (s) => k((o) => ({ ...o, url: s.target.value })),
|
|
2445
2525
|
placeholder: "Enter request URL",
|
|
2446
2526
|
className: "nice-api-tester__url-input"
|
|
2447
2527
|
}
|
|
2448
2528
|
),
|
|
2449
|
-
/* @__PURE__ */
|
|
2529
|
+
/* @__PURE__ */ e(
|
|
2450
2530
|
"button",
|
|
2451
2531
|
{
|
|
2452
|
-
onClick:
|
|
2453
|
-
className: `nice-api-tester__send-btn ${
|
|
2454
|
-
children:
|
|
2532
|
+
onClick: C ? G : Y,
|
|
2533
|
+
className: `nice-api-tester__send-btn ${C ? "nice-api-tester__send-btn--loading" : ""}`,
|
|
2534
|
+
children: C ? "Cancel" : "Send"
|
|
2455
2535
|
}
|
|
2456
2536
|
),
|
|
2457
|
-
/* @__PURE__ */
|
|
2537
|
+
/* @__PURE__ */ e("button", { onClick: p, className: "nice-api-tester__save-btn", children: "Save" })
|
|
2458
2538
|
] }),
|
|
2459
2539
|
/* @__PURE__ */ t("div", { className: "nice-api-tester__main", children: [
|
|
2460
2540
|
/* @__PURE__ */ t("div", { className: "nice-api-tester__request-panel", children: [
|
|
2461
|
-
/* @__PURE__ */
|
|
2541
|
+
/* @__PURE__ */ e("div", { className: "nice-api-tester__tabs", children: ["params", "headers", "body", "auth", "tests"].map((s) => /* @__PURE__ */ e(
|
|
2462
2542
|
"button",
|
|
2463
2543
|
{
|
|
2464
|
-
className: `nice-api-tester__tab ${$ ===
|
|
2465
|
-
onClick: () =>
|
|
2466
|
-
children:
|
|
2544
|
+
className: `nice-api-tester__tab ${$ === s ? "nice-api-tester__tab--active" : ""}`,
|
|
2545
|
+
onClick: () => L(s),
|
|
2546
|
+
children: s.charAt(0).toUpperCase() + s.slice(1)
|
|
2467
2547
|
},
|
|
2468
|
-
|
|
2548
|
+
s
|
|
2469
2549
|
)) }),
|
|
2470
2550
|
/* @__PURE__ */ t("div", { className: "nice-api-tester__tab-content", children: [
|
|
2471
|
-
$ === "params" && /* @__PURE__ */
|
|
2472
|
-
|
|
2551
|
+
$ === "params" && /* @__PURE__ */ e(
|
|
2552
|
+
tr,
|
|
2473
2553
|
{
|
|
2474
2554
|
params: m.queryParams,
|
|
2475
|
-
onChange: (
|
|
2476
|
-
onAdd:
|
|
2555
|
+
onChange: (s) => k((o) => ({ ...o, queryParams: s })),
|
|
2556
|
+
onAdd: Z
|
|
2477
2557
|
}
|
|
2478
2558
|
),
|
|
2479
|
-
$ === "headers" && /* @__PURE__ */
|
|
2480
|
-
|
|
2559
|
+
$ === "headers" && /* @__PURE__ */ e(
|
|
2560
|
+
sr,
|
|
2481
2561
|
{
|
|
2482
2562
|
headers: m.headers,
|
|
2483
|
-
onChange: (
|
|
2484
|
-
onAdd:
|
|
2563
|
+
onChange: (s) => k((o) => ({ ...o, headers: s })),
|
|
2564
|
+
onAdd: Q
|
|
2485
2565
|
}
|
|
2486
2566
|
),
|
|
2487
|
-
$ === "body" && /* @__PURE__ */
|
|
2488
|
-
|
|
2567
|
+
$ === "body" && /* @__PURE__ */ e(
|
|
2568
|
+
cr,
|
|
2489
2569
|
{
|
|
2490
2570
|
body: m.body,
|
|
2491
|
-
bodyTab:
|
|
2492
|
-
onBodyTabChange:
|
|
2493
|
-
onChange: (
|
|
2571
|
+
bodyTab: U,
|
|
2572
|
+
onBodyTabChange: W,
|
|
2573
|
+
onChange: (s) => k((o) => ({ ...o, body: s }))
|
|
2494
2574
|
}
|
|
2495
2575
|
),
|
|
2496
|
-
$ === "auth" && /* @__PURE__ */
|
|
2497
|
-
|
|
2576
|
+
$ === "auth" && /* @__PURE__ */ e(
|
|
2577
|
+
or,
|
|
2498
2578
|
{
|
|
2499
2579
|
auth: m.auth,
|
|
2500
|
-
onChange: (
|
|
2580
|
+
onChange: (s) => k((o) => ({ ...o, auth: s }))
|
|
2501
2581
|
}
|
|
2502
2582
|
),
|
|
2503
|
-
$ === "tests" && /* @__PURE__ */
|
|
2504
|
-
|
|
2583
|
+
$ === "tests" && /* @__PURE__ */ e(
|
|
2584
|
+
dr,
|
|
2505
2585
|
{
|
|
2506
2586
|
preRequestScript: w,
|
|
2507
|
-
testScript:
|
|
2508
|
-
onPreRequestChange:
|
|
2509
|
-
onTestChange:
|
|
2587
|
+
testScript: x,
|
|
2588
|
+
onPreRequestChange: N,
|
|
2589
|
+
onTestChange: K
|
|
2510
2590
|
}
|
|
2511
2591
|
)
|
|
2512
2592
|
] })
|
|
2513
2593
|
] }),
|
|
2514
|
-
/* @__PURE__ */
|
|
2594
|
+
/* @__PURE__ */ e("div", { className: "nice-api-tester__response-panel", children: g ? /* @__PURE__ */ t(F, { children: [
|
|
2515
2595
|
/* @__PURE__ */ t("div", { className: "nice-api-tester__response-meta", children: [
|
|
2516
2596
|
/* @__PURE__ */ t(
|
|
2517
2597
|
"span",
|
|
2518
2598
|
{
|
|
2519
|
-
className: `nice-api-tester__status nice-api-tester__status--${Math.floor(
|
|
2599
|
+
className: `nice-api-tester__status nice-api-tester__status--${Math.floor(g.status / 100)}`,
|
|
2520
2600
|
children: [
|
|
2521
|
-
|
|
2601
|
+
g.status,
|
|
2522
2602
|
" ",
|
|
2523
|
-
|
|
2603
|
+
g.statusText
|
|
2524
2604
|
]
|
|
2525
2605
|
}
|
|
2526
2606
|
),
|
|
2527
2607
|
/* @__PURE__ */ t("span", { className: "nice-api-tester__time", children: [
|
|
2528
|
-
|
|
2608
|
+
g.time,
|
|
2529
2609
|
"ms"
|
|
2530
2610
|
] }),
|
|
2531
|
-
/* @__PURE__ */
|
|
2611
|
+
/* @__PURE__ */ e("span", { className: "nice-api-tester__size", children: ir(g.size) })
|
|
2532
2612
|
] }),
|
|
2533
|
-
/* @__PURE__ */
|
|
2613
|
+
/* @__PURE__ */ e("div", { className: "nice-api-tester__tabs", children: ["body", "headers", "tests"].map((s) => /* @__PURE__ */ t(
|
|
2534
2614
|
"button",
|
|
2535
2615
|
{
|
|
2536
|
-
className: `nice-api-tester__tab ${
|
|
2537
|
-
onClick: () =>
|
|
2616
|
+
className: `nice-api-tester__tab ${I === s ? "nice-api-tester__tab--active" : ""}`,
|
|
2617
|
+
onClick: () => j(s),
|
|
2538
2618
|
children: [
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2619
|
+
s.charAt(0).toUpperCase() + s.slice(1),
|
|
2620
|
+
s === "tests" && q.length > 0 && /* @__PURE__ */ t("span", { className: "nice-api-tester__test-badge", children: [
|
|
2621
|
+
q.filter((o) => o.passed).length,
|
|
2542
2622
|
"/",
|
|
2543
|
-
|
|
2623
|
+
q.length
|
|
2544
2624
|
] })
|
|
2545
2625
|
]
|
|
2546
2626
|
},
|
|
2547
|
-
|
|
2627
|
+
s
|
|
2548
2628
|
)) }),
|
|
2549
2629
|
/* @__PURE__ */ t("div", { className: "nice-api-tester__response-content", children: [
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
/* @__PURE__ */
|
|
2553
|
-
/* @__PURE__ */
|
|
2554
|
-
] },
|
|
2555
|
-
|
|
2630
|
+
I === "body" && /* @__PURE__ */ e("pre", { className: "nice-api-tester__response-body", children: typeof g.body == "string" ? g.body : JSON.stringify(g.body, null, 2) }),
|
|
2631
|
+
I === "headers" && /* @__PURE__ */ e("div", { className: "nice-api-tester__response-headers", children: Object.entries(g.headers).map(([s, o]) => /* @__PURE__ */ t("div", { className: "nice-api-tester__header-row", children: [
|
|
2632
|
+
/* @__PURE__ */ e("span", { className: "nice-api-tester__header-key", children: s }),
|
|
2633
|
+
/* @__PURE__ */ e("span", { className: "nice-api-tester__header-value", children: o })
|
|
2634
|
+
] }, s)) }),
|
|
2635
|
+
I === "tests" && /* @__PURE__ */ e("div", { className: "nice-api-tester__test-results", children: q.map((s, o) => /* @__PURE__ */ t(
|
|
2556
2636
|
"div",
|
|
2557
2637
|
{
|
|
2558
|
-
className: `nice-api-tester__test-result nice-api-tester__test-result--${
|
|
2638
|
+
className: `nice-api-tester__test-result nice-api-tester__test-result--${s.passed ? "pass" : "fail"}`,
|
|
2559
2639
|
children: [
|
|
2560
|
-
/* @__PURE__ */
|
|
2561
|
-
/* @__PURE__ */
|
|
2562
|
-
|
|
2640
|
+
/* @__PURE__ */ e("span", { className: "nice-api-tester__test-icon", children: s.passed ? "✓" : "✗" }),
|
|
2641
|
+
/* @__PURE__ */ e("span", { className: "nice-api-tester__test-name", children: s.name }),
|
|
2642
|
+
s.message && /* @__PURE__ */ e("span", { className: "nice-api-tester__test-message", children: s.message })
|
|
2563
2643
|
]
|
|
2564
2644
|
},
|
|
2565
2645
|
o
|
|
2566
2646
|
)) })
|
|
2567
2647
|
] })
|
|
2568
|
-
] }) : /* @__PURE__ */
|
|
2648
|
+
] }) : /* @__PURE__ */ e("div", { className: "nice-api-tester__empty-response", children: C ? "Loading..." : "Send a request to see the response" }) })
|
|
2569
2649
|
] }),
|
|
2570
|
-
|
|
2571
|
-
/* @__PURE__ */
|
|
2572
|
-
/* @__PURE__ */
|
|
2650
|
+
M.length > 0 && /* @__PURE__ */ t("div", { className: "nice-api-tester__history", children: [
|
|
2651
|
+
/* @__PURE__ */ e("h4", { children: "History" }),
|
|
2652
|
+
/* @__PURE__ */ e("div", { className: "nice-api-tester__history-list", children: M.slice().reverse().map(({ request: s, response: o }, _) => /* @__PURE__ */ t(
|
|
2573
2653
|
"div",
|
|
2574
2654
|
{
|
|
2575
2655
|
className: "nice-api-tester__history-item",
|
|
2576
|
-
onClick: () =>
|
|
2656
|
+
onClick: () => k(s),
|
|
2577
2657
|
children: [
|
|
2578
|
-
/* @__PURE__ */
|
|
2658
|
+
/* @__PURE__ */ e(
|
|
2579
2659
|
"span",
|
|
2580
2660
|
{
|
|
2581
|
-
className: `nice-api-tester__method nice-api-tester__method--${
|
|
2582
|
-
children:
|
|
2661
|
+
className: `nice-api-tester__method nice-api-tester__method--${s.method.toLowerCase()}`,
|
|
2662
|
+
children: s.method
|
|
2583
2663
|
}
|
|
2584
2664
|
),
|
|
2585
|
-
/* @__PURE__ */
|
|
2586
|
-
/* @__PURE__ */
|
|
2665
|
+
/* @__PURE__ */ e("span", { className: "nice-api-tester__history-url", children: s.url }),
|
|
2666
|
+
/* @__PURE__ */ e(
|
|
2587
2667
|
"span",
|
|
2588
2668
|
{
|
|
2589
2669
|
className: `nice-api-tester__status nice-api-tester__status--${Math.floor(
|
|
@@ -2594,29 +2674,29 @@ function wr({
|
|
|
2594
2674
|
)
|
|
2595
2675
|
]
|
|
2596
2676
|
},
|
|
2597
|
-
|
|
2677
|
+
_
|
|
2598
2678
|
)) })
|
|
2599
2679
|
] })
|
|
2600
2680
|
] });
|
|
2601
2681
|
}
|
|
2602
|
-
function
|
|
2603
|
-
var i, n,
|
|
2682
|
+
function ar(r, a) {
|
|
2683
|
+
var i, n, c, u, l;
|
|
2604
2684
|
switch (a.type) {
|
|
2605
2685
|
case "bearer":
|
|
2606
|
-
|
|
2686
|
+
r.Authorization = `${((i = a.bearer) == null ? void 0 : i.prefix) || "Bearer"} ${(n = a.bearer) == null ? void 0 : n.token}`;
|
|
2607
2687
|
break;
|
|
2608
2688
|
case "basic":
|
|
2609
|
-
|
|
2689
|
+
r.Authorization = `Basic ${btoa(`${(c = a.basic) == null ? void 0 : c.username}:${(u = a.basic) == null ? void 0 : u.password}`)}`;
|
|
2610
2690
|
break;
|
|
2611
2691
|
case "api-key":
|
|
2612
|
-
((
|
|
2692
|
+
((l = a.apiKey) == null ? void 0 : l.in) === "header" && (r[a.apiKey.key] = a.apiKey.value);
|
|
2613
2693
|
break;
|
|
2614
2694
|
}
|
|
2615
2695
|
}
|
|
2616
|
-
function
|
|
2617
|
-
return
|
|
2696
|
+
function ir(r) {
|
|
2697
|
+
return r < 1024 ? `${r} B` : r < 1024 * 1024 ? `${(r / 1024).toFixed(1)} KB` : `${(r / (1024 * 1024)).toFixed(1)} MB`;
|
|
2618
2698
|
}
|
|
2619
|
-
function
|
|
2699
|
+
function nr(r, a) {
|
|
2620
2700
|
const i = [], n = {
|
|
2621
2701
|
response: {
|
|
2622
2702
|
code: a.status,
|
|
@@ -2626,34 +2706,34 @@ function ir(e, a) {
|
|
|
2626
2706
|
text: () => typeof a.body == "string" ? a.body : JSON.stringify(a.body),
|
|
2627
2707
|
responseTime: a.time
|
|
2628
2708
|
},
|
|
2629
|
-
test: (
|
|
2630
|
-
const
|
|
2709
|
+
test: (c, u) => {
|
|
2710
|
+
const l = performance.now();
|
|
2631
2711
|
try {
|
|
2632
|
-
u(), i.push({ name:
|
|
2712
|
+
u(), i.push({ name: c, passed: !0, duration: performance.now() - l });
|
|
2633
2713
|
} catch (y) {
|
|
2634
2714
|
i.push({
|
|
2635
|
-
name:
|
|
2715
|
+
name: c,
|
|
2636
2716
|
passed: !1,
|
|
2637
2717
|
message: y.message,
|
|
2638
|
-
duration: performance.now() -
|
|
2718
|
+
duration: performance.now() - l
|
|
2639
2719
|
});
|
|
2640
2720
|
}
|
|
2641
2721
|
},
|
|
2642
|
-
expect: (
|
|
2722
|
+
expect: (c) => ({
|
|
2643
2723
|
to: {
|
|
2644
2724
|
equal: (u) => {
|
|
2645
|
-
if (
|
|
2646
|
-
throw new Error(`Expected ${u} but got ${
|
|
2725
|
+
if (c !== u)
|
|
2726
|
+
throw new Error(`Expected ${u} but got ${c}`);
|
|
2647
2727
|
},
|
|
2648
2728
|
be: {
|
|
2649
2729
|
oneOf: (u) => {
|
|
2650
|
-
if (!u.includes(
|
|
2651
|
-
throw new Error(`Expected ${
|
|
2730
|
+
if (!u.includes(c))
|
|
2731
|
+
throw new Error(`Expected ${c} to be one of ${u}`);
|
|
2652
2732
|
}
|
|
2653
2733
|
},
|
|
2654
2734
|
have: {
|
|
2655
2735
|
property: (u) => {
|
|
2656
|
-
if (typeof
|
|
2736
|
+
if (typeof c != "object" || c === null || !(u in c))
|
|
2657
2737
|
throw new Error(`Expected object to have property ${u}`);
|
|
2658
2738
|
}
|
|
2659
2739
|
}
|
|
@@ -2661,70 +2741,70 @@ function ir(e, a) {
|
|
|
2661
2741
|
})
|
|
2662
2742
|
};
|
|
2663
2743
|
try {
|
|
2664
|
-
new Function("pm",
|
|
2665
|
-
} catch (
|
|
2744
|
+
new Function("pm", r)(n);
|
|
2745
|
+
} catch (c) {
|
|
2666
2746
|
i.push({
|
|
2667
2747
|
name: "Script Error",
|
|
2668
2748
|
passed: !1,
|
|
2669
|
-
message:
|
|
2749
|
+
message: c.message,
|
|
2670
2750
|
duration: 0
|
|
2671
2751
|
});
|
|
2672
2752
|
}
|
|
2673
2753
|
return i;
|
|
2674
2754
|
}
|
|
2675
|
-
function
|
|
2676
|
-
items:
|
|
2755
|
+
function Ce({
|
|
2756
|
+
items: r,
|
|
2677
2757
|
onChange: a,
|
|
2678
2758
|
onAdd: i,
|
|
2679
2759
|
keyPlaceholder: n = "Key",
|
|
2680
|
-
valuePlaceholder:
|
|
2760
|
+
valuePlaceholder: c = "Value"
|
|
2681
2761
|
}) {
|
|
2682
2762
|
return /* @__PURE__ */ t("div", { className: "nice-api-tester__kv-editor", children: [
|
|
2683
|
-
Object.entries(
|
|
2684
|
-
/* @__PURE__ */
|
|
2763
|
+
Object.entries(r).map(([u, l], y) => /* @__PURE__ */ t("div", { className: "nice-api-tester__kv-row", children: [
|
|
2764
|
+
/* @__PURE__ */ e(
|
|
2685
2765
|
"input",
|
|
2686
2766
|
{
|
|
2687
2767
|
type: "text",
|
|
2688
2768
|
value: u,
|
|
2689
2769
|
placeholder: n,
|
|
2690
2770
|
onChange: (b) => {
|
|
2691
|
-
const d = Object.entries(
|
|
2692
|
-
d[y] = [b.target.value,
|
|
2771
|
+
const d = Object.entries(r);
|
|
2772
|
+
d[y] = [b.target.value, l], a(Object.fromEntries(d));
|
|
2693
2773
|
}
|
|
2694
2774
|
}
|
|
2695
2775
|
),
|
|
2696
|
-
/* @__PURE__ */
|
|
2776
|
+
/* @__PURE__ */ e(
|
|
2697
2777
|
"input",
|
|
2698
2778
|
{
|
|
2699
2779
|
type: "text",
|
|
2700
|
-
value:
|
|
2701
|
-
placeholder:
|
|
2702
|
-
onChange: (b) => a({ ...
|
|
2780
|
+
value: l,
|
|
2781
|
+
placeholder: c,
|
|
2782
|
+
onChange: (b) => a({ ...r, [u]: b.target.value })
|
|
2703
2783
|
}
|
|
2704
2784
|
),
|
|
2705
|
-
/* @__PURE__ */
|
|
2785
|
+
/* @__PURE__ */ e(
|
|
2706
2786
|
"button",
|
|
2707
2787
|
{
|
|
2708
2788
|
onClick: () => {
|
|
2709
|
-
const { [u]: b, ...d } =
|
|
2789
|
+
const { [u]: b, ...d } = r;
|
|
2710
2790
|
a(d);
|
|
2711
2791
|
},
|
|
2712
2792
|
children: "×"
|
|
2713
2793
|
}
|
|
2714
2794
|
)
|
|
2715
2795
|
] }, y)),
|
|
2716
|
-
/* @__PURE__ */
|
|
2796
|
+
/* @__PURE__ */ e("button", { onClick: i, className: "nice-api-tester__add-btn", children: "+ Add" })
|
|
2717
2797
|
] });
|
|
2718
2798
|
}
|
|
2719
|
-
function
|
|
2720
|
-
params:
|
|
2799
|
+
function tr({
|
|
2800
|
+
params: r,
|
|
2721
2801
|
onChange: a,
|
|
2722
2802
|
onAdd: i
|
|
2723
2803
|
}) {
|
|
2724
|
-
return /* @__PURE__ */
|
|
2725
|
-
|
|
2804
|
+
return /* @__PURE__ */ e(
|
|
2805
|
+
Ce,
|
|
2726
2806
|
{
|
|
2727
|
-
items:
|
|
2807
|
+
items: r,
|
|
2728
2808
|
onChange: a,
|
|
2729
2809
|
onAdd: i,
|
|
2730
2810
|
keyPlaceholder: "Parameter",
|
|
@@ -2732,15 +2812,15 @@ function nr({
|
|
|
2732
2812
|
}
|
|
2733
2813
|
);
|
|
2734
2814
|
}
|
|
2735
|
-
function
|
|
2736
|
-
headers:
|
|
2815
|
+
function sr({
|
|
2816
|
+
headers: r,
|
|
2737
2817
|
onChange: a,
|
|
2738
2818
|
onAdd: i
|
|
2739
2819
|
}) {
|
|
2740
|
-
return /* @__PURE__ */
|
|
2741
|
-
|
|
2820
|
+
return /* @__PURE__ */ e(
|
|
2821
|
+
Ce,
|
|
2742
2822
|
{
|
|
2743
|
-
items:
|
|
2823
|
+
items: r,
|
|
2744
2824
|
onChange: a,
|
|
2745
2825
|
onAdd: i,
|
|
2746
2826
|
keyPlaceholder: "Header",
|
|
@@ -2748,31 +2828,31 @@ function tr({
|
|
|
2748
2828
|
}
|
|
2749
2829
|
);
|
|
2750
2830
|
}
|
|
2751
|
-
function
|
|
2752
|
-
body:
|
|
2831
|
+
function cr({
|
|
2832
|
+
body: r,
|
|
2753
2833
|
bodyTab: a,
|
|
2754
2834
|
onBodyTabChange: i,
|
|
2755
2835
|
onChange: n
|
|
2756
2836
|
}) {
|
|
2757
2837
|
return /* @__PURE__ */ t("div", { className: "nice-api-tester__body-editor", children: [
|
|
2758
|
-
/* @__PURE__ */
|
|
2759
|
-
/* @__PURE__ */
|
|
2838
|
+
/* @__PURE__ */ e("div", { className: "nice-api-tester__body-tabs", children: ["none", "json", "form-data", "raw"].map((c) => /* @__PURE__ */ t("label", { children: [
|
|
2839
|
+
/* @__PURE__ */ e(
|
|
2760
2840
|
"input",
|
|
2761
2841
|
{
|
|
2762
2842
|
type: "radio",
|
|
2763
|
-
checked: a ===
|
|
2843
|
+
checked: a === c,
|
|
2764
2844
|
onChange: () => {
|
|
2765
|
-
i(
|
|
2845
|
+
i(c), n({ type: c, content: "" });
|
|
2766
2846
|
}
|
|
2767
2847
|
}
|
|
2768
2848
|
),
|
|
2769
|
-
|
|
2770
|
-
] },
|
|
2771
|
-
a !== "none" && /* @__PURE__ */
|
|
2849
|
+
c
|
|
2850
|
+
] }, c)) }),
|
|
2851
|
+
a !== "none" && /* @__PURE__ */ e(
|
|
2772
2852
|
"textarea",
|
|
2773
2853
|
{
|
|
2774
|
-
value: typeof (
|
|
2775
|
-
onChange: (
|
|
2854
|
+
value: typeof (r == null ? void 0 : r.content) == "string" ? r.content : JSON.stringify(r == null ? void 0 : r.content, null, 2),
|
|
2855
|
+
onChange: (c) => n({ type: a, content: c.target.value }),
|
|
2776
2856
|
placeholder: a === "json" ? '{ "key": "value" }' : "Enter body content",
|
|
2777
2857
|
rows: 10,
|
|
2778
2858
|
className: "nice-api-tester__body-textarea"
|
|
@@ -2780,46 +2860,46 @@ function sr({
|
|
|
2780
2860
|
)
|
|
2781
2861
|
] });
|
|
2782
2862
|
}
|
|
2783
|
-
function
|
|
2784
|
-
auth:
|
|
2863
|
+
function or({
|
|
2864
|
+
auth: r,
|
|
2785
2865
|
onChange: a
|
|
2786
2866
|
}) {
|
|
2787
|
-
var i, n,
|
|
2867
|
+
var i, n, c, u, l, y;
|
|
2788
2868
|
return /* @__PURE__ */ t("div", { className: "nice-api-tester__auth-editor", children: [
|
|
2789
2869
|
/* @__PURE__ */ t("div", { className: "nice-api-tester__field", children: [
|
|
2790
|
-
/* @__PURE__ */
|
|
2870
|
+
/* @__PURE__ */ e("label", { children: "Type" }),
|
|
2791
2871
|
/* @__PURE__ */ t(
|
|
2792
2872
|
"select",
|
|
2793
2873
|
{
|
|
2794
|
-
value: (
|
|
2874
|
+
value: (r == null ? void 0 : r.type) || "none",
|
|
2795
2875
|
onChange: (b) => a({ type: b.target.value }),
|
|
2796
2876
|
children: [
|
|
2797
|
-
/* @__PURE__ */
|
|
2798
|
-
/* @__PURE__ */
|
|
2799
|
-
/* @__PURE__ */
|
|
2800
|
-
/* @__PURE__ */
|
|
2801
|
-
/* @__PURE__ */
|
|
2877
|
+
/* @__PURE__ */ e("option", { value: "none", children: "No Auth" }),
|
|
2878
|
+
/* @__PURE__ */ e("option", { value: "api-key", children: "API Key" }),
|
|
2879
|
+
/* @__PURE__ */ e("option", { value: "bearer", children: "Bearer Token" }),
|
|
2880
|
+
/* @__PURE__ */ e("option", { value: "basic", children: "Basic Auth" }),
|
|
2881
|
+
/* @__PURE__ */ e("option", { value: "oauth2", children: "OAuth 2.0" })
|
|
2802
2882
|
]
|
|
2803
2883
|
}
|
|
2804
2884
|
)
|
|
2805
2885
|
] }),
|
|
2806
|
-
(
|
|
2886
|
+
(r == null ? void 0 : r.type) === "api-key" && /* @__PURE__ */ t(F, { children: [
|
|
2807
2887
|
/* @__PURE__ */ t("div", { className: "nice-api-tester__field", children: [
|
|
2808
|
-
/* @__PURE__ */
|
|
2809
|
-
/* @__PURE__ */
|
|
2888
|
+
/* @__PURE__ */ e("label", { children: "Key" }),
|
|
2889
|
+
/* @__PURE__ */ e(
|
|
2810
2890
|
"input",
|
|
2811
2891
|
{
|
|
2812
2892
|
type: "text",
|
|
2813
|
-
value: ((i =
|
|
2893
|
+
value: ((i = r.apiKey) == null ? void 0 : i.key) || "",
|
|
2814
2894
|
onChange: (b) => {
|
|
2815
|
-
var d,
|
|
2895
|
+
var d, h;
|
|
2816
2896
|
return a({
|
|
2817
|
-
...
|
|
2897
|
+
...r,
|
|
2818
2898
|
apiKey: {
|
|
2819
|
-
...
|
|
2899
|
+
...r.apiKey,
|
|
2820
2900
|
key: b.target.value,
|
|
2821
|
-
value: ((d =
|
|
2822
|
-
in: ((
|
|
2901
|
+
value: ((d = r.apiKey) == null ? void 0 : d.value) || "",
|
|
2902
|
+
in: ((h = r.apiKey) == null ? void 0 : h.in) || "header"
|
|
2823
2903
|
}
|
|
2824
2904
|
});
|
|
2825
2905
|
},
|
|
@@ -2828,21 +2908,21 @@ function cr({
|
|
|
2828
2908
|
)
|
|
2829
2909
|
] }),
|
|
2830
2910
|
/* @__PURE__ */ t("div", { className: "nice-api-tester__field", children: [
|
|
2831
|
-
/* @__PURE__ */
|
|
2832
|
-
/* @__PURE__ */
|
|
2911
|
+
/* @__PURE__ */ e("label", { children: "Value" }),
|
|
2912
|
+
/* @__PURE__ */ e(
|
|
2833
2913
|
"input",
|
|
2834
2914
|
{
|
|
2835
2915
|
type: "text",
|
|
2836
|
-
value: ((n =
|
|
2916
|
+
value: ((n = r.apiKey) == null ? void 0 : n.value) || "",
|
|
2837
2917
|
onChange: (b) => {
|
|
2838
|
-
var d,
|
|
2918
|
+
var d, h;
|
|
2839
2919
|
return a({
|
|
2840
|
-
...
|
|
2920
|
+
...r,
|
|
2841
2921
|
apiKey: {
|
|
2842
|
-
...
|
|
2922
|
+
...r.apiKey,
|
|
2843
2923
|
value: b.target.value,
|
|
2844
|
-
key: ((d =
|
|
2845
|
-
in: ((
|
|
2924
|
+
key: ((d = r.apiKey) == null ? void 0 : d.key) || "",
|
|
2925
|
+
in: ((h = r.apiKey) == null ? void 0 : h.in) || "header"
|
|
2846
2926
|
}
|
|
2847
2927
|
});
|
|
2848
2928
|
},
|
|
@@ -2851,59 +2931,59 @@ function cr({
|
|
|
2851
2931
|
)
|
|
2852
2932
|
] }),
|
|
2853
2933
|
/* @__PURE__ */ t("div", { className: "nice-api-tester__field", children: [
|
|
2854
|
-
/* @__PURE__ */
|
|
2934
|
+
/* @__PURE__ */ e("label", { children: "Add to" }),
|
|
2855
2935
|
/* @__PURE__ */ t(
|
|
2856
2936
|
"select",
|
|
2857
2937
|
{
|
|
2858
|
-
value: ((
|
|
2938
|
+
value: ((c = r.apiKey) == null ? void 0 : c.in) || "header",
|
|
2859
2939
|
onChange: (b) => {
|
|
2860
|
-
var d,
|
|
2940
|
+
var d, h;
|
|
2861
2941
|
return a({
|
|
2862
|
-
...
|
|
2942
|
+
...r,
|
|
2863
2943
|
apiKey: {
|
|
2864
|
-
...
|
|
2944
|
+
...r.apiKey,
|
|
2865
2945
|
in: b.target.value,
|
|
2866
|
-
key: ((d =
|
|
2867
|
-
value: ((
|
|
2946
|
+
key: ((d = r.apiKey) == null ? void 0 : d.key) || "",
|
|
2947
|
+
value: ((h = r.apiKey) == null ? void 0 : h.value) || ""
|
|
2868
2948
|
}
|
|
2869
2949
|
});
|
|
2870
2950
|
},
|
|
2871
2951
|
children: [
|
|
2872
|
-
/* @__PURE__ */
|
|
2873
|
-
/* @__PURE__ */
|
|
2952
|
+
/* @__PURE__ */ e("option", { value: "header", children: "Header" }),
|
|
2953
|
+
/* @__PURE__ */ e("option", { value: "query", children: "Query Params" })
|
|
2874
2954
|
]
|
|
2875
2955
|
}
|
|
2876
2956
|
)
|
|
2877
2957
|
] })
|
|
2878
2958
|
] }),
|
|
2879
|
-
(
|
|
2880
|
-
/* @__PURE__ */
|
|
2881
|
-
/* @__PURE__ */
|
|
2959
|
+
(r == null ? void 0 : r.type) === "bearer" && /* @__PURE__ */ t("div", { className: "nice-api-tester__field", children: [
|
|
2960
|
+
/* @__PURE__ */ e("label", { children: "Token" }),
|
|
2961
|
+
/* @__PURE__ */ e(
|
|
2882
2962
|
"input",
|
|
2883
2963
|
{
|
|
2884
2964
|
type: "text",
|
|
2885
|
-
value: ((u =
|
|
2886
|
-
onChange: (b) => a({ ...
|
|
2965
|
+
value: ((u = r.bearer) == null ? void 0 : u.token) || "",
|
|
2966
|
+
onChange: (b) => a({ ...r, bearer: { token: b.target.value } }),
|
|
2887
2967
|
placeholder: "your-bearer-token"
|
|
2888
2968
|
}
|
|
2889
2969
|
)
|
|
2890
2970
|
] }),
|
|
2891
|
-
(
|
|
2971
|
+
(r == null ? void 0 : r.type) === "basic" && /* @__PURE__ */ t(F, { children: [
|
|
2892
2972
|
/* @__PURE__ */ t("div", { className: "nice-api-tester__field", children: [
|
|
2893
|
-
/* @__PURE__ */
|
|
2894
|
-
/* @__PURE__ */
|
|
2973
|
+
/* @__PURE__ */ e("label", { children: "Username" }),
|
|
2974
|
+
/* @__PURE__ */ e(
|
|
2895
2975
|
"input",
|
|
2896
2976
|
{
|
|
2897
2977
|
type: "text",
|
|
2898
|
-
value: ((
|
|
2978
|
+
value: ((l = r.basic) == null ? void 0 : l.username) || "",
|
|
2899
2979
|
onChange: (b) => {
|
|
2900
2980
|
var d;
|
|
2901
2981
|
return a({
|
|
2902
|
-
...
|
|
2982
|
+
...r,
|
|
2903
2983
|
basic: {
|
|
2904
|
-
...
|
|
2984
|
+
...r.basic,
|
|
2905
2985
|
username: b.target.value,
|
|
2906
|
-
password: ((d =
|
|
2986
|
+
password: ((d = r.basic) == null ? void 0 : d.password) || ""
|
|
2907
2987
|
}
|
|
2908
2988
|
});
|
|
2909
2989
|
}
|
|
@@ -2911,20 +2991,20 @@ function cr({
|
|
|
2911
2991
|
)
|
|
2912
2992
|
] }),
|
|
2913
2993
|
/* @__PURE__ */ t("div", { className: "nice-api-tester__field", children: [
|
|
2914
|
-
/* @__PURE__ */
|
|
2915
|
-
/* @__PURE__ */
|
|
2994
|
+
/* @__PURE__ */ e("label", { children: "Password" }),
|
|
2995
|
+
/* @__PURE__ */ e(
|
|
2916
2996
|
"input",
|
|
2917
2997
|
{
|
|
2918
2998
|
type: "password",
|
|
2919
|
-
value: ((y =
|
|
2999
|
+
value: ((y = r.basic) == null ? void 0 : y.password) || "",
|
|
2920
3000
|
onChange: (b) => {
|
|
2921
3001
|
var d;
|
|
2922
3002
|
return a({
|
|
2923
|
-
...
|
|
3003
|
+
...r,
|
|
2924
3004
|
basic: {
|
|
2925
|
-
...
|
|
3005
|
+
...r.basic,
|
|
2926
3006
|
password: b.target.value,
|
|
2927
|
-
username: ((d =
|
|
3007
|
+
username: ((d = r.basic) == null ? void 0 : d.username) || ""
|
|
2928
3008
|
}
|
|
2929
3009
|
});
|
|
2930
3010
|
}
|
|
@@ -2934,32 +3014,32 @@ function cr({
|
|
|
2934
3014
|
] })
|
|
2935
3015
|
] });
|
|
2936
3016
|
}
|
|
2937
|
-
function
|
|
2938
|
-
preRequestScript:
|
|
3017
|
+
function dr({
|
|
3018
|
+
preRequestScript: r,
|
|
2939
3019
|
testScript: a,
|
|
2940
3020
|
onPreRequestChange: i,
|
|
2941
3021
|
onTestChange: n
|
|
2942
3022
|
}) {
|
|
2943
3023
|
return /* @__PURE__ */ t("div", { className: "nice-api-tester__tests-editor", children: [
|
|
2944
3024
|
/* @__PURE__ */ t("div", { className: "nice-api-tester__script-section", children: [
|
|
2945
|
-
/* @__PURE__ */
|
|
2946
|
-
/* @__PURE__ */
|
|
3025
|
+
/* @__PURE__ */ e("h4", { children: "Pre-request Script" }),
|
|
3026
|
+
/* @__PURE__ */ e(
|
|
2947
3027
|
"textarea",
|
|
2948
3028
|
{
|
|
2949
|
-
value:
|
|
2950
|
-
onChange: (
|
|
3029
|
+
value: r,
|
|
3030
|
+
onChange: (c) => i(c.target.value),
|
|
2951
3031
|
placeholder: "// Code to run before the request",
|
|
2952
3032
|
rows: 5
|
|
2953
3033
|
}
|
|
2954
3034
|
)
|
|
2955
3035
|
] }),
|
|
2956
3036
|
/* @__PURE__ */ t("div", { className: "nice-api-tester__script-section", children: [
|
|
2957
|
-
/* @__PURE__ */
|
|
2958
|
-
/* @__PURE__ */
|
|
3037
|
+
/* @__PURE__ */ e("h4", { children: "Tests" }),
|
|
3038
|
+
/* @__PURE__ */ e(
|
|
2959
3039
|
"textarea",
|
|
2960
3040
|
{
|
|
2961
3041
|
value: a,
|
|
2962
|
-
onChange: (
|
|
3042
|
+
onChange: (c) => n(c.target.value),
|
|
2963
3043
|
placeholder: `pm.test("Status code is 200", function () {
|
|
2964
3044
|
pm.expect(pm.response.code).to.equal(200);
|
|
2965
3045
|
});`,
|
|
@@ -2969,7 +3049,7 @@ function or({
|
|
|
2969
3049
|
] })
|
|
2970
3050
|
] });
|
|
2971
3051
|
}
|
|
2972
|
-
const
|
|
3052
|
+
const lr = [
|
|
2973
3053
|
{
|
|
2974
3054
|
target: ".nice-integration-builder",
|
|
2975
3055
|
titleKey: "tutorial.integrationBuilder.intro.title",
|
|
@@ -2978,7 +3058,7 @@ const dr = [
|
|
|
2978
3058
|
content: "Wire a flow of nodes (triggers → actions → error handling) and connect them to build an integration.",
|
|
2979
3059
|
placement: "auto"
|
|
2980
3060
|
}
|
|
2981
|
-
],
|
|
3061
|
+
], ce = [
|
|
2982
3062
|
{ type: "trigger", label: "Trigger", icon: "⚡", category: "Control" },
|
|
2983
3063
|
{ type: "http-request", label: "HTTP Request", icon: "🌐", category: "Actions" },
|
|
2984
3064
|
{ type: "transform", label: "Transform", icon: "🔄", category: "Data" },
|
|
@@ -2992,7 +3072,7 @@ const dr = [
|
|
|
2992
3072
|
{ type: "webhook", label: "Webhook", icon: "🔗", category: "Actions" },
|
|
2993
3073
|
{ type: "function", label: "Function", icon: "ƒ", category: "Actions" },
|
|
2994
3074
|
{ type: "error-handler", label: "Error Handler", icon: "⚠️", category: "Control" }
|
|
2995
|
-
],
|
|
3075
|
+
], fr = {
|
|
2996
3076
|
id: "",
|
|
2997
3077
|
name: "New Flow",
|
|
2998
3078
|
nodes: [],
|
|
@@ -3001,247 +3081,256 @@ const dr = [
|
|
|
3001
3081
|
triggers: [],
|
|
3002
3082
|
errorHandling: { strategy: "stop" }
|
|
3003
3083
|
};
|
|
3004
|
-
function
|
|
3005
|
-
flow:
|
|
3084
|
+
function xr({
|
|
3085
|
+
flow: r,
|
|
3006
3086
|
connectors: a = [],
|
|
3007
3087
|
onChange: i,
|
|
3008
3088
|
onSave: n,
|
|
3009
|
-
onRun:
|
|
3089
|
+
onRun: c,
|
|
3010
3090
|
className: u = "",
|
|
3011
|
-
tutorial:
|
|
3091
|
+
tutorial: l
|
|
3012
3092
|
}) {
|
|
3013
|
-
const [y, b] =
|
|
3014
|
-
|
|
3015
|
-
), [d,
|
|
3093
|
+
const [y, b] = v(
|
|
3094
|
+
r || { ...fr, id: crypto.randomUUID() }
|
|
3095
|
+
), [d, h] = v(null), [S, m] = v(!0), [k, g] = v("canvas"), [P, C] = v(!1), [O, U] = v(null), [W, $] = v(!1), [L, I] = v(null), [j, w] = v(!1), N = oe(null), x = R(
|
|
3016
3096
|
(p) => {
|
|
3017
|
-
b((
|
|
3018
|
-
const
|
|
3019
|
-
return i == null || i(
|
|
3097
|
+
b((s) => {
|
|
3098
|
+
const o = p(s);
|
|
3099
|
+
return i == null || i(o), o;
|
|
3020
3100
|
});
|
|
3021
3101
|
},
|
|
3022
3102
|
[i]
|
|
3023
|
-
),
|
|
3024
|
-
(p,
|
|
3025
|
-
var
|
|
3026
|
-
const
|
|
3103
|
+
), K = R(
|
|
3104
|
+
(p, s) => {
|
|
3105
|
+
var _;
|
|
3106
|
+
const o = {
|
|
3027
3107
|
id: crypto.randomUUID(),
|
|
3028
3108
|
type: p,
|
|
3029
|
-
name: ((
|
|
3030
|
-
position:
|
|
3031
|
-
config:
|
|
3109
|
+
name: ((_ = ce.find((E) => E.type === p)) == null ? void 0 : _.label) || p,
|
|
3110
|
+
position: s,
|
|
3111
|
+
config: pr(p),
|
|
3032
3112
|
inputs: p !== "trigger" ? ["input"] : [],
|
|
3033
3113
|
outputs: ["output"]
|
|
3034
3114
|
};
|
|
3035
|
-
|
|
3036
|
-
...
|
|
3037
|
-
nodes: [...
|
|
3038
|
-
})),
|
|
3115
|
+
x((E) => ({
|
|
3116
|
+
...E,
|
|
3117
|
+
nodes: [...E.nodes, o]
|
|
3118
|
+
})), h(o);
|
|
3039
3119
|
},
|
|
3040
|
-
[
|
|
3041
|
-
),
|
|
3120
|
+
[x]
|
|
3121
|
+
), q = R(
|
|
3042
3122
|
(p) => {
|
|
3043
|
-
|
|
3044
|
-
...
|
|
3045
|
-
nodes:
|
|
3046
|
-
connections:
|
|
3047
|
-
(
|
|
3123
|
+
x((s) => ({
|
|
3124
|
+
...s,
|
|
3125
|
+
nodes: s.nodes.filter((o) => o.id !== p),
|
|
3126
|
+
connections: s.connections.filter(
|
|
3127
|
+
(o) => o.sourceNodeId !== p && o.targetNodeId !== p
|
|
3048
3128
|
)
|
|
3049
|
-
})),
|
|
3129
|
+
})), h(null);
|
|
3050
3130
|
},
|
|
3051
|
-
[
|
|
3052
|
-
),
|
|
3053
|
-
(p,
|
|
3054
|
-
|
|
3055
|
-
...
|
|
3056
|
-
nodes:
|
|
3057
|
-
})), (d == null ? void 0 : d.id) === p &&
|
|
3131
|
+
[x]
|
|
3132
|
+
), B = R(
|
|
3133
|
+
(p, s) => {
|
|
3134
|
+
x((o) => ({
|
|
3135
|
+
...o,
|
|
3136
|
+
nodes: o.nodes.map((_) => _.id === p ? { ..._, ...s } : _)
|
|
3137
|
+
})), (d == null ? void 0 : d.id) === p && h((o) => o ? { ...o, ...s } : null);
|
|
3058
3138
|
},
|
|
3059
|
-
[
|
|
3060
|
-
),
|
|
3061
|
-
(p,
|
|
3062
|
-
p ===
|
|
3063
|
-
(
|
|
3064
|
-
) ||
|
|
3065
|
-
...
|
|
3139
|
+
[x, d]
|
|
3140
|
+
), M = R(
|
|
3141
|
+
(p, s, o, _) => {
|
|
3142
|
+
p === o || y.connections.some(
|
|
3143
|
+
(H) => H.sourceNodeId === p && H.targetNodeId === o && H.sourceOutput === s && H.targetInput === _
|
|
3144
|
+
) || x((H) => ({
|
|
3145
|
+
...H,
|
|
3066
3146
|
connections: [
|
|
3067
|
-
...
|
|
3147
|
+
...H.connections,
|
|
3068
3148
|
{
|
|
3069
3149
|
id: crypto.randomUUID(),
|
|
3070
3150
|
sourceNodeId: p,
|
|
3071
|
-
sourceOutput:
|
|
3072
|
-
targetNodeId:
|
|
3073
|
-
targetInput:
|
|
3151
|
+
sourceOutput: s,
|
|
3152
|
+
targetNodeId: o,
|
|
3153
|
+
targetInput: _
|
|
3074
3154
|
}
|
|
3075
3155
|
]
|
|
3076
3156
|
}));
|
|
3077
3157
|
},
|
|
3078
|
-
[y.connections,
|
|
3079
|
-
),
|
|
3158
|
+
[y.connections, x]
|
|
3159
|
+
), J = R(
|
|
3080
3160
|
(p) => {
|
|
3081
|
-
|
|
3082
|
-
...
|
|
3083
|
-
connections:
|
|
3161
|
+
x((s) => ({
|
|
3162
|
+
...s,
|
|
3163
|
+
connections: s.connections.filter((o) => o.id !== p)
|
|
3084
3164
|
}));
|
|
3085
3165
|
},
|
|
3086
|
-
[
|
|
3087
|
-
),
|
|
3166
|
+
[x]
|
|
3167
|
+
), V = R(
|
|
3088
3168
|
(p) => {
|
|
3089
|
-
if (p.preventDefault(), !
|
|
3169
|
+
if (p.preventDefault(), !O || !N.current)
|
|
3090
3170
|
return;
|
|
3091
|
-
const
|
|
3092
|
-
|
|
3171
|
+
const s = N.current.getBoundingClientRect(), o = p.clientX - s.left, _ = p.clientY - s.top;
|
|
3172
|
+
K(O, { x: o, y: _ }), C(!1), U(null);
|
|
3093
3173
|
},
|
|
3094
|
-
[
|
|
3095
|
-
),
|
|
3096
|
-
if (
|
|
3174
|
+
[O, K]
|
|
3175
|
+
), Y = R(async () => {
|
|
3176
|
+
if (c) {
|
|
3097
3177
|
w(!0);
|
|
3098
3178
|
try {
|
|
3099
|
-
await
|
|
3179
|
+
await c(y);
|
|
3100
3180
|
} finally {
|
|
3101
3181
|
w(!1);
|
|
3102
3182
|
}
|
|
3103
3183
|
}
|
|
3104
|
-
}, [y,
|
|
3184
|
+
}, [y, c]), G = R(() => {
|
|
3105
3185
|
n == null || n(y);
|
|
3106
|
-
}, [y, n])
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
/* @__PURE__ */
|
|
3111
|
-
"
|
|
3112
|
-
{
|
|
3113
|
-
type: "text",
|
|
3114
|
-
value: y.name,
|
|
3115
|
-
onChange: (p) => S((h) => ({ ...h, name: p.target.value })),
|
|
3116
|
-
className: "nice-integration-builder__name-input"
|
|
3117
|
-
}
|
|
3118
|
-
),
|
|
3119
|
-
/* @__PURE__ */ r("div", { className: "nice-integration-builder__tabs", children: ["canvas", "code", "variables", "settings"].map((p) => /* @__PURE__ */ r(
|
|
3120
|
-
"button",
|
|
3186
|
+
}, [y, n]), Q = S && k === "canvas" ? /* @__PURE__ */ t("div", { className: "nice-integration-builder__palette", children: [
|
|
3187
|
+
/* @__PURE__ */ e("h4", { children: "Nodes" }),
|
|
3188
|
+
["Control", "Actions", "Data"].map((p) => /* @__PURE__ */ t("div", { className: "nice-integration-builder__category", children: [
|
|
3189
|
+
/* @__PURE__ */ e("h5", { children: p }),
|
|
3190
|
+
ce.filter((s) => s.category === p).map((s) => /* @__PURE__ */ t(
|
|
3191
|
+
"div",
|
|
3121
3192
|
{
|
|
3122
|
-
className:
|
|
3123
|
-
|
|
3124
|
-
|
|
3193
|
+
className: "nice-integration-builder__palette-item",
|
|
3194
|
+
draggable: !0,
|
|
3195
|
+
onDragStart: () => {
|
|
3196
|
+
C(!0), U(s.type);
|
|
3197
|
+
},
|
|
3198
|
+
onDragEnd: () => {
|
|
3199
|
+
C(!1), U(null);
|
|
3200
|
+
},
|
|
3201
|
+
children: [
|
|
3202
|
+
/* @__PURE__ */ e("span", { className: "nice-integration-builder__palette-icon", children: s.icon }),
|
|
3203
|
+
/* @__PURE__ */ e("span", { children: s.label })
|
|
3204
|
+
]
|
|
3125
3205
|
},
|
|
3126
|
-
|
|
3127
|
-
))
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3206
|
+
s.type
|
|
3207
|
+
))
|
|
3208
|
+
] }, p)),
|
|
3209
|
+
a.length > 0 && /* @__PURE__ */ t("div", { className: "nice-integration-builder__category", children: [
|
|
3210
|
+
/* @__PURE__ */ e("h5", { children: "Connectors" }),
|
|
3211
|
+
a.map((p) => /* @__PURE__ */ t("div", { className: "nice-integration-builder__palette-item", children: [
|
|
3212
|
+
/* @__PURE__ */ e("span", { className: "nice-integration-builder__palette-icon", children: "🔌" }),
|
|
3213
|
+
/* @__PURE__ */ e("span", { children: p.name })
|
|
3214
|
+
] }, p.id))
|
|
3215
|
+
] })
|
|
3216
|
+
] }) : void 0, Z = d && k === "canvas" ? /* @__PURE__ */ e(
|
|
3217
|
+
yr,
|
|
3218
|
+
{
|
|
3219
|
+
node: d,
|
|
3220
|
+
onChange: (p) => B(d.id, p),
|
|
3221
|
+
onClose: () => h(null)
|
|
3222
|
+
}
|
|
3223
|
+
) : void 0;
|
|
3224
|
+
return /* @__PURE__ */ t("div", { style: { position: "relative", height: "100%" }, children: [
|
|
3225
|
+
l && /* @__PURE__ */ e("div", { style: { position: "absolute", top: 8, right: 8, zIndex: 5 }, children: /* @__PURE__ */ e(ie, { steps: ae(l, lr) }) }),
|
|
3226
|
+
/* @__PURE__ */ t(
|
|
3227
|
+
de,
|
|
3228
|
+
{
|
|
3229
|
+
flush: !0,
|
|
3230
|
+
className: `nice-integration-builder ${u}`,
|
|
3231
|
+
height: "100%",
|
|
3232
|
+
style: { minHeight: 600 },
|
|
3233
|
+
sidebar: Q,
|
|
3234
|
+
rightSidebar: Z,
|
|
3235
|
+
toolbar: /* @__PURE__ */ t("div", { className: "nice-integration-builder__toolbar", children: [
|
|
3236
|
+
/* @__PURE__ */ e(
|
|
3237
|
+
"input",
|
|
3238
|
+
{
|
|
3239
|
+
type: "text",
|
|
3240
|
+
value: y.name,
|
|
3241
|
+
onChange: (p) => x((s) => ({ ...s, name: p.target.value })),
|
|
3242
|
+
className: "nice-integration-builder__name-input"
|
|
3243
|
+
}
|
|
3244
|
+
),
|
|
3245
|
+
/* @__PURE__ */ e("div", { className: "nice-integration-builder__tabs", children: ["canvas", "code", "variables", "settings"].map((p) => /* @__PURE__ */ e(
|
|
3246
|
+
"button",
|
|
3247
|
+
{
|
|
3248
|
+
className: `nice-integration-builder__tab ${k === p ? "nice-integration-builder__tab--active" : ""}`,
|
|
3249
|
+
onClick: () => g(p),
|
|
3250
|
+
children: p.charAt(0).toUpperCase() + p.slice(1)
|
|
3251
|
+
},
|
|
3252
|
+
p
|
|
3253
|
+
)) }),
|
|
3254
|
+
/* @__PURE__ */ t("div", { className: "nice-integration-builder__actions", children: [
|
|
3255
|
+
/* @__PURE__ */ e(
|
|
3256
|
+
"button",
|
|
3257
|
+
{
|
|
3258
|
+
onClick: Y,
|
|
3259
|
+
disabled: j,
|
|
3260
|
+
className: "nice-integration-builder__run-btn",
|
|
3261
|
+
children: j ? "⏳ Running..." : "▶ Run"
|
|
3262
|
+
}
|
|
3263
|
+
),
|
|
3264
|
+
/* @__PURE__ */ e("button", { onClick: G, className: "nice-integration-builder__save-btn", children: "💾 Save" })
|
|
3265
|
+
] })
|
|
3266
|
+
] }),
|
|
3267
|
+
children: [
|
|
3268
|
+
k === "canvas" && /* @__PURE__ */ t(
|
|
3147
3269
|
"div",
|
|
3148
3270
|
{
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
onDragEnd: () => {
|
|
3155
|
-
H(!1), j(null);
|
|
3156
|
-
},
|
|
3271
|
+
ref: N,
|
|
3272
|
+
className: `nice-integration-builder__canvas ${P ? "nice-integration-builder__canvas--dragging" : ""}`,
|
|
3273
|
+
onDragOver: (p) => p.preventDefault(),
|
|
3274
|
+
onDrop: V,
|
|
3275
|
+
onClick: () => h(null),
|
|
3157
3276
|
children: [
|
|
3158
|
-
/* @__PURE__ */
|
|
3159
|
-
|
|
3277
|
+
/* @__PURE__ */ e("svg", { className: "nice-integration-builder__connections", children: y.connections.map((p) => {
|
|
3278
|
+
const s = y.nodes.find((X) => X.id === p.sourceNodeId), o = y.nodes.find((X) => X.id === p.targetNodeId);
|
|
3279
|
+
if (!s || !o)
|
|
3280
|
+
return null;
|
|
3281
|
+
const _ = s.position.x + 150, E = s.position.y + 30, H = o.position.x, A = o.position.y + 30, ee = (_ + H) / 2;
|
|
3282
|
+
return /* @__PURE__ */ e("g", { onClick: () => J(p.id), children: /* @__PURE__ */ e(
|
|
3283
|
+
"path",
|
|
3284
|
+
{
|
|
3285
|
+
d: `M ${_} ${E} C ${ee} ${E}, ${ee} ${A}, ${H} ${A}`,
|
|
3286
|
+
className: "nice-integration-builder__connection"
|
|
3287
|
+
}
|
|
3288
|
+
) }, p.id);
|
|
3289
|
+
}) }),
|
|
3290
|
+
y.nodes.map((p) => /* @__PURE__ */ e(
|
|
3291
|
+
mr,
|
|
3292
|
+
{
|
|
3293
|
+
node: p,
|
|
3294
|
+
isSelected: (d == null ? void 0 : d.id) === p.id,
|
|
3295
|
+
onSelect: () => h(p),
|
|
3296
|
+
onDelete: () => q(p.id),
|
|
3297
|
+
onPositionChange: (s) => B(p.id, { position: s }),
|
|
3298
|
+
onStartConnection: (s) => {
|
|
3299
|
+
$(!0), I({ nodeId: p.id, output: s });
|
|
3300
|
+
},
|
|
3301
|
+
onEndConnection: (s) => {
|
|
3302
|
+
L && M(L.nodeId, L.output, p.id, s), $(!1), I(null);
|
|
3303
|
+
}
|
|
3304
|
+
},
|
|
3305
|
+
p.id
|
|
3306
|
+
)),
|
|
3307
|
+
y.nodes.length === 0 && /* @__PURE__ */ e("div", { className: "nice-integration-builder__empty", children: "Drag nodes from the palette to build your flow" })
|
|
3160
3308
|
]
|
|
3161
|
-
}
|
|
3162
|
-
|
|
3163
|
-
))
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
/* @__PURE__ */ r("svg", { className: "nice-integration-builder__connections", children: y.connections.map((p) => {
|
|
3183
|
-
const h = y.nodes.find((R) => R.id === p.sourceNodeId), C = y.nodes.find((R) => R.id === p.targetNodeId);
|
|
3184
|
-
if (!h || !C)
|
|
3185
|
-
return null;
|
|
3186
|
-
const c = h.position.x + 150, o = h.position.y + 30, N = C.position.x, D = C.position.y + 30, E = (c + N) / 2;
|
|
3187
|
-
return /* @__PURE__ */ r("g", { onClick: () => X(p.id), children: /* @__PURE__ */ r(
|
|
3188
|
-
"path",
|
|
3189
|
-
{
|
|
3190
|
-
d: `M ${c} ${o} C ${E} ${o}, ${E} ${D}, ${N} ${D}`,
|
|
3191
|
-
className: "nice-integration-builder__connection"
|
|
3192
|
-
}
|
|
3193
|
-
) }, p.id);
|
|
3194
|
-
}) }),
|
|
3195
|
-
y.nodes.map((p) => /* @__PURE__ */ r(
|
|
3196
|
-
pr,
|
|
3197
|
-
{
|
|
3198
|
-
node: p,
|
|
3199
|
-
isSelected: (d == null ? void 0 : d.id) === p.id,
|
|
3200
|
-
onSelect: () => v(p),
|
|
3201
|
-
onDelete: () => V(p.id),
|
|
3202
|
-
onPositionChange: (h) => z(p.id, { position: h }),
|
|
3203
|
-
onStartConnection: (h) => {
|
|
3204
|
-
$(!0), O({ nodeId: p.id, output: h });
|
|
3205
|
-
},
|
|
3206
|
-
onEndConnection: (h) => {
|
|
3207
|
-
U && L(U.nodeId, U.output, p.id, h), $(!1), O(null);
|
|
3208
|
-
}
|
|
3209
|
-
},
|
|
3210
|
-
p.id
|
|
3211
|
-
)),
|
|
3212
|
-
y.nodes.length === 0 && /* @__PURE__ */ r("div", { className: "nice-integration-builder__empty", children: "Drag nodes from the palette to build your flow" })
|
|
3213
|
-
]
|
|
3214
|
-
}
|
|
3215
|
-
),
|
|
3216
|
-
T === "code" && /* @__PURE__ */ r("div", { className: "nice-integration-builder__code-view", children: /* @__PURE__ */ r("pre", { children: JSON.stringify(y, null, 2) }) }),
|
|
3217
|
-
T === "variables" && /* @__PURE__ */ r(
|
|
3218
|
-
yr,
|
|
3219
|
-
{
|
|
3220
|
-
variables: y.variables,
|
|
3221
|
-
onChange: (p) => S((h) => ({ ...h, variables: p }))
|
|
3222
|
-
}
|
|
3223
|
-
),
|
|
3224
|
-
T === "settings" && /* @__PURE__ */ r(
|
|
3225
|
-
ur,
|
|
3226
|
-
{
|
|
3227
|
-
errorHandling: y.errorHandling,
|
|
3228
|
-
schedule: y.schedule,
|
|
3229
|
-
onChange: (p, h) => S((C) => ({ ...C, errorHandling: p, schedule: h }))
|
|
3230
|
-
}
|
|
3231
|
-
),
|
|
3232
|
-
d && T === "canvas" && /* @__PURE__ */ r(
|
|
3233
|
-
mr,
|
|
3234
|
-
{
|
|
3235
|
-
node: d,
|
|
3236
|
-
onChange: (p) => z(d.id, p),
|
|
3237
|
-
onClose: () => v(null)
|
|
3238
|
-
}
|
|
3239
|
-
)
|
|
3240
|
-
] })
|
|
3309
|
+
}
|
|
3310
|
+
),
|
|
3311
|
+
k === "code" && /* @__PURE__ */ e("div", { className: "nice-integration-builder__code-view", children: /* @__PURE__ */ e("pre", { children: JSON.stringify(y, null, 2) }) }),
|
|
3312
|
+
k === "variables" && /* @__PURE__ */ e(
|
|
3313
|
+
ur,
|
|
3314
|
+
{
|
|
3315
|
+
variables: y.variables,
|
|
3316
|
+
onChange: (p) => x((s) => ({ ...s, variables: p }))
|
|
3317
|
+
}
|
|
3318
|
+
),
|
|
3319
|
+
k === "settings" && /* @__PURE__ */ e(
|
|
3320
|
+
br,
|
|
3321
|
+
{
|
|
3322
|
+
errorHandling: y.errorHandling,
|
|
3323
|
+
schedule: y.schedule,
|
|
3324
|
+
onChange: (p, s) => x((o) => ({ ...o, errorHandling: p, schedule: s }))
|
|
3325
|
+
}
|
|
3326
|
+
)
|
|
3327
|
+
]
|
|
3328
|
+
}
|
|
3329
|
+
)
|
|
3241
3330
|
] });
|
|
3242
3331
|
}
|
|
3243
|
-
function
|
|
3244
|
-
switch (
|
|
3332
|
+
function pr(r) {
|
|
3333
|
+
switch (r) {
|
|
3245
3334
|
case "http-request":
|
|
3246
3335
|
return { method: "GET", url: "", headers: {}, body: "" };
|
|
3247
3336
|
case "transform":
|
|
@@ -3271,214 +3360,214 @@ return input;` };
|
|
|
3271
3360
|
return {};
|
|
3272
3361
|
}
|
|
3273
3362
|
}
|
|
3274
|
-
function
|
|
3275
|
-
node:
|
|
3363
|
+
function mr({
|
|
3364
|
+
node: r,
|
|
3276
3365
|
isSelected: a,
|
|
3277
3366
|
onSelect: i,
|
|
3278
3367
|
onDelete: n,
|
|
3279
|
-
onPositionChange:
|
|
3368
|
+
onPositionChange: c,
|
|
3280
3369
|
onStartConnection: u,
|
|
3281
|
-
onEndConnection:
|
|
3370
|
+
onEndConnection: l
|
|
3282
3371
|
}) {
|
|
3283
|
-
const [y, b] =
|
|
3284
|
-
|
|
3285
|
-
x:
|
|
3286
|
-
y:
|
|
3372
|
+
const [y, b] = v(!1), [d, h] = v({ x: 0, y: 0 }), S = oe(null), m = ce.find((g) => g.type === r.type), k = (g) => {
|
|
3373
|
+
g.button === 0 && (g.stopPropagation(), b(!0), h({
|
|
3374
|
+
x: g.clientX - r.position.x,
|
|
3375
|
+
y: g.clientY - r.position.y
|
|
3287
3376
|
}), i());
|
|
3288
3377
|
};
|
|
3289
|
-
return
|
|
3378
|
+
return he(() => {
|
|
3290
3379
|
if (!y)
|
|
3291
3380
|
return;
|
|
3292
|
-
const
|
|
3293
|
-
|
|
3294
|
-
x:
|
|
3295
|
-
y:
|
|
3381
|
+
const g = (C) => {
|
|
3382
|
+
c({
|
|
3383
|
+
x: C.clientX - d.x,
|
|
3384
|
+
y: C.clientY - d.y
|
|
3296
3385
|
});
|
|
3297
|
-
},
|
|
3386
|
+
}, P = () => {
|
|
3298
3387
|
b(!1);
|
|
3299
3388
|
};
|
|
3300
|
-
return window.addEventListener("mousemove",
|
|
3301
|
-
window.removeEventListener("mousemove",
|
|
3389
|
+
return window.addEventListener("mousemove", g), window.addEventListener("mouseup", P), () => {
|
|
3390
|
+
window.removeEventListener("mousemove", g), window.removeEventListener("mouseup", P);
|
|
3302
3391
|
};
|
|
3303
|
-
}, [y, d,
|
|
3392
|
+
}, [y, d, c]), /* @__PURE__ */ t(
|
|
3304
3393
|
"div",
|
|
3305
3394
|
{
|
|
3306
|
-
ref:
|
|
3307
|
-
className: `nice-integration-builder__node nice-integration-builder__node--${
|
|
3395
|
+
ref: S,
|
|
3396
|
+
className: `nice-integration-builder__node nice-integration-builder__node--${r.type} ${a ? "nice-integration-builder__node--selected" : ""}`,
|
|
3308
3397
|
style: {
|
|
3309
|
-
left:
|
|
3310
|
-
top:
|
|
3398
|
+
left: r.position.x,
|
|
3399
|
+
top: r.position.y
|
|
3311
3400
|
},
|
|
3312
|
-
onMouseDown:
|
|
3401
|
+
onMouseDown: k,
|
|
3313
3402
|
children: [
|
|
3314
3403
|
/* @__PURE__ */ t("div", { className: "nice-integration-builder__node-header", children: [
|
|
3315
|
-
/* @__PURE__ */
|
|
3316
|
-
/* @__PURE__ */
|
|
3317
|
-
/* @__PURE__ */
|
|
3404
|
+
/* @__PURE__ */ e("span", { className: "nice-integration-builder__node-icon", children: (m == null ? void 0 : m.icon) || "📦" }),
|
|
3405
|
+
/* @__PURE__ */ e("span", { className: "nice-integration-builder__node-name", children: r.name }),
|
|
3406
|
+
/* @__PURE__ */ e(
|
|
3318
3407
|
"button",
|
|
3319
3408
|
{
|
|
3320
3409
|
className: "nice-integration-builder__node-delete",
|
|
3321
|
-
onClick: (
|
|
3322
|
-
|
|
3410
|
+
onClick: (g) => {
|
|
3411
|
+
g.stopPropagation(), n();
|
|
3323
3412
|
},
|
|
3324
3413
|
children: "×"
|
|
3325
3414
|
}
|
|
3326
3415
|
)
|
|
3327
3416
|
] }),
|
|
3328
|
-
|
|
3417
|
+
r.inputs.map((g) => /* @__PURE__ */ t(
|
|
3329
3418
|
"div",
|
|
3330
3419
|
{
|
|
3331
3420
|
className: "nice-integration-builder__port nice-integration-builder__port--input",
|
|
3332
|
-
onMouseUp: () =>
|
|
3421
|
+
onMouseUp: () => l(g),
|
|
3333
3422
|
children: [
|
|
3334
|
-
/* @__PURE__ */
|
|
3335
|
-
/* @__PURE__ */
|
|
3423
|
+
/* @__PURE__ */ e("span", { className: "nice-integration-builder__port-dot" }),
|
|
3424
|
+
/* @__PURE__ */ e("span", { className: "nice-integration-builder__port-label", children: g })
|
|
3336
3425
|
]
|
|
3337
3426
|
},
|
|
3338
|
-
|
|
3427
|
+
g
|
|
3339
3428
|
)),
|
|
3340
|
-
|
|
3429
|
+
r.outputs.map((g) => /* @__PURE__ */ t(
|
|
3341
3430
|
"div",
|
|
3342
3431
|
{
|
|
3343
3432
|
className: "nice-integration-builder__port nice-integration-builder__port--output",
|
|
3344
|
-
onMouseDown: (
|
|
3345
|
-
|
|
3433
|
+
onMouseDown: (P) => {
|
|
3434
|
+
P.stopPropagation(), u(g);
|
|
3346
3435
|
},
|
|
3347
3436
|
children: [
|
|
3348
|
-
/* @__PURE__ */
|
|
3349
|
-
/* @__PURE__ */
|
|
3437
|
+
/* @__PURE__ */ e("span", { className: "nice-integration-builder__port-label", children: g }),
|
|
3438
|
+
/* @__PURE__ */ e("span", { className: "nice-integration-builder__port-dot" })
|
|
3350
3439
|
]
|
|
3351
3440
|
},
|
|
3352
|
-
|
|
3441
|
+
g
|
|
3353
3442
|
))
|
|
3354
3443
|
]
|
|
3355
3444
|
}
|
|
3356
3445
|
);
|
|
3357
3446
|
}
|
|
3358
|
-
function
|
|
3359
|
-
node:
|
|
3447
|
+
function yr({
|
|
3448
|
+
node: r,
|
|
3360
3449
|
onChange: a,
|
|
3361
3450
|
onClose: i
|
|
3362
3451
|
}) {
|
|
3363
3452
|
return /* @__PURE__ */ t("div", { className: "nice-integration-builder__properties", children: [
|
|
3364
3453
|
/* @__PURE__ */ t("div", { className: "nice-integration-builder__properties-header", children: [
|
|
3365
|
-
/* @__PURE__ */
|
|
3366
|
-
/* @__PURE__ */
|
|
3454
|
+
/* @__PURE__ */ e("h4", { children: r.name }),
|
|
3455
|
+
/* @__PURE__ */ e("button", { onClick: i, children: "×" })
|
|
3367
3456
|
] }),
|
|
3368
3457
|
/* @__PURE__ */ t("div", { className: "nice-integration-builder__properties-content", children: [
|
|
3369
3458
|
/* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: [
|
|
3370
|
-
/* @__PURE__ */
|
|
3371
|
-
/* @__PURE__ */
|
|
3459
|
+
/* @__PURE__ */ e("label", { children: "Name" }),
|
|
3460
|
+
/* @__PURE__ */ e(
|
|
3372
3461
|
"input",
|
|
3373
3462
|
{
|
|
3374
3463
|
type: "text",
|
|
3375
|
-
value:
|
|
3464
|
+
value: r.name,
|
|
3376
3465
|
onChange: (n) => a({ name: n.target.value })
|
|
3377
3466
|
}
|
|
3378
3467
|
)
|
|
3379
3468
|
] }),
|
|
3380
|
-
|
|
3469
|
+
r.type === "http-request" && /* @__PURE__ */ t(F, { children: [
|
|
3381
3470
|
/* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: [
|
|
3382
|
-
/* @__PURE__ */
|
|
3383
|
-
/* @__PURE__ */
|
|
3471
|
+
/* @__PURE__ */ e("label", { children: "Method" }),
|
|
3472
|
+
/* @__PURE__ */ e(
|
|
3384
3473
|
"select",
|
|
3385
3474
|
{
|
|
3386
|
-
value:
|
|
3387
|
-
onChange: (n) => a({ config: { ...
|
|
3388
|
-
children: ["GET", "POST", "PUT", "PATCH", "DELETE"].map((n) => /* @__PURE__ */
|
|
3475
|
+
value: r.config.method || "GET",
|
|
3476
|
+
onChange: (n) => a({ config: { ...r.config, method: n.target.value } }),
|
|
3477
|
+
children: ["GET", "POST", "PUT", "PATCH", "DELETE"].map((n) => /* @__PURE__ */ e("option", { value: n, children: n }, n))
|
|
3389
3478
|
}
|
|
3390
3479
|
)
|
|
3391
3480
|
] }),
|
|
3392
3481
|
/* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: [
|
|
3393
|
-
/* @__PURE__ */
|
|
3394
|
-
/* @__PURE__ */
|
|
3482
|
+
/* @__PURE__ */ e("label", { children: "URL" }),
|
|
3483
|
+
/* @__PURE__ */ e(
|
|
3395
3484
|
"input",
|
|
3396
3485
|
{
|
|
3397
3486
|
type: "text",
|
|
3398
|
-
value:
|
|
3399
|
-
onChange: (n) => a({ config: { ...
|
|
3487
|
+
value: r.config.url || "",
|
|
3488
|
+
onChange: (n) => a({ config: { ...r.config, url: n.target.value } }),
|
|
3400
3489
|
placeholder: "https://api.example.com/endpoint"
|
|
3401
3490
|
}
|
|
3402
3491
|
)
|
|
3403
3492
|
] })
|
|
3404
3493
|
] }),
|
|
3405
|
-
|
|
3406
|
-
/* @__PURE__ */
|
|
3407
|
-
/* @__PURE__ */
|
|
3494
|
+
r.type === "delay" && /* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: [
|
|
3495
|
+
/* @__PURE__ */ e("label", { children: "Duration (ms)" }),
|
|
3496
|
+
/* @__PURE__ */ e(
|
|
3408
3497
|
"input",
|
|
3409
3498
|
{
|
|
3410
3499
|
type: "number",
|
|
3411
|
-
value:
|
|
3412
|
-
onChange: (n) => a({ config: { ...
|
|
3500
|
+
value: r.config.duration || 1e3,
|
|
3501
|
+
onChange: (n) => a({ config: { ...r.config, duration: parseInt(n.target.value, 10) } })
|
|
3413
3502
|
}
|
|
3414
3503
|
)
|
|
3415
3504
|
] }),
|
|
3416
|
-
|
|
3505
|
+
r.type === "set-variable" && /* @__PURE__ */ t(F, { children: [
|
|
3417
3506
|
/* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: [
|
|
3418
|
-
/* @__PURE__ */
|
|
3419
|
-
/* @__PURE__ */
|
|
3507
|
+
/* @__PURE__ */ e("label", { children: "Variable Name" }),
|
|
3508
|
+
/* @__PURE__ */ e(
|
|
3420
3509
|
"input",
|
|
3421
3510
|
{
|
|
3422
3511
|
type: "text",
|
|
3423
|
-
value:
|
|
3424
|
-
onChange: (n) => a({ config: { ...
|
|
3512
|
+
value: r.config.name || "",
|
|
3513
|
+
onChange: (n) => a({ config: { ...r.config, name: n.target.value } })
|
|
3425
3514
|
}
|
|
3426
3515
|
)
|
|
3427
3516
|
] }),
|
|
3428
3517
|
/* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: [
|
|
3429
|
-
/* @__PURE__ */
|
|
3430
|
-
/* @__PURE__ */
|
|
3518
|
+
/* @__PURE__ */ e("label", { children: "Value" }),
|
|
3519
|
+
/* @__PURE__ */ e(
|
|
3431
3520
|
"input",
|
|
3432
3521
|
{
|
|
3433
3522
|
type: "text",
|
|
3434
|
-
value:
|
|
3435
|
-
onChange: (n) => a({ config: { ...
|
|
3523
|
+
value: r.config.value || "",
|
|
3524
|
+
onChange: (n) => a({ config: { ...r.config, value: n.target.value } })
|
|
3436
3525
|
}
|
|
3437
3526
|
)
|
|
3438
3527
|
] })
|
|
3439
3528
|
] }),
|
|
3440
|
-
|
|
3441
|
-
/* @__PURE__ */
|
|
3442
|
-
/* @__PURE__ */
|
|
3529
|
+
r.type === "function" && /* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: [
|
|
3530
|
+
/* @__PURE__ */ e("label", { children: "Code" }),
|
|
3531
|
+
/* @__PURE__ */ e(
|
|
3443
3532
|
"textarea",
|
|
3444
3533
|
{
|
|
3445
|
-
value:
|
|
3446
|
-
onChange: (n) => a({ config: { ...
|
|
3534
|
+
value: r.config.code || "",
|
|
3535
|
+
onChange: (n) => a({ config: { ...r.config, code: n.target.value } }),
|
|
3447
3536
|
rows: 10,
|
|
3448
3537
|
className: "nice-integration-builder__code-input"
|
|
3449
3538
|
}
|
|
3450
3539
|
)
|
|
3451
3540
|
] }),
|
|
3452
|
-
|
|
3541
|
+
r.type === "email" && /* @__PURE__ */ t(F, { children: [
|
|
3453
3542
|
/* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: [
|
|
3454
|
-
/* @__PURE__ */
|
|
3455
|
-
/* @__PURE__ */
|
|
3543
|
+
/* @__PURE__ */ e("label", { children: "To" }),
|
|
3544
|
+
/* @__PURE__ */ e(
|
|
3456
3545
|
"input",
|
|
3457
3546
|
{
|
|
3458
3547
|
type: "text",
|
|
3459
|
-
value:
|
|
3460
|
-
onChange: (n) => a({ config: { ...
|
|
3548
|
+
value: r.config.to || "",
|
|
3549
|
+
onChange: (n) => a({ config: { ...r.config, to: n.target.value } })
|
|
3461
3550
|
}
|
|
3462
3551
|
)
|
|
3463
3552
|
] }),
|
|
3464
3553
|
/* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: [
|
|
3465
|
-
/* @__PURE__ */
|
|
3466
|
-
/* @__PURE__ */
|
|
3554
|
+
/* @__PURE__ */ e("label", { children: "Subject" }),
|
|
3555
|
+
/* @__PURE__ */ e(
|
|
3467
3556
|
"input",
|
|
3468
3557
|
{
|
|
3469
3558
|
type: "text",
|
|
3470
|
-
value:
|
|
3471
|
-
onChange: (n) => a({ config: { ...
|
|
3559
|
+
value: r.config.subject || "",
|
|
3560
|
+
onChange: (n) => a({ config: { ...r.config, subject: n.target.value } })
|
|
3472
3561
|
}
|
|
3473
3562
|
)
|
|
3474
3563
|
] }),
|
|
3475
3564
|
/* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: [
|
|
3476
|
-
/* @__PURE__ */
|
|
3477
|
-
/* @__PURE__ */
|
|
3565
|
+
/* @__PURE__ */ e("label", { children: "Body" }),
|
|
3566
|
+
/* @__PURE__ */ e(
|
|
3478
3567
|
"textarea",
|
|
3479
3568
|
{
|
|
3480
|
-
value:
|
|
3481
|
-
onChange: (n) => a({ config: { ...
|
|
3569
|
+
value: r.config.body || "",
|
|
3570
|
+
onChange: (n) => a({ config: { ...r.config, body: n.target.value } }),
|
|
3482
3571
|
rows: 5
|
|
3483
3572
|
}
|
|
3484
3573
|
)
|
|
@@ -3487,124 +3576,124 @@ function mr({
|
|
|
3487
3576
|
] })
|
|
3488
3577
|
] });
|
|
3489
3578
|
}
|
|
3490
|
-
function
|
|
3579
|
+
function ur({ variables: r, onChange: a }) {
|
|
3491
3580
|
const i = () => {
|
|
3492
|
-
a({ ...
|
|
3581
|
+
a({ ...r, newVariable: "" });
|
|
3493
3582
|
};
|
|
3494
3583
|
return /* @__PURE__ */ t("div", { className: "nice-integration-builder__variables", children: [
|
|
3495
|
-
/* @__PURE__ */
|
|
3496
|
-
/* @__PURE__ */
|
|
3497
|
-
/* @__PURE__ */
|
|
3584
|
+
/* @__PURE__ */ e("h4", { children: "Flow Variables" }),
|
|
3585
|
+
/* @__PURE__ */ e("div", { className: "nice-integration-builder__variables-list", children: Object.entries(r).map(([n, c]) => /* @__PURE__ */ t("div", { className: "nice-integration-builder__variable-row", children: [
|
|
3586
|
+
/* @__PURE__ */ e(
|
|
3498
3587
|
"input",
|
|
3499
3588
|
{
|
|
3500
3589
|
type: "text",
|
|
3501
3590
|
value: n,
|
|
3502
3591
|
onChange: (u) => {
|
|
3503
|
-
const { [n]:
|
|
3504
|
-
a({ ...y, [u.target.value]:
|
|
3592
|
+
const { [n]: l, ...y } = r;
|
|
3593
|
+
a({ ...y, [u.target.value]: c });
|
|
3505
3594
|
},
|
|
3506
3595
|
placeholder: "Name"
|
|
3507
3596
|
}
|
|
3508
3597
|
),
|
|
3509
|
-
/* @__PURE__ */
|
|
3598
|
+
/* @__PURE__ */ e(
|
|
3510
3599
|
"input",
|
|
3511
3600
|
{
|
|
3512
3601
|
type: "text",
|
|
3513
|
-
value: String(
|
|
3514
|
-
onChange: (u) => a({ ...
|
|
3602
|
+
value: String(c),
|
|
3603
|
+
onChange: (u) => a({ ...r, [n]: u.target.value }),
|
|
3515
3604
|
placeholder: "Value"
|
|
3516
3605
|
}
|
|
3517
3606
|
),
|
|
3518
|
-
/* @__PURE__ */
|
|
3607
|
+
/* @__PURE__ */ e(
|
|
3519
3608
|
"button",
|
|
3520
3609
|
{
|
|
3521
3610
|
onClick: () => {
|
|
3522
|
-
const { [n]: u, ...
|
|
3523
|
-
a(
|
|
3611
|
+
const { [n]: u, ...l } = r;
|
|
3612
|
+
a(l);
|
|
3524
3613
|
},
|
|
3525
3614
|
children: "×"
|
|
3526
3615
|
}
|
|
3527
3616
|
)
|
|
3528
3617
|
] }, n)) }),
|
|
3529
|
-
/* @__PURE__ */
|
|
3618
|
+
/* @__PURE__ */ e("button", { onClick: i, children: "+ Add Variable" })
|
|
3530
3619
|
] });
|
|
3531
3620
|
}
|
|
3532
|
-
function
|
|
3533
|
-
errorHandling:
|
|
3621
|
+
function br({
|
|
3622
|
+
errorHandling: r,
|
|
3534
3623
|
schedule: a,
|
|
3535
3624
|
onChange: i
|
|
3536
3625
|
}) {
|
|
3537
3626
|
return /* @__PURE__ */ t("div", { className: "nice-integration-builder__settings", children: [
|
|
3538
|
-
/* @__PURE__ */
|
|
3627
|
+
/* @__PURE__ */ e("h4", { children: "Error Handling" }),
|
|
3539
3628
|
/* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: [
|
|
3540
|
-
/* @__PURE__ */
|
|
3629
|
+
/* @__PURE__ */ e("label", { children: "Strategy" }),
|
|
3541
3630
|
/* @__PURE__ */ t(
|
|
3542
3631
|
"select",
|
|
3543
3632
|
{
|
|
3544
|
-
value:
|
|
3633
|
+
value: r.strategy,
|
|
3545
3634
|
onChange: (n) => i(
|
|
3546
|
-
{ ...
|
|
3635
|
+
{ ...r, strategy: n.target.value },
|
|
3547
3636
|
a
|
|
3548
3637
|
),
|
|
3549
3638
|
children: [
|
|
3550
|
-
/* @__PURE__ */
|
|
3551
|
-
/* @__PURE__ */
|
|
3552
|
-
/* @__PURE__ */
|
|
3639
|
+
/* @__PURE__ */ e("option", { value: "stop", children: "Stop on error" }),
|
|
3640
|
+
/* @__PURE__ */ e("option", { value: "continue", children: "Continue on error" }),
|
|
3641
|
+
/* @__PURE__ */ e("option", { value: "retry", children: "Retry on error" })
|
|
3553
3642
|
]
|
|
3554
3643
|
}
|
|
3555
3644
|
)
|
|
3556
3645
|
] }),
|
|
3557
|
-
|
|
3646
|
+
r.strategy === "retry" && /* @__PURE__ */ t(F, { children: [
|
|
3558
3647
|
/* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: [
|
|
3559
|
-
/* @__PURE__ */
|
|
3560
|
-
/* @__PURE__ */
|
|
3648
|
+
/* @__PURE__ */ e("label", { children: "Max Retries" }),
|
|
3649
|
+
/* @__PURE__ */ e(
|
|
3561
3650
|
"input",
|
|
3562
3651
|
{
|
|
3563
3652
|
type: "number",
|
|
3564
|
-
value:
|
|
3565
|
-
onChange: (n) => i({ ...
|
|
3653
|
+
value: r.maxRetries || 3,
|
|
3654
|
+
onChange: (n) => i({ ...r, maxRetries: parseInt(n.target.value, 10) }, a)
|
|
3566
3655
|
}
|
|
3567
3656
|
)
|
|
3568
3657
|
] }),
|
|
3569
3658
|
/* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: [
|
|
3570
|
-
/* @__PURE__ */
|
|
3571
|
-
/* @__PURE__ */
|
|
3659
|
+
/* @__PURE__ */ e("label", { children: "Retry Delay (ms)" }),
|
|
3660
|
+
/* @__PURE__ */ e(
|
|
3572
3661
|
"input",
|
|
3573
3662
|
{
|
|
3574
3663
|
type: "number",
|
|
3575
|
-
value:
|
|
3576
|
-
onChange: (n) => i({ ...
|
|
3664
|
+
value: r.retryDelay || 1e3,
|
|
3665
|
+
onChange: (n) => i({ ...r, retryDelay: parseInt(n.target.value, 10) }, a)
|
|
3577
3666
|
}
|
|
3578
3667
|
)
|
|
3579
3668
|
] })
|
|
3580
3669
|
] }),
|
|
3581
|
-
/* @__PURE__ */
|
|
3582
|
-
/* @__PURE__ */
|
|
3583
|
-
/* @__PURE__ */
|
|
3670
|
+
/* @__PURE__ */ e("h4", { children: "Schedule" }),
|
|
3671
|
+
/* @__PURE__ */ e("div", { className: "nice-integration-builder__field", children: /* @__PURE__ */ t("label", { children: [
|
|
3672
|
+
/* @__PURE__ */ e(
|
|
3584
3673
|
"input",
|
|
3585
3674
|
{
|
|
3586
3675
|
type: "checkbox",
|
|
3587
3676
|
checked: (a == null ? void 0 : a.enabled) || !1,
|
|
3588
|
-
onChange: (n) => i(
|
|
3677
|
+
onChange: (n) => i(r, { ...a, enabled: n.target.checked })
|
|
3589
3678
|
}
|
|
3590
3679
|
),
|
|
3591
3680
|
"Enable scheduled execution"
|
|
3592
3681
|
] }) }),
|
|
3593
3682
|
(a == null ? void 0 : a.enabled) && /* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: [
|
|
3594
|
-
/* @__PURE__ */
|
|
3595
|
-
/* @__PURE__ */
|
|
3683
|
+
/* @__PURE__ */ e("label", { children: "Cron Expression" }),
|
|
3684
|
+
/* @__PURE__ */ e(
|
|
3596
3685
|
"input",
|
|
3597
3686
|
{
|
|
3598
3687
|
type: "text",
|
|
3599
3688
|
value: a.cron || "",
|
|
3600
|
-
onChange: (n) => i(
|
|
3689
|
+
onChange: (n) => i(r, { ...a, cron: n.target.value }),
|
|
3601
3690
|
placeholder: "0 0 * * *"
|
|
3602
3691
|
}
|
|
3603
3692
|
)
|
|
3604
3693
|
] })
|
|
3605
3694
|
] });
|
|
3606
3695
|
}
|
|
3607
|
-
const
|
|
3696
|
+
const hr = [
|
|
3608
3697
|
{
|
|
3609
3698
|
target: ".nice-webhook-tester",
|
|
3610
3699
|
titleKey: "tutorial.webhookTester.intro.title",
|
|
@@ -3614,126 +3703,126 @@ const br = [
|
|
|
3614
3703
|
placement: "auto"
|
|
3615
3704
|
}
|
|
3616
3705
|
];
|
|
3617
|
-
function
|
|
3618
|
-
return
|
|
3706
|
+
function me(r) {
|
|
3707
|
+
return r ? Object.entries(r).map(([a, i]) => ({ key: a, value: i })) : [];
|
|
3619
3708
|
}
|
|
3620
|
-
function
|
|
3709
|
+
function ye(r) {
|
|
3621
3710
|
const a = {};
|
|
3622
|
-
for (const i of
|
|
3711
|
+
for (const i of r)
|
|
3623
3712
|
i.key.trim() !== "" && (a[i.key] = i.value);
|
|
3624
3713
|
return a;
|
|
3625
3714
|
}
|
|
3626
|
-
async function
|
|
3627
|
-
var
|
|
3628
|
-
const i = (
|
|
3715
|
+
async function gr(r, a) {
|
|
3716
|
+
var l;
|
|
3717
|
+
const i = (l = globalThis.crypto) == null ? void 0 : l.subtle;
|
|
3629
3718
|
if (!i)
|
|
3630
3719
|
throw new Error("Web Crypto (crypto.subtle) is unavailable in this environment");
|
|
3631
|
-
const n = new TextEncoder(),
|
|
3720
|
+
const n = new TextEncoder(), c = await i.importKey(
|
|
3632
3721
|
"raw",
|
|
3633
|
-
n.encode(
|
|
3722
|
+
n.encode(r),
|
|
3634
3723
|
{ name: "HMAC", hash: "SHA-256" },
|
|
3635
3724
|
!1,
|
|
3636
3725
|
["sign"]
|
|
3637
|
-
), u = await i.sign("HMAC",
|
|
3726
|
+
), u = await i.sign("HMAC", c, n.encode(a));
|
|
3638
3727
|
return [...new Uint8Array(u)].map((y) => y.toString(16).padStart(2, "0")).join("");
|
|
3639
3728
|
}
|
|
3640
|
-
const
|
|
3729
|
+
const Sr = ue(
|
|
3641
3730
|
function(a, i) {
|
|
3642
3731
|
const {
|
|
3643
3732
|
url: n = "",
|
|
3644
|
-
method:
|
|
3733
|
+
method: c = "POST",
|
|
3645
3734
|
headers: u,
|
|
3646
|
-
payload:
|
|
3735
|
+
payload: l = "",
|
|
3647
3736
|
samples: y = [],
|
|
3648
3737
|
onSend: b,
|
|
3649
3738
|
signing: d,
|
|
3650
|
-
onSaveSample:
|
|
3651
|
-
tutorial:
|
|
3739
|
+
onSaveSample: h,
|
|
3740
|
+
tutorial: S,
|
|
3652
3741
|
className: m,
|
|
3653
|
-
style:
|
|
3654
|
-
id:
|
|
3655
|
-
"data-testid":
|
|
3656
|
-
} = a, [
|
|
3742
|
+
style: k,
|
|
3743
|
+
id: g,
|
|
3744
|
+
"data-testid": P
|
|
3745
|
+
} = a, [C, O] = v(n), [U, W] = v(c), [$, L] = v(() => me(u)), [I, j] = v(l), [w, N] = v(""), [x, K] = v(!1), [q, B] = v(null), [M, J] = v(null), V = Ee(() => {
|
|
3657
3746
|
const o = /* @__PURE__ */ new Map();
|
|
3658
|
-
for (const
|
|
3659
|
-
o.set(
|
|
3747
|
+
for (const _ of y)
|
|
3748
|
+
o.set(_.id, _);
|
|
3660
3749
|
return o;
|
|
3661
|
-
}, [y]),
|
|
3662
|
-
|
|
3663
|
-
const
|
|
3664
|
-
|
|
3665
|
-
},
|
|
3666
|
-
|
|
3667
|
-
},
|
|
3668
|
-
|
|
3750
|
+
}, [y]), Y = (o) => {
|
|
3751
|
+
N(o);
|
|
3752
|
+
const _ = V.get(o);
|
|
3753
|
+
_ && (j(_.payload), _.headers && L(me(_.headers)));
|
|
3754
|
+
}, G = (o, _) => {
|
|
3755
|
+
L((E) => E.map((H, A) => A === o ? { ...H, ..._ } : H));
|
|
3756
|
+
}, Q = async () => {
|
|
3757
|
+
K(!0), B(null), J(null);
|
|
3669
3758
|
try {
|
|
3670
|
-
const o =
|
|
3759
|
+
const o = ye($);
|
|
3671
3760
|
if (d && d.secret) {
|
|
3672
|
-
const
|
|
3673
|
-
o[d.header] = `${d.prefix ?? ""}${
|
|
3761
|
+
const A = await gr(d.secret, I);
|
|
3762
|
+
o[d.header] = `${d.prefix ?? ""}${A}`;
|
|
3674
3763
|
}
|
|
3675
|
-
const
|
|
3676
|
-
(typeof performance < "u" ? performance.now() : Date.now()) -
|
|
3764
|
+
const _ = typeof performance < "u" ? performance.now() : Date.now(), E = await b({ url: C, method: U ?? "POST", headers: o, body: I }), H = Math.round(
|
|
3765
|
+
(typeof performance < "u" ? performance.now() : Date.now()) - _
|
|
3677
3766
|
);
|
|
3678
|
-
|
|
3767
|
+
J({ ...E, durationMs: E.durationMs ?? H });
|
|
3679
3768
|
} catch (o) {
|
|
3680
|
-
|
|
3769
|
+
B(o instanceof Error ? o.message : String(o));
|
|
3681
3770
|
} finally {
|
|
3682
|
-
|
|
3771
|
+
K(!1);
|
|
3683
3772
|
}
|
|
3684
|
-
},
|
|
3685
|
-
var
|
|
3686
|
-
if (!
|
|
3773
|
+
}, Z = () => {
|
|
3774
|
+
var _;
|
|
3775
|
+
if (!h)
|
|
3687
3776
|
return;
|
|
3688
|
-
const o = typeof window < "u" && ((
|
|
3689
|
-
o &&
|
|
3777
|
+
const o = typeof window < "u" && ((_ = window.prompt) == null ? void 0 : _.call(window, "Sample name")) || "";
|
|
3778
|
+
o && h({
|
|
3690
3779
|
id: `sample_${Date.now().toString(36)}`,
|
|
3691
3780
|
name: o,
|
|
3692
|
-
payload:
|
|
3693
|
-
headers:
|
|
3781
|
+
payload: I,
|
|
3782
|
+
headers: ye($)
|
|
3694
3783
|
});
|
|
3695
|
-
},
|
|
3696
|
-
return /* @__PURE__ */ t("div", { ref: i, id:
|
|
3697
|
-
|
|
3784
|
+
}, p = M == null ? "" : M.status >= 200 && M.status < 300 ? " nice-webhook-tester__status--ok" : " nice-webhook-tester__status--error", s = "nice-webhook-tester" + (m ? ` ${m}` : "");
|
|
3785
|
+
return /* @__PURE__ */ t("div", { ref: i, id: g, className: s, style: k, "data-testid": P, children: [
|
|
3786
|
+
S && /* @__PURE__ */ e("div", { className: "nice-webhook-tester__tutorial", children: /* @__PURE__ */ e(ie, { steps: ae(S, hr) }) }),
|
|
3698
3787
|
/* @__PURE__ */ t("div", { className: "nice-webhook-tester__bar", children: [
|
|
3699
|
-
/* @__PURE__ */
|
|
3788
|
+
/* @__PURE__ */ e(
|
|
3700
3789
|
"select",
|
|
3701
3790
|
{
|
|
3702
3791
|
className: "nice-webhook-tester__method",
|
|
3703
|
-
value:
|
|
3704
|
-
onChange: (o) =>
|
|
3792
|
+
value: U,
|
|
3793
|
+
onChange: (o) => W(o.target.value),
|
|
3705
3794
|
"aria-label": "Method",
|
|
3706
|
-
children: ["POST", "PUT", "GET", "PATCH", "DELETE"].map((o) => /* @__PURE__ */
|
|
3795
|
+
children: ["POST", "PUT", "GET", "PATCH", "DELETE"].map((o) => /* @__PURE__ */ e("option", { value: o, children: o }, o))
|
|
3707
3796
|
}
|
|
3708
3797
|
),
|
|
3709
|
-
/* @__PURE__ */
|
|
3798
|
+
/* @__PURE__ */ e(
|
|
3710
3799
|
"input",
|
|
3711
3800
|
{
|
|
3712
3801
|
type: "text",
|
|
3713
3802
|
className: "nice-webhook-tester__url",
|
|
3714
|
-
value:
|
|
3803
|
+
value: C,
|
|
3715
3804
|
placeholder: "https://example.com/api/payments/stripe/webhook",
|
|
3716
|
-
onChange: (o) =>
|
|
3805
|
+
onChange: (o) => O(o.target.value),
|
|
3717
3806
|
"aria-label": "URL"
|
|
3718
3807
|
}
|
|
3719
3808
|
),
|
|
3720
|
-
/* @__PURE__ */
|
|
3809
|
+
/* @__PURE__ */ e(
|
|
3721
3810
|
"button",
|
|
3722
3811
|
{
|
|
3723
3812
|
type: "button",
|
|
3724
3813
|
className: "nice-webhook-tester__send",
|
|
3725
|
-
onClick: () => void
|
|
3726
|
-
disabled:
|
|
3727
|
-
children:
|
|
3814
|
+
onClick: () => void Q(),
|
|
3815
|
+
disabled: x || C.trim() === "",
|
|
3816
|
+
children: x ? "Sending…" : "Send"
|
|
3728
3817
|
}
|
|
3729
3818
|
)
|
|
3730
3819
|
] }),
|
|
3731
|
-
y.length > 0 && /* @__PURE__ */
|
|
3820
|
+
y.length > 0 && /* @__PURE__ */ e("div", { className: "nice-webhook-tester__samples", children: /* @__PURE__ */ t("label", { children: [
|
|
3732
3821
|
"Sample:",
|
|
3733
3822
|
" ",
|
|
3734
|
-
/* @__PURE__ */ t("select", { value: w, onChange: (o) =>
|
|
3735
|
-
/* @__PURE__ */
|
|
3736
|
-
y.map((o) => /* @__PURE__ */
|
|
3823
|
+
/* @__PURE__ */ t("select", { value: w, onChange: (o) => Y(o.target.value), children: [
|
|
3824
|
+
/* @__PURE__ */ e("option", { value: "", children: "— choose a saved payload —" }),
|
|
3825
|
+
y.map((o) => /* @__PURE__ */ e("option", { value: o.id, children: o.name }, o.id))
|
|
3737
3826
|
] })
|
|
3738
3827
|
] }) }),
|
|
3739
3828
|
/* @__PURE__ */ t("div", { className: "nice-webhook-tester__headers", children: [
|
|
@@ -3742,46 +3831,46 @@ const xr = ke(
|
|
|
3742
3831
|
d && /* @__PURE__ */ t("span", { className: "nice-webhook-tester__signed", children: [
|
|
3743
3832
|
" ",
|
|
3744
3833
|
"· auto-signs ",
|
|
3745
|
-
/* @__PURE__ */
|
|
3834
|
+
/* @__PURE__ */ e("code", { children: d.header })
|
|
3746
3835
|
] })
|
|
3747
3836
|
] }),
|
|
3748
|
-
$.map((o,
|
|
3749
|
-
/* @__PURE__ */
|
|
3837
|
+
$.map((o, _) => /* @__PURE__ */ t("div", { className: "nice-webhook-tester__header-row", children: [
|
|
3838
|
+
/* @__PURE__ */ e(
|
|
3750
3839
|
"input",
|
|
3751
3840
|
{
|
|
3752
3841
|
type: "text",
|
|
3753
3842
|
value: o.key,
|
|
3754
3843
|
placeholder: "Header",
|
|
3755
|
-
onChange: (
|
|
3844
|
+
onChange: (E) => G(_, { key: E.target.value }),
|
|
3756
3845
|
"aria-label": "Header name"
|
|
3757
3846
|
}
|
|
3758
3847
|
),
|
|
3759
|
-
/* @__PURE__ */
|
|
3848
|
+
/* @__PURE__ */ e(
|
|
3760
3849
|
"input",
|
|
3761
3850
|
{
|
|
3762
3851
|
type: "text",
|
|
3763
3852
|
value: o.value,
|
|
3764
3853
|
placeholder: "Value",
|
|
3765
|
-
onChange: (
|
|
3854
|
+
onChange: (E) => G(_, { value: E.target.value }),
|
|
3766
3855
|
"aria-label": "Header value"
|
|
3767
3856
|
}
|
|
3768
3857
|
),
|
|
3769
|
-
/* @__PURE__ */
|
|
3858
|
+
/* @__PURE__ */ e(
|
|
3770
3859
|
"button",
|
|
3771
3860
|
{
|
|
3772
3861
|
type: "button",
|
|
3773
|
-
onClick: () =>
|
|
3862
|
+
onClick: () => L((E) => E.filter((H, A) => A !== _)),
|
|
3774
3863
|
"aria-label": "Remove header",
|
|
3775
3864
|
children: "✕"
|
|
3776
3865
|
}
|
|
3777
3866
|
)
|
|
3778
|
-
] },
|
|
3779
|
-
/* @__PURE__ */
|
|
3867
|
+
] }, _)),
|
|
3868
|
+
/* @__PURE__ */ e(
|
|
3780
3869
|
"button",
|
|
3781
3870
|
{
|
|
3782
3871
|
type: "button",
|
|
3783
3872
|
className: "nice-webhook-tester__add-header",
|
|
3784
|
-
onClick: () =>
|
|
3873
|
+
onClick: () => L((o) => [...o, { key: "", value: "" }]),
|
|
3785
3874
|
children: "+ Header"
|
|
3786
3875
|
}
|
|
3787
3876
|
)
|
|
@@ -3789,41 +3878,41 @@ const xr = ke(
|
|
|
3789
3878
|
/* @__PURE__ */ t("div", { className: "nice-webhook-tester__payload", children: [
|
|
3790
3879
|
/* @__PURE__ */ t("div", { className: "nice-webhook-tester__section-label", children: [
|
|
3791
3880
|
"Payload",
|
|
3792
|
-
|
|
3881
|
+
h && /* @__PURE__ */ e("button", { type: "button", className: "nice-webhook-tester__save", onClick: Z, children: "Save as sample" })
|
|
3793
3882
|
] }),
|
|
3794
|
-
/* @__PURE__ */
|
|
3883
|
+
/* @__PURE__ */ e(
|
|
3795
3884
|
"textarea",
|
|
3796
3885
|
{
|
|
3797
3886
|
className: "nice-webhook-tester__textarea",
|
|
3798
|
-
value:
|
|
3887
|
+
value: I,
|
|
3799
3888
|
spellCheck: !1,
|
|
3800
3889
|
rows: 8,
|
|
3801
3890
|
placeholder: '{ "type": "payment.succeeded", "data": { ... } }',
|
|
3802
|
-
onChange: (o) =>
|
|
3891
|
+
onChange: (o) => j(o.target.value),
|
|
3803
3892
|
"aria-label": "Payload"
|
|
3804
3893
|
}
|
|
3805
3894
|
)
|
|
3806
3895
|
] }),
|
|
3807
|
-
|
|
3808
|
-
|
|
3896
|
+
q && /* @__PURE__ */ e("div", { className: "nice-webhook-tester__error", children: q }),
|
|
3897
|
+
M && /* @__PURE__ */ t("div", { className: "nice-webhook-tester__response", children: [
|
|
3809
3898
|
/* @__PURE__ */ t("div", { className: "nice-webhook-tester__section-label", children: [
|
|
3810
3899
|
"Response",
|
|
3811
3900
|
" ",
|
|
3812
|
-
/* @__PURE__ */
|
|
3813
|
-
|
|
3901
|
+
/* @__PURE__ */ e("span", { className: "nice-webhook-tester__status" + p, children: M.status }),
|
|
3902
|
+
M.durationMs != null && /* @__PURE__ */ t("span", { className: "nice-webhook-tester__time", children: [
|
|
3814
3903
|
" · ",
|
|
3815
|
-
|
|
3904
|
+
M.durationMs,
|
|
3816
3905
|
" ms"
|
|
3817
3906
|
] })
|
|
3818
3907
|
] }),
|
|
3819
|
-
|
|
3908
|
+
M.body != null && /* @__PURE__ */ e("pre", { className: "nice-webhook-tester__response-body", children: M.body })
|
|
3820
3909
|
] })
|
|
3821
3910
|
] });
|
|
3822
3911
|
}
|
|
3823
3912
|
);
|
|
3824
3913
|
export {
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3914
|
+
wr as NiceAPIDesigner,
|
|
3915
|
+
Nr as NiceAPITester,
|
|
3916
|
+
xr as NiceIntegrationBuilder,
|
|
3917
|
+
Sr as NiceWebhookTester
|
|
3829
3918
|
};
|