@t0.labs/daxta 0.4.24 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +139 -91
- package/assets/empty.html +6 -5
- package/assets/example.html +237 -246
- package/assets/favicon.png +0 -0
- package/assets/favicon.svg +16 -0
- package/assets/logo.png +0 -0
- package/assets/viewer.html +164 -113
- package/dist/build/build-spec.d.ts +3 -1
- package/dist/build/build-spec.js +11 -6
- package/dist/cli/install.js +16 -13
- package/dist/cli/main.js +15 -15
- package/dist/cli/migrate.js +2 -2
- package/dist/cli/titles.js +3 -3
- package/dist/cli/tree.d.ts +1 -1
- package/dist/cli/tree.js +4 -4
- package/dist/cli/ui.js +1 -1
- package/dist/cli/uninstall.js +16 -6
- package/dist/config.d.ts +3 -3
- package/dist/config.js +4 -4
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -1
- package/dist/jest/global-teardown.d.ts +2 -2
- package/dist/jest/global-teardown.js +3 -3
- package/dist/jest/reporter.d.ts +1 -1
- package/dist/jest/reporter.js +6 -7
- package/dist/serve/index.d.ts +2 -2
- package/dist/serve/index.js +8 -6
- package/dist/serve/middleware.d.ts +4 -4
- package/dist/serve/middleware.js +6 -6
- package/dist/serve/paths.d.ts +8 -0
- package/dist/serve/paths.js +22 -4
- package/package.json +2 -2
package/assets/example.html
CHANGED
|
@@ -3,39 +3,37 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="utf-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
-
<title>
|
|
7
|
-
<link rel="icon"
|
|
8
|
-
<link rel="apple-touch-icon" href="data:image/
|
|
6
|
+
<title>API Documentation</title>
|
|
7
|
+
<link rel="icon" href="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+CiAgPHN0eWxlPgogICAgLmJnIHsgZmlsbDogI2ZmZmZmZjsgfQogICAgLmZnIHsgZmlsbDogIzExMTExMTsgfQogICAgLnJpbmcgeyBmaWxsOiBub25lOyBzdHJva2U6ICMxMTExMTE7IHN0cm9rZS13aWR0aDogMS4yNTsgfQogICAgQG1lZGlhIChwcmVmZXJzLWNvbG9yLXNjaGVtZTogZGFyaykgewogICAgICAuYmcgeyBmaWxsOiAjMTExMTExOyB9CiAgICAgIC5mZyB7IGZpbGw6ICNmZmZmZmY7IH0KICAgICAgLnJpbmcgeyBzdHJva2U6ICNmZmZmZmY7IH0KICAgIH0KICA8L3N0eWxlPgogIDxyZWN0IGNsYXNzPSJiZyIgd2lkdGg9IjMyIiBoZWlnaHQ9IjMyIiByeD0iNyIvPgogIDxyZWN0IGNsYXNzPSJyaW5nIiB4PSIwLjYiIHk9IjAuNiIgd2lkdGg9IjMwLjgiIGhlaWdodD0iMzAuOCIgcng9IjYuNCIvPgogIDxwYXRoIGNsYXNzPSJmZyIgZD0iTTQuMiA1LjIgMTQuMiA4Ljh2NC4yQTQuMiA0LjIgMCAwIDEgMTQuMiAyMS40djRMNC4yIDI2LjhaIi8+CiAgPHBhdGggY2xhc3M9ImZnIiBkPSJNMjcuOCA1LjIgMTcuOCA4Ljh2NC4yQTQuMiA0LjIgMCAwIDAgMTcuOCAyMS40djRMMjcuOCAyNi44WiIvPgo8L3N2Zz4K" />
|
|
8
|
+
<link rel="apple-touch-icon" href="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+CiAgPHN0eWxlPgogICAgLmJnIHsgZmlsbDogI2ZmZmZmZjsgfQogICAgLmZnIHsgZmlsbDogIzExMTExMTsgfQogICAgLnJpbmcgeyBmaWxsOiBub25lOyBzdHJva2U6ICMxMTExMTE7IHN0cm9rZS13aWR0aDogMS4yNTsgfQogICAgQG1lZGlhIChwcmVmZXJzLWNvbG9yLXNjaGVtZTogZGFyaykgewogICAgICAuYmcgeyBmaWxsOiAjMTExMTExOyB9CiAgICAgIC5mZyB7IGZpbGw6ICNmZmZmZmY7IH0KICAgICAgLnJpbmcgeyBzdHJva2U6ICNmZmZmZmY7IH0KICAgIH0KICA8L3N0eWxlPgogIDxyZWN0IGNsYXNzPSJiZyIgd2lkdGg9IjMyIiBoZWlnaHQ9IjMyIiByeD0iNyIvPgogIDxyZWN0IGNsYXNzPSJyaW5nIiB4PSIwLjYiIHk9IjAuNiIgd2lkdGg9IjMwLjgiIGhlaWdodD0iMzAuOCIgcng9IjYuNCIvPgogIDxwYXRoIGNsYXNzPSJmZyIgZD0iTTQuMiA1LjIgMTQuMiA4Ljh2NC4yQTQuMiA0LjIgMCAwIDEgMTQuMiAyMS40djRMNC4yIDI2LjhaIi8+CiAgPHBhdGggY2xhc3M9ImZnIiBkPSJNMjcuOCA1LjIgMTcuOCA4Ljh2NC4yQTQuMiA0LjIgMCAwIDAgMTcuOCAyMS40djRMMjcuOCAyNi44WiIvPgo8L3N2Zz4K" />
|
|
9
9
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
10
10
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
11
11
|
<link href="https://fonts.googleapis.com/css2?family=Geist+Mono:wght@400;500;600&family=Geist:wght@400;500;600&display=swap" rel="stylesheet" />
|
|
12
12
|
<style>
|
|
13
13
|
:root {
|
|
14
|
-
--canvas: #
|
|
15
|
-
--sidebar: #
|
|
14
|
+
--canvas: #fafafa;
|
|
15
|
+
--sidebar: #fafafa;
|
|
16
16
|
--nav: #ffffff;
|
|
17
|
-
--paper: #
|
|
17
|
+
--paper: #fafafa;
|
|
18
18
|
--white: #ffffff;
|
|
19
|
-
--inset: #
|
|
20
|
-
--
|
|
21
|
-
--
|
|
22
|
-
--
|
|
23
|
-
--
|
|
24
|
-
--
|
|
25
|
-
--
|
|
26
|
-
--
|
|
27
|
-
--accent: #ea580c;
|
|
28
|
-
--accent-soft: #fff4ed;
|
|
19
|
+
--inset: #f5f5f5;
|
|
20
|
+
--hairline: #e6e6e6;
|
|
21
|
+
--line: #e6e6e6;
|
|
22
|
+
--smoke: #888888;
|
|
23
|
+
--stone: #666666;
|
|
24
|
+
--charcoal: #333333;
|
|
25
|
+
--obsidian: #111111;
|
|
26
|
+
--accent: #6f7d3c;
|
|
29
27
|
--ok: #15803d;
|
|
30
|
-
--ok-bg: #
|
|
28
|
+
--ok-bg: #e8f8ee;
|
|
29
|
+
--get: #16a34a;
|
|
31
30
|
--err: #b42318;
|
|
32
|
-
--err-bg: #
|
|
31
|
+
--err-bg: #fbeaea;
|
|
33
32
|
--sans: Geist, Inter, ui-sans-serif, system-ui, sans-serif;
|
|
34
33
|
--mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
35
|
-
--radius:
|
|
36
|
-
--
|
|
37
|
-
--
|
|
38
|
-
--ghost: 0 0 0 1px #e4e4e7;
|
|
34
|
+
--radius: 5px;
|
|
35
|
+
--ring: 0 0 0 1px #e6e6e6;
|
|
36
|
+
--ghost: 0 0 0 1px #e6e6e6;
|
|
39
37
|
}
|
|
40
38
|
* { box-sizing: border-box; }
|
|
41
39
|
html, body { height: 100%; }
|
|
@@ -50,10 +48,10 @@
|
|
|
50
48
|
.topnav {
|
|
51
49
|
height: 44px;
|
|
52
50
|
display: grid;
|
|
53
|
-
grid-template-columns: 1fr minmax(
|
|
51
|
+
grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr);
|
|
54
52
|
align-items: center;
|
|
55
|
-
gap:
|
|
56
|
-
padding: 0
|
|
53
|
+
gap: 12px;
|
|
54
|
+
padding: 0 14px;
|
|
57
55
|
background: var(--nav);
|
|
58
56
|
border-bottom: 1px solid var(--hairline);
|
|
59
57
|
position: sticky;
|
|
@@ -62,29 +60,25 @@
|
|
|
62
60
|
}
|
|
63
61
|
body.searching .topnav { z-index: 30; }
|
|
64
62
|
.brand-wrap { display: flex; align-items: center; gap: 10px; min-width: 0; justify-self: start; }
|
|
65
|
-
.
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
63
|
+
.workspace { display: none; }
|
|
64
|
+
.brand { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--charcoal); }
|
|
65
|
+
.ep-nav {
|
|
66
|
+
justify-self: center;
|
|
67
|
+
display: flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
gap: 8px;
|
|
70
|
+
min-width: 0;
|
|
71
|
+
max-width: 100%;
|
|
74
72
|
}
|
|
75
|
-
.
|
|
76
|
-
font-size:
|
|
73
|
+
.ep-name {
|
|
74
|
+
font-size: 14px;
|
|
77
75
|
font-weight: 600;
|
|
78
76
|
letter-spacing: -0.02em;
|
|
77
|
+
white-space: nowrap;
|
|
78
|
+
overflow: hidden;
|
|
79
|
+
text-overflow: ellipsis;
|
|
80
|
+
color: var(--obsidian);
|
|
79
81
|
}
|
|
80
|
-
.nav-divider {
|
|
81
|
-
width: 1px;
|
|
82
|
-
height: 16px;
|
|
83
|
-
background: var(--hairline);
|
|
84
|
-
flex: none;
|
|
85
|
-
}
|
|
86
|
-
.workspace { display: none; }
|
|
87
|
-
.brand { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--charcoal); }
|
|
88
82
|
.ver-select {
|
|
89
83
|
height: 24px;
|
|
90
84
|
border: 1px solid var(--hairline);
|
|
@@ -131,10 +125,11 @@
|
|
|
131
125
|
transform: translateX(-50%) translateY(0);
|
|
132
126
|
}
|
|
133
127
|
.search-wrap {
|
|
134
|
-
justify-self: center;
|
|
135
128
|
position: relative;
|
|
136
129
|
width: 100%;
|
|
130
|
+
flex: none;
|
|
137
131
|
z-index: 30;
|
|
132
|
+
margin-bottom: 8px;
|
|
138
133
|
}
|
|
139
134
|
.search {
|
|
140
135
|
width: 100%;
|
|
@@ -143,8 +138,8 @@
|
|
|
143
138
|
border-radius: var(--radius);
|
|
144
139
|
box-shadow: none;
|
|
145
140
|
background: var(--white);
|
|
146
|
-
padding: 0
|
|
147
|
-
font-size:
|
|
141
|
+
padding: 0 28px 0 10px;
|
|
142
|
+
font-size: 12px;
|
|
148
143
|
}
|
|
149
144
|
.search-kbd {
|
|
150
145
|
position: absolute;
|
|
@@ -234,9 +229,9 @@
|
|
|
234
229
|
flex: none;
|
|
235
230
|
width: 180px;
|
|
236
231
|
height: 28px;
|
|
237
|
-
border:
|
|
238
|
-
border-radius: var(--radius
|
|
239
|
-
box-shadow:
|
|
232
|
+
border: 0;
|
|
233
|
+
border-radius: var(--radius);
|
|
234
|
+
box-shadow: var(--ghost);
|
|
240
235
|
background: var(--white);
|
|
241
236
|
padding: 0 32px 0 12px;
|
|
242
237
|
font: 500 12px/1 var(--mono);
|
|
@@ -321,19 +316,18 @@
|
|
|
321
316
|
.ghost-btn:disabled:hover { color: var(--stone); }
|
|
322
317
|
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; align-items: center; }
|
|
323
318
|
.chip-btn {
|
|
324
|
-
border:
|
|
325
|
-
background: var(--
|
|
326
|
-
box-shadow:
|
|
327
|
-
border-radius:
|
|
319
|
+
border: 0;
|
|
320
|
+
background: var(--inset);
|
|
321
|
+
box-shadow: var(--ghost);
|
|
322
|
+
border-radius: 9999px;
|
|
328
323
|
padding: 5px 10px;
|
|
329
324
|
cursor: pointer;
|
|
330
325
|
font-size: 12px;
|
|
331
326
|
color: var(--charcoal);
|
|
332
327
|
}
|
|
333
328
|
.chip-btn.on {
|
|
334
|
-
background: var(--
|
|
335
|
-
color: var(--
|
|
336
|
-
border-color: #fed7aa;
|
|
329
|
+
background: var(--obsidian);
|
|
330
|
+
color: var(--white);
|
|
337
331
|
box-shadow: none;
|
|
338
332
|
}
|
|
339
333
|
.env-base-line {
|
|
@@ -363,9 +357,8 @@
|
|
|
363
357
|
margin-top: 4px;
|
|
364
358
|
}
|
|
365
359
|
.btn.primary {
|
|
366
|
-
background: var(--
|
|
360
|
+
background: var(--obsidian);
|
|
367
361
|
color: var(--white);
|
|
368
|
-
border-color: var(--accent);
|
|
369
362
|
box-shadow: none;
|
|
370
363
|
}
|
|
371
364
|
.btn.primary:hover { opacity: 0.92; color: var(--white); }
|
|
@@ -381,13 +374,26 @@
|
|
|
381
374
|
.app {
|
|
382
375
|
display: grid;
|
|
383
376
|
grid-template-columns: var(--sidebar-w, 320px) 6px minmax(0, 1fr);
|
|
377
|
+
grid-template-rows: minmax(0, 1fr) auto;
|
|
384
378
|
height: calc(100vh - 44px);
|
|
385
379
|
}
|
|
386
380
|
.app.sidebar-collapsed {
|
|
387
381
|
grid-template-columns: 0 28px minmax(0, 1fr);
|
|
388
382
|
}
|
|
389
|
-
.sidebar
|
|
390
|
-
|
|
383
|
+
.sidebar {
|
|
384
|
+
grid-row: 1 / -1;
|
|
385
|
+
}
|
|
386
|
+
.sidebar-resizer {
|
|
387
|
+
grid-row: 1 / -1;
|
|
388
|
+
}
|
|
389
|
+
.workbench {
|
|
390
|
+
grid-column: 3;
|
|
391
|
+
grid-row: 1;
|
|
392
|
+
min-height: 0;
|
|
393
|
+
overflow: auto;
|
|
394
|
+
padding: 14px 18px 16px;
|
|
395
|
+
background: var(--paper);
|
|
396
|
+
}
|
|
391
397
|
.sidebar {
|
|
392
398
|
position: relative;
|
|
393
399
|
min-width: 0;
|
|
@@ -396,8 +402,8 @@
|
|
|
396
402
|
display: flex;
|
|
397
403
|
flex-direction: column;
|
|
398
404
|
background: var(--sidebar);
|
|
399
|
-
border-right:
|
|
400
|
-
font-size:
|
|
405
|
+
border-right: 0;
|
|
406
|
+
font-size: 13px;
|
|
401
407
|
}
|
|
402
408
|
.app.sidebar-collapsed .sidebar {
|
|
403
409
|
overflow: hidden;
|
|
@@ -420,14 +426,13 @@
|
|
|
420
426
|
.tree-scroll { flex: 1; min-height: 0; overflow: auto; }
|
|
421
427
|
.nav-foot {
|
|
422
428
|
flex: none;
|
|
423
|
-
margin-top:
|
|
424
|
-
padding: 8px;
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
429
|
+
margin-top: 8px;
|
|
430
|
+
padding: 8px 2px 0;
|
|
431
|
+
display: flex;
|
|
432
|
+
justify-content: space-between;
|
|
433
|
+
gap: 8px;
|
|
428
434
|
font-size: 11px;
|
|
429
|
-
color: var(--
|
|
430
|
-
line-height: 1.35;
|
|
435
|
+
color: var(--smoke);
|
|
431
436
|
}
|
|
432
437
|
.sidebar-resizer {
|
|
433
438
|
position: relative;
|
|
@@ -550,15 +555,8 @@
|
|
|
550
555
|
gap: 0;
|
|
551
556
|
border-radius: var(--radius);
|
|
552
557
|
}
|
|
553
|
-
.nav-op:hover { background:
|
|
554
|
-
.nav-op.active {
|
|
555
|
-
background: var(--white);
|
|
556
|
-
box-shadow: none;
|
|
557
|
-
outline: 1px solid var(--hairline);
|
|
558
|
-
}
|
|
559
|
-
.nav-op.active .nav-item {
|
|
560
|
-
box-shadow: inset 3px 0 0 var(--accent);
|
|
561
|
-
}
|
|
558
|
+
.nav-op:hover { background: var(--white); }
|
|
559
|
+
.nav-op.active { background: var(--white); box-shadow: 0 0 0 1px var(--hairline); }
|
|
562
560
|
.nav-op-row {
|
|
563
561
|
display: flex;
|
|
564
562
|
align-items: center;
|
|
@@ -596,27 +594,22 @@
|
|
|
596
594
|
.nav-examples {
|
|
597
595
|
display: none;
|
|
598
596
|
flex-direction: column;
|
|
599
|
-
gap:
|
|
600
|
-
margin: 0 6px
|
|
601
|
-
padding:
|
|
602
|
-
border: 1px solid var(--hairline);
|
|
603
|
-
border-radius: var(--radius-sm);
|
|
604
|
-
background: var(--white);
|
|
605
|
-
overflow: hidden;
|
|
597
|
+
gap: 4px;
|
|
598
|
+
margin: 0 4px 6px 18px;
|
|
599
|
+
padding-left: 8px;
|
|
600
|
+
border-left: 1px solid var(--hairline);
|
|
606
601
|
}
|
|
607
602
|
.nav-op.examples-open > .nav-examples { display: flex; }
|
|
608
|
-
.nav-ex-group { display: flex; flex-direction: column; gap:
|
|
609
|
-
.nav-ex-group + .nav-ex-group { border-top: 1px solid var(--hairline); }
|
|
603
|
+
.nav-ex-group { display: flex; flex-direction: column; gap: 1px; }
|
|
610
604
|
.nav-ex-group-label {
|
|
611
605
|
display: flex;
|
|
612
606
|
align-items: center;
|
|
613
607
|
justify-content: space-between;
|
|
614
608
|
gap: 8px;
|
|
615
|
-
padding: 6px 8px
|
|
616
|
-
font:
|
|
609
|
+
padding: 6px 8px 2px;
|
|
610
|
+
font: 600 10px/1.2 var(--sans);
|
|
617
611
|
letter-spacing: 0.02em;
|
|
618
612
|
color: var(--stone);
|
|
619
|
-
background: var(--inset);
|
|
620
613
|
}
|
|
621
614
|
.nav-ex-count {
|
|
622
615
|
font: 600 10px/1.4 var(--mono);
|
|
@@ -626,11 +619,10 @@
|
|
|
626
619
|
display: block;
|
|
627
620
|
width: 100%;
|
|
628
621
|
border: 0;
|
|
629
|
-
border-top: 1px solid var(--hairline);
|
|
630
622
|
background: transparent;
|
|
631
623
|
text-align: left;
|
|
632
|
-
padding:
|
|
633
|
-
border-radius:
|
|
624
|
+
padding: 4px 8px;
|
|
625
|
+
border-radius: 4px;
|
|
634
626
|
cursor: pointer;
|
|
635
627
|
font-size: 11px;
|
|
636
628
|
line-height: 1.35;
|
|
@@ -639,18 +631,16 @@
|
|
|
639
631
|
text-overflow: ellipsis;
|
|
640
632
|
white-space: nowrap;
|
|
641
633
|
}
|
|
642
|
-
.nav-ex-group-label + .nav-example { border-top: 0; }
|
|
643
634
|
.nav-example:hover { background: var(--inset); color: var(--charcoal); }
|
|
644
|
-
.nav-example.on { color: var(--obsidian); background: var(--
|
|
635
|
+
.nav-example.on { color: var(--obsidian); background: var(--inset); }
|
|
645
636
|
.nav-ex-total {
|
|
646
637
|
flex: none;
|
|
647
638
|
min-width: 16px;
|
|
648
639
|
margin-right: 2px;
|
|
649
640
|
padding: 1px 5px;
|
|
650
|
-
border-radius:
|
|
651
|
-
background: var(--
|
|
652
|
-
color: var(--
|
|
653
|
-
border: 1px solid var(--hairline);
|
|
641
|
+
border-radius: 4px;
|
|
642
|
+
background: var(--obsidian);
|
|
643
|
+
color: var(--white);
|
|
654
644
|
font: 600 10px/1.4 var(--mono);
|
|
655
645
|
text-align: center;
|
|
656
646
|
cursor: pointer;
|
|
@@ -793,64 +783,67 @@
|
|
|
793
783
|
min-width: 40px;
|
|
794
784
|
height: 18px;
|
|
795
785
|
padding: 0 5px;
|
|
796
|
-
border-radius:
|
|
786
|
+
border-radius: 4px;
|
|
797
787
|
font: 600 10px/1 var(--mono);
|
|
798
788
|
letter-spacing: 0.04em;
|
|
799
789
|
text-transform: uppercase;
|
|
800
790
|
box-shadow: none;
|
|
801
|
-
|
|
802
|
-
|
|
791
|
+
border: 0;
|
|
792
|
+
background: #e4e4e7;
|
|
793
|
+
color: #27272a;
|
|
794
|
+
}
|
|
795
|
+
.method.get { background: #f4f4f5; color: #52525b; }
|
|
796
|
+
.method.patch { background: #d4d4d8; color: #18181b; }
|
|
797
|
+
.method.put { background: #a1a1aa; color: #fafafa; }
|
|
798
|
+
.method.post { background: #3f3f46; color: #fafafa; }
|
|
799
|
+
.method.delete { background: #111111; color: #ffffff; }
|
|
800
|
+
.schema-block {
|
|
801
|
+
padding: 10px 12px 12px;
|
|
802
|
+
border-top: 1px solid var(--hairline);
|
|
803
803
|
}
|
|
804
|
-
.
|
|
805
|
-
.method.delete { background: var(--white); color: var(--charcoal); border: 1px solid var(--hairline); }
|
|
804
|
+
.schema-block .meta-label { margin-bottom: 8px; display: block; }
|
|
806
805
|
|
|
807
|
-
.
|
|
808
|
-
.
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
.meta-line {
|
|
817
|
-
display: flex;
|
|
818
|
-
align-items: center;
|
|
819
|
-
gap: 8px;
|
|
820
|
-
color: var(--stone);
|
|
821
|
-
font: 12px/1.4 var(--mono);
|
|
822
|
-
margin: 8px 0 0;
|
|
823
|
-
}
|
|
824
|
-
.open-editor {
|
|
825
|
-
height: 28px;
|
|
826
|
-
font-size: 12px;
|
|
806
|
+
.ex-block { margin: 0; position: relative; }
|
|
807
|
+
.ex-dock {
|
|
808
|
+
grid-column: 3;
|
|
809
|
+
grid-row: 2;
|
|
810
|
+
position: relative;
|
|
811
|
+
z-index: 100;
|
|
812
|
+
padding: 8px 16px 10px;
|
|
813
|
+
background: var(--white);
|
|
814
|
+
border-top: 1px solid var(--hairline);
|
|
827
815
|
}
|
|
828
|
-
|
|
829
|
-
.ex-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
text-transform: uppercase;
|
|
834
|
-
color: var(--stone);
|
|
835
|
-
margin-bottom: 6px;
|
|
816
|
+
.ex-dock:empty { display: none; }
|
|
817
|
+
.ex-dock .dd-menu {
|
|
818
|
+
top: auto;
|
|
819
|
+
bottom: calc(100% + 4px);
|
|
820
|
+
max-height: min(380px, 45vh);
|
|
836
821
|
}
|
|
837
822
|
.dd { position: relative; width: 100%; }
|
|
838
823
|
.dd-toggle {
|
|
839
824
|
width: 100%;
|
|
840
|
-
|
|
825
|
+
height: 28px;
|
|
826
|
+
min-height: 28px;
|
|
841
827
|
border: 1px solid var(--hairline);
|
|
842
828
|
border-radius: var(--radius);
|
|
843
829
|
box-shadow: none;
|
|
844
830
|
background: var(--white);
|
|
845
|
-
padding:
|
|
831
|
+
padding: 0 28px 0 8px;
|
|
846
832
|
text-align: left;
|
|
847
833
|
cursor: pointer;
|
|
848
|
-
font-size:
|
|
849
|
-
line-height: 1
|
|
834
|
+
font-size: 12px;
|
|
835
|
+
line-height: 1;
|
|
850
836
|
position: relative;
|
|
851
837
|
display: flex;
|
|
852
838
|
align-items: center;
|
|
853
|
-
gap:
|
|
839
|
+
gap: 8px;
|
|
840
|
+
}
|
|
841
|
+
.dd-kicker {
|
|
842
|
+
font: 600 10px/1 var(--mono);
|
|
843
|
+
letter-spacing: 0.06em;
|
|
844
|
+
text-transform: uppercase;
|
|
845
|
+
color: var(--stone);
|
|
846
|
+
flex: none;
|
|
854
847
|
}
|
|
855
848
|
.dd-status {
|
|
856
849
|
font: 600 11px/1 var(--mono);
|
|
@@ -872,10 +865,10 @@
|
|
|
872
865
|
.dd-toggle::after {
|
|
873
866
|
content: "";
|
|
874
867
|
position: absolute;
|
|
875
|
-
right:
|
|
868
|
+
right: 10px;
|
|
876
869
|
top: 50%;
|
|
877
|
-
width:
|
|
878
|
-
height:
|
|
870
|
+
width: 5px;
|
|
871
|
+
height: 5px;
|
|
879
872
|
border-right: 1px solid var(--obsidian);
|
|
880
873
|
border-bottom: 1px solid var(--obsidian);
|
|
881
874
|
transform: translateY(-70%) rotate(45deg);
|
|
@@ -912,13 +905,12 @@
|
|
|
912
905
|
align-items: center;
|
|
913
906
|
justify-content: space-between;
|
|
914
907
|
gap: 8px;
|
|
915
|
-
font-family: var(--
|
|
908
|
+
font-family: var(--mono);
|
|
916
909
|
font-size: 10px;
|
|
917
|
-
letter-spacing: 0.
|
|
918
|
-
text-transform:
|
|
910
|
+
letter-spacing: 0.08em;
|
|
911
|
+
text-transform: uppercase;
|
|
919
912
|
color: var(--stone);
|
|
920
|
-
padding:
|
|
921
|
-
background: var(--inset);
|
|
913
|
+
padding: 10px 12px 4px;
|
|
922
914
|
}
|
|
923
915
|
.dd-group.ok { color: var(--ok); }
|
|
924
916
|
.dd-group.err { color: var(--err); }
|
|
@@ -934,15 +926,13 @@
|
|
|
934
926
|
gap: 10px;
|
|
935
927
|
width: 100%;
|
|
936
928
|
border: 0;
|
|
937
|
-
border-top: 1px solid var(--hairline);
|
|
938
929
|
background: transparent;
|
|
939
930
|
text-align: left;
|
|
940
|
-
padding:
|
|
941
|
-
font-size:
|
|
931
|
+
padding: 6px 12px;
|
|
932
|
+
font-size: 13px;
|
|
942
933
|
cursor: pointer;
|
|
943
934
|
}
|
|
944
|
-
.dd-item:hover { background: var(--inset); }
|
|
945
|
-
.dd-item.on { background: var(--accent-soft); }
|
|
935
|
+
.dd-item:hover, .dd-item.on { background: var(--inset); }
|
|
946
936
|
.dd-item .st {
|
|
947
937
|
font: 600 11px/1 var(--mono);
|
|
948
938
|
width: 28px;
|
|
@@ -990,6 +980,7 @@
|
|
|
990
980
|
color: var(--charcoal);
|
|
991
981
|
white-space: nowrap;
|
|
992
982
|
font-size: 12px;
|
|
983
|
+
text-decoration: none;
|
|
993
984
|
}
|
|
994
985
|
.btn:hover { color: var(--obsidian); }
|
|
995
986
|
.btn.sm { height: 32px; padding: 0 10px; font-size: 12px; }
|
|
@@ -1030,8 +1021,8 @@
|
|
|
1030
1021
|
.pair {
|
|
1031
1022
|
display: grid;
|
|
1032
1023
|
grid-template-columns: 1fr 1fr;
|
|
1033
|
-
gap:
|
|
1034
|
-
margin-bottom:
|
|
1024
|
+
gap: 12px;
|
|
1025
|
+
margin-bottom: 20px;
|
|
1035
1026
|
align-items: start;
|
|
1036
1027
|
}
|
|
1037
1028
|
.card {
|
|
@@ -1043,7 +1034,6 @@
|
|
|
1043
1034
|
display: flex;
|
|
1044
1035
|
flex-direction: column;
|
|
1045
1036
|
max-width: 100%;
|
|
1046
|
-
overflow: hidden;
|
|
1047
1037
|
}
|
|
1048
1038
|
.card.response-card {
|
|
1049
1039
|
overflow: hidden;
|
|
@@ -1059,34 +1049,28 @@
|
|
|
1059
1049
|
}
|
|
1060
1050
|
.card-head h2 {
|
|
1061
1051
|
margin: 0;
|
|
1062
|
-
font-size:
|
|
1052
|
+
font-size: 11px;
|
|
1063
1053
|
font-weight: 600;
|
|
1064
|
-
letter-spacing:
|
|
1065
|
-
text-transform:
|
|
1054
|
+
letter-spacing: 0.08em;
|
|
1055
|
+
text-transform: uppercase;
|
|
1066
1056
|
}
|
|
1067
1057
|
.card-head-actions { display: flex; align-items: center; gap: 8px; }
|
|
1068
1058
|
.mode-toggle {
|
|
1069
1059
|
display: flex;
|
|
1070
|
-
|
|
1071
|
-
border:
|
|
1072
|
-
|
|
1060
|
+
border: 1px solid var(--hairline);
|
|
1061
|
+
border-radius: 4px;
|
|
1062
|
+
overflow: hidden;
|
|
1073
1063
|
}
|
|
1074
1064
|
.mode-toggle button {
|
|
1075
1065
|
height: 24px;
|
|
1076
1066
|
padding: 0 8px;
|
|
1077
1067
|
border: 0;
|
|
1078
|
-
|
|
1079
|
-
background: transparent;
|
|
1068
|
+
background: var(--white);
|
|
1080
1069
|
font-size: 11px;
|
|
1081
1070
|
cursor: pointer;
|
|
1082
1071
|
color: var(--stone);
|
|
1083
|
-
border-radius: 0;
|
|
1084
|
-
}
|
|
1085
|
-
.mode-toggle button.on {
|
|
1086
|
-
background: transparent;
|
|
1087
|
-
color: var(--obsidian);
|
|
1088
|
-
border-bottom-color: var(--accent);
|
|
1089
1072
|
}
|
|
1073
|
+
.mode-toggle button.on { background: var(--obsidian); color: var(--white); }
|
|
1090
1074
|
.card-body {
|
|
1091
1075
|
padding: 0;
|
|
1092
1076
|
display: flex;
|
|
@@ -1154,22 +1138,21 @@
|
|
|
1154
1138
|
}
|
|
1155
1139
|
pre {
|
|
1156
1140
|
margin: 0;
|
|
1157
|
-
padding: 12px
|
|
1158
|
-
background:
|
|
1159
|
-
color: #f4f4f5;
|
|
1141
|
+
padding: 10px 12px;
|
|
1142
|
+
background: #fcfcfc;
|
|
1160
1143
|
border-radius: 0;
|
|
1161
1144
|
overflow: auto;
|
|
1162
|
-
font: 12px/1.
|
|
1145
|
+
font: 12px/1.5 var(--mono);
|
|
1163
1146
|
}
|
|
1164
|
-
.k { color: #
|
|
1165
|
-
.s { color:
|
|
1166
|
-
.n { color: #
|
|
1167
|
-
.p { color: #
|
|
1147
|
+
.k { color: #111111; }
|
|
1148
|
+
.s { color: var(--accent); }
|
|
1149
|
+
.n { color: #111111; }
|
|
1150
|
+
.p { color: #666666; }
|
|
1168
1151
|
.empty { color: var(--stone); font-size: 13px; padding: 14px 16px; }
|
|
1169
1152
|
.code {
|
|
1170
1153
|
font: 600 11px/1 var(--mono);
|
|
1171
1154
|
padding: 3px 6px;
|
|
1172
|
-
border-radius:
|
|
1155
|
+
border-radius: 4px;
|
|
1173
1156
|
background: var(--inset);
|
|
1174
1157
|
}
|
|
1175
1158
|
.code.ok { background: var(--ok-bg); color: var(--ok); }
|
|
@@ -1180,34 +1163,26 @@
|
|
|
1180
1163
|
.schemas {
|
|
1181
1164
|
display: grid;
|
|
1182
1165
|
grid-template-columns: 1fr 1fr;
|
|
1183
|
-
gap:
|
|
1184
|
-
padding-top:
|
|
1185
|
-
border-top:
|
|
1186
|
-
}
|
|
1187
|
-
.schemas > section {
|
|
1188
|
-
background: var(--white);
|
|
1189
|
-
border: 1px solid var(--hairline);
|
|
1190
|
-
border-radius: var(--radius);
|
|
1191
|
-
padding: 12px 14px;
|
|
1166
|
+
gap: 24px;
|
|
1167
|
+
padding-top: 8px;
|
|
1168
|
+
border-top: 1px solid var(--hairline);
|
|
1192
1169
|
}
|
|
1193
1170
|
.schemas h2 {
|
|
1194
|
-
font-size:
|
|
1171
|
+
font-size: 11px;
|
|
1195
1172
|
font-weight: 600;
|
|
1196
|
-
letter-spacing:
|
|
1197
|
-
text-transform:
|
|
1173
|
+
letter-spacing: 0.08em;
|
|
1174
|
+
text-transform: uppercase;
|
|
1198
1175
|
margin: 0 0 8px;
|
|
1199
|
-
color: var(--
|
|
1176
|
+
color: var(--stone);
|
|
1200
1177
|
}
|
|
1201
1178
|
.row {
|
|
1202
1179
|
display: grid;
|
|
1203
1180
|
grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.9fr) auto;
|
|
1204
1181
|
gap: 8px;
|
|
1205
1182
|
align-items: baseline;
|
|
1206
|
-
padding:
|
|
1183
|
+
padding: 5px 0;
|
|
1207
1184
|
font-size: 12px;
|
|
1208
|
-
border-top: 1px solid var(--hairline);
|
|
1209
1185
|
}
|
|
1210
|
-
.row:first-of-type { border-top: 0; padding-top: 0; }
|
|
1211
1186
|
.row .name {
|
|
1212
1187
|
font-family: var(--mono);
|
|
1213
1188
|
font-size: 12px;
|
|
@@ -1244,12 +1219,16 @@
|
|
|
1244
1219
|
@media (max-width: 960px) {
|
|
1245
1220
|
.app {
|
|
1246
1221
|
grid-template-columns: 1fr;
|
|
1222
|
+
grid-template-rows: auto 1fr auto;
|
|
1247
1223
|
height: auto;
|
|
1224
|
+
min-height: calc(100vh - 44px);
|
|
1248
1225
|
}
|
|
1249
1226
|
.app.sidebar-collapsed {
|
|
1250
1227
|
grid-template-columns: 1fr;
|
|
1251
1228
|
}
|
|
1229
|
+
.sidebar, .workbench, .ex-dock { grid-column: 1; grid-row: auto; }
|
|
1252
1230
|
.sidebar { max-height: 40vh; opacity: 1 !important; pointer-events: auto !important; padding: 16px 12px 24px !important; }
|
|
1231
|
+
.ex-dock { position: sticky; bottom: 0; }
|
|
1253
1232
|
.sidebar-resizer { display: none; }
|
|
1254
1233
|
.pair, .schemas { grid-template-columns: 1fr; }
|
|
1255
1234
|
.search-wrap { width: min(280px, 70vw); }
|
|
@@ -1262,10 +1241,8 @@
|
|
|
1262
1241
|
<div class="brand" id="brand">API</div>
|
|
1263
1242
|
<select class="ver-select" id="ver-select" aria-label="API version"></select>
|
|
1264
1243
|
</div>
|
|
1265
|
-
<div class="
|
|
1266
|
-
<
|
|
1267
|
-
<span class="search-kbd">⌘K</span>
|
|
1268
|
-
<div class="search-panel" id="search-panel" role="listbox"></div>
|
|
1244
|
+
<div class="ep-nav" id="ep-nav">
|
|
1245
|
+
<span class="ep-name" id="ep-name"></span>
|
|
1269
1246
|
</div>
|
|
1270
1247
|
<div class="nav-tools">
|
|
1271
1248
|
<button class="btn icon" id="export-openapi" type="button" data-tip="Export" aria-label="Export">
|
|
@@ -1304,9 +1281,18 @@
|
|
|
1304
1281
|
</div>
|
|
1305
1282
|
</div>
|
|
1306
1283
|
<div class="app" id="app">
|
|
1307
|
-
<aside class="sidebar"
|
|
1284
|
+
<aside class="sidebar">
|
|
1285
|
+
<div class="search-wrap" id="search-wrap">
|
|
1286
|
+
<input class="search" id="search" placeholder="Search endpoints..." autocomplete="off" spellcheck="false" />
|
|
1287
|
+
<span class="search-kbd">/</span>
|
|
1288
|
+
<div class="search-panel" id="search-panel" role="listbox"></div>
|
|
1289
|
+
</div>
|
|
1290
|
+
<div class="tree-scroll" id="nav"></div>
|
|
1291
|
+
<div class="nav-foot"><span>Generated by DAxTA</span><span id="nav-version"></span></div>
|
|
1292
|
+
</aside>
|
|
1308
1293
|
<button type="button" class="sidebar-resizer" id="sidebar-resizer" aria-label="Resize sidebar" title="Drag to resize · double-click to collapse"></button>
|
|
1309
1294
|
<main class="workbench" id="main"></main>
|
|
1295
|
+
<div class="ex-dock" id="ex-dock"></div>
|
|
1310
1296
|
</div>
|
|
1311
1297
|
<script>
|
|
1312
1298
|
window.__SPEC__ = {
|
|
@@ -1319,7 +1305,7 @@
|
|
|
1319
1305
|
"x-viewer": {
|
|
1320
1306
|
"workspace": "token-x",
|
|
1321
1307
|
"baseUrl": "http://localhost:3000",
|
|
1322
|
-
"docsPath": "/docs",
|
|
1308
|
+
"docsPath": "/api-docs",
|
|
1323
1309
|
"envPresets": {
|
|
1324
1310
|
"local": { "baseUrl": "http://localhost:3000" }
|
|
1325
1311
|
}
|
|
@@ -1518,7 +1504,7 @@
|
|
|
1518
1504
|
const viewer = spec["x-viewer"] || {};
|
|
1519
1505
|
const workspace = (spec.info && spec.info["x-workspace"]) || viewer.workspace || "";
|
|
1520
1506
|
const defaultBaseUrlFromSpec = String((viewer.baseUrl || (spec.servers && spec.servers[0] && spec.servers[0].url) || "http://localhost:3000")).replace(/\/$/, "");
|
|
1521
|
-
const docsPathSuffix = String(viewer.docsPath || "/docs").replace(/\/$/, "") || "/docs";
|
|
1507
|
+
const docsPathSuffix = String(viewer.docsPath || "/api-docs").replace(/\/$/, "") || "/api-docs";
|
|
1522
1508
|
|
|
1523
1509
|
const inferBaseUrlFromLocation = () => {
|
|
1524
1510
|
if (typeof location === "undefined") return null;
|
|
@@ -1538,9 +1524,9 @@
|
|
|
1538
1524
|
};
|
|
1539
1525
|
|
|
1540
1526
|
const locationBaseUrl = inferBaseUrlFromLocation();
|
|
1541
|
-
// Prefer the URL that is serving the viewer (strip
|
|
1527
|
+
// Prefer the URL that is serving the viewer (strip the docs path), else fall back to spec.
|
|
1542
1528
|
const defaultBaseUrl = locationBaseUrl || defaultBaseUrlFromSpec;
|
|
1543
|
-
const title = (spec.info && spec.info.title) || "API
|
|
1529
|
+
const title = (spec.info && spec.info.title) || "API Documentation";
|
|
1544
1530
|
const STORE_KEY = "openapi-docs-env:" + (workspace || "default");
|
|
1545
1531
|
const SIDEBAR_STORE_KEY = "openapi-docs-sidebar:" + (workspace || "default");
|
|
1546
1532
|
const SIDEBAR_MIN = 200;
|
|
@@ -2272,8 +2258,12 @@
|
|
|
2272
2258
|
};
|
|
2273
2259
|
};
|
|
2274
2260
|
|
|
2275
|
-
document.title =
|
|
2276
|
-
document.getElementById("brand")
|
|
2261
|
+
document.title = title || "API Documentation";
|
|
2262
|
+
const brandEl = document.getElementById("brand");
|
|
2263
|
+
if (brandEl) brandEl.textContent = title;
|
|
2264
|
+
const specVersion = (spec.info && spec.info.version) || "";
|
|
2265
|
+
const navVersion = document.getElementById("nav-version");
|
|
2266
|
+
if (navVersion) navVersion.textContent = specVersion ? (specVersion.startsWith("v") ? specVersion : "v" + specVersion) : "";
|
|
2277
2267
|
|
|
2278
2268
|
const envWrap = document.getElementById("env-wrap");
|
|
2279
2269
|
document.getElementById("env-trigger").addEventListener("click", (event) => {
|
|
@@ -2522,7 +2512,7 @@
|
|
|
2522
2512
|
}
|
|
2523
2513
|
return {
|
|
2524
2514
|
id: typeof crypto !== "undefined" && crypto.randomUUID ? crypto.randomUUID() : String(Date.now()),
|
|
2525
|
-
name: (workspace || title || "
|
|
2515
|
+
name: (workspace || title || "API") + " · " + store.activeEnv,
|
|
2526
2516
|
values,
|
|
2527
2517
|
_postman_variable_scope: "environment",
|
|
2528
2518
|
_postman_exported_at: new Date().toISOString(),
|
|
@@ -2695,8 +2685,8 @@
|
|
|
2695
2685
|
return {
|
|
2696
2686
|
info: {
|
|
2697
2687
|
_postman_id: typeof crypto !== "undefined" && crypto.randomUUID ? crypto.randomUUID() : String(Date.now()),
|
|
2698
|
-
name: (openapi.info && openapi.info.title) || workspace || title || "
|
|
2699
|
-
description: (openapi.info && openapi.info.description) || "Exported from
|
|
2688
|
+
name: (openapi.info && openapi.info.title) || workspace || title || "API",
|
|
2689
|
+
description: (openapi.info && openapi.info.description) || "Exported from API docs with named examples",
|
|
2700
2690
|
schema: "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
|
|
2701
2691
|
},
|
|
2702
2692
|
item,
|
|
@@ -3012,6 +3002,7 @@
|
|
|
3012
3002
|
const ok = current ? statusOk(current.status) : false;
|
|
3013
3003
|
return `<div class="dd ${exampleOpen ? "open" : ""}" id="scenario-dd">
|
|
3014
3004
|
<button type="button" class="dd-toggle" id="scenario-toggle">
|
|
3005
|
+
<span class="dd-kicker">Example</span>
|
|
3015
3006
|
<span class="dd-status ${ok ? "ok" : "err"}">${escapeHtml(String(current?.status ?? ""))}</span>
|
|
3016
3007
|
<span class="dd-kind">${escapeHtml(kind)}</span>
|
|
3017
3008
|
<span class="dd-toggle-label">${escapeHtml(current?.name || "Example")}</span>
|
|
@@ -3171,6 +3162,7 @@
|
|
|
3171
3162
|
|
|
3172
3163
|
const renderNav = () => {
|
|
3173
3164
|
const nav = document.getElementById("nav");
|
|
3165
|
+
const q = navQuery.trim().toLowerCase();
|
|
3174
3166
|
if (!ops.length) {
|
|
3175
3167
|
nav.innerHTML = `<div class="tree-empty">No endpoints recorded</div>`;
|
|
3176
3168
|
return;
|
|
@@ -3179,22 +3171,7 @@
|
|
|
3179
3171
|
const active = ops.find((item) => item.id === currentId);
|
|
3180
3172
|
if (active) expandPathToItem(active);
|
|
3181
3173
|
}
|
|
3182
|
-
|
|
3183
|
-
nav.innerHTML = `
|
|
3184
|
-
<input class="nav-filter" id="nav-filter" placeholder="Search endpoints..." value="${escapeAttr(navQuery)}" autocomplete="off" spellcheck="false" />
|
|
3185
|
-
<div class="tree-scroll"><div class="tree-root">${renderTreeNode(buildPathTree(visibleOps()), "", q)}</div></div>
|
|
3186
|
-
<div class="nav-foot">Generated by Notary</div>
|
|
3187
|
-
`;
|
|
3188
|
-
const filter = document.getElementById("nav-filter");
|
|
3189
|
-
if (filter) {
|
|
3190
|
-
filter.oninput = (event) => {
|
|
3191
|
-
navQuery = event.target.value;
|
|
3192
|
-
renderNav();
|
|
3193
|
-
document.getElementById("nav-filter")?.focus();
|
|
3194
|
-
const el = document.getElementById("nav-filter");
|
|
3195
|
-
if (el) el.selectionStart = el.selectionEnd = el.value.length;
|
|
3196
|
-
};
|
|
3197
|
-
}
|
|
3174
|
+
nav.innerHTML = `<div class="tree-root">${renderTreeNode(buildPathTree(visibleOps()), "", q)}</div>`;
|
|
3198
3175
|
nav.querySelectorAll(".nav-item").forEach((button) => {
|
|
3199
3176
|
button.onclick = () => select(button.dataset.id);
|
|
3200
3177
|
});
|
|
@@ -3279,7 +3256,11 @@
|
|
|
3279
3256
|
wrap.classList.remove("open");
|
|
3280
3257
|
document.body.classList.remove("searching");
|
|
3281
3258
|
searchActiveIndex = 0;
|
|
3282
|
-
if (clear)
|
|
3259
|
+
if (clear) {
|
|
3260
|
+
input.value = "";
|
|
3261
|
+
navQuery = "";
|
|
3262
|
+
renderNav();
|
|
3263
|
+
}
|
|
3283
3264
|
};
|
|
3284
3265
|
|
|
3285
3266
|
const openSearch = () => {
|
|
@@ -3289,6 +3270,8 @@
|
|
|
3289
3270
|
|
|
3290
3271
|
const renderSearchPanel = (query = "") => {
|
|
3291
3272
|
const q = query.trim().toLowerCase();
|
|
3273
|
+
navQuery = query;
|
|
3274
|
+
renderNav();
|
|
3292
3275
|
const panel = document.getElementById("search-panel");
|
|
3293
3276
|
if (!q) {
|
|
3294
3277
|
closeSearch();
|
|
@@ -3385,25 +3368,23 @@
|
|
|
3385
3368
|
.join("");
|
|
3386
3369
|
};
|
|
3387
3370
|
|
|
3388
|
-
const
|
|
3371
|
+
const schemasInline = (fields, resBody) => {
|
|
3389
3372
|
const requestFields = fields.filter((field) => field.in === "body" || field.in === "path" || field.in === "query" || field.in === "header");
|
|
3390
3373
|
const responseFields = schemaFromValue(resBody);
|
|
3391
|
-
return
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
</section>
|
|
3396
|
-
<section>
|
|
3397
|
-
<h2>Response schema</h2>
|
|
3398
|
-
${schemaRows(responseFields)}
|
|
3399
|
-
</section>
|
|
3400
|
-
</div>`;
|
|
3374
|
+
return {
|
|
3375
|
+
request: `<div class="schema-block"><span class="meta-label">Request schema</span>${schemaRows(requestFields, { showLoc: true })}</div>`,
|
|
3376
|
+
response: `<div class="schema-block"><span class="meta-label">Response schema</span>${schemaRows(responseFields)}</div>`,
|
|
3377
|
+
};
|
|
3401
3378
|
};
|
|
3402
3379
|
|
|
3403
3380
|
const renderMain = () => {
|
|
3404
3381
|
const item = ops.find((entry) => entry.id === currentId);
|
|
3405
3382
|
if (!item) {
|
|
3406
3383
|
document.getElementById("main").innerHTML = `<div class="empty">No operations in this workspace yet.</div>`;
|
|
3384
|
+
const dock = document.getElementById("ex-dock");
|
|
3385
|
+
if (dock) dock.innerHTML = "";
|
|
3386
|
+
const epName = document.getElementById("ep-name");
|
|
3387
|
+
if (epName) epName.textContent = "";
|
|
3407
3388
|
return;
|
|
3408
3389
|
}
|
|
3409
3390
|
if (scenarioIndex >= item.scenarios.length) scenarioIndex = 0;
|
|
@@ -3447,14 +3428,12 @@
|
|
|
3447
3428
|
? `<div class="empty">Empty body</div>`
|
|
3448
3429
|
: jsonBlock(displayBody, resPretty);
|
|
3449
3430
|
|
|
3431
|
+
const schemas = schemasInline(fields, displayEmpty ? undefined : displayBody);
|
|
3432
|
+
const epName = document.getElementById("ep-name");
|
|
3433
|
+
if (epName) epName.textContent = item.title;
|
|
3434
|
+
document.title = item.title + (title ? " · " + title : "");
|
|
3435
|
+
|
|
3450
3436
|
document.getElementById("main").innerHTML = `
|
|
3451
|
-
<div class="ep-head">
|
|
3452
|
-
<div class="ep-head-top">
|
|
3453
|
-
<h1 class="title">${item.title}</h1>
|
|
3454
|
-
</div>
|
|
3455
|
-
<p class="meta-line"><span class="method ${item.method}">${item.method}</span><span>${item.path}</span></p>
|
|
3456
|
-
</div>
|
|
3457
|
-
${item.scenarios.length ? `<div class="ex-block"><div class="ex-kicker">Example</div>${groupedDropdown(item.scenarios, scenarioIndex)}</div>` : ""}
|
|
3458
3437
|
<div class="urlbar">
|
|
3459
3438
|
<div class="url"><span class="method ${item.method}">${item.method}</span><span>${resolvedUrl(item, scenario)}</span></div>
|
|
3460
3439
|
<button class="btn" id="copy-curl" type="button">Copy cURL</button>
|
|
@@ -3477,6 +3456,7 @@
|
|
|
3477
3456
|
${metaBlock("Path", pathParamsHtml)}
|
|
3478
3457
|
${metaBlock("Query", queryHtml)}
|
|
3479
3458
|
${metaBlock("Body", bodyHtml, "", { always: true })}
|
|
3459
|
+
${schemas.request}
|
|
3480
3460
|
</div>
|
|
3481
3461
|
</section>
|
|
3482
3462
|
<section class="card response-card" id="response-card">
|
|
@@ -3495,13 +3475,17 @@
|
|
|
3495
3475
|
<button class="btn sm icon" id="copy-res" type="button" title="Copy body" aria-label="Copy body" ${resCopyText ? "" : "disabled"}>${copyIcon}</button>
|
|
3496
3476
|
</div>
|
|
3497
3477
|
</div>
|
|
3498
|
-
<div class="card-body"
|
|
3478
|
+
<div class="card-body">
|
|
3479
|
+
<div id="response-body">${resHtml}</div>
|
|
3480
|
+
${schemas.response}
|
|
3481
|
+
</div>
|
|
3499
3482
|
</section>
|
|
3500
3483
|
</div>
|
|
3501
|
-
${schemasPanel(fields, displayEmpty ? undefined : displayBody)}
|
|
3502
|
-
<div class="work-foot">Generated by Notary</div>
|
|
3503
3484
|
`;
|
|
3504
3485
|
|
|
3486
|
+
const dock = document.getElementById("ex-dock");
|
|
3487
|
+
if (dock) dock.innerHTML = item.scenarios.length ? groupedDropdown(item.scenarios, scenarioIndex) : "";
|
|
3488
|
+
|
|
3505
3489
|
const scenarioToggle = document.getElementById("scenario-toggle");
|
|
3506
3490
|
if (scenarioToggle) {
|
|
3507
3491
|
const root = document.getElementById("scenario-dd");
|
|
@@ -3598,7 +3582,7 @@
|
|
|
3598
3582
|
body: undefined,
|
|
3599
3583
|
error:
|
|
3600
3584
|
message +
|
|
3601
|
-
"\n\nTip: open docs at the same app port: http://localhost:3000
|
|
3585
|
+
"\n\nTip: open API docs at the same app port: http://localhost:3000" + docsPathSuffix,
|
|
3602
3586
|
};
|
|
3603
3587
|
}
|
|
3604
3588
|
renderMain();
|
|
@@ -3671,6 +3655,13 @@
|
|
|
3671
3655
|
if ((event.metaKey || event.ctrlKey) && event.key.toLowerCase() === "k") {
|
|
3672
3656
|
event.preventDefault();
|
|
3673
3657
|
document.getElementById("search")?.focus();
|
|
3658
|
+
return;
|
|
3659
|
+
}
|
|
3660
|
+
if (event.key === "/" && !event.metaKey && !event.ctrlKey && !event.altKey) {
|
|
3661
|
+
const tag = (event.target && event.target.tagName) || "";
|
|
3662
|
+
if (tag === "INPUT" || tag === "TEXTAREA" || tag === "SELECT" || event.target?.isContentEditable) return;
|
|
3663
|
+
event.preventDefault();
|
|
3664
|
+
document.getElementById("search")?.focus();
|
|
3674
3665
|
}
|
|
3675
3666
|
});
|
|
3676
3667
|
|