@t0.labs/daxta 0.4.21 → 0.4.23
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/assets/empty.html +176 -0
- package/assets/viewer.html +594 -269
- package/dist/build/build-spec.js +37 -1
- package/dist/serve/index.js +4 -1
- package/dist/serve/middleware.js +3 -2
- package/dist/serve/paths.d.ts +2 -0
- package/dist/serve/paths.js +17 -0
- package/package.json +1 -1
package/assets/viewer.html
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="utf-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
-
<title>
|
|
6
|
+
<title>Notary</title>
|
|
7
7
|
<link rel="icon" type="image/png" href="__FAVICON_DATA_URI__" />
|
|
8
8
|
<link rel="apple-touch-icon" href="__FAVICON_DATA_URI__" />
|
|
9
9
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
@@ -11,23 +11,28 @@
|
|
|
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: #
|
|
16
|
-
--nav: #
|
|
17
|
-
--paper: #
|
|
14
|
+
--canvas: #fafafa;
|
|
15
|
+
--sidebar: #fafafa;
|
|
16
|
+
--nav: #ffffff;
|
|
17
|
+
--paper: #fafafa;
|
|
18
18
|
--white: #ffffff;
|
|
19
|
-
--inset: #
|
|
20
|
-
--hairline: #
|
|
21
|
-
--line: #
|
|
22
|
-
--smoke: #
|
|
23
|
-
--stone: #
|
|
19
|
+
--inset: #f5f5f5;
|
|
20
|
+
--hairline: #e6e6e6;
|
|
21
|
+
--line: #e6e6e6;
|
|
22
|
+
--smoke: #888888;
|
|
23
|
+
--stone: #666666;
|
|
24
24
|
--charcoal: #333333;
|
|
25
|
-
--obsidian: #
|
|
25
|
+
--obsidian: #111111;
|
|
26
|
+
--accent: #2563eb;
|
|
27
|
+
--ok: #16794c;
|
|
28
|
+
--ok-bg: #e8f6ee;
|
|
29
|
+
--err: #b42318;
|
|
30
|
+
--err-bg: #fbeaea;
|
|
26
31
|
--sans: Geist, Inter, ui-sans-serif, system-ui, sans-serif;
|
|
27
32
|
--mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
28
|
-
--radius:
|
|
29
|
-
--ring: 0 0 0 1px #
|
|
30
|
-
--ghost: 0 0 0 1px #
|
|
33
|
+
--radius: 5px;
|
|
34
|
+
--ring: 0 0 0 1px #e6e6e6;
|
|
35
|
+
--ghost: 0 0 0 1px #e6e6e6;
|
|
31
36
|
}
|
|
32
37
|
* { box-sizing: border-box; }
|
|
33
38
|
html, body { height: 100%; }
|
|
@@ -35,17 +40,17 @@
|
|
|
35
40
|
margin: 0;
|
|
36
41
|
background: var(--canvas);
|
|
37
42
|
color: var(--obsidian);
|
|
38
|
-
font:
|
|
43
|
+
font: 13px/1.45 var(--sans);
|
|
39
44
|
}
|
|
40
45
|
button, input { font: inherit; color: inherit; }
|
|
41
46
|
|
|
42
47
|
.topnav {
|
|
43
|
-
height:
|
|
48
|
+
height: 44px;
|
|
44
49
|
display: grid;
|
|
45
|
-
grid-template-columns: 1fr
|
|
50
|
+
grid-template-columns: 1fr minmax(240px, 420px) 1fr;
|
|
46
51
|
align-items: center;
|
|
47
52
|
gap: 16px;
|
|
48
|
-
padding: 0
|
|
53
|
+
padding: 0 16px;
|
|
49
54
|
background: var(--nav);
|
|
50
55
|
border-bottom: 1px solid var(--hairline);
|
|
51
56
|
position: sticky;
|
|
@@ -54,26 +59,48 @@
|
|
|
54
59
|
}
|
|
55
60
|
body.searching .topnav { z-index: 30; }
|
|
56
61
|
.brand-wrap { display: flex; align-items: center; gap: 10px; min-width: 0; justify-self: start; }
|
|
57
|
-
.
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
text-transform: uppercase;
|
|
62
|
-
padding: 5px 8px;
|
|
63
|
-
border-radius: 9999px;
|
|
62
|
+
.logo-mark {
|
|
63
|
+
width: 20px;
|
|
64
|
+
height: 20px;
|
|
65
|
+
border-radius: 4px;
|
|
64
66
|
background: var(--obsidian);
|
|
65
67
|
color: var(--white);
|
|
68
|
+
font: 600 11px/20px var(--sans);
|
|
69
|
+
text-align: center;
|
|
70
|
+
flex: none;
|
|
71
|
+
}
|
|
72
|
+
.logo-name {
|
|
73
|
+
font-size: 13px;
|
|
74
|
+
font-weight: 600;
|
|
75
|
+
letter-spacing: -0.02em;
|
|
76
|
+
}
|
|
77
|
+
.nav-divider {
|
|
78
|
+
width: 1px;
|
|
79
|
+
height: 16px;
|
|
80
|
+
background: var(--hairline);
|
|
81
|
+
flex: none;
|
|
82
|
+
}
|
|
83
|
+
.workspace { display: none; }
|
|
84
|
+
.brand { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--charcoal); }
|
|
85
|
+
.ver-select {
|
|
86
|
+
height: 24px;
|
|
87
|
+
border: 1px solid var(--hairline);
|
|
88
|
+
border-radius: 4px;
|
|
89
|
+
background: var(--white);
|
|
90
|
+
font: 500 11px/1 var(--mono);
|
|
91
|
+
color: var(--obsidian);
|
|
92
|
+
padding: 0 6px;
|
|
93
|
+
cursor: pointer;
|
|
66
94
|
}
|
|
67
|
-
.brand { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
68
95
|
.nav-tools { display: flex; align-items: center; gap: 8px; justify-self: end; }
|
|
69
96
|
.nav-tools .btn {
|
|
70
|
-
height:
|
|
71
|
-
padding: 0
|
|
97
|
+
height: 28px;
|
|
98
|
+
padding: 0 10px;
|
|
72
99
|
font-size: 12px;
|
|
73
100
|
}
|
|
74
101
|
.nav-tools .btn.icon {
|
|
75
|
-
width:
|
|
76
|
-
height:
|
|
102
|
+
width: 28px;
|
|
103
|
+
height: 28px;
|
|
77
104
|
padding: 0;
|
|
78
105
|
}
|
|
79
106
|
.nav-tools .btn.icon svg { width: 16px; height: 16px; }
|
|
@@ -103,23 +130,38 @@
|
|
|
103
130
|
.search-wrap {
|
|
104
131
|
justify-self: center;
|
|
105
132
|
position: relative;
|
|
106
|
-
width:
|
|
133
|
+
width: 100%;
|
|
107
134
|
z-index: 30;
|
|
108
135
|
}
|
|
109
136
|
.search {
|
|
110
137
|
width: 100%;
|
|
111
|
-
height:
|
|
112
|
-
border:
|
|
138
|
+
height: 30px;
|
|
139
|
+
border: 1px solid var(--hairline);
|
|
113
140
|
border-radius: var(--radius);
|
|
114
|
-
box-shadow:
|
|
141
|
+
box-shadow: none;
|
|
115
142
|
background: var(--white);
|
|
116
|
-
padding: 0 12px;
|
|
143
|
+
padding: 0 56px 0 12px;
|
|
144
|
+
font-size: 13px;
|
|
145
|
+
}
|
|
146
|
+
.search-kbd {
|
|
147
|
+
position: absolute;
|
|
148
|
+
right: 8px;
|
|
149
|
+
top: 50%;
|
|
150
|
+
transform: translateY(-50%);
|
|
151
|
+
font: 500 10px/1 var(--mono);
|
|
152
|
+
color: var(--smoke);
|
|
153
|
+
border: 1px solid var(--hairline);
|
|
154
|
+
border-radius: 4px;
|
|
155
|
+
padding: 3px 5px;
|
|
156
|
+
pointer-events: none;
|
|
157
|
+
background: var(--inset);
|
|
117
158
|
}
|
|
118
159
|
.search::placeholder { color: var(--smoke); }
|
|
119
160
|
.search-wrap.open .search {
|
|
120
|
-
|
|
161
|
+
border-color: var(--obsidian);
|
|
121
162
|
border-radius: var(--radius) var(--radius) 0 0;
|
|
122
163
|
}
|
|
164
|
+
.search-wrap.open .search-kbd { display: none; }
|
|
123
165
|
.search-backdrop {
|
|
124
166
|
display: none;
|
|
125
167
|
position: fixed;
|
|
@@ -139,7 +181,9 @@
|
|
|
139
181
|
overflow: auto;
|
|
140
182
|
background: var(--white);
|
|
141
183
|
border-radius: 0 0 var(--radius) var(--radius);
|
|
142
|
-
box-shadow:
|
|
184
|
+
box-shadow: none;
|
|
185
|
+
border: 1px solid var(--hairline);
|
|
186
|
+
border-top: 0;
|
|
143
187
|
z-index: 31;
|
|
144
188
|
padding: 6px;
|
|
145
189
|
}
|
|
@@ -185,8 +229,8 @@
|
|
|
185
229
|
.env-wrap.open .env-pop { display: block; }
|
|
186
230
|
.env-trigger {
|
|
187
231
|
flex: none;
|
|
188
|
-
width:
|
|
189
|
-
height:
|
|
232
|
+
width: 180px;
|
|
233
|
+
height: 28px;
|
|
190
234
|
border: 0;
|
|
191
235
|
border-radius: var(--radius);
|
|
192
236
|
box-shadow: var(--ghost);
|
|
@@ -223,7 +267,8 @@
|
|
|
223
267
|
overflow: auto;
|
|
224
268
|
background: var(--white);
|
|
225
269
|
border-radius: var(--radius);
|
|
226
|
-
box-shadow:
|
|
270
|
+
box-shadow: none;
|
|
271
|
+
border: 1px solid var(--hairline);
|
|
227
272
|
padding: 16px;
|
|
228
273
|
z-index: 40;
|
|
229
274
|
}
|
|
@@ -331,16 +376,20 @@
|
|
|
331
376
|
.app {
|
|
332
377
|
display: grid;
|
|
333
378
|
grid-template-columns: var(--sidebar-w, 320px) 6px minmax(0, 1fr);
|
|
334
|
-
height: calc(100vh -
|
|
379
|
+
height: calc(100vh - 44px);
|
|
335
380
|
}
|
|
336
381
|
.app.sidebar-collapsed {
|
|
337
382
|
grid-template-columns: 0 28px minmax(0, 1fr);
|
|
338
383
|
}
|
|
339
|
-
.sidebar, .workbench { height: 100%;
|
|
384
|
+
.sidebar, .workbench { height: 100%; }
|
|
385
|
+
.workbench { overflow: auto; }
|
|
340
386
|
.sidebar {
|
|
341
387
|
position: relative;
|
|
342
388
|
min-width: 0;
|
|
343
|
-
|
|
389
|
+
overflow: hidden;
|
|
390
|
+
padding: 10px 10px 12px;
|
|
391
|
+
display: flex;
|
|
392
|
+
flex-direction: column;
|
|
344
393
|
background: var(--sidebar);
|
|
345
394
|
border-right: 0;
|
|
346
395
|
font-size: 13px;
|
|
@@ -351,6 +400,30 @@
|
|
|
351
400
|
pointer-events: none;
|
|
352
401
|
opacity: 0;
|
|
353
402
|
}
|
|
403
|
+
.nav-filter {
|
|
404
|
+
width: 100%;
|
|
405
|
+
height: 28px;
|
|
406
|
+
border: 1px solid var(--hairline);
|
|
407
|
+
border-radius: var(--radius);
|
|
408
|
+
background: var(--white);
|
|
409
|
+
padding: 0 8px;
|
|
410
|
+
font-size: 12px;
|
|
411
|
+
margin-bottom: 8px;
|
|
412
|
+
flex: none;
|
|
413
|
+
}
|
|
414
|
+
.nav-filter::placeholder { color: var(--smoke); }
|
|
415
|
+
.tree-scroll { flex: 1; min-height: 0; overflow: auto; }
|
|
416
|
+
.nav-foot {
|
|
417
|
+
flex: none;
|
|
418
|
+
margin-top: 10px;
|
|
419
|
+
padding: 8px;
|
|
420
|
+
border: 1px solid var(--hairline);
|
|
421
|
+
border-radius: var(--radius);
|
|
422
|
+
background: var(--white);
|
|
423
|
+
font-size: 11px;
|
|
424
|
+
color: var(--stone);
|
|
425
|
+
line-height: 1.35;
|
|
426
|
+
}
|
|
354
427
|
.sidebar-resizer {
|
|
355
428
|
position: relative;
|
|
356
429
|
z-index: 5;
|
|
@@ -358,7 +431,7 @@
|
|
|
358
431
|
margin: 0;
|
|
359
432
|
padding: 0;
|
|
360
433
|
border: 0;
|
|
361
|
-
background: var(--
|
|
434
|
+
background: var(--hairline);
|
|
362
435
|
cursor: col-resize;
|
|
363
436
|
touch-action: none;
|
|
364
437
|
}
|
|
@@ -461,7 +534,7 @@
|
|
|
461
534
|
border: 0;
|
|
462
535
|
background: transparent;
|
|
463
536
|
text-align: left;
|
|
464
|
-
padding:
|
|
537
|
+
padding: 5px 8px;
|
|
465
538
|
border-radius: var(--radius);
|
|
466
539
|
cursor: pointer;
|
|
467
540
|
}
|
|
@@ -473,7 +546,7 @@
|
|
|
473
546
|
border-radius: var(--radius);
|
|
474
547
|
}
|
|
475
548
|
.nav-op:hover { background: var(--white); }
|
|
476
|
-
.nav-op.active { background: var(--white); box-shadow: var(--
|
|
549
|
+
.nav-op.active { background: var(--white); box-shadow: 0 0 0 1px var(--hairline); }
|
|
477
550
|
.nav-op-row {
|
|
478
551
|
display: flex;
|
|
479
552
|
align-items: center;
|
|
@@ -482,10 +555,10 @@
|
|
|
482
555
|
}
|
|
483
556
|
.nav-expand {
|
|
484
557
|
flex: none;
|
|
485
|
-
width:
|
|
486
|
-
height:
|
|
558
|
+
width: 24px;
|
|
559
|
+
height: 24px;
|
|
487
560
|
border: 0;
|
|
488
|
-
border-radius:
|
|
561
|
+
border-radius: 4px;
|
|
489
562
|
background: transparent;
|
|
490
563
|
color: var(--stone);
|
|
491
564
|
cursor: pointer;
|
|
@@ -501,23 +574,19 @@
|
|
|
501
574
|
border-right: 1.5px solid currentColor;
|
|
502
575
|
border-bottom: 1.5px solid currentColor;
|
|
503
576
|
transform: rotate(-45deg);
|
|
504
|
-
transition: transform 0.15s ease;
|
|
505
577
|
margin-top: -2px;
|
|
506
578
|
}
|
|
507
579
|
.nav-op.examples-open > .nav-op-row .nav-expand .chev {
|
|
508
580
|
transform: rotate(45deg);
|
|
509
581
|
margin-top: 0;
|
|
510
582
|
}
|
|
511
|
-
.nav-expand:disabled {
|
|
512
|
-
opacity: 0.25;
|
|
513
|
-
cursor: default;
|
|
514
|
-
}
|
|
583
|
+
.nav-expand:disabled { opacity: 0.25; cursor: default; }
|
|
515
584
|
.nav-examples {
|
|
516
585
|
display: none;
|
|
517
586
|
flex-direction: column;
|
|
518
|
-
gap:
|
|
587
|
+
gap: 4px;
|
|
519
588
|
margin: 0 4px 6px 18px;
|
|
520
|
-
padding-left:
|
|
589
|
+
padding-left: 8px;
|
|
521
590
|
border-left: 1px solid var(--hairline);
|
|
522
591
|
}
|
|
523
592
|
.nav-op.examples-open > .nav-examples { display: flex; }
|
|
@@ -528,29 +597,13 @@
|
|
|
528
597
|
justify-content: space-between;
|
|
529
598
|
gap: 8px;
|
|
530
599
|
padding: 6px 8px 2px;
|
|
531
|
-
font: 600 10px/1.2 var(--
|
|
532
|
-
letter-spacing: 0.
|
|
533
|
-
text-transform: uppercase;
|
|
600
|
+
font: 600 10px/1.2 var(--sans);
|
|
601
|
+
letter-spacing: 0.02em;
|
|
534
602
|
color: var(--stone);
|
|
535
603
|
}
|
|
536
|
-
.nav-ex-count
|
|
537
|
-
.nav-ex-total,
|
|
538
|
-
.dd-count {
|
|
539
|
-
flex: none;
|
|
540
|
-
min-width: 16px;
|
|
541
|
-
padding: 1px 6px;
|
|
542
|
-
border-radius: 9999px;
|
|
543
|
-
background: var(--inset);
|
|
544
|
-
color: var(--charcoal);
|
|
604
|
+
.nav-ex-count {
|
|
545
605
|
font: 600 10px/1.4 var(--mono);
|
|
546
|
-
|
|
547
|
-
text-transform: none;
|
|
548
|
-
text-align: center;
|
|
549
|
-
}
|
|
550
|
-
.nav-ex-total {
|
|
551
|
-
margin-right: 2px;
|
|
552
|
-
background: var(--white);
|
|
553
|
-
box-shadow: var(--ghost);
|
|
606
|
+
color: var(--stone);
|
|
554
607
|
}
|
|
555
608
|
.nav-example {
|
|
556
609
|
display: block;
|
|
@@ -558,8 +611,8 @@
|
|
|
558
611
|
border: 0;
|
|
559
612
|
background: transparent;
|
|
560
613
|
text-align: left;
|
|
561
|
-
padding:
|
|
562
|
-
border-radius:
|
|
614
|
+
padding: 4px 8px;
|
|
615
|
+
border-radius: 4px;
|
|
563
616
|
cursor: pointer;
|
|
564
617
|
font-size: 11px;
|
|
565
618
|
line-height: 1.35;
|
|
@@ -570,6 +623,18 @@
|
|
|
570
623
|
}
|
|
571
624
|
.nav-example:hover { background: var(--inset); color: var(--charcoal); }
|
|
572
625
|
.nav-example.on { color: var(--obsidian); background: var(--inset); }
|
|
626
|
+
.nav-ex-total {
|
|
627
|
+
flex: none;
|
|
628
|
+
min-width: 16px;
|
|
629
|
+
margin-right: 2px;
|
|
630
|
+
padding: 1px 5px;
|
|
631
|
+
border-radius: 4px;
|
|
632
|
+
background: var(--obsidian);
|
|
633
|
+
color: var(--white);
|
|
634
|
+
font: 600 10px/1.4 var(--mono);
|
|
635
|
+
text-align: center;
|
|
636
|
+
cursor: pointer;
|
|
637
|
+
}
|
|
573
638
|
.nav-title {
|
|
574
639
|
font-size: 12px;
|
|
575
640
|
color: var(--charcoal);
|
|
@@ -578,7 +643,7 @@
|
|
|
578
643
|
text-overflow: ellipsis;
|
|
579
644
|
white-space: nowrap;
|
|
580
645
|
}
|
|
581
|
-
.nav-op.active .nav-title { color: var(--obsidian); }
|
|
646
|
+
.nav-op.active .nav-title { color: var(--obsidian); font-weight: 500; }
|
|
582
647
|
|
|
583
648
|
.export-backdrop {
|
|
584
649
|
display: none;
|
|
@@ -598,8 +663,9 @@
|
|
|
598
663
|
display: flex;
|
|
599
664
|
flex-direction: column;
|
|
600
665
|
background: var(--white);
|
|
601
|
-
border-radius:
|
|
602
|
-
box-shadow:
|
|
666
|
+
border-radius: var(--radius);
|
|
667
|
+
box-shadow: none;
|
|
668
|
+
border: 1px solid var(--hairline);
|
|
603
669
|
overflow: hidden;
|
|
604
670
|
}
|
|
605
671
|
.export-head {
|
|
@@ -704,64 +770,89 @@
|
|
|
704
770
|
display: inline-flex;
|
|
705
771
|
align-items: center;
|
|
706
772
|
justify-content: center;
|
|
707
|
-
min-width:
|
|
708
|
-
height:
|
|
709
|
-
padding: 0
|
|
710
|
-
border-radius:
|
|
711
|
-
font:
|
|
712
|
-
letter-spacing: 0.
|
|
773
|
+
min-width: 40px;
|
|
774
|
+
height: 18px;
|
|
775
|
+
padding: 0 5px;
|
|
776
|
+
border-radius: 4px;
|
|
777
|
+
font: 600 10px/1 var(--mono);
|
|
778
|
+
letter-spacing: 0.04em;
|
|
713
779
|
text-transform: uppercase;
|
|
714
|
-
box-shadow:
|
|
715
|
-
background: var(--white);
|
|
716
|
-
}
|
|
717
|
-
.method.post, .method.put, .method.patch {
|
|
780
|
+
box-shadow: none;
|
|
718
781
|
background: var(--obsidian);
|
|
719
782
|
color: var(--white);
|
|
720
|
-
box-shadow: none;
|
|
721
783
|
}
|
|
722
|
-
.method.get { background: var(--inset); color: var(--obsidian); }
|
|
723
|
-
.method.delete { background: var(--white); color: var(--charcoal); }
|
|
784
|
+
.method.get { background: var(--inset); color: var(--obsidian); border: 1px solid var(--hairline); }
|
|
785
|
+
.method.delete { background: var(--white); color: var(--charcoal); border: 1px solid var(--hairline); }
|
|
724
786
|
|
|
725
|
-
.workbench { padding:
|
|
726
|
-
.head-
|
|
787
|
+
.workbench { padding: 16px 20px 48px; background: var(--paper); }
|
|
788
|
+
.ep-head { margin-bottom: 12px; }
|
|
789
|
+
.ep-head-top {
|
|
727
790
|
display: flex;
|
|
728
791
|
align-items: flex-start;
|
|
729
792
|
justify-content: space-between;
|
|
730
|
-
gap:
|
|
731
|
-
|
|
793
|
+
gap: 12px;
|
|
794
|
+
}
|
|
795
|
+
.title { font-size: 24px; letter-spacing: -0.04em; line-height: 1.2; margin: 0; font-weight: 600; min-width: 0; }
|
|
796
|
+
.meta-line {
|
|
797
|
+
display: flex;
|
|
798
|
+
align-items: center;
|
|
799
|
+
gap: 8px;
|
|
800
|
+
color: var(--stone);
|
|
801
|
+
font: 12px/1.4 var(--mono);
|
|
802
|
+
margin: 8px 0 0;
|
|
803
|
+
}
|
|
804
|
+
.open-editor {
|
|
805
|
+
height: 28px;
|
|
806
|
+
font-size: 12px;
|
|
732
807
|
}
|
|
733
|
-
.title { font-size: 28px; letter-spacing: -1px; line-height: 1.15; margin: 0; font-weight: 400; min-width: 0; }
|
|
734
|
-
.meta-line { color: var(--stone); font: 12px/1.4 var(--mono); margin: 8px 0 0; }
|
|
735
808
|
|
|
736
|
-
.
|
|
809
|
+
.ex-block { margin-bottom: 10px; position: relative; }
|
|
810
|
+
.ex-kicker {
|
|
811
|
+
font: 600 10px/1 var(--mono);
|
|
812
|
+
letter-spacing: 0.08em;
|
|
813
|
+
text-transform: uppercase;
|
|
814
|
+
color: var(--stone);
|
|
815
|
+
margin-bottom: 6px;
|
|
816
|
+
}
|
|
817
|
+
.dd { position: relative; width: 100%; }
|
|
737
818
|
.dd-toggle {
|
|
738
819
|
width: 100%;
|
|
739
|
-
min-height:
|
|
740
|
-
border:
|
|
820
|
+
min-height: 36px;
|
|
821
|
+
border: 1px solid var(--hairline);
|
|
741
822
|
border-radius: var(--radius);
|
|
742
|
-
box-shadow:
|
|
823
|
+
box-shadow: none;
|
|
743
824
|
background: var(--white);
|
|
744
|
-
padding: 8px
|
|
825
|
+
padding: 8px 32px 8px 10px;
|
|
745
826
|
text-align: left;
|
|
746
827
|
cursor: pointer;
|
|
747
|
-
font-size:
|
|
748
|
-
line-height: 1.
|
|
828
|
+
font-size: 13px;
|
|
829
|
+
line-height: 1.35;
|
|
749
830
|
position: relative;
|
|
750
831
|
display: flex;
|
|
751
832
|
align-items: center;
|
|
752
|
-
gap:
|
|
833
|
+
gap: 10px;
|
|
834
|
+
}
|
|
835
|
+
.dd-status {
|
|
836
|
+
font: 600 11px/1 var(--mono);
|
|
837
|
+
min-width: 28px;
|
|
838
|
+
}
|
|
839
|
+
.dd-status.ok { color: var(--ok); }
|
|
840
|
+
.dd-status.err { color: var(--err); }
|
|
841
|
+
.dd-kind {
|
|
842
|
+
color: var(--stone);
|
|
843
|
+
font-size: 12px;
|
|
753
844
|
}
|
|
754
845
|
.dd-toggle .dd-toggle-label {
|
|
755
846
|
min-width: 0;
|
|
756
847
|
overflow: hidden;
|
|
757
848
|
text-overflow: ellipsis;
|
|
758
849
|
white-space: nowrap;
|
|
850
|
+
flex: 1;
|
|
759
851
|
}
|
|
760
|
-
.dd-toggle .dd-count { margin-left: auto; margin-right: 4px; }
|
|
761
852
|
.dd-toggle::after {
|
|
762
853
|
content: "";
|
|
763
854
|
position: absolute;
|
|
764
|
-
right:
|
|
855
|
+
right: 12px;
|
|
765
856
|
top: 50%;
|
|
766
857
|
width: 6px;
|
|
767
858
|
height: 6px;
|
|
@@ -777,72 +868,105 @@
|
|
|
777
868
|
top: calc(100% + 4px);
|
|
778
869
|
left: 0;
|
|
779
870
|
right: 0;
|
|
780
|
-
max-height:
|
|
781
|
-
overflow:
|
|
871
|
+
max-height: 420px;
|
|
872
|
+
overflow: hidden;
|
|
782
873
|
background: var(--white);
|
|
783
874
|
border-radius: var(--radius);
|
|
784
|
-
|
|
785
|
-
|
|
875
|
+
border: 1px solid var(--hairline);
|
|
876
|
+
box-shadow: none;
|
|
877
|
+
padding: 0;
|
|
786
878
|
}
|
|
787
|
-
.dd.open .dd-menu { display:
|
|
879
|
+
.dd.open .dd-menu { display: flex; flex-direction: column; }
|
|
880
|
+
.dd-search {
|
|
881
|
+
height: 32px;
|
|
882
|
+
margin: 8px 8px 4px;
|
|
883
|
+
border: 1px solid var(--hairline);
|
|
884
|
+
border-radius: 4px;
|
|
885
|
+
padding: 0 8px;
|
|
886
|
+
font-size: 12px;
|
|
887
|
+
background: var(--white);
|
|
888
|
+
}
|
|
889
|
+
.dd-list { overflow: auto; padding: 4px 0 8px; }
|
|
788
890
|
.dd-group {
|
|
789
891
|
display: flex;
|
|
790
892
|
align-items: center;
|
|
791
893
|
justify-content: space-between;
|
|
792
894
|
gap: 8px;
|
|
793
895
|
font-family: var(--mono);
|
|
794
|
-
font-size:
|
|
896
|
+
font-size: 10px;
|
|
795
897
|
letter-spacing: 0.08em;
|
|
796
898
|
text-transform: uppercase;
|
|
797
899
|
color: var(--stone);
|
|
798
|
-
padding: 10px 12px
|
|
900
|
+
padding: 10px 12px 4px;
|
|
799
901
|
}
|
|
800
|
-
.dd-group
|
|
801
|
-
|
|
902
|
+
.dd-group.ok { color: var(--ok); }
|
|
903
|
+
.dd-group.err { color: var(--err); }
|
|
904
|
+
.dd-count {
|
|
905
|
+
font: 600 10px/1.4 var(--mono);
|
|
906
|
+
color: var(--stone);
|
|
907
|
+
letter-spacing: 0;
|
|
908
|
+
text-transform: none;
|
|
802
909
|
}
|
|
803
910
|
.dd-item {
|
|
804
|
-
display:
|
|
911
|
+
display: flex;
|
|
912
|
+
align-items: center;
|
|
913
|
+
gap: 10px;
|
|
805
914
|
width: 100%;
|
|
806
915
|
border: 0;
|
|
807
916
|
background: transparent;
|
|
808
917
|
text-align: left;
|
|
809
|
-
padding:
|
|
810
|
-
font-size:
|
|
918
|
+
padding: 6px 12px;
|
|
919
|
+
font-size: 13px;
|
|
811
920
|
cursor: pointer;
|
|
812
921
|
}
|
|
813
922
|
.dd-item:hover, .dd-item.on { background: var(--inset); }
|
|
923
|
+
.dd-item .st {
|
|
924
|
+
font: 600 11px/1 var(--mono);
|
|
925
|
+
width: 28px;
|
|
926
|
+
flex: none;
|
|
927
|
+
}
|
|
928
|
+
.dd-item .st.ok { color: var(--ok); }
|
|
929
|
+
.dd-item .st.err { color: var(--err); }
|
|
814
930
|
|
|
815
931
|
.urlbar {
|
|
816
932
|
display: flex;
|
|
817
933
|
gap: 8px;
|
|
818
934
|
align-items: stretch;
|
|
819
|
-
margin-bottom:
|
|
935
|
+
margin-bottom: 12px;
|
|
820
936
|
}
|
|
821
937
|
.url {
|
|
822
938
|
flex: 1;
|
|
823
939
|
min-width: 0;
|
|
824
940
|
display: flex;
|
|
825
941
|
align-items: center;
|
|
826
|
-
gap:
|
|
942
|
+
gap: 10px;
|
|
827
943
|
background: var(--white);
|
|
828
944
|
border-radius: var(--radius);
|
|
829
|
-
|
|
830
|
-
|
|
945
|
+
border: 1px solid var(--hairline);
|
|
946
|
+
box-shadow: none;
|
|
947
|
+
padding: 0 10px;
|
|
948
|
+
height: 36px;
|
|
831
949
|
font-family: var(--mono);
|
|
832
|
-
font-size:
|
|
833
|
-
|
|
950
|
+
font-size: 12px;
|
|
951
|
+
overflow: hidden;
|
|
952
|
+
}
|
|
953
|
+
.url span:last-child {
|
|
954
|
+
overflow: hidden;
|
|
955
|
+
text-overflow: ellipsis;
|
|
956
|
+
white-space: nowrap;
|
|
834
957
|
}
|
|
835
958
|
.url .method { flex: none; }
|
|
836
959
|
.btn {
|
|
837
|
-
border:
|
|
960
|
+
border: 1px solid var(--hairline);
|
|
838
961
|
background: var(--white);
|
|
839
|
-
box-shadow:
|
|
962
|
+
box-shadow: none;
|
|
840
963
|
border-radius: var(--radius);
|
|
841
|
-
padding: 0
|
|
842
|
-
height:
|
|
964
|
+
padding: 0 12px;
|
|
965
|
+
height: 36px;
|
|
843
966
|
cursor: pointer;
|
|
844
967
|
color: var(--charcoal);
|
|
845
968
|
white-space: nowrap;
|
|
969
|
+
font-size: 12px;
|
|
846
970
|
}
|
|
847
971
|
.btn:hover { color: var(--obsidian); }
|
|
848
972
|
.btn.sm { height: 32px; padding: 0 10px; font-size: 12px; }
|
|
@@ -883,14 +1007,15 @@
|
|
|
883
1007
|
.pair {
|
|
884
1008
|
display: grid;
|
|
885
1009
|
grid-template-columns: 1fr 1fr;
|
|
886
|
-
gap:
|
|
887
|
-
margin-bottom:
|
|
1010
|
+
gap: 12px;
|
|
1011
|
+
margin-bottom: 20px;
|
|
888
1012
|
align-items: start;
|
|
889
1013
|
}
|
|
890
1014
|
.card {
|
|
891
1015
|
background: var(--white);
|
|
892
1016
|
border-radius: var(--radius);
|
|
893
|
-
|
|
1017
|
+
border: 1px solid var(--hairline);
|
|
1018
|
+
box-shadow: none;
|
|
894
1019
|
min-width: 0;
|
|
895
1020
|
display: flex;
|
|
896
1021
|
flex-direction: column;
|
|
@@ -904,12 +1029,34 @@
|
|
|
904
1029
|
align-items: center;
|
|
905
1030
|
justify-content: space-between;
|
|
906
1031
|
gap: 12px;
|
|
907
|
-
padding:
|
|
1032
|
+
padding: 10px 12px;
|
|
908
1033
|
border-bottom: 1px solid var(--hairline);
|
|
909
1034
|
flex: none;
|
|
910
1035
|
}
|
|
911
|
-
.card-head h2 {
|
|
1036
|
+
.card-head h2 {
|
|
1037
|
+
margin: 0;
|
|
1038
|
+
font-size: 11px;
|
|
1039
|
+
font-weight: 600;
|
|
1040
|
+
letter-spacing: 0.08em;
|
|
1041
|
+
text-transform: uppercase;
|
|
1042
|
+
}
|
|
912
1043
|
.card-head-actions { display: flex; align-items: center; gap: 8px; }
|
|
1044
|
+
.mode-toggle {
|
|
1045
|
+
display: flex;
|
|
1046
|
+
border: 1px solid var(--hairline);
|
|
1047
|
+
border-radius: 4px;
|
|
1048
|
+
overflow: hidden;
|
|
1049
|
+
}
|
|
1050
|
+
.mode-toggle button {
|
|
1051
|
+
height: 24px;
|
|
1052
|
+
padding: 0 8px;
|
|
1053
|
+
border: 0;
|
|
1054
|
+
background: var(--white);
|
|
1055
|
+
font-size: 11px;
|
|
1056
|
+
cursor: pointer;
|
|
1057
|
+
color: var(--stone);
|
|
1058
|
+
}
|
|
1059
|
+
.mode-toggle button.on { background: var(--obsidian); color: var(--white); }
|
|
913
1060
|
.card-body {
|
|
914
1061
|
padding: 0;
|
|
915
1062
|
display: flex;
|
|
@@ -923,7 +1070,7 @@
|
|
|
923
1070
|
max-height: none;
|
|
924
1071
|
}
|
|
925
1072
|
.meta-block {
|
|
926
|
-
padding:
|
|
1073
|
+
padding: 10px 12px;
|
|
927
1074
|
border-top: 1px solid var(--hairline);
|
|
928
1075
|
}
|
|
929
1076
|
.meta-block:first-child { border-top: 0; }
|
|
@@ -932,10 +1079,10 @@
|
|
|
932
1079
|
align-items: center;
|
|
933
1080
|
justify-content: space-between;
|
|
934
1081
|
gap: 8px;
|
|
935
|
-
margin-bottom:
|
|
1082
|
+
margin-bottom: 8px;
|
|
936
1083
|
}
|
|
937
1084
|
.meta-label {
|
|
938
|
-
font: 600
|
|
1085
|
+
font: 600 10px/1 var(--mono);
|
|
939
1086
|
letter-spacing: 0.08em;
|
|
940
1087
|
text-transform: uppercase;
|
|
941
1088
|
color: var(--obsidian);
|
|
@@ -946,18 +1093,18 @@
|
|
|
946
1093
|
display: flex;
|
|
947
1094
|
align-items: center;
|
|
948
1095
|
gap: 12px;
|
|
949
|
-
margin-bottom:
|
|
950
|
-
font-size:
|
|
1096
|
+
margin-bottom: 6px;
|
|
1097
|
+
font-size: 12px;
|
|
951
1098
|
min-width: 0;
|
|
952
1099
|
}
|
|
953
1100
|
.kv:last-child { margin-bottom: 0; }
|
|
954
1101
|
.kname {
|
|
955
1102
|
flex: none;
|
|
956
|
-
width:
|
|
1103
|
+
width: 110px;
|
|
957
1104
|
color: var(--stone);
|
|
958
1105
|
font-family: var(--mono);
|
|
959
1106
|
font-size: 11px;
|
|
960
|
-
letter-spacing: 0.
|
|
1107
|
+
letter-spacing: 0.02em;
|
|
961
1108
|
white-space: nowrap;
|
|
962
1109
|
overflow: hidden;
|
|
963
1110
|
text-overflow: ellipsis;
|
|
@@ -968,59 +1115,59 @@
|
|
|
968
1115
|
font-family: var(--mono);
|
|
969
1116
|
font-size: 12px;
|
|
970
1117
|
color: var(--obsidian);
|
|
971
|
-
padding:
|
|
972
|
-
background:
|
|
973
|
-
border-radius:
|
|
1118
|
+
padding: 4px 0;
|
|
1119
|
+
background: transparent;
|
|
1120
|
+
border-radius: 0;
|
|
974
1121
|
white-space: nowrap;
|
|
975
1122
|
overflow: hidden;
|
|
976
1123
|
text-overflow: ellipsis;
|
|
977
1124
|
}
|
|
978
1125
|
pre {
|
|
979
1126
|
margin: 0;
|
|
980
|
-
padding: 12px;
|
|
981
|
-
background:
|
|
982
|
-
border-radius:
|
|
1127
|
+
padding: 10px 12px;
|
|
1128
|
+
background: #fcfcfc;
|
|
1129
|
+
border-radius: 0;
|
|
983
1130
|
overflow: auto;
|
|
984
1131
|
font: 12px/1.5 var(--mono);
|
|
985
1132
|
}
|
|
986
|
-
.k { color: #
|
|
987
|
-
.s { color: #
|
|
988
|
-
.n { color: #
|
|
989
|
-
.p { color: #
|
|
1133
|
+
.k { color: #111111; }
|
|
1134
|
+
.s { color: #2563eb; }
|
|
1135
|
+
.n { color: #111111; }
|
|
1136
|
+
.p { color: #666666; }
|
|
990
1137
|
.empty { color: var(--stone); font-size: 13px; padding: 14px 16px; }
|
|
991
1138
|
.code {
|
|
992
|
-
font:
|
|
993
|
-
padding:
|
|
994
|
-
border-radius:
|
|
1139
|
+
font: 600 11px/1 var(--mono);
|
|
1140
|
+
padding: 3px 6px;
|
|
1141
|
+
border-radius: 4px;
|
|
995
1142
|
background: var(--inset);
|
|
996
1143
|
}
|
|
997
|
-
.code.ok { background:
|
|
1144
|
+
.code.ok { background: var(--ok-bg); color: var(--ok); }
|
|
1145
|
+
.code.err { background: var(--err-bg); color: var(--err); }
|
|
998
1146
|
.code-text { color: var(--stone); font-size: 12px; }
|
|
1147
|
+
.res-meta { display: flex; align-items: center; gap: 10px; color: var(--stone); font: 11px/1 var(--mono); }
|
|
999
1148
|
|
|
1000
|
-
.
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1149
|
+
.schemas {
|
|
1150
|
+
display: grid;
|
|
1151
|
+
grid-template-columns: 1fr 1fr;
|
|
1152
|
+
gap: 24px;
|
|
1153
|
+
padding-top: 8px;
|
|
1154
|
+
border-top: 1px solid var(--hairline);
|
|
1006
1155
|
}
|
|
1007
|
-
.
|
|
1008
|
-
|
|
1009
|
-
font:
|
|
1156
|
+
.schemas h2 {
|
|
1157
|
+
font-size: 11px;
|
|
1158
|
+
font-weight: 600;
|
|
1010
1159
|
letter-spacing: 0.08em;
|
|
1011
1160
|
text-transform: uppercase;
|
|
1161
|
+
margin: 0 0 8px;
|
|
1012
1162
|
color: var(--stone);
|
|
1013
|
-
margin-bottom: 8px;
|
|
1014
|
-
padding-bottom: 8px;
|
|
1015
|
-
border-bottom: 1px solid var(--hairline);
|
|
1016
1163
|
}
|
|
1017
1164
|
.row {
|
|
1018
1165
|
display: grid;
|
|
1019
|
-
grid-template-columns: minmax(0, 1.
|
|
1020
|
-
gap:
|
|
1021
|
-
align-items:
|
|
1022
|
-
padding:
|
|
1023
|
-
font-size:
|
|
1166
|
+
grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.9fr) auto;
|
|
1167
|
+
gap: 8px;
|
|
1168
|
+
align-items: baseline;
|
|
1169
|
+
padding: 5px 0;
|
|
1170
|
+
font-size: 12px;
|
|
1024
1171
|
}
|
|
1025
1172
|
.row .name {
|
|
1026
1173
|
font-family: var(--mono);
|
|
@@ -1032,8 +1179,8 @@
|
|
|
1032
1179
|
}
|
|
1033
1180
|
.row .name.nested {
|
|
1034
1181
|
color: var(--charcoal);
|
|
1035
|
-
border-left:
|
|
1036
|
-
padding-left:
|
|
1182
|
+
border-left: 1px solid var(--hairline);
|
|
1183
|
+
padding-left: 8px;
|
|
1037
1184
|
margin-left: 2px;
|
|
1038
1185
|
}
|
|
1039
1186
|
.row .name.nested[data-depth="2"] { margin-left: 14px; }
|
|
@@ -1043,11 +1190,17 @@
|
|
|
1043
1190
|
.row .type {
|
|
1044
1191
|
color: var(--stone);
|
|
1045
1192
|
font-family: var(--mono);
|
|
1046
|
-
font-size:
|
|
1193
|
+
font-size: 11px;
|
|
1047
1194
|
min-width: 0;
|
|
1048
1195
|
}
|
|
1049
|
-
.flag {
|
|
1050
|
-
.flag.req { color:
|
|
1196
|
+
.flag { font-size: 11px; color: var(--smoke); }
|
|
1197
|
+
.flag.req { color: var(--err); }
|
|
1198
|
+
|
|
1199
|
+
.work-foot {
|
|
1200
|
+
margin-top: 24px;
|
|
1201
|
+
font-size: 11px;
|
|
1202
|
+
color: var(--smoke);
|
|
1203
|
+
}
|
|
1051
1204
|
|
|
1052
1205
|
@media (max-width: 960px) {
|
|
1053
1206
|
.app {
|
|
@@ -1059,7 +1212,7 @@
|
|
|
1059
1212
|
}
|
|
1060
1213
|
.sidebar { max-height: 40vh; opacity: 1 !important; pointer-events: auto !important; padding: 16px 12px 24px !important; }
|
|
1061
1214
|
.sidebar-resizer { display: none; }
|
|
1062
|
-
.pair { grid-template-columns: 1fr; }
|
|
1215
|
+
.pair, .schemas { grid-template-columns: 1fr; }
|
|
1063
1216
|
.search-wrap { width: min(280px, 70vw); }
|
|
1064
1217
|
}
|
|
1065
1218
|
</style>
|
|
@@ -1067,15 +1220,19 @@
|
|
|
1067
1220
|
<body>
|
|
1068
1221
|
<header class="topnav">
|
|
1069
1222
|
<div class="brand-wrap">
|
|
1070
|
-
<span class="
|
|
1071
|
-
<
|
|
1223
|
+
<span class="logo-mark">N</span>
|
|
1224
|
+
<span class="logo-name">Notary</span>
|
|
1225
|
+
<span class="nav-divider"></span>
|
|
1226
|
+
<div class="brand" id="brand">API</div>
|
|
1227
|
+
<select class="ver-select" id="ver-select" aria-label="API version"></select>
|
|
1072
1228
|
</div>
|
|
1073
1229
|
<div class="search-wrap" id="search-wrap">
|
|
1074
|
-
<input class="search" id="search" placeholder="Search endpoints" autocomplete="off" spellcheck="false" />
|
|
1230
|
+
<input class="search" id="search" placeholder="Search endpoints..." autocomplete="off" spellcheck="false" />
|
|
1231
|
+
<span class="search-kbd">⌘K</span>
|
|
1075
1232
|
<div class="search-panel" id="search-panel" role="listbox"></div>
|
|
1076
1233
|
</div>
|
|
1077
1234
|
<div class="nav-tools">
|
|
1078
|
-
<button class="btn icon" id="export-openapi" type="button" data-tip="Export
|
|
1235
|
+
<button class="btn icon" id="export-openapi" type="button" data-tip="Export" aria-label="Export">
|
|
1079
1236
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>
|
|
1080
1237
|
</button>
|
|
1081
1238
|
<div class="env-wrap" id="env-wrap">
|
|
@@ -1877,14 +2034,7 @@
|
|
|
1877
2034
|
};
|
|
1878
2035
|
};
|
|
1879
2036
|
|
|
1880
|
-
document.title = "
|
|
1881
|
-
const workspaceEl = document.getElementById("workspace");
|
|
1882
|
-
if (workspace) {
|
|
1883
|
-
workspaceEl.textContent = workspace;
|
|
1884
|
-
workspaceEl.hidden = false;
|
|
1885
|
-
} else {
|
|
1886
|
-
workspaceEl.hidden = true;
|
|
1887
|
-
}
|
|
2037
|
+
document.title = "Notary · " + title;
|
|
1888
2038
|
document.getElementById("brand").textContent = title;
|
|
1889
2039
|
|
|
1890
2040
|
const envWrap = document.getElementById("env-wrap");
|
|
@@ -2435,11 +2585,6 @@
|
|
|
2435
2585
|
"INVALID CASES",
|
|
2436
2586
|
"OMITTED CASES",
|
|
2437
2587
|
"SEMANTIC ERROR CASES - AUTH",
|
|
2438
|
-
"Success",
|
|
2439
|
-
"Business errors",
|
|
2440
|
-
"Invalid input",
|
|
2441
|
-
"Missing fields",
|
|
2442
|
-
"Auth",
|
|
2443
2588
|
"Other",
|
|
2444
2589
|
];
|
|
2445
2590
|
const METHOD_ORDER = { get: 0, post: 1, put: 2, patch: 3, delete: 4 };
|
|
@@ -2583,15 +2728,17 @@
|
|
|
2583
2728
|
if (body !== undefined && item.method !== "get" && item.method !== "head") {
|
|
2584
2729
|
init.body = typeof body === "string" ? body : JSON.stringify(body);
|
|
2585
2730
|
}
|
|
2731
|
+
const started = performance.now();
|
|
2586
2732
|
const response = await fetch(proxyUrl(target), init);
|
|
2587
2733
|
const text = await response.text();
|
|
2734
|
+
const ms = Math.max(1, Math.round(performance.now() - started));
|
|
2588
2735
|
let parsed = text;
|
|
2589
2736
|
try {
|
|
2590
2737
|
parsed = text ? JSON.parse(text) : undefined;
|
|
2591
2738
|
} catch {
|
|
2592
2739
|
parsed = text;
|
|
2593
2740
|
}
|
|
2594
|
-
return { status: response.status, body: parsed, ok: response.ok };
|
|
2741
|
+
return { status: response.status, body: parsed, ok: response.ok, ms, bytes: text.length };
|
|
2595
2742
|
};
|
|
2596
2743
|
|
|
2597
2744
|
const groupScenarios = (scenarios) => {
|
|
@@ -2606,42 +2753,70 @@
|
|
|
2606
2753
|
return { groups, order };
|
|
2607
2754
|
};
|
|
2608
2755
|
|
|
2756
|
+
const GROUP_LABEL = {
|
|
2757
|
+
"POSITIVE CASES": "Positive cases",
|
|
2758
|
+
"SEMANTIC ERROR CASES": "False positive cases",
|
|
2759
|
+
"INVALID CASES": "Invalid cases",
|
|
2760
|
+
"OMITTED CASES": "Omitted cases",
|
|
2761
|
+
"SEMANTIC ERROR CASES - AUTH": "False positive cases — Auth",
|
|
2762
|
+
Other: "Other",
|
|
2763
|
+
};
|
|
2764
|
+
|
|
2765
|
+
const displayGroup = (group) => GROUP_LABEL[group] || group || "Other";
|
|
2766
|
+
const groupTone = (label) => (String(label).toLowerCase() === "positive cases" ? "ok" : "err");
|
|
2767
|
+
const statusOk = (status) => Number(status) >= 200 && Number(status) < 300;
|
|
2768
|
+
|
|
2609
2769
|
const groupedDropdown = (scenarios, selected) => {
|
|
2610
2770
|
const { groups, order } = groupScenarios(scenarios);
|
|
2611
2771
|
const current = scenarios[selected];
|
|
2612
|
-
const
|
|
2613
|
-
const
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
)
|
|
2627
|
-
.
|
|
2628
|
-
|
|
2629
|
-
|
|
2772
|
+
const q = exampleQuery.trim().toLowerCase();
|
|
2773
|
+
const kind = current ? displayGroup(current.group) : "";
|
|
2774
|
+
const ok = current ? statusOk(current.status) : false;
|
|
2775
|
+
return `<div class="dd ${exampleOpen ? "open" : ""}" id="scenario-dd">
|
|
2776
|
+
<button type="button" class="dd-toggle" id="scenario-toggle">
|
|
2777
|
+
<span class="dd-status ${ok ? "ok" : "err"}">${escapeHtml(String(current?.status ?? ""))}</span>
|
|
2778
|
+
<span class="dd-kind">${escapeHtml(kind)}</span>
|
|
2779
|
+
<span class="dd-toggle-label">${escapeHtml(current?.name || "Example")}</span>
|
|
2780
|
+
</button>
|
|
2781
|
+
<div class="dd-menu">
|
|
2782
|
+
<input class="dd-search" id="example-search" placeholder="Search examples..." value="${escapeAttr(exampleQuery)}" autocomplete="off" spellcheck="false" />
|
|
2783
|
+
<div class="dd-list">${order
|
|
2784
|
+
.map((group) => {
|
|
2785
|
+
const rows = groups[group].filter(({ scenario }) => {
|
|
2786
|
+
if (!q) return true;
|
|
2787
|
+
return (String(scenario.status) + " " + (scenario.name || "") + " " + (scenario.group || "")).toLowerCase().includes(q);
|
|
2788
|
+
});
|
|
2789
|
+
if (!rows.length) return "";
|
|
2790
|
+
const label = displayGroup(group);
|
|
2791
|
+
return `<div class="dd-group ${groupTone(label)}"><span>${escapeHtml(label)} (${rows.length})</span></div>` +
|
|
2792
|
+
rows
|
|
2793
|
+
.map(
|
|
2794
|
+
({ scenario, index }) =>
|
|
2795
|
+
`<button type="button" class="dd-item ${index === selected ? "on" : ""}" data-index="${index}"><span class="st ${statusOk(scenario.status) ? "ok" : "err"}">${escapeHtml(String(scenario.status))}</span><span>${escapeHtml(scenario.name)}</span></button>`,
|
|
2796
|
+
)
|
|
2797
|
+
.join("");
|
|
2798
|
+
})
|
|
2799
|
+
.join("")}</div>
|
|
2800
|
+
</div>
|
|
2630
2801
|
</div>`;
|
|
2631
2802
|
};
|
|
2632
2803
|
|
|
2633
2804
|
let currentId = ops[0]?.id;
|
|
2634
2805
|
let scenarioIndex = 0;
|
|
2806
|
+
let navQuery = "";
|
|
2807
|
+
let exampleQuery = "";
|
|
2808
|
+
let exampleOpen = false;
|
|
2809
|
+
let jsonMode = { req: "pretty", res: "pretty" };
|
|
2635
2810
|
const treePathSegments = (item) => item.treeSegments || item.path.split("/").filter(Boolean);
|
|
2636
|
-
const
|
|
2637
|
-
|
|
2638
|
-
);
|
|
2811
|
+
const apiVersions = [...new Set(ops.map((item) => treePathSegments(item)[0]).filter(Boolean))];
|
|
2812
|
+
let activeVersion = apiVersions[0] || "";
|
|
2813
|
+
const expandedFolders = new Set(apiVersions.map((version) => "/" + version));
|
|
2639
2814
|
const expandedExampleOps = new Set();
|
|
2640
2815
|
|
|
2641
2816
|
const scenarioNavLabel = (scenario) => {
|
|
2642
2817
|
const status = scenario.status != null ? String(scenario.status) : "";
|
|
2643
2818
|
const name = scenario.name || "example";
|
|
2644
|
-
return status ? status + "
|
|
2819
|
+
return status ? status + " " + name : name;
|
|
2645
2820
|
};
|
|
2646
2821
|
|
|
2647
2822
|
const renderNavExamples = (item) => {
|
|
@@ -2649,7 +2824,7 @@
|
|
|
2649
2824
|
return `<div class="nav-examples">${order
|
|
2650
2825
|
.map(
|
|
2651
2826
|
(group) => `<div class="nav-ex-group">
|
|
2652
|
-
<div class="nav-ex-group-label"><span>${escapeHtml(group)}</span><span class="nav-ex-count">${groups[group].length}</span></div>
|
|
2827
|
+
<div class="nav-ex-group-label"><span>${escapeHtml(displayGroup(group))}</span><span class="nav-ex-count">${groups[group].length}</span></div>
|
|
2653
2828
|
${groups[group]
|
|
2654
2829
|
.map(
|
|
2655
2830
|
({ scenario, index }) =>
|
|
@@ -2714,7 +2889,6 @@
|
|
|
2714
2889
|
.map((item) => {
|
|
2715
2890
|
const hasExamples = Array.isArray(item.scenarios) && item.scenarios.length > 0;
|
|
2716
2891
|
const examplesOpen = expandedExampleOps.has(item.id);
|
|
2717
|
-
const examplesHtml = hasExamples ? renderNavExamples(item) : "";
|
|
2718
2892
|
const exampleCount = hasExamples ? item.scenarios.length : 0;
|
|
2719
2893
|
return `<div class="nav-op ${item.id === currentId ? "active" : ""} ${examplesOpen ? "examples-open" : ""}" data-op-id="${escapeAttr(item.id)}">
|
|
2720
2894
|
<div class="nav-op-row">
|
|
@@ -2727,7 +2901,7 @@
|
|
|
2727
2901
|
<span class="chev"></span>
|
|
2728
2902
|
</button>
|
|
2729
2903
|
</div>
|
|
2730
|
-
${
|
|
2904
|
+
${hasExamples ? renderNavExamples(item) : ""}
|
|
2731
2905
|
</div>`;
|
|
2732
2906
|
})
|
|
2733
2907
|
.join("");
|
|
@@ -2752,6 +2926,11 @@
|
|
|
2752
2926
|
return opsHtml + foldersHtml;
|
|
2753
2927
|
};
|
|
2754
2928
|
|
|
2929
|
+
const visibleOps = () => {
|
|
2930
|
+
if (!activeVersion) return ops;
|
|
2931
|
+
return ops.filter((item) => treePathSegments(item)[0] === activeVersion);
|
|
2932
|
+
};
|
|
2933
|
+
|
|
2755
2934
|
const renderNav = () => {
|
|
2756
2935
|
const nav = document.getElementById("nav");
|
|
2757
2936
|
if (!ops.length) {
|
|
@@ -2762,7 +2941,22 @@
|
|
|
2762
2941
|
const active = ops.find((item) => item.id === currentId);
|
|
2763
2942
|
if (active) expandPathToItem(active);
|
|
2764
2943
|
}
|
|
2765
|
-
|
|
2944
|
+
const q = navQuery.trim().toLowerCase();
|
|
2945
|
+
nav.innerHTML = `
|
|
2946
|
+
<input class="nav-filter" id="nav-filter" placeholder="Search endpoints..." value="${escapeAttr(navQuery)}" autocomplete="off" spellcheck="false" />
|
|
2947
|
+
<div class="tree-scroll"><div class="tree-root">${renderTreeNode(buildPathTree(visibleOps()), "", q)}</div></div>
|
|
2948
|
+
<div class="nav-foot">Generated by Notary</div>
|
|
2949
|
+
`;
|
|
2950
|
+
const filter = document.getElementById("nav-filter");
|
|
2951
|
+
if (filter) {
|
|
2952
|
+
filter.oninput = (event) => {
|
|
2953
|
+
navQuery = event.target.value;
|
|
2954
|
+
renderNav();
|
|
2955
|
+
document.getElementById("nav-filter")?.focus();
|
|
2956
|
+
const el = document.getElementById("nav-filter");
|
|
2957
|
+
if (el) el.selectionStart = el.selectionEnd = el.value.length;
|
|
2958
|
+
};
|
|
2959
|
+
}
|
|
2766
2960
|
nav.querySelectorAll(".nav-item").forEach((button) => {
|
|
2767
2961
|
button.onclick = () => select(button.dataset.id);
|
|
2768
2962
|
});
|
|
@@ -2780,6 +2974,17 @@
|
|
|
2780
2974
|
}
|
|
2781
2975
|
};
|
|
2782
2976
|
});
|
|
2977
|
+
nav.querySelectorAll(".nav-ex-total").forEach((badge) => {
|
|
2978
|
+
badge.onclick = (event) => {
|
|
2979
|
+
event.stopPropagation();
|
|
2980
|
+
const wrap = badge.closest(".nav-op");
|
|
2981
|
+
const opId = wrap && wrap.dataset.opId;
|
|
2982
|
+
if (!opId) return;
|
|
2983
|
+
if (expandedExampleOps.has(opId)) expandedExampleOps.delete(opId);
|
|
2984
|
+
else expandedExampleOps.add(opId);
|
|
2985
|
+
renderNav();
|
|
2986
|
+
};
|
|
2987
|
+
});
|
|
2783
2988
|
nav.querySelectorAll(".nav-example").forEach((button) => {
|
|
2784
2989
|
button.onclick = (event) => {
|
|
2785
2990
|
event.stopPropagation();
|
|
@@ -2876,12 +3081,14 @@
|
|
|
2876
3081
|
});
|
|
2877
3082
|
};
|
|
2878
3083
|
|
|
2879
|
-
const
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
3084
|
+
const jsonBlock = (value, pretty) => {
|
|
3085
|
+
if (value === undefined) return `<div class="meta-empty">No JSON body</div>`;
|
|
3086
|
+
if (!pretty) {
|
|
3087
|
+
const raw = typeof value === "string" ? value : JSON.stringify(value);
|
|
3088
|
+
return `<pre>${escapeHtml(raw)}</pre>`;
|
|
3089
|
+
}
|
|
3090
|
+
return `<pre>${highlight(value)}</pre>`;
|
|
3091
|
+
};
|
|
2885
3092
|
|
|
2886
3093
|
const fieldDepth = (name) => {
|
|
2887
3094
|
const parts = String(name || "")
|
|
@@ -2891,43 +3098,74 @@
|
|
|
2891
3098
|
return Math.max(0, parts.length - 1);
|
|
2892
3099
|
};
|
|
2893
3100
|
|
|
2894
|
-
const
|
|
2895
|
-
if (!
|
|
3101
|
+
const byteLabel = (bytes) => {
|
|
3102
|
+
if (!bytes) return "";
|
|
3103
|
+
if (bytes < 1024) return bytes + " B";
|
|
3104
|
+
return (bytes / 1024).toFixed(1).replace(/\.0$/, "") + " KB";
|
|
3105
|
+
};
|
|
3106
|
+
|
|
3107
|
+
const schemaFromValue = (value, prefix = "") => {
|
|
3108
|
+
const out = [];
|
|
3109
|
+
const walk = (node, path) => {
|
|
3110
|
+
if (node === null || node === undefined) {
|
|
3111
|
+
if (path) out.push({ name: path, type: "null" });
|
|
3112
|
+
return;
|
|
3113
|
+
}
|
|
3114
|
+
if (Array.isArray(node)) {
|
|
3115
|
+
const inner = node[0];
|
|
3116
|
+
const innerType = inner == null ? "unknown" : Array.isArray(inner) ? "array" : typeof inner === "object" ? "object" : typeof inner;
|
|
3117
|
+
out.push({ name: path, type: "array<" + innerType + ">" });
|
|
3118
|
+
if (inner && typeof inner === "object" && !Array.isArray(inner)) {
|
|
3119
|
+
for (const [key, nested] of Object.entries(inner)) walk(nested, path + "[]." + key);
|
|
3120
|
+
}
|
|
3121
|
+
return;
|
|
3122
|
+
}
|
|
3123
|
+
if (typeof node === "object") {
|
|
3124
|
+
if (path) out.push({ name: path, type: "object" });
|
|
3125
|
+
for (const [key, nested] of Object.entries(node)) walk(nested, path ? path + "." + key : key);
|
|
3126
|
+
return;
|
|
3127
|
+
}
|
|
3128
|
+
out.push({ name: path, type: typeof node === "number" && Number.isInteger(node) ? "integer" : typeof node });
|
|
3129
|
+
};
|
|
3130
|
+
walk(value, prefix);
|
|
3131
|
+
return out;
|
|
3132
|
+
};
|
|
3133
|
+
|
|
3134
|
+
const schemaRows = (fields, { showLoc = false } = {}) => {
|
|
3135
|
+
if (!fields.length) return `<div class="meta-empty">—</div>`;
|
|
2896
3136
|
return fields
|
|
2897
3137
|
.map((field) => {
|
|
2898
|
-
const depth =
|
|
3138
|
+
const depth = fieldDepth(field.name);
|
|
2899
3139
|
const nestClass = depth ? " nested" : "";
|
|
2900
3140
|
const depthAttr = depth ? ` data-depth="${Math.min(depth, 4)}"` : "";
|
|
2901
3141
|
return `<div class="row">
|
|
2902
3142
|
<div class="name${nestClass}"${depthAttr}>${escapeHtml(field.name)}</div>
|
|
2903
|
-
<div class="
|
|
2904
|
-
|
|
2905
|
-
<div class="type">${escapeHtml(field.type)}</div>
|
|
2906
|
-
${field.required === true ? `<div class="flag req">Required</div>` : field.required === false ? `<div class="flag">Optional</div>` : ""}
|
|
2907
|
-
</div>
|
|
3143
|
+
<div class="type">${escapeHtml(field.type)}${showLoc && field.in && field.in !== "body" ? " · " + escapeHtml(field.in) : ""}</div>
|
|
3144
|
+
${field.required === true ? `<div class="flag req">required</div>` : field.required === false ? `<div class="flag">optional</div>` : `<div></div>`}
|
|
2908
3145
|
</div>`;
|
|
2909
3146
|
})
|
|
2910
3147
|
.join("");
|
|
2911
3148
|
};
|
|
2912
3149
|
|
|
2913
|
-
const
|
|
2914
|
-
|
|
2915
|
-
const
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
3150
|
+
const schemasPanel = (fields, resBody) => {
|
|
3151
|
+
const requestFields = fields.filter((field) => field.in === "body" || field.in === "path" || field.in === "query" || field.in === "header");
|
|
3152
|
+
const responseFields = schemaFromValue(resBody);
|
|
3153
|
+
return `<div class="schemas">
|
|
3154
|
+
<section>
|
|
3155
|
+
<h2>Request schema</h2>
|
|
3156
|
+
${schemaRows(requestFields, { showLoc: true })}
|
|
3157
|
+
</section>
|
|
3158
|
+
<section>
|
|
3159
|
+
<h2>Response schema</h2>
|
|
3160
|
+
${schemaRows(responseFields)}
|
|
3161
|
+
</section>
|
|
3162
|
+
</div>`;
|
|
2925
3163
|
};
|
|
2926
3164
|
|
|
2927
3165
|
const renderMain = () => {
|
|
2928
3166
|
const item = ops.find((entry) => entry.id === currentId);
|
|
2929
3167
|
if (!item) {
|
|
2930
|
-
document.getElementById("main").innerHTML = `<div class="empty">No operations in this workspace yet
|
|
3168
|
+
document.getElementById("main").innerHTML = `<div class="empty">No operations in this workspace yet.</div>`;
|
|
2931
3169
|
return;
|
|
2932
3170
|
}
|
|
2933
3171
|
if (scenarioIndex >= item.scenarios.length) scenarioIndex = 0;
|
|
@@ -2946,7 +3184,11 @@
|
|
|
2946
3184
|
const displayStatusText = STATUS[displayStatus] || (showingLive ? "" : statusText);
|
|
2947
3185
|
const displayEmpty = showingLive ? displayBody === undefined || displayBody === "" : emptyResponse;
|
|
2948
3186
|
const resCopyText = displayEmpty ? null : copyBodyText(displayBody);
|
|
2949
|
-
const
|
|
3187
|
+
const reqPretty = jsonMode.req !== "raw";
|
|
3188
|
+
const resPretty = jsonMode.res !== "raw";
|
|
3189
|
+
const recordedBytes = displayEmpty ? 0 : new Blob([typeof displayBody === "string" ? displayBody : JSON.stringify(displayBody)]).size;
|
|
3190
|
+
const bytes = showingLive && liveResult.bytes != null ? liveResult.bytes : recordedBytes;
|
|
3191
|
+
const ms = showingLive && liveResult.ms != null ? liveResult.ms : null;
|
|
2950
3192
|
const headersHtml = Object.keys(displayHeaders).length
|
|
2951
3193
|
? Object.entries(displayHeaders).map(([name, value]) => kv(name, value)).join("")
|
|
2952
3194
|
: `<div class="meta-empty">No headers in this header group</div>`;
|
|
@@ -2958,17 +3200,23 @@
|
|
|
2958
3200
|
.join("");
|
|
2959
3201
|
const bodyHtml =
|
|
2960
3202
|
scenario.reqBody !== undefined
|
|
2961
|
-
?
|
|
3203
|
+
? jsonBlock(scenario.reqBody, reqPretty)
|
|
2962
3204
|
: `<div class="meta-empty">No JSON body</div>`;
|
|
3205
|
+
const resHtml =
|
|
3206
|
+
showingLive && liveResult.error
|
|
3207
|
+
? `<div class="live-err">${String(liveResult.error).replace(/&/g, "&").replace(/</g, "<")}</div>`
|
|
3208
|
+
: displayEmpty
|
|
3209
|
+
? `<div class="empty">Empty body</div>`
|
|
3210
|
+
: jsonBlock(displayBody, resPretty);
|
|
2963
3211
|
|
|
2964
3212
|
document.getElementById("main").innerHTML = `
|
|
2965
|
-
<div class="head
|
|
2966
|
-
<div>
|
|
3213
|
+
<div class="ep-head">
|
|
3214
|
+
<div class="ep-head-top">
|
|
2967
3215
|
<h1 class="title">${item.title}</h1>
|
|
2968
|
-
<p class="meta-line">${item.method.toUpperCase()} ${item.path}</p>
|
|
2969
3216
|
</div>
|
|
2970
|
-
${item.
|
|
3217
|
+
<p class="meta-line"><span class="method ${item.method}">${item.method}</span><span>${item.path}</span></p>
|
|
2971
3218
|
</div>
|
|
3219
|
+
${item.scenarios.length ? `<div class="ex-block"><div class="ex-kicker">Example</div>${groupedDropdown(item.scenarios, scenarioIndex)}</div>` : ""}
|
|
2972
3220
|
<div class="urlbar">
|
|
2973
3221
|
<div class="url"><span class="method ${item.method}">${item.method}</span><span>${resolvedUrl(item, scenario)}</span></div>
|
|
2974
3222
|
<button class="btn" id="copy-curl" type="button">Copy cURL</button>
|
|
@@ -2979,6 +3227,10 @@
|
|
|
2979
3227
|
<div class="card-head">
|
|
2980
3228
|
<h2>Request</h2>
|
|
2981
3229
|
<div class="card-head-actions">
|
|
3230
|
+
<div class="mode-toggle">
|
|
3231
|
+
<button type="button" data-json="req" data-mode="pretty" class="${reqPretty ? "on" : ""}">Pretty</button>
|
|
3232
|
+
<button type="button" data-json="req" data-mode="raw" class="${reqPretty ? "" : "on"}">Raw</button>
|
|
3233
|
+
</div>
|
|
2982
3234
|
<button class="btn sm icon" id="copy-req" type="button" title="Copy body" aria-label="Copy body" ${reqCopyText ? "" : "disabled"}>${copyIcon}</button>
|
|
2983
3235
|
</div>
|
|
2984
3236
|
</div>
|
|
@@ -2991,18 +3243,25 @@
|
|
|
2991
3243
|
</section>
|
|
2992
3244
|
<section class="card response-card" id="response-card">
|
|
2993
3245
|
<div class="card-head">
|
|
2994
|
-
<h2
|
|
3246
|
+
<h2>Response</h2>
|
|
2995
3247
|
<div class="card-head-actions">
|
|
3248
|
+
<div class="res-meta">
|
|
3249
|
+
<span class="code ${displayOk ? "ok" : "err"}">${displayStatus || ""} ${escapeHtml(displayStatusText)}</span>
|
|
3250
|
+
${ms != null ? `<span>${ms} ms</span>` : ""}
|
|
3251
|
+
${bytes ? `<span>${byteLabel(bytes)}</span>` : ""}
|
|
3252
|
+
</div>
|
|
3253
|
+
<div class="mode-toggle">
|
|
3254
|
+
<button type="button" data-json="res" data-mode="pretty" class="${resPretty ? "on" : ""}">Pretty</button>
|
|
3255
|
+
<button type="button" data-json="res" data-mode="raw" class="${resPretty ? "" : "on"}">Raw</button>
|
|
3256
|
+
</div>
|
|
2996
3257
|
<button class="btn sm icon" id="copy-res" type="button" title="Copy body" aria-label="Copy body" ${resCopyText ? "" : "disabled"}>${copyIcon}</button>
|
|
2997
|
-
<span><span class="code ${displayOk ? "ok" : ""}">${displayStatus || ""}</span> <span class="code-text">${displayStatusText}</span></span>
|
|
2998
3258
|
</div>
|
|
2999
3259
|
</div>
|
|
3000
|
-
<div class="card-body" id="response-body">
|
|
3001
|
-
${showingLive && liveResult.error ? `<div class="live-err">${String(liveResult.error).replace(/&/g, "&").replace(/</g, "<")}</div>` : displayEmpty ? `<div class="empty">Empty body</div>` : `<pre>${highlight(displayBody)}</pre>`}
|
|
3002
|
-
</div>
|
|
3260
|
+
<div class="card-body" id="response-body">${resHtml}</div>
|
|
3003
3261
|
</section>
|
|
3004
3262
|
</div>
|
|
3005
|
-
${
|
|
3263
|
+
${schemasPanel(fields, displayEmpty ? undefined : displayBody)}
|
|
3264
|
+
<div class="work-foot">Generated by Notary</div>
|
|
3006
3265
|
`;
|
|
3007
3266
|
|
|
3008
3267
|
const scenarioToggle = document.getElementById("scenario-toggle");
|
|
@@ -3010,24 +3269,50 @@
|
|
|
3010
3269
|
const root = document.getElementById("scenario-dd");
|
|
3011
3270
|
scenarioToggle.onclick = (event) => {
|
|
3012
3271
|
event.stopPropagation();
|
|
3272
|
+
exampleOpen = !root.classList.contains("open");
|
|
3013
3273
|
document.querySelectorAll(".dd.open").forEach((el) => {
|
|
3014
3274
|
if (el !== root) el.classList.remove("open");
|
|
3015
3275
|
});
|
|
3016
|
-
root.classList.toggle("open");
|
|
3276
|
+
root.classList.toggle("open", exampleOpen);
|
|
3277
|
+
if (exampleOpen) document.getElementById("example-search")?.focus();
|
|
3017
3278
|
};
|
|
3279
|
+
const exSearch = document.getElementById("example-search");
|
|
3280
|
+
if (exSearch) {
|
|
3281
|
+
exSearch.onclick = (event) => event.stopPropagation();
|
|
3282
|
+
exSearch.oninput = (event) => {
|
|
3283
|
+
exampleQuery = event.target.value;
|
|
3284
|
+
exampleOpen = true;
|
|
3285
|
+
const pos = event.target.selectionStart;
|
|
3286
|
+
renderMain();
|
|
3287
|
+
const next = document.getElementById("example-search");
|
|
3288
|
+
if (next) {
|
|
3289
|
+
next.focus();
|
|
3290
|
+
next.selectionStart = next.selectionEnd = pos;
|
|
3291
|
+
}
|
|
3292
|
+
};
|
|
3293
|
+
}
|
|
3018
3294
|
root.querySelectorAll(".dd-item").forEach((button) => {
|
|
3019
3295
|
button.onclick = (event) => {
|
|
3020
3296
|
event.stopPropagation();
|
|
3021
3297
|
scenarioIndex = Number(button.dataset.index);
|
|
3022
3298
|
liveResult = null;
|
|
3023
|
-
|
|
3024
|
-
|
|
3299
|
+
exampleOpen = false;
|
|
3300
|
+
exampleQuery = "";
|
|
3025
3301
|
renderNav();
|
|
3026
3302
|
renderMain();
|
|
3027
3303
|
};
|
|
3028
3304
|
});
|
|
3305
|
+
root.onclick = (event) => event.stopPropagation();
|
|
3029
3306
|
}
|
|
3030
3307
|
|
|
3308
|
+
document.querySelectorAll("[data-json]").forEach((button) => {
|
|
3309
|
+
button.onclick = (event) => {
|
|
3310
|
+
event.stopPropagation();
|
|
3311
|
+
jsonMode[button.dataset.json] = button.dataset.mode;
|
|
3312
|
+
renderMain();
|
|
3313
|
+
};
|
|
3314
|
+
});
|
|
3315
|
+
|
|
3031
3316
|
const syncResponseHeight = () => {
|
|
3032
3317
|
const requestCard = document.getElementById("request-card");
|
|
3033
3318
|
const responseCard = document.getElementById("response-card");
|
|
@@ -3058,7 +3343,14 @@
|
|
|
3058
3343
|
sendBtn.textContent = "Sending…";
|
|
3059
3344
|
try {
|
|
3060
3345
|
const result = await sendRequest(item, scenario);
|
|
3061
|
-
liveResult = {
|
|
3346
|
+
liveResult = {
|
|
3347
|
+
id: item.id,
|
|
3348
|
+
scenarioIndex,
|
|
3349
|
+
status: result.status,
|
|
3350
|
+
body: result.body,
|
|
3351
|
+
ms: result.ms,
|
|
3352
|
+
bytes: result.bytes,
|
|
3353
|
+
};
|
|
3062
3354
|
} catch (error) {
|
|
3063
3355
|
const message = error instanceof Error ? error.message : String(error);
|
|
3064
3356
|
liveResult = {
|
|
@@ -3080,8 +3372,15 @@
|
|
|
3080
3372
|
currentId = id;
|
|
3081
3373
|
scenarioIndex = typeof nextScenarioIndex === "number" ? nextScenarioIndex : 0;
|
|
3082
3374
|
liveResult = null;
|
|
3375
|
+
exampleOpen = false;
|
|
3376
|
+
exampleQuery = "";
|
|
3083
3377
|
const selected = ops.find((entry) => entry.id === id);
|
|
3084
|
-
if (selected)
|
|
3378
|
+
if (selected) {
|
|
3379
|
+
syncHeaderGroupForOp(selected.op);
|
|
3380
|
+
const version = treePathSegments(selected)[0];
|
|
3381
|
+
if (version) activeVersion = version;
|
|
3382
|
+
expandedExampleOps.add(id);
|
|
3383
|
+
}
|
|
3085
3384
|
renderNav();
|
|
3086
3385
|
renderMain();
|
|
3087
3386
|
history.replaceState(null, "", "#" + encodeURIComponent(id));
|
|
@@ -3124,11 +3423,37 @@
|
|
|
3124
3423
|
document.getElementById("search-wrap").addEventListener("click", (event) => event.stopPropagation());
|
|
3125
3424
|
|
|
3126
3425
|
document.addEventListener("click", () => {
|
|
3426
|
+
exampleOpen = false;
|
|
3127
3427
|
document.querySelectorAll(".dd.open").forEach((el) => el.classList.remove("open"));
|
|
3128
3428
|
document.getElementById("env-wrap").classList.remove("open");
|
|
3129
3429
|
if (document.body.classList.contains("searching")) closeSearch({ clear: true });
|
|
3130
3430
|
});
|
|
3131
3431
|
|
|
3432
|
+
document.addEventListener("keydown", (event) => {
|
|
3433
|
+
if ((event.metaKey || event.ctrlKey) && event.key.toLowerCase() === "k") {
|
|
3434
|
+
event.preventDefault();
|
|
3435
|
+
document.getElementById("search")?.focus();
|
|
3436
|
+
}
|
|
3437
|
+
});
|
|
3438
|
+
|
|
3439
|
+
const verSelect = document.getElementById("ver-select");
|
|
3440
|
+
if (verSelect) {
|
|
3441
|
+
if (!apiVersions.length) verSelect.hidden = true;
|
|
3442
|
+
else {
|
|
3443
|
+
verSelect.innerHTML = apiVersions.map((name) => `<option value="${escapeAttr(name)}">${escapeHtml(name)}</option>`).join("");
|
|
3444
|
+
verSelect.value = activeVersion;
|
|
3445
|
+
verSelect.onchange = () => {
|
|
3446
|
+
activeVersion = verSelect.value;
|
|
3447
|
+
const first = visibleOps()[0];
|
|
3448
|
+
if (first) select(first.id);
|
|
3449
|
+
else {
|
|
3450
|
+
renderNav();
|
|
3451
|
+
renderMain();
|
|
3452
|
+
}
|
|
3453
|
+
};
|
|
3454
|
+
}
|
|
3455
|
+
}
|
|
3456
|
+
|
|
3132
3457
|
const initial = decodeURIComponent(location.hash.replace(/^#/, "")) || ops[0]?.id;
|
|
3133
3458
|
select(ops.some((item) => item.id === initial) ? initial : ops[0]?.id);
|
|
3134
3459
|
|