@scalar/api-client 3.2.1 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/dist/style.css +102 -130
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.js.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js +9 -0
- package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js.map +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +2 -0
- package/dist/v2/blocks/operation-block/components/Header.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.js +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.js.map +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.script.js +20 -10
- package/dist/v2/blocks/operation-block/components/Header.vue.script.js.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/send-request.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/send-request.js +2 -2
- package/dist/v2/blocks/operation-block/helpers/send-request.js.map +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +2 -2
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +2 -2
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.d.ts +2 -2
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.script.js.map +1 -1
- package/dist/v2/components/server/ServerDropdown.vue.d.ts +2 -2
- package/dist/v2/components/sidebar/Sidebar.vue.script.js +2 -2
- package/dist/v2/components/sidebar/Sidebar.vue.script.js.map +1 -1
- package/dist/v2/constants.js +1 -1
- package/dist/v2/features/app/App.vue.d.ts +22 -4
- package/dist/v2/features/app/App.vue.d.ts.map +1 -1
- package/dist/v2/features/app/App.vue.js.map +1 -1
- package/dist/v2/features/app/App.vue.script.js +57 -54
- package/dist/v2/features/app/App.vue.script.js.map +1 -1
- package/dist/v2/features/app/app-events.d.ts.map +1 -1
- package/dist/v2/features/app/app-events.js +4 -0
- package/dist/v2/features/app/app-events.js.map +1 -1
- package/dist/v2/features/app/app-state.d.ts +7 -1
- package/dist/v2/features/app/app-state.d.ts.map +1 -1
- package/dist/v2/features/app/app-state.js +24 -4
- package/dist/v2/features/app/app-state.js.map +1 -1
- package/dist/v2/features/app/components/AppHeader.vue.d.ts +20 -0
- package/dist/v2/features/app/components/AppHeader.vue.d.ts.map +1 -0
- package/dist/v2/features/app/components/AppHeader.vue.js +7 -0
- package/dist/v2/features/app/components/AppHeader.vue.js.map +1 -0
- package/dist/v2/features/app/components/AppHeader.vue.script.js +43 -0
- package/dist/v2/features/app/components/AppHeader.vue.script.js.map +1 -0
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts +17 -56
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue.js +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue.js.map +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue.script.js +437 -271
- package/dist/v2/features/app/components/AppSidebar.vue.script.js.map +1 -1
- package/dist/v2/features/app/helpers/load-registry-document.d.ts +18 -0
- package/dist/v2/features/app/helpers/load-registry-document.d.ts.map +1 -0
- package/dist/v2/features/app/helpers/load-registry-document.js +45 -0
- package/dist/v2/features/app/helpers/load-registry-document.js.map +1 -0
- package/dist/v2/features/app/helpers/routes.d.ts +6 -1
- package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
- package/dist/v2/features/app/helpers/routes.js +84 -75
- package/dist/v2/features/app/helpers/routes.js.map +1 -1
- package/dist/v2/features/app/hooks/use-document-filter.d.ts +38 -0
- package/dist/v2/features/app/hooks/use-document-filter.d.ts.map +1 -0
- package/dist/v2/features/app/hooks/use-document-filter.js +63 -0
- package/dist/v2/features/app/hooks/use-document-filter.js.map +1 -0
- package/dist/v2/features/app/hooks/use-sidebar-context-menu.d.ts +17258 -0
- package/dist/v2/features/app/hooks/use-sidebar-context-menu.d.ts.map +1 -0
- package/dist/v2/features/app/hooks/use-sidebar-context-menu.js +107 -0
- package/dist/v2/features/app/hooks/use-sidebar-context-menu.js.map +1 -0
- package/dist/v2/features/app/hooks/use-sidebar-documents.d.ts +95 -0
- package/dist/v2/features/app/hooks/use-sidebar-documents.d.ts.map +1 -0
- package/dist/v2/features/app/hooks/use-sidebar-documents.js +97 -0
- package/dist/v2/features/app/hooks/use-sidebar-documents.js.map +1 -0
- package/dist/v2/features/app/index.d.ts +1 -0
- package/dist/v2/features/app/index.d.ts.map +1 -1
- package/dist/v2/features/collection/components/GetStarted.vue.d.ts +13 -0
- package/dist/v2/features/collection/components/GetStarted.vue.d.ts.map +1 -0
- package/dist/v2/features/collection/components/GetStarted.vue.js +7 -0
- package/dist/v2/features/collection/components/GetStarted.vue.js.map +1 -0
- package/dist/v2/features/collection/components/GetStarted.vue.script.js +101 -0
- package/dist/v2/features/collection/components/GetStarted.vue.script.js.map +1 -0
- package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.d.ts +7 -1
- package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.d.ts.map +1 -1
- package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.js.map +1 -1
- package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.script.js +29 -10
- package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.script.js.map +1 -1
- package/dist/v2/features/command-palette/helpers/generate-unique-slug.d.ts +4 -0
- package/dist/v2/features/command-palette/helpers/generate-unique-slug.d.ts.map +1 -1
- package/dist/v2/features/command-palette/helpers/generate-unique-slug.js +5 -1
- package/dist/v2/features/command-palette/helpers/generate-unique-slug.js.map +1 -1
- package/dist/v2/features/search/components/DocumentSearchModal.vue.d.ts +16 -0
- package/dist/v2/features/search/components/DocumentSearchModal.vue.d.ts.map +1 -0
- package/dist/v2/features/search/components/DocumentSearchModal.vue.js +9 -0
- package/dist/v2/features/search/components/DocumentSearchModal.vue.js.map +1 -0
- package/dist/v2/features/search/components/DocumentSearchModal.vue.script.js +123 -0
- package/dist/v2/features/search/components/DocumentSearchModal.vue.script.js.map +1 -0
- package/dist/v2/features/search/components/SearchResult.vue.d.ts +11 -0
- package/dist/v2/features/search/components/SearchResult.vue.d.ts.map +1 -0
- package/dist/v2/features/search/components/SearchResult.vue.js +7 -0
- package/dist/v2/features/search/components/SearchResult.vue.js.map +1 -0
- package/dist/v2/features/search/components/SearchResult.vue.script.js +71 -0
- package/dist/v2/features/search/components/SearchResult.vue.script.js.map +1 -0
- package/dist/v2/features/search/hooks/use-document-search.d.ts +19 -0
- package/dist/v2/features/search/hooks/use-document-search.d.ts.map +1 -0
- package/dist/v2/features/search/hooks/use-document-search.js +42 -0
- package/dist/v2/features/search/hooks/use-document-search.js.map +1 -0
- package/dist/v2/features/search/index.d.ts +2 -0
- package/dist/v2/features/search/index.d.ts.map +1 -1
- package/dist/v2/features/search/index.js +3 -1
- package/dist/v2/helpers/handle-hotkeys.d.ts.map +1 -1
- package/dist/v2/helpers/handle-hotkeys.js +8 -4
- package/dist/v2/helpers/handle-hotkeys.js.map +1 -1
- package/dist/v2/types/configuration.d.ts +1 -0
- package/dist/v2/types/configuration.d.ts.map +1 -1
- package/package.json +13 -12
- package/dist/assets/rabbit.ascii.virtual.js +0 -6
- package/dist/assets/rabbit.ascii.virtual.js.map +0 -1
- package/dist/assets/rabbitjump.ascii.virtual.js +0 -6
- package/dist/assets/rabbitjump.ascii.virtual.js.map +0 -1
- package/dist/v2/features/app/components/DownloadAppButton.vue.d.ts +0 -4
- package/dist/v2/features/app/components/DownloadAppButton.vue.d.ts.map +0 -1
- package/dist/v2/features/app/components/DownloadAppButton.vue.js +0 -9
- package/dist/v2/features/app/components/DownloadAppButton.vue.js.map +0 -1
- package/dist/v2/features/app/components/DownloadAppButton.vue.script.js +0 -21
- package/dist/v2/features/app/components/DownloadAppButton.vue.script.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @scalar/api-client
|
|
2
2
|
|
|
3
|
+
## 3.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#8972](https://github.com/scalar/scalar/pull/8972): feat: implement the new workspace sidebar
|
|
8
|
+
- [#8977](https://github.com/scalar/scalar/pull/8977): feat: add app header
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- [#8978](https://github.com/scalar/scalar/pull/8978): fix: layout height collapse and improve menu behavior
|
|
13
|
+
|
|
14
|
+
## 3.2.2
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- [#8952](https://github.com/scalar/scalar/pull/8952): Export shared Scalar custom header constants from `@scalar/helpers/http/scalar-headers` and consume them in request build/send flows.
|
|
19
|
+
- [#8950](https://github.com/scalar/scalar/pull/8950): fix: correctly handle custom file imports
|
|
20
|
+
- [#8951](https://github.com/scalar/scalar/pull/8951): fix: api client initial routing
|
|
21
|
+
|
|
3
22
|
## 3.2.1
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
package/dist/style.css
CHANGED
|
@@ -588,6 +588,7 @@
|
|
|
588
588
|
--ease-in: cubic-bezier(.4, 0, 1, 1);
|
|
589
589
|
--ease-out: cubic-bezier(0, 0, .2, 1);
|
|
590
590
|
--ease-in-out: cubic-bezier(.4, 0, .2, 1);
|
|
591
|
+
--animate-pulse: pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;
|
|
591
592
|
--default-transition-duration: .15s;
|
|
592
593
|
--default-transition-timing-function: cubic-bezier(.4, 0, .2, 1);
|
|
593
594
|
--tracking-tight: -.025em;
|
|
@@ -983,6 +984,10 @@
|
|
|
983
984
|
.scalar-app .bg-b-1\.5 {
|
|
984
985
|
background-color: color-mix(in srgb, var(--scalar-background-1), var(--scalar-background-2));
|
|
985
986
|
}
|
|
987
|
+
|
|
988
|
+
.scalar-app .bg-sidebar-c-2\/15 {
|
|
989
|
+
background-color: color-mix(in oklab, var(--scalar-sidebar-color-2, var(--scalar-color-2)) 15%, transparent);
|
|
990
|
+
}
|
|
986
991
|
}
|
|
987
992
|
|
|
988
993
|
@supports (background-image: linear-gradient(in lab, red, red)) {
|
|
@@ -1496,6 +1501,12 @@
|
|
|
1496
1501
|
inherits: false
|
|
1497
1502
|
}
|
|
1498
1503
|
|
|
1504
|
+
@keyframes pulse {
|
|
1505
|
+
50% {
|
|
1506
|
+
opacity: .5;
|
|
1507
|
+
}
|
|
1508
|
+
}
|
|
1509
|
+
|
|
1499
1510
|
.sidebar-heading-type[data-v-1857170e] {
|
|
1500
1511
|
text-transform: uppercase;
|
|
1501
1512
|
color: var(--method-color, var(--scalar-color-1));
|
|
@@ -2592,6 +2603,10 @@
|
|
|
2592
2603
|
bottom: 0;
|
|
2593
2604
|
}
|
|
2594
2605
|
|
|
2606
|
+
.group\/item:last-of-type > .group\/button > .group\/button-label > .group\/button-loading {
|
|
2607
|
+
width: 66.6667%;
|
|
2608
|
+
}
|
|
2609
|
+
|
|
2595
2610
|
.group\/items.-translate-x-full .group\/button {
|
|
2596
2611
|
transition-behavior: allow-discrete;
|
|
2597
2612
|
max-height: 0;
|
|
@@ -2860,10 +2875,6 @@
|
|
|
2860
2875
|
}
|
|
2861
2876
|
}
|
|
2862
2877
|
|
|
2863
|
-
.scalar-app .invisible {
|
|
2864
|
-
visibility: hidden;
|
|
2865
|
-
}
|
|
2866
|
-
|
|
2867
2878
|
.scalar-app .-inset-y-0\.5 {
|
|
2868
2879
|
inset-block: -2px;
|
|
2869
2880
|
}
|
|
@@ -3032,10 +3043,6 @@
|
|
|
3032
3043
|
margin: -8px;
|
|
3033
3044
|
}
|
|
3034
3045
|
|
|
3035
|
-
.scalar-app .-m-px {
|
|
3036
|
-
margin: -1px;
|
|
3037
|
-
}
|
|
3038
|
-
|
|
3039
3046
|
.scalar-app .m-1 {
|
|
3040
3047
|
margin: 4px;
|
|
3041
3048
|
}
|
|
@@ -3064,6 +3071,10 @@
|
|
|
3064
3071
|
margin-block: -8px;
|
|
3065
3072
|
}
|
|
3066
3073
|
|
|
3074
|
+
.scalar-app .-my-px {
|
|
3075
|
+
margin-block: -1px;
|
|
3076
|
+
}
|
|
3077
|
+
|
|
3067
3078
|
.scalar-app .my-0\.75 {
|
|
3068
3079
|
margin-block: 3px;
|
|
3069
3080
|
}
|
|
@@ -3378,6 +3389,10 @@
|
|
|
3378
3389
|
scale: var(--tw-scale-x) var(--tw-scale-y);
|
|
3379
3390
|
}
|
|
3380
3391
|
|
|
3392
|
+
.scalar-app .animate-pulse {
|
|
3393
|
+
animation: var(--animate-pulse);
|
|
3394
|
+
}
|
|
3395
|
+
|
|
3381
3396
|
.scalar-app .appearance-none {
|
|
3382
3397
|
appearance: none;
|
|
3383
3398
|
}
|
|
@@ -3537,6 +3552,16 @@
|
|
|
3537
3552
|
background-color: var(--scalar-sidebar-search-background, var(--scalar-background-2));
|
|
3538
3553
|
}
|
|
3539
3554
|
|
|
3555
|
+
.scalar-app .bg-sidebar-c-2\/15 {
|
|
3556
|
+
background-color: var(--scalar-sidebar-color-2, var(--scalar-color-2));
|
|
3557
|
+
}
|
|
3558
|
+
|
|
3559
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
3560
|
+
.scalar-app .bg-sidebar-c-2\/15 {
|
|
3561
|
+
background-color: color-mix(in oklab, var(--scalar-sidebar-color-2, var(--scalar-color-2)) 15%, transparent);
|
|
3562
|
+
}
|
|
3563
|
+
}
|
|
3564
|
+
|
|
3540
3565
|
.scalar-app .bg-sidebar-indent-border {
|
|
3541
3566
|
background-color: var(--scalar-sidebar-indent-border, var(--scalar-border-color));
|
|
3542
3567
|
}
|
|
@@ -3620,12 +3645,12 @@
|
|
|
3620
3645
|
mask-repeat: repeat;
|
|
3621
3646
|
}
|
|
3622
3647
|
|
|
3623
|
-
.scalar-app .
|
|
3624
|
-
padding:
|
|
3648
|
+
.scalar-app .px-1\.25 {
|
|
3649
|
+
padding-inline: 5px;
|
|
3625
3650
|
}
|
|
3626
3651
|
|
|
3627
|
-
.scalar-app .
|
|
3628
|
-
padding:
|
|
3652
|
+
.scalar-app .px-3\.5 {
|
|
3653
|
+
padding-inline: 14px;
|
|
3629
3654
|
}
|
|
3630
3655
|
|
|
3631
3656
|
.scalar-app .px-9 {
|
|
@@ -3687,11 +3712,6 @@
|
|
|
3687
3712
|
font-weight: var(--scalar-sidebar-font-weight, var(--scalar-regular));
|
|
3688
3713
|
}
|
|
3689
3714
|
|
|
3690
|
-
.scalar-app .font-sidebar-active {
|
|
3691
|
-
--tw-font-weight: var(--scalar-sidebar-font-weight-active, var(--scalar-semibold));
|
|
3692
|
-
font-weight: var(--scalar-sidebar-font-weight-active, var(--scalar-semibold));
|
|
3693
|
-
}
|
|
3694
|
-
|
|
3695
3715
|
.scalar-app .break-words, .scalar-app .wrap-break-word {
|
|
3696
3716
|
overflow-wrap: break-word;
|
|
3697
3717
|
}
|
|
@@ -3712,10 +3732,6 @@
|
|
|
3712
3732
|
color: var(--scalar-tooltip-color);
|
|
3713
3733
|
}
|
|
3714
3734
|
|
|
3715
|
-
.scalar-app .text-sidebar-c-1 {
|
|
3716
|
-
color: var(--scalar-sidebar-color-1, var(--scalar-color-1));
|
|
3717
|
-
}
|
|
3718
|
-
|
|
3719
3735
|
.scalar-app .text-sidebar-c-active {
|
|
3720
3736
|
color: var(--scalar-sidebar-color-active, var(--scalar-sidebar-color-1));
|
|
3721
3737
|
}
|
|
@@ -4142,6 +4158,10 @@
|
|
|
4142
4158
|
visibility: collapse;
|
|
4143
4159
|
}
|
|
4144
4160
|
|
|
4161
|
+
.scalar-app .invisible {
|
|
4162
|
+
visibility: hidden;
|
|
4163
|
+
}
|
|
4164
|
+
|
|
4145
4165
|
.scalar-app .visible {
|
|
4146
4166
|
visibility: visible;
|
|
4147
4167
|
}
|
|
@@ -4236,10 +4256,6 @@
|
|
|
4236
4256
|
inset-inline-end: 4px;
|
|
4237
4257
|
}
|
|
4238
4258
|
|
|
4239
|
-
.scalar-app .-top-0\.5 {
|
|
4240
|
-
top: -2px;
|
|
4241
|
-
}
|
|
4242
|
-
|
|
4243
4259
|
.scalar-app .top-0 {
|
|
4244
4260
|
top: 0;
|
|
4245
4261
|
}
|
|
@@ -4260,10 +4276,6 @@
|
|
|
4260
4276
|
top: calc(100% + 4px);
|
|
4261
4277
|
}
|
|
4262
4278
|
|
|
4263
|
-
.scalar-app .-right-0\.5 {
|
|
4264
|
-
right: -2px;
|
|
4265
|
-
}
|
|
4266
|
-
|
|
4267
4279
|
.scalar-app .-right-\[30px\] {
|
|
4268
4280
|
right: -30px;
|
|
4269
4281
|
}
|
|
@@ -4410,6 +4422,10 @@
|
|
|
4410
4422
|
margin: -2px;
|
|
4411
4423
|
}
|
|
4412
4424
|
|
|
4425
|
+
.scalar-app .-m-px {
|
|
4426
|
+
margin: -1px;
|
|
4427
|
+
}
|
|
4428
|
+
|
|
4413
4429
|
.scalar-app .m-0 {
|
|
4414
4430
|
margin: 0;
|
|
4415
4431
|
}
|
|
@@ -4767,10 +4783,6 @@
|
|
|
4767
4783
|
height: 500px;
|
|
4768
4784
|
}
|
|
4769
4785
|
|
|
4770
|
-
.scalar-app .h-\[68px\] {
|
|
4771
|
-
height: 68px;
|
|
4772
|
-
}
|
|
4773
|
-
|
|
4774
4786
|
.scalar-app .h-\[300px\] {
|
|
4775
4787
|
height: 300px;
|
|
4776
4788
|
}
|
|
@@ -4795,10 +4807,6 @@
|
|
|
4795
4807
|
height: 100%;
|
|
4796
4808
|
}
|
|
4797
4809
|
|
|
4798
|
-
.scalar-app .h-header {
|
|
4799
|
-
height: 48px;
|
|
4800
|
-
}
|
|
4801
|
-
|
|
4802
4810
|
.scalar-app .h-min {
|
|
4803
4811
|
height: min-content;
|
|
4804
4812
|
}
|
|
@@ -4975,10 +4983,6 @@
|
|
|
4975
4983
|
width: 288px;
|
|
4976
4984
|
}
|
|
4977
4985
|
|
|
4978
|
-
.scalar-app .w-\[60px\] {
|
|
4979
|
-
width: 60px;
|
|
4980
|
-
}
|
|
4981
|
-
|
|
4982
4986
|
.scalar-app .w-\[100px\] {
|
|
4983
4987
|
width: 100px;
|
|
4984
4988
|
}
|
|
@@ -5870,6 +5874,10 @@
|
|
|
5870
5874
|
padding: 0 !important;
|
|
5871
5875
|
}
|
|
5872
5876
|
|
|
5877
|
+
.scalar-app .p-\(--scalar-sidebar-padding\) {
|
|
5878
|
+
padding: var(--scalar-sidebar-padding);
|
|
5879
|
+
}
|
|
5880
|
+
|
|
5873
5881
|
.scalar-app .p-0 {
|
|
5874
5882
|
padding: 0;
|
|
5875
5883
|
}
|
|
@@ -5914,6 +5922,10 @@
|
|
|
5914
5922
|
padding: 16px;
|
|
5915
5923
|
}
|
|
5916
5924
|
|
|
5925
|
+
.scalar-app .p-6 {
|
|
5926
|
+
padding: 24px;
|
|
5927
|
+
}
|
|
5928
|
+
|
|
5917
5929
|
.scalar-app .p-\[3px\] {
|
|
5918
5930
|
padding: 3px;
|
|
5919
5931
|
}
|
|
@@ -5922,6 +5934,10 @@
|
|
|
5922
5934
|
padding: 1px;
|
|
5923
5935
|
}
|
|
5924
5936
|
|
|
5937
|
+
.scalar-app .px-\(--scalar-sidebar-padding\) {
|
|
5938
|
+
padding-inline: var(--scalar-sidebar-padding);
|
|
5939
|
+
}
|
|
5940
|
+
|
|
5925
5941
|
.scalar-app .px-0 {
|
|
5926
5942
|
padding-inline: 0;
|
|
5927
5943
|
}
|
|
@@ -5942,10 +5958,6 @@
|
|
|
5942
5958
|
padding-inline: 6px;
|
|
5943
5959
|
}
|
|
5944
5960
|
|
|
5945
|
-
.scalar-app .px-1\.25 {
|
|
5946
|
-
padding-inline: 5px;
|
|
5947
|
-
}
|
|
5948
|
-
|
|
5949
5961
|
.scalar-app .px-2 {
|
|
5950
5962
|
padding-inline: 8px;
|
|
5951
5963
|
}
|
|
@@ -5958,10 +5970,6 @@
|
|
|
5958
5970
|
padding-inline: 12px;
|
|
5959
5971
|
}
|
|
5960
5972
|
|
|
5961
|
-
.scalar-app .px-3\.5 {
|
|
5962
|
-
padding-inline: 14px;
|
|
5963
|
-
}
|
|
5964
|
-
|
|
5965
5973
|
.scalar-app .px-4 {
|
|
5966
5974
|
padding-inline: 16px;
|
|
5967
5975
|
}
|
|
@@ -6126,6 +6134,10 @@
|
|
|
6126
6134
|
padding-right: 26px;
|
|
6127
6135
|
}
|
|
6128
6136
|
|
|
6137
|
+
.scalar-app .pb-1 {
|
|
6138
|
+
padding-bottom: 4px;
|
|
6139
|
+
}
|
|
6140
|
+
|
|
6129
6141
|
.scalar-app .pb-1\.5 {
|
|
6130
6142
|
padding-bottom: 6px;
|
|
6131
6143
|
}
|
|
@@ -6345,6 +6357,11 @@
|
|
|
6345
6357
|
font-weight: var(--scalar-regular);
|
|
6346
6358
|
}
|
|
6347
6359
|
|
|
6360
|
+
.scalar-app .font-sidebar-active {
|
|
6361
|
+
--tw-font-weight: var(--scalar-sidebar-font-weight-active, var(--scalar-semibold));
|
|
6362
|
+
font-weight: var(--scalar-sidebar-font-weight-active, var(--scalar-semibold));
|
|
6363
|
+
}
|
|
6364
|
+
|
|
6348
6365
|
.scalar-app .tracking-tight {
|
|
6349
6366
|
--tw-tracking: var(--tracking-tight);
|
|
6350
6367
|
letter-spacing: var(--tracking-tight);
|
|
@@ -6467,6 +6484,10 @@
|
|
|
6467
6484
|
color: var(--scalar-color-red);
|
|
6468
6485
|
}
|
|
6469
6486
|
|
|
6487
|
+
.scalar-app .text-sidebar-c-1 {
|
|
6488
|
+
color: var(--scalar-sidebar-color-1, var(--scalar-color-1));
|
|
6489
|
+
}
|
|
6490
|
+
|
|
6470
6491
|
.scalar-app .text-sidebar-c-2 {
|
|
6471
6492
|
color: var(--scalar-sidebar-color-2, var(--scalar-color-2));
|
|
6472
6493
|
}
|
|
@@ -6983,6 +7004,10 @@
|
|
|
6983
7004
|
border-radius: var(--scalar-radius);
|
|
6984
7005
|
}
|
|
6985
7006
|
|
|
7007
|
+
:is(.scalar-app .\*\:first\:flex-none > *):first-child {
|
|
7008
|
+
flex: none;
|
|
7009
|
+
}
|
|
7010
|
+
|
|
6986
7011
|
:is(.scalar-app .\*\:first\:rounded-l > *):first-child {
|
|
6987
7012
|
border-top-left-radius: var(--scalar-radius);
|
|
6988
7013
|
border-bottom-left-radius: var(--scalar-radius);
|
|
@@ -7116,6 +7141,10 @@
|
|
|
7116
7141
|
color: var(--scalar-color-red);
|
|
7117
7142
|
}
|
|
7118
7143
|
|
|
7144
|
+
.scalar-app .hover\:text-sidebar-c-1:hover {
|
|
7145
|
+
color: var(--scalar-sidebar-color-1, var(--scalar-color-1));
|
|
7146
|
+
}
|
|
7147
|
+
|
|
7119
7148
|
.scalar-app .hover\:underline:hover {
|
|
7120
7149
|
text-decoration-line: underline;
|
|
7121
7150
|
}
|
|
@@ -7270,19 +7299,6 @@
|
|
|
7270
7299
|
}
|
|
7271
7300
|
}
|
|
7272
7301
|
|
|
7273
|
-
@media (min-width: 600px) {
|
|
7274
|
-
.scalar-app .sm\:not-sr-only {
|
|
7275
|
-
clip-path: none;
|
|
7276
|
-
white-space: normal;
|
|
7277
|
-
width: auto;
|
|
7278
|
-
height: auto;
|
|
7279
|
-
margin: 0;
|
|
7280
|
-
padding: 0;
|
|
7281
|
-
position: static;
|
|
7282
|
-
overflow: visible;
|
|
7283
|
-
}
|
|
7284
|
-
}
|
|
7285
|
-
|
|
7286
7302
|
@media (min-width: 800px) {
|
|
7287
7303
|
.scalar-app .md\:pointer-events-none {
|
|
7288
7304
|
pointer-events: none;
|
|
@@ -7936,11 +7952,11 @@
|
|
|
7936
7952
|
--scalar-address-bar-bg: var(--scalar-background-1);
|
|
7937
7953
|
}
|
|
7938
7954
|
|
|
7939
|
-
.app-exit-button[data-v-
|
|
7955
|
+
.app-exit-button[data-v-1c2b0dae] {
|
|
7940
7956
|
color: white;
|
|
7941
7957
|
background: rgba(0, 0, 0, 0.1);
|
|
7942
7958
|
}
|
|
7943
|
-
.app-exit-button[data-v-
|
|
7959
|
+
.app-exit-button[data-v-1c2b0dae]:hover {
|
|
7944
7960
|
background: rgba(255, 255, 255, 0.1);
|
|
7945
7961
|
}
|
|
7946
7962
|
|
|
@@ -8352,77 +8368,33 @@ to {
|
|
|
8352
8368
|
bottom: 0;
|
|
8353
8369
|
}
|
|
8354
8370
|
|
|
8355
|
-
.
|
|
8356
|
-
|
|
8357
|
-
|
|
8358
|
-
|
|
8359
|
-
|
|
8360
|
-
|
|
8361
|
-
|
|
8362
|
-
|
|
8363
|
-
|
|
8364
|
-
|
|
8365
|
-
|
|
8366
|
-
background: linear-gradient(rgba(0, 0, 0, 0.15), rgba(255, 255, 255, 0.1));
|
|
8371
|
+
.ref-search-meta[data-v-a00657cc] {
|
|
8372
|
+
background: var(--scalar-background-1);
|
|
8373
|
+
border-bottom-left-radius: var(--scalar-radius-lg);
|
|
8374
|
+
border-bottom-right-radius: var(--scalar-radius-lg);
|
|
8375
|
+
padding: 6px 12px;
|
|
8376
|
+
font-size: var(--scalar-font-size-4);
|
|
8377
|
+
color: var(--scalar-color-3);
|
|
8378
|
+
font-weight: var(--scalar-semibold);
|
|
8379
|
+
display: flex;
|
|
8380
|
+
gap: 12px;
|
|
8381
|
+
border-top: var(--scalar-border-width) solid var(--scalar-border-color);
|
|
8367
8382
|
}
|
|
8368
8383
|
|
|
8369
|
-
|
|
8370
|
-
|
|
8371
|
-
|
|
8372
|
-
|
|
8373
|
-
|
|
8374
|
-
|
|
8375
|
-
|
|
8376
|
-
opacity: 0;
|
|
8377
|
-
}
|
|
8378
|
-
.empty-sidebar-item:hover .rabbitjump[data-v-8269f62b] {
|
|
8379
|
-
opacity: 1;
|
|
8380
|
-
animation: rabbitAnimation-8269f62b 0.5s steps(1) infinite;
|
|
8381
|
-
}
|
|
8382
|
-
.empty-sidebar-item:hover .rabbitsit[data-v-8269f62b] {
|
|
8383
|
-
opacity: 0;
|
|
8384
|
-
animation: rabbitAnimation2-8269f62b 0.5s steps(1) infinite;
|
|
8385
|
-
}
|
|
8386
|
-
.empty-sidebar-item:hover .rabbit-ascii[data-v-8269f62b] {
|
|
8387
|
-
animation: rabbitRun-8269f62b 8s infinite linear;
|
|
8388
|
-
}
|
|
8389
|
-
@keyframes rabbitRun-8269f62b {
|
|
8390
|
-
0% {
|
|
8391
|
-
transform: translate3d(0, 0, 0);
|
|
8392
|
-
}
|
|
8393
|
-
25% {
|
|
8394
|
-
transform: translate3d(250px, 0, 0);
|
|
8395
|
-
}
|
|
8396
|
-
25.01% {
|
|
8397
|
-
transform: translate3d(-250px, 0, 0);
|
|
8398
|
-
}
|
|
8399
|
-
75% {
|
|
8400
|
-
transform: translate3d(250px, 0, 0);
|
|
8401
|
-
}
|
|
8402
|
-
75.01% {
|
|
8403
|
-
transform: translate3d(-250px, 0, 0);
|
|
8404
|
-
}
|
|
8405
|
-
100% {
|
|
8406
|
-
transform: translate3d(0, 0, 0);
|
|
8407
|
-
}
|
|
8384
|
+
/*
|
|
8385
|
+
* Gentle pulse for the registry loading skeletons. Matches the existing
|
|
8386
|
+
* `LoadingSkeleton.vue` easing/duration used in `@scalar/api-reference` so
|
|
8387
|
+
* any skeleton in the app feels consistent.
|
|
8388
|
+
*/
|
|
8389
|
+
.sidebar-skeleton-row > span[data-v-e803152c] {
|
|
8390
|
+
animation: sidebar-skeleton-pulse-e803152c 1.5s infinite alternate;
|
|
8408
8391
|
}
|
|
8409
|
-
@keyframes
|
|
8410
|
-
|
|
8411
|
-
100% {
|
|
8392
|
+
@keyframes sidebar-skeleton-pulse-e803152c {
|
|
8393
|
+
from {
|
|
8412
8394
|
opacity: 1;
|
|
8413
8395
|
}
|
|
8414
|
-
|
|
8415
|
-
opacity: 0;
|
|
8416
|
-
}
|
|
8417
|
-
}
|
|
8418
|
-
@keyframes rabbitAnimation2-8269f62b {
|
|
8419
|
-
0%,
|
|
8420
|
-
100% {
|
|
8421
|
-
opacity: 0;
|
|
8422
|
-
}
|
|
8423
|
-
50% {
|
|
8424
|
-
opacity: 1;
|
|
8425
|
-
transform: translate3d(0, -8px, 0);
|
|
8396
|
+
to {
|
|
8397
|
+
opacity: 0.33;
|
|
8426
8398
|
}
|
|
8427
8399
|
}
|
|
8428
8400
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OperationBlock.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/blocks/operation-block/OperationBlock.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OperationBlock.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/blocks/operation-block/OperationBlock.vue"],"names":[],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OperationBlock.vue.js","names":[],"sources":["../../../../src/v2/blocks/operation-block/OperationBlock.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * OperationBlock\n *\n * Orchestrates the operation view by wiring together the Header, OperationBlock,\n * and ResponseBlock. Forwards user interactions to the workspace event bus and\n * passes through configuration such as auth, servers, plugins, and environment.\n * This component keeps the Operation page lean by centralizing event emission\n * and prop wiring between the blocks.\n *\n * Notable behavior:\n * - Uses operation['x-scalar-method'] and operation['x-scalar-path'] to provide\n * draft overrides for the UI when present.\n */\nexport default {\n name: 'OperationBlock',\n}\n\nexport type OperationBlockProps = {\n /** Event bus */\n eventBus: WorkspaceEventBus\n /** Application version */\n appVersion: string\n /** Openapi document */\n document: OpenApiDocument\n /** Workspace cookies */\n workspaceCookies: XScalarCookie[]\n /** Document cookies */\n documentCookies: XScalarCookie[]\n /** Current request path */\n path: string\n /** Current request method */\n method: HttpMethodType\n /** HTTP clients */\n httpClients: AvailableClients\n /** The history for the operation */\n history?: HistoryEntry[]\n /** Client layout */\n layout: ClientLayout\n /** Currently selected server */\n server: ServerObject | null\n /** Currently selected client */\n selectedClient: WorkspaceStore['workspace']['x-scalar-default-client']\n /** Server list available for operation/document */\n servers: ServerObject[]\n /** Meta information for the server */\n serverMeta: ServerMeta\n /** Hides the client button on the header */\n hideClientButton?: boolean\n /** Client integration */\n integration?: string | null\n /** Openapi document url for `modal` mode to open the client app */\n documentUrl?: string\n /** Client source */\n source?: 'gitbook' | 'api-reference'\n /** Operation object */\n operation: OperationObject\n /** Currently selected example key for the current operation */\n exampleKey: string\n /** Meta information for the auth update */\n authMeta: AuthMeta\n /** Document defined security schemes */\n securitySchemes: MergedSecuritySchemes\n /** Client plugins */\n plugins: ClientPlugin[]\n /** Environment list */\n environments?: string[]\n /** Currently selected environment */\n activeEnvironment?: string\n /** For environment variables in the inputs */\n environment: XScalarEnvironment\n /** The proxy URL for sending requests */\n proxyUrl: string\n /** Currently selected security */\n selectedSecurity: SelectedSecurity\n /** Currently selected security schemes */\n selectedSecuritySchemes: SecuritySchemeObjectSecret[]\n /** Security requirements */\n securityRequirements: OpenApiDocument['security']\n /** Default headers */\n defaultHeaders: Record<string, string>\n /** Selected anyOf/oneOf request-body variants keyed by schema path */\n requestBodyCompositionSelection?: Record<string, number>\n /** Subset of config options for the modal */\n options?: ModalProps['options']\n}\n</script>\n<script setup lang=\"ts\">\nimport { ERRORS } from '@scalar/helpers/errors/normalize-error'\nimport { isElectron } from '@scalar/helpers/general/is-electron'\nimport { buildSafeBodyRequest } from '@scalar/helpers/http/can-method-have-body'\nimport type { HttpMethod as HttpMethodType } from '@scalar/helpers/http/http-methods'\nimport { executeHook, type ClientPlugin } from '@scalar/oas-utils/helpers'\nimport {\n AVAILABLE_CLIENTS,\n type AvailableClients,\n} from '@scalar/types/snippetz'\nimport { useToasts } from '@scalar/use-toasts'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { SelectedSecurity } from '@scalar/workspace-store/entities/auth'\nimport type { HistoryEntry } from '@scalar/workspace-store/entities/history/schema'\nimport type {\n AuthMeta,\n ServerMeta,\n WorkspaceEventBus,\n} from '@scalar/workspace-store/events'\nimport {\n buildRequest,\n createVariablesStoreForRequest,\n getEnvironmentVariables,\n requestFactory,\n type MergedSecuritySchemes,\n type RequestPayload,\n type SecuritySchemeObjectSecret,\n} from '@scalar/workspace-store/request-example'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type { XScalarCookie } from '@scalar/workspace-store/schemas/extensions/general/x-scalar-cookies'\nimport type {\n OpenApiDocument,\n ServerObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport type { OperationObject } from '@scalar/workspace-store/schemas/v3.1/strict/operation'\nimport { computed, onBeforeUnmount, onMounted, ref, toValue, watch } from 'vue'\n\nimport ViewLayout from '@/components/ViewLayout/ViewLayout.vue'\nimport ViewLayoutContent from '@/components/ViewLayout/ViewLayoutContent.vue'\nimport { harToFetchRequest } from '@/v2/blocks/operation-block/helpers/har-to-fetch-request'\nimport { harToFetchResponse } from '@/v2/blocks/operation-block/helpers/har-to-fetch-response'\nimport {\n getOperationExampleKey,\n isStreamingResponse,\n responseCache,\n} from '@/v2/blocks/operation-block/helpers/response-cache'\nimport {\n sendRequest,\n type ResponseInstance,\n} from '@/v2/blocks/operation-block/helpers/send-request'\nimport { validatePathParameters } from '@/v2/blocks/operation-block/helpers/validate-path-parameters'\nimport { generateClientOptions } from '@/v2/blocks/operation-code-sample'\nimport { RequestBlock } from '@/v2/blocks/request-block'\nimport { ResponseBlock } from '@/v2/blocks/response-block'\nimport { type History } from '@/v2/blocks/scalar-address-bar-block'\nimport type { ModalProps } from '@/v2/features/modal/Modal.vue'\nimport type { ClientLayout } from '@/v2/types/layout'\n\nimport Header from './components/Header.vue'\n\nconst {\n authMeta,\n environment,\n eventBus,\n exampleKey,\n document,\n workspaceCookies = [],\n documentCookies = [],\n hideClientButton,\n httpClients = AVAILABLE_CLIENTS,\n history = [],\n method,\n operation,\n path,\n plugins = [],\n proxyUrl,\n requestBodyCompositionSelection,\n securitySchemes,\n selectedClient,\n server,\n environments,\n options,\n activeEnvironment,\n serverMeta,\n selectedSecurity,\n selectedSecuritySchemes,\n securityRequirements,\n defaultHeaders,\n} = defineProps<OperationBlockProps>()\n\n/** Hoist up client generation so it doesn't get re-generated on every operation */\nconst clientOptions = computed(() => generateClientOptions(httpClients))\n\nconst { toast } = useToasts()\n\n// Refs\nconst abortController = ref<AbortController | null>(null)\nconst response = ref<ResponseInstance | null>(null)\nconst requestPayload = ref<RequestPayload | null>(null)\n\n/** Cancel the request */\nconst cancelRequest = () => abortController.value?.abort(ERRORS.REQUEST_ABORTED)\n\n/** Execute the current operation example */\nconst handleExecute = async () => {\n const pathValidation = validatePathParameters(\n operation.parameters ?? [],\n exampleKey,\n )\n if (pathValidation.ok === false) {\n toast('Path parameters must have values.', 'error')\n return\n }\n\n const globalCookies = [...workspaceCookies, ...documentCookies]\n\n const { request: requestBuilder } = requestFactory({\n defaultHeaders,\n environment,\n exampleName: exampleKey,\n globalCookies,\n method,\n operation,\n path,\n proxyUrl,\n server,\n selectedSecuritySchemes,\n isElectron: isElectron(),\n requestBodyCompositionSelection,\n })\n\n // Stop any previous streaming response\n if (response.value && 'reader' in response.value) {\n response.value.reader.cancel()\n }\n\n const variablesStore = createVariablesStoreForRequest()\n\n // Execute the beforeRequest hook (plugins receive RequestFactory, not fetch Request)\n await executeHook(\n {\n requestBuilder,\n document,\n operation,\n variablesStore,\n },\n 'beforeRequest',\n plugins,\n )\n\n const envVariables = {\n ...getEnvironmentVariables(environment),\n ...variablesStore.getVariables(),\n }\n\n // Build the fetch Request after hooks may have mutated the factory\n const requestResult = (() => {\n try {\n return {\n ok: true,\n result: buildRequest(requestBuilder, {\n envVariables,\n }),\n } as const\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error)\n return {\n ok: false,\n error: message,\n } as const\n }\n })()\n\n if (requestResult.ok === false) {\n toast(requestResult.error, 'error')\n return\n }\n\n // Store the abort controller for cancellation\n abortController.value = requestResult.result.controller\n\n // Execute the hooks\n eventBus.emit('hooks:on:request:sent', {\n meta: {\n method,\n path,\n exampleKey,\n },\n })\n\n /** Execute the request */\n const [sendError, sendResult] = await sendRequest({\n isUsingProxy: requestResult.result.isUsingProxy,\n requestPayload: requestResult.result.requestPayload,\n plugins,\n customFetch: toValue(options)?.customFetch,\n })\n\n if (sendResult) {\n // Execute the responseReceived hook\n await executeHook(\n {\n response: sendResult.originalResponse.clone(),\n requestBuilder,\n request: buildSafeBodyRequest(...sendResult.requestPayload),\n document,\n operation,\n variablesStore,\n },\n 'responseReceived',\n plugins,\n )\n }\n\n // Execute the hooks\n eventBus.emit('hooks:on:request:complete', {\n payload: sendResult\n ? {\n response: sendResult.originalResponse.clone(),\n requestPayload: sendResult.requestPayload,\n duration: sendResult.response.duration,\n timestamp: sendResult.timestamp,\n }\n : undefined,\n meta: {\n method,\n path,\n exampleKey,\n },\n })\n\n if (sendError) {\n // clean up the response and request\n response.value = null\n requestPayload.value = null\n abortController.value = null\n\n toast(sendError.message, 'error')\n return\n }\n\n // Store the response\n response.value = sendResult.response\n requestPayload.value = sendResult.requestPayload\n\n // Cache non-streaming responses so they can be restored when navigating back\n if (!isStreamingResponse(sendResult.response)) {\n responseCache.set(getOperationExampleKey(method, path, exampleKey), {\n response: sendResult.response,\n requestPayload: sendResult.requestPayload,\n })\n }\n}\n\nonMounted(() => {\n eventBus.on('operation:send:request:hotkey', handleExecute)\n eventBus.on('operation:cancel:request', cancelRequest)\n})\nonBeforeUnmount(() => {\n eventBus.off('operation:send:request:hotkey', handleExecute)\n eventBus.off('operation:cancel:request', cancelRequest)\n})\n\nconst operationHistory = computed<History[]>(() =>\n history\n .map((entry) => ({\n method: entry.request.method as HttpMethodType,\n path: entry.request.url,\n duration: entry.time,\n status: entry.response.status,\n }))\n .reverse(),\n)\n\nconst handleSelectHistoryItem = ({ index }: { index: number }) => {\n const transformedIndex = (history.length ?? 0) - index - 1\n const historyItem = history[transformedIndex]\n if (!historyItem) {\n return\n }\n\n const navigate = () =>\n eventBus.emit('ui:navigate', {\n page: 'example',\n method,\n path,\n exampleName: 'draft',\n callback: (status) => {\n // Do not replace the response if the navigation was not successful\n if (status !== 'success') {\n return\n }\n // Reconstruct the response\n const fetchResponse = harToFetchResponse({\n harResponse: historyItem.response,\n url: historyItem.request.url,\n method,\n path,\n duration: historyItem.time,\n })\n\n // Reconstruct the request\n const fetchRequest = harToFetchRequest({\n harRequest: historyItem.request,\n })\n\n // Update the response and request\n response.value = fetchResponse\n requestPayload.value = fetchRequest\n },\n })\n\n eventBus.emit('operation:reload:history', {\n meta: {\n path,\n method,\n },\n index: transformedIndex,\n callback: navigate,\n })\n}\n\n/**\n * When the path, method, or example key changes: save current response to\n * cache (so it can be restored when navigating back), then restore from cache\n * for the new operation or clear if no cached response. Response is only\n * cleared on page refresh or when making a new request for that operation.\n */\nwatch(\n [() => path, () => method, () => exampleKey],\n ([newPath, newMethod, newExampleKey]) => {\n const newKey = getOperationExampleKey(newMethod, newPath, newExampleKey)\n const cached = responseCache.get(newKey)\n if (cached) {\n response.value = cached.response\n requestPayload.value = cached.requestPayload\n } else {\n response.value = null\n requestPayload.value = null\n }\n\n // Cancel any in-flight request\n cancelRequest()\n },\n { immediate: true },\n)\n\nonBeforeUnmount(() => {\n // We cancel the request if the component is unmounted\n cancelRequest()\n})\n</script>\n<template>\n <div class=\"bg-b-1 flex h-full flex-col\">\n <div\n class=\"lg:min-h-header flex w-full flex-wrap items-center justify-center p-2 lg:p-0\">\n <!-- Address Bar -->\n <Header\n :activeEnvironment\n :documentUrl\n :environment\n :environments\n :eventBus\n :hideClientButton\n :history=\"operationHistory\"\n :integration\n :layout\n :method\n :path\n :server\n :serverMeta\n :servers\n :source\n @execute=\"handleExecute\"\n @select:history:item=\"handleSelectHistoryItem\" />\n </div>\n\n <ViewLayout class=\"border-t\">\n <ViewLayoutContent class=\"flex-1\">\n <!-- Request Section -->\n <RequestBlock\n :authMeta\n :clientOptions\n :defaultHeaders\n :documentCookies\n :environment\n :eventBus\n :exampleKey\n :layout\n :method\n :operation\n :options=\"toValue(options)\"\n :path\n :plugins\n :proxyUrl\n :requestBodyCompositionSelection\n :securityRequirements\n :securitySchemes\n :selectedClient\n :selectedSecurity\n :selectedSecuritySchemes\n :server\n :workspaceCookies />\n\n <!-- Response Section -->\n <ResponseBlock\n :appVersion\n :eventBus\n :layout\n :plugins\n :requestPayload\n :response\n :totalPerformedRequests=\"operationHistory.length\" />\n </ViewLayoutContent>\n </ViewLayout>\n </div>\n</template>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"OperationBlock.vue.js","names":[],"sources":["../../../../src/v2/blocks/operation-block/OperationBlock.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * OperationBlock\n *\n * Orchestrates the operation view by wiring together the Header, OperationBlock,\n * and ResponseBlock. Forwards user interactions to the workspace event bus and\n * passes through configuration such as auth, servers, plugins, and environment.\n * This component keeps the Operation page lean by centralizing event emission\n * and prop wiring between the blocks.\n *\n * Notable behavior:\n * - Uses operation['x-scalar-method'] and operation['x-scalar-path'] to provide\n * draft overrides for the UI when present.\n */\nexport default {\n name: 'OperationBlock',\n}\n\nexport type OperationBlockProps = {\n /** Event bus */\n eventBus: WorkspaceEventBus\n /** Application version */\n appVersion: string\n /** Openapi document */\n document: OpenApiDocument\n /** Workspace cookies */\n workspaceCookies: XScalarCookie[]\n /** Document cookies */\n documentCookies: XScalarCookie[]\n /** Current request path */\n path: string\n /** Current request method */\n method: HttpMethodType\n /** HTTP clients */\n httpClients: AvailableClients\n /** The history for the operation */\n history?: HistoryEntry[]\n /** Client layout */\n layout: ClientLayout\n /** Currently selected server */\n server: ServerObject | null\n /** Currently selected client */\n selectedClient: WorkspaceStore['workspace']['x-scalar-default-client']\n /** Server list available for operation/document */\n servers: ServerObject[]\n /** Meta information for the server */\n serverMeta: ServerMeta\n /** Hides the client button on the header */\n hideClientButton?: boolean\n /** Client integration */\n integration?: string | null\n /** Openapi document url for `modal` mode to open the client app */\n documentUrl?: string\n /** Client source */\n source?: 'gitbook' | 'api-reference'\n /** Operation object */\n operation: OperationObject\n /** Currently selected example key for the current operation */\n exampleKey: string\n /** Meta information for the auth update */\n authMeta: AuthMeta\n /** Document defined security schemes */\n securitySchemes: MergedSecuritySchemes\n /** Client plugins */\n plugins: ClientPlugin[]\n /** Environment list */\n environments?: string[]\n /** Currently selected environment */\n activeEnvironment?: string\n /** For environment variables in the inputs */\n environment: XScalarEnvironment\n /** The proxy URL for sending requests */\n proxyUrl: string\n /** Currently selected security */\n selectedSecurity: SelectedSecurity\n /** Currently selected security schemes */\n selectedSecuritySchemes: SecuritySchemeObjectSecret[]\n /** Security requirements */\n securityRequirements: OpenApiDocument['security']\n /** Default headers */\n defaultHeaders: Record<string, string>\n /** Selected anyOf/oneOf request-body variants keyed by schema path */\n requestBodyCompositionSelection?: Record<string, number>\n /** Subset of config options for the modal */\n options?: ModalProps['options']\n}\n</script>\n<script setup lang=\"ts\">\nimport { ERRORS } from '@scalar/helpers/errors/normalize-error'\nimport { isElectron } from '@scalar/helpers/general/is-electron'\nimport { buildSafeBodyRequest } from '@scalar/helpers/http/can-method-have-body'\nimport type { HttpMethod as HttpMethodType } from '@scalar/helpers/http/http-methods'\nimport { executeHook, type ClientPlugin } from '@scalar/oas-utils/helpers'\nimport {\n AVAILABLE_CLIENTS,\n type AvailableClients,\n} from '@scalar/types/snippetz'\nimport { useToasts } from '@scalar/use-toasts'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { SelectedSecurity } from '@scalar/workspace-store/entities/auth'\nimport type { HistoryEntry } from '@scalar/workspace-store/entities/history/schema'\nimport type {\n AuthMeta,\n ServerMeta,\n WorkspaceEventBus,\n} from '@scalar/workspace-store/events'\nimport {\n buildRequest,\n createVariablesStoreForRequest,\n getEnvironmentVariables,\n requestFactory,\n type MergedSecuritySchemes,\n type RequestPayload,\n type SecuritySchemeObjectSecret,\n} from '@scalar/workspace-store/request-example'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type { XScalarCookie } from '@scalar/workspace-store/schemas/extensions/general/x-scalar-cookies'\nimport type {\n OpenApiDocument,\n ServerObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport type { OperationObject } from '@scalar/workspace-store/schemas/v3.1/strict/operation'\nimport { computed, onBeforeUnmount, onMounted, ref, toValue, watch } from 'vue'\n\nimport ViewLayout from '@/components/ViewLayout/ViewLayout.vue'\nimport ViewLayoutContent from '@/components/ViewLayout/ViewLayoutContent.vue'\nimport { harToFetchRequest } from '@/v2/blocks/operation-block/helpers/har-to-fetch-request'\nimport { harToFetchResponse } from '@/v2/blocks/operation-block/helpers/har-to-fetch-response'\nimport {\n getOperationExampleKey,\n isStreamingResponse,\n responseCache,\n} from '@/v2/blocks/operation-block/helpers/response-cache'\nimport {\n sendRequest,\n type ResponseInstance,\n} from '@/v2/blocks/operation-block/helpers/send-request'\nimport { validatePathParameters } from '@/v2/blocks/operation-block/helpers/validate-path-parameters'\nimport { generateClientOptions } from '@/v2/blocks/operation-code-sample'\nimport { RequestBlock } from '@/v2/blocks/request-block'\nimport { ResponseBlock } from '@/v2/blocks/response-block'\nimport { type History } from '@/v2/blocks/scalar-address-bar-block'\nimport type { ModalProps } from '@/v2/features/modal/Modal.vue'\nimport type { ClientLayout } from '@/v2/types/layout'\n\nimport Header from './components/Header.vue'\n\nconst {\n authMeta,\n environment,\n eventBus,\n exampleKey,\n document,\n workspaceCookies = [],\n documentCookies = [],\n hideClientButton,\n httpClients = AVAILABLE_CLIENTS,\n history = [],\n method,\n operation,\n path,\n plugins = [],\n proxyUrl,\n requestBodyCompositionSelection,\n securitySchemes,\n selectedClient,\n server,\n environments,\n options,\n activeEnvironment,\n serverMeta,\n selectedSecurity,\n selectedSecuritySchemes,\n securityRequirements,\n defaultHeaders,\n} = defineProps<OperationBlockProps>()\n\n/** Hoist up client generation so it doesn't get re-generated on every operation */\nconst clientOptions = computed(() => generateClientOptions(httpClients))\n\nconst { toast } = useToasts()\n\n// Refs\nconst abortController = ref<AbortController | null>(null)\nconst response = ref<ResponseInstance | null>(null)\nconst requestPayload = ref<RequestPayload | null>(null)\n\n/** Cancel the request */\nconst cancelRequest = () => abortController.value?.abort(ERRORS.REQUEST_ABORTED)\n\n/** Execute the current operation example */\nconst handleExecute = async () => {\n const pathValidation = validatePathParameters(\n operation.parameters ?? [],\n exampleKey,\n )\n if (pathValidation.ok === false) {\n toast('Path parameters must have values.', 'error')\n return\n }\n\n const globalCookies = [...workspaceCookies, ...documentCookies]\n\n const { request: requestBuilder } = requestFactory({\n defaultHeaders,\n environment,\n exampleName: exampleKey,\n globalCookies,\n method,\n operation,\n path,\n proxyUrl,\n server,\n selectedSecuritySchemes,\n isElectron: isElectron(),\n requestBodyCompositionSelection,\n })\n\n // Stop any previous streaming response\n if (response.value && 'reader' in response.value) {\n response.value.reader.cancel()\n }\n\n const variablesStore = createVariablesStoreForRequest()\n\n // Execute the beforeRequest hook (plugins receive RequestFactory, not fetch Request)\n await executeHook(\n {\n requestBuilder,\n document,\n operation,\n variablesStore,\n },\n 'beforeRequest',\n plugins,\n )\n\n const envVariables = {\n ...getEnvironmentVariables(environment),\n ...variablesStore.getVariables(),\n }\n\n // Build the fetch Request after hooks may have mutated the factory\n const requestResult = (() => {\n try {\n return {\n ok: true,\n result: buildRequest(requestBuilder, {\n envVariables,\n }),\n } as const\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error)\n return {\n ok: false,\n error: message,\n } as const\n }\n })()\n\n if (requestResult.ok === false) {\n toast(requestResult.error, 'error')\n return\n }\n\n // Store the abort controller for cancellation\n abortController.value = requestResult.result.controller\n\n // Execute the hooks\n eventBus.emit('hooks:on:request:sent', {\n meta: {\n method,\n path,\n exampleKey,\n },\n })\n\n /** Execute the request */\n const [sendError, sendResult] = await sendRequest({\n isUsingProxy: requestResult.result.isUsingProxy,\n requestPayload: requestResult.result.requestPayload,\n plugins,\n customFetch: toValue(options)?.customFetch,\n })\n\n if (sendResult) {\n // Execute the responseReceived hook\n await executeHook(\n {\n response: sendResult.originalResponse.clone(),\n requestBuilder,\n request: buildSafeBodyRequest(...sendResult.requestPayload),\n document,\n operation,\n variablesStore,\n },\n 'responseReceived',\n plugins,\n )\n }\n\n // Execute the hooks\n eventBus.emit('hooks:on:request:complete', {\n payload: sendResult\n ? {\n response: sendResult.originalResponse.clone(),\n requestPayload: sendResult.requestPayload,\n duration: sendResult.response.duration,\n timestamp: sendResult.timestamp,\n }\n : undefined,\n meta: {\n method,\n path,\n exampleKey,\n },\n })\n\n if (sendError) {\n // clean up the response and request\n response.value = null\n requestPayload.value = null\n abortController.value = null\n\n toast(sendError.message, 'error')\n return\n }\n\n // Store the response\n response.value = sendResult.response\n requestPayload.value = sendResult.requestPayload\n\n // Cache non-streaming responses so they can be restored when navigating back\n if (!isStreamingResponse(sendResult.response)) {\n responseCache.set(getOperationExampleKey(method, path, exampleKey), {\n response: sendResult.response,\n requestPayload: sendResult.requestPayload,\n })\n }\n}\n\nonMounted(() => {\n eventBus.on('operation:send:request:hotkey', handleExecute)\n eventBus.on('operation:cancel:request', cancelRequest)\n})\nonBeforeUnmount(() => {\n eventBus.off('operation:send:request:hotkey', handleExecute)\n eventBus.off('operation:cancel:request', cancelRequest)\n})\n\nconst operationHistory = computed<History[]>(() =>\n history\n .map((entry) => ({\n method: entry.request.method as HttpMethodType,\n path: entry.request.url,\n duration: entry.time,\n status: entry.response.status,\n }))\n .reverse(),\n)\n\nconst handleSelectHistoryItem = ({ index }: { index: number }) => {\n const transformedIndex = (history.length ?? 0) - index - 1\n const historyItem = history[transformedIndex]\n if (!historyItem) {\n return\n }\n\n const navigate = () =>\n eventBus.emit('ui:navigate', {\n page: 'example',\n method,\n path,\n exampleName: 'draft',\n callback: (status) => {\n // Do not replace the response if the navigation was not successful\n if (status !== 'success') {\n return\n }\n // Reconstruct the response\n const fetchResponse = harToFetchResponse({\n harResponse: historyItem.response,\n url: historyItem.request.url,\n method,\n path,\n duration: historyItem.time,\n })\n\n // Reconstruct the request\n const fetchRequest = harToFetchRequest({\n harRequest: historyItem.request,\n })\n\n // Update the response and request\n response.value = fetchResponse\n requestPayload.value = fetchRequest\n },\n })\n\n eventBus.emit('operation:reload:history', {\n meta: {\n path,\n method,\n },\n index: transformedIndex,\n callback: navigate,\n })\n}\n\nconst handleNavigateSettings = () => {\n eventBus.emit('ui:navigate', {\n page: 'operation',\n path: 'overview',\n operationPath: path,\n method,\n })\n}\n\n/**\n * When the path, method, or example key changes: save current response to\n * cache (so it can be restored when navigating back), then restore from cache\n * for the new operation or clear if no cached response. Response is only\n * cleared on page refresh or when making a new request for that operation.\n */\nwatch(\n [() => path, () => method, () => exampleKey],\n ([newPath, newMethod, newExampleKey]) => {\n const newKey = getOperationExampleKey(newMethod, newPath, newExampleKey)\n const cached = responseCache.get(newKey)\n if (cached) {\n response.value = cached.response\n requestPayload.value = cached.requestPayload\n } else {\n response.value = null\n requestPayload.value = null\n }\n\n // Cancel any in-flight request\n cancelRequest()\n },\n { immediate: true },\n)\n\nonBeforeUnmount(() => {\n // We cancel the request if the component is unmounted\n cancelRequest()\n})\n</script>\n<template>\n <div class=\"bg-b-1 flex h-full flex-col\">\n <div\n class=\"lg:min-h-header flex w-full flex-wrap items-center justify-center p-2 lg:p-0\">\n <!-- Address Bar -->\n <Header\n :activeEnvironment\n :documentUrl\n :environment\n :environments\n :eventBus\n :hideClientButton\n :history=\"operationHistory\"\n :integration\n :layout\n :method\n :path\n :server\n :serverMeta\n :servers\n :source\n @execute=\"handleExecute\"\n @navigate:settings=\"handleNavigateSettings\"\n @select:history:item=\"handleSelectHistoryItem\" />\n </div>\n\n <ViewLayout class=\"border-t\">\n <ViewLayoutContent class=\"flex-1\">\n <!-- Request Section -->\n <RequestBlock\n :authMeta\n :clientOptions\n :defaultHeaders\n :documentCookies\n :environment\n :eventBus\n :exampleKey\n :layout\n :method\n :operation\n :options=\"toValue(options)\"\n :path\n :plugins\n :proxyUrl\n :requestBodyCompositionSelection\n :securityRequirements\n :securitySchemes\n :selectedClient\n :selectedSecurity\n :selectedSecuritySchemes\n :server\n :workspaceCookies />\n\n <!-- Response Section -->\n <ResponseBlock\n :appVersion\n :eventBus\n :layout\n :plugins\n :requestPayload\n :response\n :totalPerformedRequests=\"operationHistory.length\" />\n </ViewLayoutContent>\n </ViewLayout>\n </div>\n</template>\n"],"mappings":""}
|
|
@@ -210,6 +210,14 @@ var OperationBlock_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
210
210
|
callback: navigate
|
|
211
211
|
});
|
|
212
212
|
};
|
|
213
|
+
const handleNavigateSettings = () => {
|
|
214
|
+
__props.eventBus.emit("ui:navigate", {
|
|
215
|
+
page: "operation",
|
|
216
|
+
path: "overview",
|
|
217
|
+
operationPath: __props.path,
|
|
218
|
+
method: __props.method
|
|
219
|
+
});
|
|
220
|
+
};
|
|
213
221
|
/**
|
|
214
222
|
* When the path, method, or example key changes: save current response to
|
|
215
223
|
* cache (so it can be restored when navigating back), then restore from cache
|
|
@@ -253,6 +261,7 @@ var OperationBlock_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
253
261
|
servers: __props.servers,
|
|
254
262
|
source: __props.source,
|
|
255
263
|
onExecute: handleExecute,
|
|
264
|
+
"onNavigate:settings": handleNavigateSettings,
|
|
256
265
|
"onSelect:history:item": handleSelectHistoryItem
|
|
257
266
|
}, null, 8, [
|
|
258
267
|
"activeEnvironment",
|