@scalar/api-client 3.28.0 → 3.29.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 +92 -65
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue_vue_type_script_setup_true_lang.js +4 -0
- package/dist/v2/blocks/operation-block/OperationBlock.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/send-request.js +1 -4
- package/dist/v2/blocks/operation-block/helpers/send-request.js.map +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts +2 -0
- package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.js +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue_vue_type_script_setup_true_lang.js +5 -0
- package/dist/v2/blocks/request-block/RequestBlock.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts +2 -0
- package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue.js +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue_vue_type_script_setup_true_lang.js +6 -2
- package/dist/v2/blocks/request-block/components/RequestBody.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.d.ts +1 -0
- package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBodyForm.vue_vue_type_script_setup_true_lang.js +7 -5
- package/dist/v2/blocks/request-block/components/RequestBodyForm.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/v2/blocks/request-block/helpers/get-form-body-rows.d.ts +1 -1
- package/dist/v2/blocks/request-block/helpers/get-form-body-rows.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/helpers/get-form-body-rows.js +10 -3
- package/dist/v2/blocks/request-block/helpers/get-form-body-rows.js.map +1 -1
- package/dist/v2/constants.js +1 -1
- package/dist/v2/types/options.d.ts +1 -1
- package/dist/v2/types/options.d.ts.map +1 -1
- package/dist/vue-styles.css +7 -7
- package/package.json +16 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @scalar/api-client
|
|
2
2
|
|
|
3
|
+
## 3.29.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#11137](https://github.com/scalar/scalar/pull/11137): Add an opt-in ASP.NET Core form naming mode through the API Reference configuration option `multipartNaming: "indexed-dot"`. The body editor, sent requests, and code samples use indexed dotted names such as `Certificates[0].name` for nested fields in multipart and URL-encoded request bodies.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- [#11146](https://github.com/scalar/scalar/pull/11146): Update compatible npm dependencies for AI chat, encoding, analytics, date handling, HTTP serving, and application query caching.
|
|
12
|
+
- [#11140](https://github.com/scalar/scalar/pull/11140): Update response cookie parsing to follow browser UTC expiration rules and ignore empty cookies.
|
|
13
|
+
- [#11145](https://github.com/scalar/scalar/pull/11145): Prevent CSP eval violation reports when loading OAuth authentication and AI Chat by configuring Zod before schemas are constructed.
|
|
14
|
+
|
|
15
|
+
This disables JIT compilation for the shared Zod instance, so applications using that same instance may also see slower object parsing.
|
|
16
|
+
- [#11130](https://github.com/scalar/scalar/pull/11130): Update nanoid to version 6 for faster identifier generation while preserving existing identifier formats.
|
|
17
|
+
|
|
18
|
+
## 3.28.1
|
|
19
|
+
|
|
20
|
+
No changes in this release.
|
|
21
|
+
|
|
3
22
|
## 3.28.0
|
|
4
23
|
|
|
5
24
|
### Minor Changes
|
package/dist/style.css
CHANGED
|
@@ -397,6 +397,49 @@
|
|
|
397
397
|
}
|
|
398
398
|
}
|
|
399
399
|
|
|
400
|
+
.light-mode, .dark-mode, .light-mode .dark-mode, .dark-mode .light-mode {
|
|
401
|
+
--scalar-code-keyword: var(--scalar-color-purple);
|
|
402
|
+
--scalar-code-string: var(--scalar-color-blue);
|
|
403
|
+
--scalar-code-number: var(--scalar-color-orange);
|
|
404
|
+
--scalar-code-function: var(--scalar-color-orange);
|
|
405
|
+
--scalar-code-builtin: var(--scalar-color-blue);
|
|
406
|
+
--scalar-code-type: var(--scalar-color-1);
|
|
407
|
+
--scalar-code-parameter: var(--scalar-color-red);
|
|
408
|
+
--scalar-code-property: var(--scalar-color-green);
|
|
409
|
+
--scalar-code-comment: var(--scalar-color-2);
|
|
410
|
+
--scalar-code-punctuation: var(--scalar-color-2);
|
|
411
|
+
--scalar-code-addition: var(--scalar-color-green);
|
|
412
|
+
--scalar-code-deletion: var(--scalar-color-red);
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
@supports (color: oklch(from white l c h)) {
|
|
416
|
+
.light-mode, .dark-mode .light-mode {
|
|
417
|
+
--scalar-code-keyword: oklch(from var(--scalar-color-purple) min(l, .395) min(c, .22) h);
|
|
418
|
+
--scalar-code-string: oklch(from var(--scalar-color-blue) min(l, .55) min(c, .14) h);
|
|
419
|
+
--scalar-code-number: oklch(from var(--scalar-color-orange) min(l, .59) min(c, .17) calc(h + 3));
|
|
420
|
+
--scalar-code-function: oklch(from var(--scalar-color-orange) min(l, .59) min(c, .17) calc(h + 3));
|
|
421
|
+
--scalar-code-builtin: oklch(from var(--scalar-color-blue) min(l, .55) min(c, .14) h);
|
|
422
|
+
--scalar-code-type: oklch(from var(--scalar-color-blue) min(l, .33) min(c, .1) calc(h + 8));
|
|
423
|
+
--scalar-code-parameter: oklch(from var(--scalar-color-red) min(l, .5) min(c, .2) calc(h - 14));
|
|
424
|
+
--scalar-code-property: oklch(from var(--scalar-color-green) min(l, .51) min(c, .11) h);
|
|
425
|
+
--scalar-code-addition: oklch(from var(--scalar-color-green) min(l, .51) min(c, .11) h);
|
|
426
|
+
--scalar-code-deletion: oklch(from var(--scalar-color-red) min(l, .5) min(c, .2) calc(h - 14));
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.dark-mode, .light-mode .dark-mode {
|
|
430
|
+
--scalar-code-keyword: oklch(from var(--scalar-color-purple) max(l, .68) c h);
|
|
431
|
+
--scalar-code-string: oklch(from var(--scalar-color-blue) max(l, .68) c h);
|
|
432
|
+
--scalar-code-number: oklch(from var(--scalar-color-orange) max(l, .75) min(c, .16) h);
|
|
433
|
+
--scalar-code-function: oklch(from var(--scalar-color-orange) max(l, .75) min(c, .16) h);
|
|
434
|
+
--scalar-code-builtin: oklch(from var(--scalar-color-blue) max(l, .68) c h);
|
|
435
|
+
--scalar-code-type: oklch(from var(--scalar-color-blue) max(l, .85) min(c, .075) h);
|
|
436
|
+
--scalar-code-parameter: oklch(from var(--scalar-color-red) max(l, .68) min(c, .19) calc(h - 14));
|
|
437
|
+
--scalar-code-property: oklch(from var(--scalar-color-green) max(l, .68) c h);
|
|
438
|
+
--scalar-code-addition: oklch(from var(--scalar-color-green) max(l, .68) c h);
|
|
439
|
+
--scalar-code-deletion: oklch(from var(--scalar-color-red) max(l, .68) min(c, .19) calc(h - 14));
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
|
|
400
443
|
:root, :host {
|
|
401
444
|
--tracking-widest: .1em;
|
|
402
445
|
--leading-snug: 1.375;
|
|
@@ -757,10 +800,6 @@
|
|
|
757
800
|
margin-block: 2px -2px;
|
|
758
801
|
}
|
|
759
802
|
|
|
760
|
-
.scalar-app .hljs-regexp, .scalar-app .hljs-string, .scalar-app .hljs-built_in, .scalar-app .hljs-subst, .scalar-app .hljs-name, .scalar-app .hljs-doctag, .scalar-app .hljs-section, .scalar-app .hljs-title {
|
|
761
|
-
color: var(--scalar-color-blue);
|
|
762
|
-
}
|
|
763
|
-
|
|
764
803
|
.scalar-code-block-pre {
|
|
765
804
|
font-family: var(--scalar-font-code);
|
|
766
805
|
font-variant-ligatures: none;
|
|
@@ -874,13 +913,13 @@
|
|
|
874
913
|
.scalar-app code.hljs {
|
|
875
914
|
all: unset;
|
|
876
915
|
font-size: inherit;
|
|
877
|
-
color: var(--scalar-color-
|
|
916
|
+
color: var(--scalar-color-1);
|
|
878
917
|
font-family: var(--scalar-font-code);
|
|
879
918
|
counter-reset: linenumber;
|
|
880
919
|
}
|
|
881
920
|
|
|
882
921
|
.scalar-app .hljs {
|
|
883
|
-
color: var(--scalar-color-
|
|
922
|
+
color: var(--scalar-color-1);
|
|
884
923
|
background: none;
|
|
885
924
|
}
|
|
886
925
|
|
|
@@ -895,64 +934,60 @@
|
|
|
895
934
|
}
|
|
896
935
|
|
|
897
936
|
.scalar-app .hljs-comment, .scalar-app .hljs-quote {
|
|
898
|
-
color: var(--scalar-color-
|
|
937
|
+
color: var(--scalar-code-comment, var(--scalar-color-2));
|
|
899
938
|
font-style: italic;
|
|
900
939
|
}
|
|
901
940
|
|
|
902
|
-
.scalar-app .hljs-
|
|
903
|
-
color: var(--scalar-color-
|
|
904
|
-
}
|
|
905
|
-
|
|
906
|
-
.scalar-app .hljs-regexp, .scalar-app .hljs-string, .scalar-app .hljs-built_in {
|
|
907
|
-
color: var(--scalar-color-blue);
|
|
941
|
+
.scalar-app .hljs-punctuation, .scalar-app .hljs-operator, .scalar-app .hljs-bullet {
|
|
942
|
+
color: var(--scalar-code-punctuation, var(--scalar-color-2));
|
|
908
943
|
}
|
|
909
944
|
|
|
910
|
-
.scalar-app .hljs-
|
|
911
|
-
color: var(--scalar-color-
|
|
945
|
+
.scalar-app .hljs-number, .scalar-app .hljs-literal, .scalar-app .hljs-symbol {
|
|
946
|
+
color: var(--scalar-code-number, var(--scalar-color-orange));
|
|
912
947
|
}
|
|
913
948
|
|
|
914
|
-
.scalar-app .hljs-
|
|
915
|
-
color: var(--scalar-color-
|
|
949
|
+
.scalar-app .hljs-regexp, .scalar-app .hljs-string {
|
|
950
|
+
color: var(--scalar-code-string, var(--scalar-color-blue));
|
|
916
951
|
}
|
|
917
952
|
|
|
918
|
-
.scalar-app .hljs-
|
|
919
|
-
color: var(--scalar-color-
|
|
953
|
+
.scalar-app .hljs-built_in, .scalar-app .hljs-meta {
|
|
954
|
+
color: var(--scalar-code-builtin, var(--scalar-color-blue));
|
|
920
955
|
}
|
|
921
956
|
|
|
922
|
-
.scalar-app .hljs-subst, .scalar-app .hljs-name {
|
|
923
|
-
color: var(--scalar-color-
|
|
957
|
+
.scalar-app .hljs-keyword, .scalar-app .hljs-doctag, .scalar-app .hljs-subst, .scalar-app .hljs-name {
|
|
958
|
+
color: var(--scalar-code-keyword, var(--scalar-color-purple));
|
|
924
959
|
}
|
|
925
960
|
|
|
926
|
-
.scalar-app .hljs-
|
|
927
|
-
color: var(--scalar-color-
|
|
961
|
+
.scalar-app .hljs-section, .scalar-app .hljs-link, .scalar-app .hljs-title, .scalar-app .hljs-title.function_ {
|
|
962
|
+
color: var(--scalar-code-function, var(--scalar-color-orange));
|
|
928
963
|
}
|
|
929
964
|
|
|
930
|
-
.scalar-app .hljs-
|
|
931
|
-
color: var(--scalar-color-
|
|
965
|
+
.scalar-app .hljs-title.class_, .scalar-app .hljs-type {
|
|
966
|
+
color: var(--scalar-code-type, var(--scalar-color-1));
|
|
932
967
|
}
|
|
933
968
|
|
|
934
|
-
.scalar-app .hljs-
|
|
935
|
-
color: var(--scalar-color-
|
|
969
|
+
.scalar-app .hljs-params {
|
|
970
|
+
color: var(--scalar-code-parameter, var(--scalar-color-red));
|
|
936
971
|
}
|
|
937
972
|
|
|
938
|
-
.scalar-app .hljs-
|
|
939
|
-
color: var(--scalar-color-
|
|
973
|
+
.scalar-app .hljs-property, .scalar-app .hljs-attr, .scalar-app .hljs-attribute, .scalar-app .hljs-selector-tag, .scalar-app .hljs-selector-attr, .scalar-app .hljs-selector-pseudo {
|
|
974
|
+
color: var(--scalar-code-property, var(--scalar-color-green));
|
|
940
975
|
}
|
|
941
976
|
|
|
942
977
|
.scalar-app .hljs-selector-id, .scalar-app .hljs-template-variable, .scalar-app .hljs-variable {
|
|
943
978
|
color: var(--scalar-color-1);
|
|
944
979
|
}
|
|
945
980
|
|
|
946
|
-
.scalar-app .hljs-
|
|
947
|
-
|
|
981
|
+
.scalar-app .hljs-addition {
|
|
982
|
+
color: var(--scalar-code-addition, var(--scalar-color-green));
|
|
948
983
|
}
|
|
949
984
|
|
|
950
|
-
.scalar-app .hljs-
|
|
951
|
-
|
|
985
|
+
.scalar-app .hljs-name, .scalar-app .hljs-section, .scalar-app .hljs-strong {
|
|
986
|
+
font-weight: var(--scalar-semibold);
|
|
952
987
|
}
|
|
953
988
|
|
|
954
989
|
.scalar-app .hljs-deletion {
|
|
955
|
-
color: var(--scalar-color-red);
|
|
990
|
+
color: var(--scalar-code-deletion, var(--scalar-color-red));
|
|
956
991
|
}
|
|
957
992
|
|
|
958
993
|
.scalar-app .hljs-formula {
|
|
@@ -980,27 +1015,19 @@
|
|
|
980
1015
|
}
|
|
981
1016
|
|
|
982
1017
|
.hljs.language-html .hljs-attr {
|
|
983
|
-
color: var(--scalar-color-
|
|
1018
|
+
color: var(--scalar-code-property, var(--scalar-color-green));
|
|
984
1019
|
}
|
|
985
1020
|
|
|
986
1021
|
.hljs.language-curl .hljs-string {
|
|
987
|
-
color: var(--scalar-color-blue);
|
|
988
|
-
}
|
|
989
|
-
|
|
990
|
-
.hljs.language-curl .hljs-literal {
|
|
991
|
-
color: var(--scalar-color-1);
|
|
1022
|
+
color: var(--scalar-code-string, var(--scalar-color-blue));
|
|
992
1023
|
}
|
|
993
1024
|
|
|
994
|
-
.hljs.language-php .hljs-variable {
|
|
995
|
-
color: var(--scalar-color-blue);
|
|
996
|
-
}
|
|
997
|
-
|
|
998
|
-
.hljs.language-objectivec .hljs-meta {
|
|
1025
|
+
.hljs.language-php .hljs-variable, .hljs.language-objectivec .hljs-meta {
|
|
999
1026
|
color: var(--scalar-color-1);
|
|
1000
1027
|
}
|
|
1001
1028
|
|
|
1002
1029
|
.hljs.language-objectivec .hljs-built_in {
|
|
1003
|
-
color: var(--scalar-color-
|
|
1030
|
+
color: var(--scalar-code-builtin, var(--scalar-color-blue));
|
|
1004
1031
|
}
|
|
1005
1032
|
|
|
1006
1033
|
.scalar-app .markdown {
|
|
@@ -1973,17 +2000,17 @@
|
|
|
1973
2000
|
border-radius: var(--scalar-radius);
|
|
1974
2001
|
}
|
|
1975
2002
|
|
|
1976
|
-
.request-card[data-v-aaf1efda], .request-card[data-v-
|
|
2003
|
+
.request-card[data-v-aaf1efda], .request-card[data-v-f11de264] {
|
|
1977
2004
|
color: var(--scalar-color-1);
|
|
1978
2005
|
font-size: var(--scalar-font-size-3);
|
|
1979
2006
|
}
|
|
1980
2007
|
|
|
1981
|
-
.request-method[data-v-
|
|
2008
|
+
.request-method[data-v-f11de264] {
|
|
1982
2009
|
font-family: var(--scalar-font-code);
|
|
1983
2010
|
margin-right: 6px;
|
|
1984
2011
|
}
|
|
1985
2012
|
|
|
1986
|
-
.request-card-footer[data-v-
|
|
2013
|
+
.request-card-footer[data-v-f11de264] {
|
|
1987
2014
|
flex-shrink: 0;
|
|
1988
2015
|
justify-content: flex-end;
|
|
1989
2016
|
padding: 6px;
|
|
@@ -1991,18 +2018,18 @@
|
|
|
1991
2018
|
position: relative;
|
|
1992
2019
|
}
|
|
1993
2020
|
|
|
1994
|
-
.request-card-footer--wraps[data-v-
|
|
2021
|
+
.request-card-footer--wraps[data-v-f11de264] {
|
|
1995
2022
|
flex-wrap: wrap;
|
|
1996
2023
|
row-gap: 4px;
|
|
1997
2024
|
}
|
|
1998
2025
|
|
|
1999
|
-
.request-card-footer-start[data-v-
|
|
2026
|
+
.request-card-footer-start[data-v-f11de264] {
|
|
2000
2027
|
flex: 1 0 auto;
|
|
2001
2028
|
align-items: center;
|
|
2002
2029
|
display: flex;
|
|
2003
2030
|
}
|
|
2004
2031
|
|
|
2005
|
-
.request-card-footer-addon[data-v-
|
|
2032
|
+
.request-card-footer-addon[data-v-f11de264] {
|
|
2006
2033
|
flex: 7em;
|
|
2007
2034
|
align-items: center;
|
|
2008
2035
|
min-width: 0;
|
|
@@ -2011,16 +2038,16 @@
|
|
|
2011
2038
|
display: flex;
|
|
2012
2039
|
}
|
|
2013
2040
|
|
|
2014
|
-
.request-editor-section[data-v-
|
|
2041
|
+
.request-editor-section[data-v-f11de264] {
|
|
2015
2042
|
flex: 1;
|
|
2016
2043
|
display: flex;
|
|
2017
2044
|
}
|
|
2018
2045
|
|
|
2019
|
-
.code-snippet > .scalar-code-copy[data-v-
|
|
2046
|
+
.code-snippet > .scalar-code-copy[data-v-f11de264] {
|
|
2020
2047
|
background: var(--scalar-card-surface-raised, var(--scalar-background-2));
|
|
2021
2048
|
}
|
|
2022
2049
|
|
|
2023
|
-
.request-card-simple[data-v-
|
|
2050
|
+
.request-card-simple[data-v-f11de264] {
|
|
2024
2051
|
font-size: var(--scalar-small);
|
|
2025
2052
|
flex-wrap: wrap;
|
|
2026
2053
|
justify-content: space-between;
|
|
@@ -2030,17 +2057,17 @@
|
|
|
2030
2057
|
display: flex;
|
|
2031
2058
|
}
|
|
2032
2059
|
|
|
2033
|
-
.request-header[data-v-
|
|
2060
|
+
.request-header[data-v-f11de264] {
|
|
2034
2061
|
overflow-wrap: anywhere;
|
|
2035
2062
|
flex: 999 auto;
|
|
2036
2063
|
min-width: 0;
|
|
2037
2064
|
}
|
|
2038
2065
|
|
|
2039
|
-
.request-card-actions[data-v-
|
|
2066
|
+
.request-card-actions[data-v-f11de264] {
|
|
2040
2067
|
flex: 1 0 auto;
|
|
2041
2068
|
}
|
|
2042
2069
|
|
|
2043
|
-
.code-snippet[data-v-
|
|
2070
|
+
.code-snippet[data-v-f11de264] {
|
|
2044
2071
|
flex-direction: column;
|
|
2045
2072
|
width: 100%;
|
|
2046
2073
|
display: flex;
|
|
@@ -7997,7 +8024,7 @@ to {
|
|
|
7997
8024
|
color: var(--scalar-color-1);
|
|
7998
8025
|
}
|
|
7999
8026
|
|
|
8000
|
-
[data-v-
|
|
8027
|
+
[data-v-efbe965b] .cm-content {
|
|
8001
8028
|
font-size: var(--scalar-small);
|
|
8002
8029
|
}
|
|
8003
8030
|
|
|
@@ -8046,20 +8073,20 @@ input[data-v-029a43f5]::placeholder {
|
|
|
8046
8073
|
-moz-text-security: disc;
|
|
8047
8074
|
}
|
|
8048
8075
|
|
|
8049
|
-
.request-section-content[data-v-
|
|
8076
|
+
.request-section-content[data-v-2e177312] {
|
|
8050
8077
|
--scalar-border-width: 0.5px;
|
|
8051
8078
|
}
|
|
8052
|
-
.request-section-content-filter[data-v-
|
|
8079
|
+
.request-section-content-filter[data-v-2e177312] {
|
|
8053
8080
|
box-shadow: 0 -10px 0 10px var(--scalar-background-1);
|
|
8054
8081
|
}
|
|
8055
|
-
.request-item:focus-within .request-meta-buttons[data-v-
|
|
8082
|
+
.request-item:focus-within .request-meta-buttons[data-v-2e177312] {
|
|
8056
8083
|
opacity: 1;
|
|
8057
8084
|
}
|
|
8058
|
-
.group-hover-input[data-v-
|
|
8085
|
+
.group-hover-input[data-v-2e177312] {
|
|
8059
8086
|
border-width: var(--scalar-border-width);
|
|
8060
8087
|
border-color: transparent;
|
|
8061
8088
|
}
|
|
8062
|
-
.group:hover .group-hover-input[data-v-
|
|
8089
|
+
.group:hover .group-hover-input[data-v-2e177312] {
|
|
8063
8090
|
background: color-mix(
|
|
8064
8091
|
in srgb,
|
|
8065
8092
|
var(--scalar-background-1),
|
|
@@ -8067,7 +8094,7 @@ input[data-v-029a43f5]::placeholder {
|
|
|
8067
8094
|
);
|
|
8068
8095
|
border-color: var(--scalar-border-color);
|
|
8069
8096
|
}
|
|
8070
|
-
.group-hover-input[data-v-
|
|
8097
|
+
.group-hover-input[data-v-2e177312]:focus {
|
|
8071
8098
|
background: transparent !important;
|
|
8072
8099
|
border-color: var(--scalar-border-color) !important;
|
|
8073
8100
|
}
|
|
@@ -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":"AAi4BA,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,wBAAwB,CAAA;AAG/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAA;AAC7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iDAAiD,CAAA;AACnF,OAAO,KAAK,EACV,QAAQ,EACR,UAAU,EACV,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAML,KAAK,qBAAqB,EAE1B,KAAK,0BAA0B,EAChC,MAAM,yCAAyC,CAAA;AAChD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qEAAqE,CAAA;AACxG,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EACb,MAAM,8DAA8D,CAAA;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uDAAuD,CAAA;AAmC5F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAKrD;;;;;;;;;;;;GAYG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAMzC,MAAM,MAAM,mB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AAE,eAAe,CAAA;IACjC,+DAA+D;IAC/D,UAAU,EAAE,MAAM,CAAA;IAClB,2CAA2C;IAC3C,QAAQ,EAAE,QAAQ,CAAA;IAClB,wCAAwC;IACxC,eAAe,EAAE,qBAAqB,CAAA;IACtC,qBAAqB;IACrB,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,uBAAuB;IACvB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;IACvB,qCAAqC;IACrC,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,8CAA8C;IAC9C,WAAW,EAAE,kBAAkB,CAAA;IAC/B,yCAAyC;IACzC,QAAQ,EAAE,MAAM,CAAA;IAChB,kCAAkC;IAClC,gBAAgB,EAAE,gBAAgB,CAAA;IAClC,0CAA0C;IAC1C,uBAAuB,EAAE,0BAA0B,EAAE,CAAA;IACrD,4BAA4B;IAC5B,oBAAoB,EAAE,eAAe,CAAC,UAAU,CAAC,CAAA;IACjD,sBAAsB;IACtB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACtC,sEAAsE;IACtE,+BAA+B,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACxD,6CAA6C;IAC7C,OAAO,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAA;CAChC,CAAA;AACD,QAAA,MAAM,YAAY;;;;kFAq6Bd,CAAC"}
|
package/dist/v2/blocks/operation-block/OperationBlock.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -161,6 +161,7 @@ var OperationBlock_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
161
161
|
isElectron: isElectron(),
|
|
162
162
|
openapiVersion: openapiVersion.value,
|
|
163
163
|
jsonSchemaDialect: __props.document.jsonSchemaDialect,
|
|
164
|
+
multipartNaming: toValue(__props.options)?.multipartNaming,
|
|
164
165
|
requestBodyCompositionSelection: __props.requestBodyCompositionSelection
|
|
165
166
|
});
|
|
166
167
|
return resolveExecutableRequestUrl(request, getEnvironmentVariables(__props.environment), { allowMissingRequestServerBase });
|
|
@@ -222,6 +223,7 @@ var OperationBlock_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
222
223
|
isElectron: isElectron(),
|
|
223
224
|
openapiVersion: openapiVersion.value,
|
|
224
225
|
jsonSchemaDialect: __props.document.jsonSchemaDialect,
|
|
226
|
+
multipartNaming: toValue(__props.options)?.multipartNaming,
|
|
225
227
|
requestBodyCompositionSelection: __props.requestBodyCompositionSelection
|
|
226
228
|
});
|
|
227
229
|
if (response.value && "reader" in response.value) response.value.reader.cancel();
|
|
@@ -536,6 +538,7 @@ var OperationBlock_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
536
538
|
jsonSchemaDialect: __props.document.jsonSchemaDialect,
|
|
537
539
|
layout: __props.layout,
|
|
538
540
|
method: __props.method,
|
|
541
|
+
multipartNaming: toValue(__props.options)?.multipartNaming,
|
|
539
542
|
openapiVersion: openapiVersion.value,
|
|
540
543
|
operation: __props.operation,
|
|
541
544
|
options: toValue(__props.options),
|
|
@@ -565,6 +568,7 @@ var OperationBlock_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
565
568
|
"jsonSchemaDialect",
|
|
566
569
|
"layout",
|
|
567
570
|
"method",
|
|
571
|
+
"multipartNaming",
|
|
568
572
|
"openapiVersion",
|
|
569
573
|
"operation",
|
|
570
574
|
"options",
|
package/dist/v2/blocks/operation-block/OperationBlock.vue_vue_type_script_setup_true_lang.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OperationBlock.vue_vue_type_script_setup_true_lang.js","names":["$emit","_openBlock","_createElementBlock","_createElementVNode","_createVNode","Header","ViewLayout","_withCtx","ViewLayoutContent","_createBlock","ViewLayoutSection","_createTextVNode","_Fragment","_unref","RequestBlock","ResponseBlock"],"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 /** Keep execution and editing unavailable until the selected payload is ready. */\n externalExamplesPending?: boolean\n externalExamplesFailed?: boolean\n /** Event bus */\n eventBus: WorkspaceEventBus\n /** Application version */\n appVersion: string\n /** Openapi document */\n document: OpenApiDocument\n /** Openapi document slug */\n documentSlug: string\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: string\n /** Whether `path` identifies an OpenAPI webhook. */\n isWebhook?: boolean\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 /** Operation before downloaded examples are overlaid, for parameter edit targets. */\n sourceOperation?: 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 { generateClientOptions } from '@scalar/blocks/code-example'\nimport { ScalarButton } from '@scalar/components/button'\nimport { ERRORS } from '@scalar/helpers/errors/normalize-error'\nimport { isElectron } from '@scalar/helpers/general/is-electron'\nimport { isAllowedOAuthUrl } from '@scalar/helpers/url/is-allowed-oauth-url'\nimport { buildSafeBodyRequest } from '@scalar/helpers/http/can-method-have-body'\nimport { isForbiddenHttpMethod } from '@scalar/helpers/http/is-forbidden-http-method'\nimport {\n executeHook,\n executeResponseHook,\n type ClientPlugin,\n} from '@scalar/oas-utils/helpers'\nimport {\n AVAILABLE_CLIENTS,\n type AvailableClients,\n} from '@scalar/types/snippetz'\nimport { useClipboard } from '@scalar/use-hooks/useClipboard'\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 resolveExecutableRequestUrl,\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.2/strict/openapi-document'\nimport type { OperationObject } from '@scalar/workspace-store/schemas/v3.2/strict/operation'\nimport {\n computed,\n nextTick,\n onBeforeUnmount,\n onMounted,\n ref,\n toValue,\n watch,\n} from 'vue'\n\nimport ViewLayout from '@/components/ViewLayout/ViewLayout.vue'\nimport ViewLayoutContent from '@/components/ViewLayout/ViewLayoutContent.vue'\nimport ViewLayoutSection from '@/components/ViewLayout/ViewLayoutSection.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 getCookieRequestUrl,\n getResponseCookieActions,\n} from '@/v2/blocks/operation-block/helpers/persist-response-cookies'\nimport { getEnvironmentPersistenceActions } from '@/v2/blocks/operation-block/helpers/persist-script-environment'\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 { RequestBlock } from '@/v2/blocks/request-block'\nimport { ResponseBlock } from '@/v2/blocks/response-block'\nimport { type History } from '@/v2/blocks/scalar-address-bar-block'\nimport { useLocalization } from '@/v2/features/localization'\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 externalExamplesPending = false,\n externalExamplesFailed = false,\n authMeta,\n environment,\n eventBus,\n exampleKey,\n document,\n documentSlug,\n workspaceCookies = [],\n documentCookies = [],\n hideClientButton,\n httpClients = AVAILABLE_CLIENTS,\n history = [],\n layout,\n method,\n isWebhook = false,\n operation,\n sourceOperation,\n path,\n plugins = [],\n proxyUrl,\n requestBodyCompositionSelection,\n securitySchemes,\n selectedClient,\n server,\n servers,\n environments,\n options,\n activeEnvironment,\n serverMeta,\n selectedSecurity,\n selectedSecuritySchemes,\n securityRequirements,\n defaultHeaders,\n} = defineProps<OperationBlockProps>()\n\ndefineEmits<{ (e: 'retry:externalExamples'): void }>()\n\nconst { translate } = useLocalization()\n\nconst openapiVersion = computed<string>(\n () => document['x-original-oas-version'] || document.openapi,\n)\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()\nconst { copyToClipboard } = useClipboard()\n\n// Refs\nconst abortController = ref<AbortController | null>(null)\nconst response = ref<ResponseInstance | null>(null)\nconst requestError = ref<Error | null>(null)\nconst requestPayload = ref<RequestPayload | null>(null)\n\n/**\n * A webhook has no OpenAPI server, so its destination is the full URL the user\n * enters at runtime. The field holds that whole URL (not a server-relative path),\n * and the request is sent to it directly with no separate server base.\n */\nconst webhookUrl = ref('')\n\nwatch(\n [() => path, () => method, () => isWebhook],\n () => {\n webhookUrl.value = ''\n },\n { immediate: true },\n)\n\nconst requestPath = computed(() => (isWebhook ? webhookUrl.value : path))\nconst requestServer = computed<ServerObject | null>(() =>\n isWebhook ? null : server,\n)\n\n/** Cancel the request */\nconst cancelRequest = () => abortController.value?.abort(ERRORS.REQUEST_ABORTED)\n\n/**\n * Persist server-set cookies from a response into the document cookie jar.\n *\n * Scalar keeps its own cookie jar because browsers hide `Set-Cookie` from `fetch`.\n * Mirroring browser behavior, cookies are stored scoped to the request host and\n * path and removed when the server expires them, so a value like a Django CSRF\n * token stays available for later PUT/PATCH requests after a page reload.\n */\nconst persistResponseCookies = (sendResult: {\n response: ResponseInstance\n requestPayload: RequestPayload\n}) => {\n const actions = getResponseCookieActions({\n cookieHeaderKeys: sendResult.response.cookieHeaderKeys ?? [],\n documentCookies,\n requestUrl: getCookieRequestUrl(String(sendResult.requestPayload[0])),\n })\n\n for (const action of actions) {\n if (action.type === 'delete') {\n eventBus.emit('cookie:delete:cookie', {\n collectionType: 'document',\n cookieName: action.cookieName,\n index: action.index,\n })\n continue\n }\n\n eventBus.emit('cookie:upsert:cookie', {\n collectionType: 'document',\n payload: action.cookie,\n ...(action.index === undefined ? {} : { index: action.index }),\n })\n }\n}\n\n/**\n * Resolve the executable URL using the same pipeline as Send (`requestFactory` +\n * `resolveExecutableRequestUrl`), including security query params.\n */\nconst getAddressBarUrl = (allowMissingRequestServerBase = true): string => {\n const { request } = requestFactory({\n defaultHeaders,\n environment,\n exampleName: exampleKey,\n globalCookies: [...workspaceCookies, ...documentCookies],\n method,\n operation,\n path: requestPath.value,\n proxyUrl,\n server: requestServer.value,\n selectedSecuritySchemes,\n isElectron: isElectron(),\n openapiVersion: openapiVersion.value,\n jsonSchemaDialect: document.jsonSchemaDialect,\n requestBodyCompositionSelection,\n })\n\n return resolveExecutableRequestUrl(\n request,\n getEnvironmentVariables(environment),\n { allowMissingRequestServerBase },\n )\n}\n\n/** Copy remains permissive so incomplete URLs can still be shared or edited. */\nconst copyAddressBarUrl = async (): Promise<void> => {\n await copyToClipboard(getAddressBarUrl())\n}\n\n/** Browser navigation uses the destination URL and the browser's own session. */\nconst openInBrowser = async (): Promise<void> => {\n if (method.toLowerCase() !== 'get' || externalExamplesPending) return\n\n eventBus.flushDebouncedEmits?.()\n // Apply pending parameter and address-bar edits before resolving the destination.\n await nextTick()\n\n if (!validatePathParameters(operation.parameters ?? [], exampleKey).ok) {\n toast(translate('apiClient.operationBlock.pathParametersRequired'), 'error')\n return\n }\n\n try {\n const url = new URL(getAddressBarUrl(layout === 'modal' && !isWebhook))\n // A request URL is untrusted input; navigation must never execute another scheme.\n if (url.protocol !== 'http:' && url.protocol !== 'https:') {\n toast(translate('apiClient.addressBar.browserUrlRequired'), 'error')\n return\n }\n // Match Electron's external-navigation policy instead of silently dropping the action.\n if (isElectron() && !isAllowedOAuthUrl(url)) {\n toast(\n translate('apiClient.addressBar.desktopBrowserUrlRequired'),\n 'error',\n )\n return\n }\n window.open(url.href, '_blank', 'noopener,noreferrer')\n } catch {\n toast(translate('apiClient.addressBar.browserUrlRequired'), 'error')\n }\n}\n\n/** Execute the current operation example */\nconst handleExecute = async () => {\n if (externalExamplesPending) return\n requestError.value = null\n eventBus.flushDebouncedEmits?.()\n // Source edits must reach the overlaid operation prop before building the request.\n await nextTick()\n\n if (isWebhook && !requestPath.value.trim()) {\n toast(translate('apiClient.operationBlock.webhookUrlRequired'), 'error')\n return\n }\n\n const pathValidation = validatePathParameters(\n operation.parameters ?? [],\n exampleKey,\n )\n if (pathValidation.ok === false) {\n toast(translate('apiClient.operationBlock.pathParametersRequired'), '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: requestPath.value,\n proxyUrl,\n server: requestServer.value,\n selectedSecuritySchemes,\n isElectron: isElectron(),\n openapiVersion: openapiVersion.value,\n jsonSchemaDialect: document.jsonSchemaDialect,\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 // Seed the script variable store with the active environment so pm.environment.get()\n // and pm.variables.get() resolve to the same values as {{…}} placeholders. Without\n // seeding, the store starts empty and every scripted read returns undefined.\n const seededEnvironment = getEnvironmentVariables(environment)\n variablesStore.setEnvironment?.(\n Object.entries(seededEnvironment).map(([key, value]) => ({ key, value })),\n )\n\n // Snapshot the persistence target at request start, alongside the seed. Persistence runs after\n // the request completes (awaits below), and the environment props are reactive — if the active\n // environment is switched mid-flight, or a concurrent request splices these arrays, reading\n // them at persist time would apply the script's writes to the wrong environment or resolve\n // workspace/document indexes against a shifted list. Copy the arrays (not just the reference)\n // so the seeded values and these targets stay fixed to the same point in time.\n const persistenceTarget = activeEnvironment\n ? {\n environmentName: activeEnvironment,\n mergedVariables: [...environment.variables],\n documentVariables: [\n ...(document['x-scalar-environments']?.[activeEnvironment]\n ?.variables ?? []),\n ],\n environmentExistsOnDocument: Boolean(\n document['x-scalar-environments']?.[activeEnvironment],\n ),\n }\n : null\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 server: requestServer.value,\n customFetch: toValue(options)?.customFetch,\n },\n 'beforeRequest',\n plugins,\n )\n\n // Persist environment variables set by scripts (pm.environment.set / unset) back to the active\n // environment so they survive to the next request, mirroring the Environment tab. Scope and\n // index are resolved from the seed-time environment so updates mutate in place. Defined here so\n // it can run on every exit path after the pre-request scripts — including a build failure or a\n // failed send — so a pre-request set, like a token stored before a flaky call, is not lost.\n const persistScriptEnvironment = () => {\n if (!persistenceTarget) {\n return\n }\n\n const environmentActions = getEnvironmentPersistenceActions({\n ...persistenceTarget,\n seededVariables: seededEnvironment,\n scriptVariables: variablesStore.getEnvironment(),\n })\n\n for (const action of environmentActions) {\n if (action.type === 'delete') {\n eventBus.emit('environment:delete:environment-variable', {\n environmentName: action.environmentName,\n index: action.index,\n collectionType: action.collectionType,\n })\n } else {\n eventBus.emit('environment:upsert:environment-variable', {\n environmentName: action.environmentName,\n variable: action.variable,\n index: action.index,\n collectionType: action.collectionType,\n })\n }\n }\n }\n\n // Resolve {{…}} placeholders from the script store so pre-request pm.environment.set() and\n // unset() take effect on this request. The store was seeded from the active environment, so\n // it already holds every value spreading seededEnvironment would add — minus the keys a script\n // unset, which must stay dropped (an object spread cannot remove them again).\n const envVariables = variablesStore.getVariables()\n\n // Build the fetch Request after hooks may have mutated the factory\n const built = buildRequest(requestBuilder, {\n envVariables,\n allowMissingRequestServerBase: layout === 'modal',\n })\n if (!built.ok) {\n // Save any pre-request script writes before bailing out on a build failure.\n persistScriptEnvironment()\n toast(built.message ?? built.error, 'error')\n return\n }\n\n // Check the final method because pre-request scripts can change it.\n const requestMethod = built.data.requestPayload[1].method ?? 'GET'\n if (isForbiddenHttpMethod(requestMethod)) {\n persistScriptEnvironment()\n toast(\n translate('apiClient.operationBlock.forbiddenMethod', {\n method: requestMethod.toUpperCase(),\n }),\n 'error',\n )\n return\n }\n\n // Store the abort controller for cancellation\n abortController.value = built.data.controller\n\n // Build the fetch Request once so the requestBuilt hook observes the exact bytes that are\n // sent. Rebuilding it later would generate a different multipart boundary, which breaks\n // plugins that hash the body (for example, request signing).\n const request = buildSafeBodyRequest(...built.data.requestPayload)\n\n // Execute the requestBuilt hook (plugins receive the exact fetch Request that will be sent)\n await executeHook(\n {\n request,\n requestBuilder,\n document,\n operation,\n variablesStore,\n },\n 'requestBuilt',\n plugins,\n )\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: built.data.isUsingProxy,\n requestPayload: built.data.requestPayload,\n request,\n plugins,\n customFetch: toValue(options)?.customFetch,\n onResponseReceived: async (response, responseDuration) => {\n const result = await executeResponseHook(\n {\n response,\n responseDuration,\n requestBuilder,\n request: buildSafeBodyRequest(...built.data.requestPayload),\n document,\n operation,\n variablesStore,\n },\n plugins,\n )\n return result.response\n },\n })\n\n // Save script environment writes (pre-request and, on success, post-response) back to the\n // active environment. Runs even when the send fails so a pre-request set is not lost.\n persistScriptEnvironment()\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 // Cancellation also happens when navigating away; keep the new operation intact.\n if (built.data.controller.signal.aborted) {\n if (abortController.value === built.data.controller) {\n abortController.value = null\n }\n return\n }\n requestError.value = 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 // Persist server-set cookies into the document jar so values like a CSRF token\n // survive a page reload and get replayed on the next request, like a browser would.\n persistResponseCookies(sendResult)\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 eventBus.on('copy-url:address-bar', copyAddressBarUrl)\n\n // Let plugins warm up per-operation resources (e.g. the scripts sandbox) so the first request\n // does not pay their cold-start cost.\n void executeHook({ document, operation }, 'onRequestMount', plugins)\n})\nonBeforeUnmount(() => {\n eventBus.off('operation:send:request:hotkey', handleExecute)\n eventBus.off('operation:cancel:request', cancelRequest)\n eventBus.off('copy-url:address-bar', copyAddressBarUrl)\n})\n\nconst operationHistory = computed<History[]>(() =>\n history\n .map((entry) => ({\n method: entry.request.method as string,\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 requestError.value = null\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, restore the response panel\n * for the new operation from the best available source:\n *\n * 1. `responseCache` — in-memory, populated on every successful send.\n * Has the live response object (including streams) so it wins.\n * 2. `history` — persisted in the workspace store. Used as a fallback when\n * the in-memory cache is empty (page reload, fresh app session, etc.)\n * so navigating to an operation that has been called before shows the\n * last response instead of an empty panel.\n * 3. Otherwise clear.\n *\n * Only the response is restored from history — the user's request inputs are\n * left alone, so we never silently overwrite an in-progress draft.\n */\nwatch(\n [() => path, () => method, () => exampleKey],\n ([newPath, newMethod, newExampleKey]) => {\n requestError.value = null\n const cached = responseCache.get(\n getOperationExampleKey(newMethod, newPath, newExampleKey),\n )\n\n if (cached) {\n response.value = cached.response\n requestPayload.value = cached.requestPayload\n } else {\n // History is keyed only by document/path/method but each entry carries\n // the example it came from, so we walk from the end and pick the most\n // recent entry that matches the active example. Otherwise a cache miss\n // on example B would restore example A's response. Only runs on a\n // cache miss — the common case (in-session navigation) skips it.\n const latest = (() => {\n for (let i = history.length - 1; i >= 0; i--) {\n const entry = history[i]\n if (entry?.meta.example === newExampleKey) {\n return entry\n }\n }\n return undefined\n })()\n\n if (latest) {\n response.value = harToFetchResponse({\n harResponse: latest.response,\n url: latest.request.url,\n method: newMethod,\n path: newPath,\n duration: latest.time,\n })\n requestPayload.value = null\n } else {\n response.value = null\n requestPayload.value = null\n }\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 min-w-0 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 :documentSlug\n :documentUrl\n :environment\n :environments\n :eventBus\n :exampleKey\n :executionDisabled=\"externalExamplesPending\"\n :hideClientButton\n :history=\"operationHistory\"\n :integration\n :isWebhook\n :layout\n :method\n :path=\"requestPath\"\n :server=\"requestServer\"\n :serverMeta\n :servers\n :source\n @execute=\"handleExecute\"\n @navigate:settings=\"handleNavigateSettings\"\n @open:browser=\"openInBrowser\"\n @select:history:item=\"handleSelectHistoryItem\"\n @update:webhookUrl=\"(value: string) => (webhookUrl = value)\" />\n </div>\n\n <ViewLayout class=\"border-t\">\n <ViewLayoutContent class=\"flex-1\">\n <!-- Request Section -->\n <ViewLayoutSection\n v-if=\"externalExamplesPending\"\n aria-label=\"Request\">\n <template #title>Request</template>\n <div\n class=\"text-c-2 p-4\"\n role=\"status\">\n <template v-if=\"externalExamplesFailed\">\n Could not load this example.\n <ScalarButton\n size=\"sm\"\n variant=\"ghost\"\n @click=\"$emit('retry:externalExamples')\">\n Retry\n </ScalarButton>\n </template>\n <template v-else>Loading example…</template>\n </div>\n </ViewLayoutSection>\n <RequestBlock\n v-else\n :allowedSecuritySchemes=\"\n toValue(options)?.authentication?.allowedSecuritySchemes\n \"\n :authMeta\n :clientOptions\n :defaultHeaders\n :defaultRequestBodyView=\"\n document['x-scalar-default-request-body-view']\n \"\n :documentCookies\n :documentSlug\n :environment\n :eventBus\n :exampleKey\n :jsonSchemaDialect=\"document.jsonSchemaDialect\"\n :layout\n :method\n :openapiVersion\n :operation\n :options=\"toValue(options)\"\n :path=\"requestPath\"\n :plugins\n :proxyUrl\n :requestBodyCompositionSelection\n :securityRequirements\n :securitySchemes\n :selectedClient\n :selectedSecurity\n :selectedSecuritySchemes\n :server=\"requestServer\"\n :sourceOperation\n :workspaceCookies />\n\n <!-- Response Section -->\n <ResponseBlock\n :appVersion\n :eventBus\n :executionDisabled=\"externalExamplesPending\"\n :layout\n :plugins\n :requestError\n :requestPayload\n :response\n :totalPerformedRequests=\"operationHistory.length\" />\n </ViewLayoutContent>\n </ViewLayout>\n </div>\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MACA,YAAA,QAAA;MACA,mBAAmB,QAAA,SAAS;MAC5B,QAAA,QAAA;MACA,QAAA,QAAA;MACA,gBAAA,eAAA;MACA,WAAA,QAAA;MACA,SAAS,QAAQ,QAAA,OAAO;MACxB,MAAM,YAAA;MACN,SAAA,QAAA;MACA,UAAA,QAAA;MACA,iCAAA,QAAA;MACA,sBAAA,QAAA;MACA,iBAAA,QAAA;MACA,gBAAA,QAAA;MACA,kBAAA,QAAA;MACA,yBAAA,QAAA;MACA,QAAQ,cAAA;MACR,iBAAA,QAAA;MACA,kBAAA,QAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;K,KAGHV,YASsDS,MAAAE,qBAAA,GAAA;MARnD,YAAA,QAAA;MACA,UAAA,QAAA;MACA,mBAAmB,QAAA;MACnB,QAAA,QAAA;MACA,SAAA,QAAA;MACA,cAAA,aAAA;MACA,gBAAA,eAAA;MACA,UAAA,SAAA;MACA,wBAAwB,iBAAA,MAAiB"}
|
|
1
|
+
{"version":3,"file":"OperationBlock.vue_vue_type_script_setup_true_lang.js","names":["$emit","_openBlock","_createElementBlock","_createElementVNode","_createVNode","Header","ViewLayout","_withCtx","ViewLayoutContent","_createBlock","ViewLayoutSection","_createTextVNode","_Fragment","_unref","RequestBlock","ResponseBlock"],"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 /** Keep execution and editing unavailable until the selected payload is ready. */\n externalExamplesPending?: boolean\n externalExamplesFailed?: boolean\n /** Event bus */\n eventBus: WorkspaceEventBus\n /** Application version */\n appVersion: string\n /** Openapi document */\n document: OpenApiDocument\n /** Openapi document slug */\n documentSlug: string\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: string\n /** Whether `path` identifies an OpenAPI webhook. */\n isWebhook?: boolean\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 /** Operation before downloaded examples are overlaid, for parameter edit targets. */\n sourceOperation?: 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 { generateClientOptions } from '@scalar/blocks/code-example'\nimport { ScalarButton } from '@scalar/components/button'\nimport { ERRORS } from '@scalar/helpers/errors/normalize-error'\nimport { isElectron } from '@scalar/helpers/general/is-electron'\nimport { isAllowedOAuthUrl } from '@scalar/helpers/url/is-allowed-oauth-url'\nimport { buildSafeBodyRequest } from '@scalar/helpers/http/can-method-have-body'\nimport { isForbiddenHttpMethod } from '@scalar/helpers/http/is-forbidden-http-method'\nimport {\n executeHook,\n executeResponseHook,\n type ClientPlugin,\n} from '@scalar/oas-utils/helpers'\nimport {\n AVAILABLE_CLIENTS,\n type AvailableClients,\n} from '@scalar/types/snippetz'\nimport { useClipboard } from '@scalar/use-hooks/useClipboard'\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 resolveExecutableRequestUrl,\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.2/strict/openapi-document'\nimport type { OperationObject } from '@scalar/workspace-store/schemas/v3.2/strict/operation'\nimport {\n computed,\n nextTick,\n onBeforeUnmount,\n onMounted,\n ref,\n toValue,\n watch,\n} from 'vue'\n\nimport ViewLayout from '@/components/ViewLayout/ViewLayout.vue'\nimport ViewLayoutContent from '@/components/ViewLayout/ViewLayoutContent.vue'\nimport ViewLayoutSection from '@/components/ViewLayout/ViewLayoutSection.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 getCookieRequestUrl,\n getResponseCookieActions,\n} from '@/v2/blocks/operation-block/helpers/persist-response-cookies'\nimport { getEnvironmentPersistenceActions } from '@/v2/blocks/operation-block/helpers/persist-script-environment'\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 { RequestBlock } from '@/v2/blocks/request-block'\nimport { ResponseBlock } from '@/v2/blocks/response-block'\nimport { type History } from '@/v2/blocks/scalar-address-bar-block'\nimport { useLocalization } from '@/v2/features/localization'\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 externalExamplesPending = false,\n externalExamplesFailed = false,\n authMeta,\n environment,\n eventBus,\n exampleKey,\n document,\n documentSlug,\n workspaceCookies = [],\n documentCookies = [],\n hideClientButton,\n httpClients = AVAILABLE_CLIENTS,\n history = [],\n layout,\n method,\n isWebhook = false,\n operation,\n sourceOperation,\n path,\n plugins = [],\n proxyUrl,\n requestBodyCompositionSelection,\n securitySchemes,\n selectedClient,\n server,\n servers,\n environments,\n options,\n activeEnvironment,\n serverMeta,\n selectedSecurity,\n selectedSecuritySchemes,\n securityRequirements,\n defaultHeaders,\n} = defineProps<OperationBlockProps>()\n\ndefineEmits<{ (e: 'retry:externalExamples'): void }>()\n\nconst { translate } = useLocalization()\n\nconst openapiVersion = computed<string>(\n () => document['x-original-oas-version'] || document.openapi,\n)\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()\nconst { copyToClipboard } = useClipboard()\n\n// Refs\nconst abortController = ref<AbortController | null>(null)\nconst response = ref<ResponseInstance | null>(null)\nconst requestError = ref<Error | null>(null)\nconst requestPayload = ref<RequestPayload | null>(null)\n\n/**\n * A webhook has no OpenAPI server, so its destination is the full URL the user\n * enters at runtime. The field holds that whole URL (not a server-relative path),\n * and the request is sent to it directly with no separate server base.\n */\nconst webhookUrl = ref('')\n\nwatch(\n [() => path, () => method, () => isWebhook],\n () => {\n webhookUrl.value = ''\n },\n { immediate: true },\n)\n\nconst requestPath = computed(() => (isWebhook ? webhookUrl.value : path))\nconst requestServer = computed<ServerObject | null>(() =>\n isWebhook ? null : server,\n)\n\n/** Cancel the request */\nconst cancelRequest = () => abortController.value?.abort(ERRORS.REQUEST_ABORTED)\n\n/**\n * Persist server-set cookies from a response into the document cookie jar.\n *\n * Scalar keeps its own cookie jar because browsers hide `Set-Cookie` from `fetch`.\n * Mirroring browser behavior, cookies are stored scoped to the request host and\n * path and removed when the server expires them, so a value like a Django CSRF\n * token stays available for later PUT/PATCH requests after a page reload.\n */\nconst persistResponseCookies = (sendResult: {\n response: ResponseInstance\n requestPayload: RequestPayload\n}) => {\n const actions = getResponseCookieActions({\n cookieHeaderKeys: sendResult.response.cookieHeaderKeys ?? [],\n documentCookies,\n requestUrl: getCookieRequestUrl(String(sendResult.requestPayload[0])),\n })\n\n for (const action of actions) {\n if (action.type === 'delete') {\n eventBus.emit('cookie:delete:cookie', {\n collectionType: 'document',\n cookieName: action.cookieName,\n index: action.index,\n })\n continue\n }\n\n eventBus.emit('cookie:upsert:cookie', {\n collectionType: 'document',\n payload: action.cookie,\n ...(action.index === undefined ? {} : { index: action.index }),\n })\n }\n}\n\n/**\n * Resolve the executable URL using the same pipeline as Send (`requestFactory` +\n * `resolveExecutableRequestUrl`), including security query params.\n */\nconst getAddressBarUrl = (allowMissingRequestServerBase = true): string => {\n const { request } = requestFactory({\n defaultHeaders,\n environment,\n exampleName: exampleKey,\n globalCookies: [...workspaceCookies, ...documentCookies],\n method,\n operation,\n path: requestPath.value,\n proxyUrl,\n server: requestServer.value,\n selectedSecuritySchemes,\n isElectron: isElectron(),\n openapiVersion: openapiVersion.value,\n jsonSchemaDialect: document.jsonSchemaDialect,\n multipartNaming: toValue(options)?.multipartNaming,\n requestBodyCompositionSelection,\n })\n\n return resolveExecutableRequestUrl(\n request,\n getEnvironmentVariables(environment),\n { allowMissingRequestServerBase },\n )\n}\n\n/** Copy remains permissive so incomplete URLs can still be shared or edited. */\nconst copyAddressBarUrl = async (): Promise<void> => {\n await copyToClipboard(getAddressBarUrl())\n}\n\n/** Browser navigation uses the destination URL and the browser's own session. */\nconst openInBrowser = async (): Promise<void> => {\n if (method.toLowerCase() !== 'get' || externalExamplesPending) return\n\n eventBus.flushDebouncedEmits?.()\n // Apply pending parameter and address-bar edits before resolving the destination.\n await nextTick()\n\n if (!validatePathParameters(operation.parameters ?? [], exampleKey).ok) {\n toast(translate('apiClient.operationBlock.pathParametersRequired'), 'error')\n return\n }\n\n try {\n const url = new URL(getAddressBarUrl(layout === 'modal' && !isWebhook))\n // A request URL is untrusted input; navigation must never execute another scheme.\n if (url.protocol !== 'http:' && url.protocol !== 'https:') {\n toast(translate('apiClient.addressBar.browserUrlRequired'), 'error')\n return\n }\n // Match Electron's external-navigation policy instead of silently dropping the action.\n if (isElectron() && !isAllowedOAuthUrl(url)) {\n toast(\n translate('apiClient.addressBar.desktopBrowserUrlRequired'),\n 'error',\n )\n return\n }\n window.open(url.href, '_blank', 'noopener,noreferrer')\n } catch {\n toast(translate('apiClient.addressBar.browserUrlRequired'), 'error')\n }\n}\n\n/** Execute the current operation example */\nconst handleExecute = async () => {\n if (externalExamplesPending) return\n requestError.value = null\n eventBus.flushDebouncedEmits?.()\n // Source edits must reach the overlaid operation prop before building the request.\n await nextTick()\n\n if (isWebhook && !requestPath.value.trim()) {\n toast(translate('apiClient.operationBlock.webhookUrlRequired'), 'error')\n return\n }\n\n const pathValidation = validatePathParameters(\n operation.parameters ?? [],\n exampleKey,\n )\n if (pathValidation.ok === false) {\n toast(translate('apiClient.operationBlock.pathParametersRequired'), '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: requestPath.value,\n proxyUrl,\n server: requestServer.value,\n selectedSecuritySchemes,\n isElectron: isElectron(),\n openapiVersion: openapiVersion.value,\n jsonSchemaDialect: document.jsonSchemaDialect,\n multipartNaming: toValue(options)?.multipartNaming,\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 // Seed the script variable store with the active environment so pm.environment.get()\n // and pm.variables.get() resolve to the same values as {{…}} placeholders. Without\n // seeding, the store starts empty and every scripted read returns undefined.\n const seededEnvironment = getEnvironmentVariables(environment)\n variablesStore.setEnvironment?.(\n Object.entries(seededEnvironment).map(([key, value]) => ({ key, value })),\n )\n\n // Snapshot the persistence target at request start, alongside the seed. Persistence runs after\n // the request completes (awaits below), and the environment props are reactive — if the active\n // environment is switched mid-flight, or a concurrent request splices these arrays, reading\n // them at persist time would apply the script's writes to the wrong environment or resolve\n // workspace/document indexes against a shifted list. Copy the arrays (not just the reference)\n // so the seeded values and these targets stay fixed to the same point in time.\n const persistenceTarget = activeEnvironment\n ? {\n environmentName: activeEnvironment,\n mergedVariables: [...environment.variables],\n documentVariables: [\n ...(document['x-scalar-environments']?.[activeEnvironment]\n ?.variables ?? []),\n ],\n environmentExistsOnDocument: Boolean(\n document['x-scalar-environments']?.[activeEnvironment],\n ),\n }\n : null\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 server: requestServer.value,\n customFetch: toValue(options)?.customFetch,\n },\n 'beforeRequest',\n plugins,\n )\n\n // Persist environment variables set by scripts (pm.environment.set / unset) back to the active\n // environment so they survive to the next request, mirroring the Environment tab. Scope and\n // index are resolved from the seed-time environment so updates mutate in place. Defined here so\n // it can run on every exit path after the pre-request scripts — including a build failure or a\n // failed send — so a pre-request set, like a token stored before a flaky call, is not lost.\n const persistScriptEnvironment = () => {\n if (!persistenceTarget) {\n return\n }\n\n const environmentActions = getEnvironmentPersistenceActions({\n ...persistenceTarget,\n seededVariables: seededEnvironment,\n scriptVariables: variablesStore.getEnvironment(),\n })\n\n for (const action of environmentActions) {\n if (action.type === 'delete') {\n eventBus.emit('environment:delete:environment-variable', {\n environmentName: action.environmentName,\n index: action.index,\n collectionType: action.collectionType,\n })\n } else {\n eventBus.emit('environment:upsert:environment-variable', {\n environmentName: action.environmentName,\n variable: action.variable,\n index: action.index,\n collectionType: action.collectionType,\n })\n }\n }\n }\n\n // Resolve {{…}} placeholders from the script store so pre-request pm.environment.set() and\n // unset() take effect on this request. The store was seeded from the active environment, so\n // it already holds every value spreading seededEnvironment would add — minus the keys a script\n // unset, which must stay dropped (an object spread cannot remove them again).\n const envVariables = variablesStore.getVariables()\n\n // Build the fetch Request after hooks may have mutated the factory\n const built = buildRequest(requestBuilder, {\n envVariables,\n allowMissingRequestServerBase: layout === 'modal',\n })\n if (!built.ok) {\n // Save any pre-request script writes before bailing out on a build failure.\n persistScriptEnvironment()\n toast(built.message ?? built.error, 'error')\n return\n }\n\n // Check the final method because pre-request scripts can change it.\n const requestMethod = built.data.requestPayload[1].method ?? 'GET'\n if (isForbiddenHttpMethod(requestMethod)) {\n persistScriptEnvironment()\n toast(\n translate('apiClient.operationBlock.forbiddenMethod', {\n method: requestMethod.toUpperCase(),\n }),\n 'error',\n )\n return\n }\n\n // Store the abort controller for cancellation\n abortController.value = built.data.controller\n\n // Build the fetch Request once so the requestBuilt hook observes the exact bytes that are\n // sent. Rebuilding it later would generate a different multipart boundary, which breaks\n // plugins that hash the body (for example, request signing).\n const request = buildSafeBodyRequest(...built.data.requestPayload)\n\n // Execute the requestBuilt hook (plugins receive the exact fetch Request that will be sent)\n await executeHook(\n {\n request,\n requestBuilder,\n document,\n operation,\n variablesStore,\n },\n 'requestBuilt',\n plugins,\n )\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: built.data.isUsingProxy,\n requestPayload: built.data.requestPayload,\n request,\n plugins,\n customFetch: toValue(options)?.customFetch,\n onResponseReceived: async (response, responseDuration) => {\n const result = await executeResponseHook(\n {\n response,\n responseDuration,\n requestBuilder,\n request: buildSafeBodyRequest(...built.data.requestPayload),\n document,\n operation,\n variablesStore,\n },\n plugins,\n )\n return result.response\n },\n })\n\n // Save script environment writes (pre-request and, on success, post-response) back to the\n // active environment. Runs even when the send fails so a pre-request set is not lost.\n persistScriptEnvironment()\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 // Cancellation also happens when navigating away; keep the new operation intact.\n if (built.data.controller.signal.aborted) {\n if (abortController.value === built.data.controller) {\n abortController.value = null\n }\n return\n }\n requestError.value = 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 // Persist server-set cookies into the document jar so values like a CSRF token\n // survive a page reload and get replayed on the next request, like a browser would.\n persistResponseCookies(sendResult)\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 eventBus.on('copy-url:address-bar', copyAddressBarUrl)\n\n // Let plugins warm up per-operation resources (e.g. the scripts sandbox) so the first request\n // does not pay their cold-start cost.\n void executeHook({ document, operation }, 'onRequestMount', plugins)\n})\nonBeforeUnmount(() => {\n eventBus.off('operation:send:request:hotkey', handleExecute)\n eventBus.off('operation:cancel:request', cancelRequest)\n eventBus.off('copy-url:address-bar', copyAddressBarUrl)\n})\n\nconst operationHistory = computed<History[]>(() =>\n history\n .map((entry) => ({\n method: entry.request.method as string,\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 requestError.value = null\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, restore the response panel\n * for the new operation from the best available source:\n *\n * 1. `responseCache` — in-memory, populated on every successful send.\n * Has the live response object (including streams) so it wins.\n * 2. `history` — persisted in the workspace store. Used as a fallback when\n * the in-memory cache is empty (page reload, fresh app session, etc.)\n * so navigating to an operation that has been called before shows the\n * last response instead of an empty panel.\n * 3. Otherwise clear.\n *\n * Only the response is restored from history — the user's request inputs are\n * left alone, so we never silently overwrite an in-progress draft.\n */\nwatch(\n [() => path, () => method, () => exampleKey],\n ([newPath, newMethod, newExampleKey]) => {\n requestError.value = null\n const cached = responseCache.get(\n getOperationExampleKey(newMethod, newPath, newExampleKey),\n )\n\n if (cached) {\n response.value = cached.response\n requestPayload.value = cached.requestPayload\n } else {\n // History is keyed only by document/path/method but each entry carries\n // the example it came from, so we walk from the end and pick the most\n // recent entry that matches the active example. Otherwise a cache miss\n // on example B would restore example A's response. Only runs on a\n // cache miss — the common case (in-session navigation) skips it.\n const latest = (() => {\n for (let i = history.length - 1; i >= 0; i--) {\n const entry = history[i]\n if (entry?.meta.example === newExampleKey) {\n return entry\n }\n }\n return undefined\n })()\n\n if (latest) {\n response.value = harToFetchResponse({\n harResponse: latest.response,\n url: latest.request.url,\n method: newMethod,\n path: newPath,\n duration: latest.time,\n })\n requestPayload.value = null\n } else {\n response.value = null\n requestPayload.value = null\n }\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 min-w-0 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 :documentSlug\n :documentUrl\n :environment\n :environments\n :eventBus\n :exampleKey\n :executionDisabled=\"externalExamplesPending\"\n :hideClientButton\n :history=\"operationHistory\"\n :integration\n :isWebhook\n :layout\n :method\n :path=\"requestPath\"\n :server=\"requestServer\"\n :serverMeta\n :servers\n :source\n @execute=\"handleExecute\"\n @navigate:settings=\"handleNavigateSettings\"\n @open:browser=\"openInBrowser\"\n @select:history:item=\"handleSelectHistoryItem\"\n @update:webhookUrl=\"(value: string) => (webhookUrl = value)\" />\n </div>\n\n <ViewLayout class=\"border-t\">\n <ViewLayoutContent class=\"flex-1\">\n <!-- Request Section -->\n <ViewLayoutSection\n v-if=\"externalExamplesPending\"\n aria-label=\"Request\">\n <template #title>Request</template>\n <div\n class=\"text-c-2 p-4\"\n role=\"status\">\n <template v-if=\"externalExamplesFailed\">\n Could not load this example.\n <ScalarButton\n size=\"sm\"\n variant=\"ghost\"\n @click=\"$emit('retry:externalExamples')\">\n Retry\n </ScalarButton>\n </template>\n <template v-else>Loading example…</template>\n </div>\n </ViewLayoutSection>\n <RequestBlock\n v-else\n :allowedSecuritySchemes=\"\n toValue(options)?.authentication?.allowedSecuritySchemes\n \"\n :authMeta\n :clientOptions\n :defaultHeaders\n :defaultRequestBodyView=\"\n document['x-scalar-default-request-body-view']\n \"\n :documentCookies\n :documentSlug\n :environment\n :eventBus\n :exampleKey\n :jsonSchemaDialect=\"document.jsonSchemaDialect\"\n :layout\n :method\n :multipartNaming=\"toValue(options)?.multipartNaming\"\n :openapiVersion\n :operation\n :options=\"toValue(options)\"\n :path=\"requestPath\"\n :plugins\n :proxyUrl\n :requestBodyCompositionSelection\n :securityRequirements\n :securitySchemes\n :selectedClient\n :selectedSecurity\n :selectedSecuritySchemes\n :server=\"requestServer\"\n :sourceOperation\n :workspaceCookies />\n\n <!-- Response Section -->\n <ResponseBlock\n :appVersion\n :eventBus\n :executionDisabled=\"externalExamplesPending\"\n :layout\n :plugins\n :requestError\n :requestPayload\n :response\n :totalPerformedRequests=\"operationHistory.length\" />\n </ViewLayoutContent>\n </ViewLayout>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAeE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2MR,MAAM,EAAE,cAAc,gBAAgB;EAEtC,MAAM,iBAAiB,eACf,QAAA,SAAS,6BAA6B,QAAA,SAAS,OACvD;;EAGA,MAAM,gBAAgB,eAAe,sBAAsB,QAAA,WAAW,CAAC;EAEvE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M,YAAA;MACN,SAAA,QAAA;MACA,UAAA,QAAA;MACA,iCAAA,QAAA;MACA,sBAAA,QAAA;MACA,iBAAA,QAAA;MACA,gBAAA,QAAA;MACA,kBAAA,QAAA;MACA,yBAAA,QAAA;MACA,QAAQ,cAAA;MACR,iBAAA,QAAA;MACA,kBAAA,QAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;K,KAGHV,YASsDS,MAAAE,qBAAA,GAAA;MARnD,YAAA,QAAA;MACA,UAAA,QAAA;MACA,mBAAmB,QAAA;MACnB,QAAA,QAAA;MACA,SAAA,QAAA;MACA,cAAA,aAAA;MACA,gBAAA,eAAA;MACA,UAAA,SAAA;MACA,wBAAwB,iBAAA,MAAiB"}
|
|
@@ -84,10 +84,7 @@ var sendRequest = async ({ isUsingProxy, requestPayload, request, plugins = [],
|
|
|
84
84
|
* Returns an array of serialized cookie strings, or null if no cookies were found.
|
|
85
85
|
*/
|
|
86
86
|
var getCustomCookie = (response) => {
|
|
87
|
-
const result = parseSetCookie(response.headers.get(X_SCALAR_SET_COOKIE) ?? "").map((
|
|
88
|
-
...c,
|
|
89
|
-
sameSite: c.sameSite
|
|
90
|
-
}));
|
|
87
|
+
const result = parseSetCookie(response.headers.get(X_SCALAR_SET_COOKIE) ?? "").map((cookie) => serializeCookie(cookie.name, cookie.value, cookie));
|
|
91
88
|
if (result.length) return result;
|
|
92
89
|
return null;
|
|
93
90
|
};
|