@scalar/api-client 3.10.2 → 3.10.4
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 +21 -0
- package/dist/style.css +188 -96
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-security-schemes.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-security-schemes.js.map +1 -1
- package/dist/v2/blocks/operation-code-sample/index.d.ts +1 -1
- package/dist/v2/blocks/operation-code-sample/index.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/index.js +2 -2
- package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.js +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.script.js +13 -28
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +4 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.script.js +2 -2
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.d.ts +3 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.script.js +3 -2
- package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.script.js +0 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.script.js +2 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.d.ts +4 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.js +4 -3
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts +7 -2
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js +11 -9
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js.map +1 -1
- package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
- package/dist/v2/components/code-input/CodeInput.vue.js +1 -1
- package/dist/v2/components/code-input/CodeInput.vue.js.map +1 -1
- package/dist/v2/components/code-input/CodeInput.vue.script.js +3 -2
- package/dist/v2/components/code-input/CodeInput.vue.script.js.map +1 -1
- package/dist/v2/components/code-input/CodeInputLite.vue.d.ts +124 -0
- package/dist/v2/components/code-input/CodeInputLite.vue.d.ts.map +1 -0
- package/dist/v2/components/code-input/CodeInputLite.vue.js +10 -0
- package/dist/v2/components/code-input/CodeInputLite.vue.js.map +1 -0
- package/dist/v2/components/code-input/CodeInputLite.vue.script.js +631 -0
- package/dist/v2/components/code-input/CodeInputLite.vue.script.js.map +1 -0
- package/dist/v2/components/code-input/PillTooltipHost.vue.d.ts +3 -0
- package/dist/v2/components/code-input/PillTooltipHost.vue.d.ts.map +1 -1
- package/dist/v2/components/code-input/PillTooltipHost.vue.js.map +1 -1
- package/dist/v2/components/code-input/PillTooltipHost.vue.script.js +23 -11
- package/dist/v2/components/code-input/PillTooltipHost.vue.script.js.map +1 -1
- package/dist/v2/components/code-input/code-variable-widget.d.ts.map +1 -1
- package/dist/v2/components/code-input/code-variable-widget.js +5 -2
- package/dist/v2/components/code-input/code-variable-widget.js.map +1 -1
- package/dist/v2/components/code-input/helpers/build-pill-context.d.ts +11 -0
- package/dist/v2/components/code-input/helpers/build-pill-context.d.ts.map +1 -0
- package/dist/v2/components/code-input/helpers/build-pill-context.js +28 -0
- package/dist/v2/components/code-input/helpers/build-pill-context.js.map +1 -0
- package/dist/v2/components/code-input/helpers/lookup-variable-value.d.ts +11 -0
- package/dist/v2/components/code-input/helpers/lookup-variable-value.d.ts.map +1 -0
- package/dist/v2/components/code-input/helpers/lookup-variable-value.js +18 -0
- package/dist/v2/components/code-input/helpers/lookup-variable-value.js.map +1 -0
- package/dist/v2/components/code-input/helpers/pill-signature.d.ts +13 -0
- package/dist/v2/components/code-input/helpers/pill-signature.d.ts.map +1 -0
- package/dist/v2/components/code-input/helpers/pill-signature.js +25 -0
- package/dist/v2/components/code-input/helpers/pill-signature.js.map +1 -0
- package/dist/v2/components/code-input/helpers/serialize-value.d.ts +10 -0
- package/dist/v2/components/code-input/helpers/serialize-value.d.ts.map +1 -0
- package/dist/v2/components/code-input/helpers/serialize-value.js +17 -0
- package/dist/v2/components/code-input/helpers/serialize-value.js.map +1 -0
- package/dist/v2/components/code-input/index.d.ts +1 -0
- package/dist/v2/components/code-input/index.d.ts.map +1 -1
- package/dist/v2/components/code-input/index.js +2 -1
- package/dist/v2/components/data-table/DataTableInput.vue.d.ts +0 -4
- package/dist/v2/components/data-table/DataTableInput.vue.d.ts.map +1 -1
- package/dist/v2/components/data-table/DataTableInput.vue.js +1 -1
- package/dist/v2/components/data-table/DataTableInput.vue.js.map +1 -1
- package/dist/v2/components/data-table/DataTableInput.vue.script.js +2 -19
- package/dist/v2/components/data-table/DataTableInput.vue.script.js.map +1 -1
- package/dist/v2/constants.js +1 -1
- package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.d.ts +9 -0
- package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.d.ts.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.js.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.script.js +59 -28
- package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.script.js.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.d.ts.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.js +1 -1
- package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.js.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.script.js +3 -8
- package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.script.js.map +1 -1
- package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts.map +1 -1
- package/dist/v2/features/modal/helpers/create-api-client-modal.js +12 -1
- package/dist/v2/features/modal/helpers/create-api-client-modal.js.map +1 -1
- package/dist/v2/features/modal/helpers/resolve-route-parameters.d.ts.map +1 -1
- package/dist/v2/features/modal/helpers/resolve-route-parameters.js +6 -1
- package/dist/v2/features/modal/helpers/resolve-route-parameters.js.map +1 -1
- package/dist/v2/features/search/helpers/create-search-index.d.ts.map +1 -1
- package/dist/v2/features/search/helpers/create-search-index.js +2 -1
- package/dist/v2/features/search/helpers/create-search-index.js.map +1 -1
- package/dist/vue-styles.css +141 -89
- package/package.json +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @scalar/api-client
|
|
2
2
|
|
|
3
|
+
## 3.10.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#9319](https://github.com/scalar/scalar/pull/9319): feat: route OAuth2 token exchange/refresh and OpenID Connect discovery through the configured `customFetch`
|
|
8
|
+
|
|
9
|
+
The auth selector now forwards the client's `customFetch` to the OAuth2 and OpenID Connect flows. This lets the Electron desktop app pipe these requests over IPC (like regular API requests) instead of the renderer's network stack, so the desktop Content Security Policy can lock down `connect-src`. When no `customFetch` is provided the flows fall back to the global `fetch`, so web behavior is unchanged.
|
|
10
|
+
|
|
11
|
+
- [#9138](https://github.com/scalar/scalar/pull/9138): feat(api-client): add CodeInputLite, a lightweight contenteditable variable input that replaces CodeMirror in the request, auth, and environment tables for better performance
|
|
12
|
+
|
|
13
|
+
## 3.10.3
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [#9482](https://github.com/scalar/scalar/pull/9482): Fix the auth scheme dropdown not opening when multiple client apps are on the page (for example, the API reference modal). Each modal app now gets a unique id prefix, so teleport targets no longer collide and the popover renders in the visible app instead of a hidden one
|
|
18
|
+
- [#9342](https://github.com/scalar/scalar/pull/9342): fix: resolve operations when OpenAPI path items use `$ref`
|
|
19
|
+
|
|
20
|
+
Path entries and webhooks can reference `components.pathItems` instead of inlining operations. Navigation, mutators, search, and markdown export now resolve path-item references before reading HTTP methods and path-level parameters.
|
|
21
|
+
|
|
22
|
+
- [#9498](https://github.com/scalar/scalar/pull/9498): Sync the SDK installation tabs with the operation code examples: picking a language under "Client Libraries" now switches every operation's code sample to that language's custom example
|
|
23
|
+
|
|
3
24
|
## 3.10.2
|
|
4
25
|
|
|
5
26
|
## 3.10.1
|
package/dist/style.css
CHANGED
|
@@ -889,7 +889,7 @@
|
|
|
889
889
|
color: var(--scalar-color-1);
|
|
890
890
|
}
|
|
891
891
|
|
|
892
|
-
.hljs.language-objectivec .hljs-built_in
|
|
892
|
+
.hljs.language-objectivec .hljs-built_in {
|
|
893
893
|
color: var(--scalar-color-orange);
|
|
894
894
|
}
|
|
895
895
|
|
|
@@ -1650,7 +1650,7 @@
|
|
|
1650
1650
|
|
|
1651
1651
|
:where(body) > .scalar-tooltip {
|
|
1652
1652
|
--scalar-tooltip-padding: 8px;
|
|
1653
|
-
padding:
|
|
1653
|
+
padding: var(--scalar-tooltip-padding);
|
|
1654
1654
|
z-index: 99999;
|
|
1655
1655
|
max-width: 320px;
|
|
1656
1656
|
font-size: var(--scalar-font-size-5);
|
|
@@ -1661,9 +1661,24 @@
|
|
|
1661
1661
|
color: var(--scalar-tooltip-color);
|
|
1662
1662
|
}
|
|
1663
1663
|
|
|
1664
|
+
:where(body) > .scalar-tooltip[data-side="top"] {
|
|
1665
|
+
padding-bottom: calc(var(--scalar-tooltip-padding) + var(--scalar-tooltip-offset));
|
|
1666
|
+
}
|
|
1667
|
+
|
|
1668
|
+
:where(body) > .scalar-tooltip[data-side="bottom"] {
|
|
1669
|
+
padding-top: calc(var(--scalar-tooltip-padding) + var(--scalar-tooltip-offset));
|
|
1670
|
+
}
|
|
1671
|
+
|
|
1672
|
+
:where(body) > .scalar-tooltip[data-side="left"] {
|
|
1673
|
+
padding-right: calc(var(--scalar-tooltip-padding) + var(--scalar-tooltip-offset));
|
|
1674
|
+
}
|
|
1675
|
+
|
|
1676
|
+
:where(body) > .scalar-tooltip[data-side="right"] {
|
|
1677
|
+
padding-left: calc(var(--scalar-tooltip-padding) + var(--scalar-tooltip-offset));
|
|
1678
|
+
}
|
|
1679
|
+
|
|
1664
1680
|
:where(body) > .scalar-tooltip:before {
|
|
1665
1681
|
content: "";
|
|
1666
|
-
inset: var(--scalar-tooltip-offset);
|
|
1667
1682
|
z-index: calc(1 * -1);
|
|
1668
1683
|
border-radius: var(--scalar-radius);
|
|
1669
1684
|
background-color: var(--scalar-tooltip-background);
|
|
@@ -1671,6 +1686,23 @@
|
|
|
1671
1686
|
-webkit-backdrop-filter: var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, );
|
|
1672
1687
|
backdrop-filter: var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, );
|
|
1673
1688
|
position: absolute;
|
|
1689
|
+
inset: 0;
|
|
1690
|
+
}
|
|
1691
|
+
|
|
1692
|
+
:where(body) > .scalar-tooltip[data-side="top"]:before {
|
|
1693
|
+
bottom: var(--scalar-tooltip-offset);
|
|
1694
|
+
}
|
|
1695
|
+
|
|
1696
|
+
:where(body) > .scalar-tooltip[data-side="bottom"]:before {
|
|
1697
|
+
top: var(--scalar-tooltip-offset);
|
|
1698
|
+
}
|
|
1699
|
+
|
|
1700
|
+
:where(body) > .scalar-tooltip[data-side="left"]:before {
|
|
1701
|
+
right: var(--scalar-tooltip-offset);
|
|
1702
|
+
}
|
|
1703
|
+
|
|
1704
|
+
:where(body) > .scalar-tooltip[data-side="right"]:before {
|
|
1705
|
+
left: var(--scalar-tooltip-offset);
|
|
1674
1706
|
}
|
|
1675
1707
|
|
|
1676
1708
|
:where(body.dark-mode) > .scalar-tooltip:before {
|
|
@@ -1965,10 +1997,18 @@
|
|
|
1965
1997
|
inset-block: 2px;
|
|
1966
1998
|
}
|
|
1967
1999
|
|
|
2000
|
+
.scalar-app .-start {
|
|
2001
|
+
inset-inline-start: -4px;
|
|
2002
|
+
}
|
|
2003
|
+
|
|
1968
2004
|
.scalar-app .start {
|
|
1969
2005
|
inset-inline-start: 4px;
|
|
1970
2006
|
}
|
|
1971
2007
|
|
|
2008
|
+
.scalar-app .-end {
|
|
2009
|
+
inset-inline-end: -4px;
|
|
2010
|
+
}
|
|
2011
|
+
|
|
1972
2012
|
.scalar-app .end {
|
|
1973
2013
|
inset-inline-end: 4px;
|
|
1974
2014
|
}
|
|
@@ -4765,15 +4805,15 @@
|
|
|
4765
4805
|
outline-width: 1px;
|
|
4766
4806
|
}
|
|
4767
4807
|
|
|
4768
|
-
.scalar-app .group-has-\[\.cm-focused\]\:z-1:is(:where(.group):has(.cm-focused) *) {
|
|
4808
|
+
.scalar-app .group-has-\[\.cm-focused\]\:z-1:is(:where(.group):has(.cm-focused) *), .scalar-app .group-has-\[\.code-input-lite__editor\:focus\]\:z-1:is(:where(.group):has(:is(.code-input-lite editor:focus)) *) {
|
|
4769
4809
|
z-index: 1;
|
|
4770
4810
|
}
|
|
4771
4811
|
|
|
4772
|
-
.scalar-app .group-has-\[\.
|
|
4812
|
+
.scalar-app .group-has-\[\.code-input-lite__editor\:focus\]\:flex:is(:where(.group):has(:is(.code-input-lite editor:focus)) *) {
|
|
4773
4813
|
display: flex;
|
|
4774
4814
|
}
|
|
4775
4815
|
|
|
4776
|
-
.scalar-app .group-has-\[\.
|
|
4816
|
+
.scalar-app .group-has-\[\.code-input-lite__editor\:focus\]\:pr-10:is(:where(.group):has(:is(.code-input-lite editor:focus)) *) {
|
|
4777
4817
|
padding-right: 40px;
|
|
4778
4818
|
}
|
|
4779
4819
|
|
|
@@ -4892,7 +4932,7 @@
|
|
|
4892
4932
|
opacity: 1;
|
|
4893
4933
|
}
|
|
4894
4934
|
|
|
4895
|
-
.scalar-app .peer-has-\[\.cm-focused\]\:opacity-0:is(:where(.peer):has(.cm-focused) ~ *) {
|
|
4935
|
+
.scalar-app .peer-has-\[\.cm-focused\]\:opacity-0:is(:where(.peer):has(.cm-focused) ~ *), .scalar-app .peer-has-\[\.code-input-lite__editor\:focus\]\:opacity-0:is(:where(.peer):has(:is(.code-input-lite editor:focus)) ~ *) {
|
|
4896
4936
|
opacity: 0;
|
|
4897
4937
|
}
|
|
4898
4938
|
|
|
@@ -5966,23 +6006,23 @@ to {
|
|
|
5966
6006
|
/*
|
|
5967
6007
|
Deep styling for customizing Codemirror
|
|
5968
6008
|
*/
|
|
5969
|
-
[data-v-
|
|
6009
|
+
[data-v-d6fb2049] .cm-editor {
|
|
5970
6010
|
height: 100%;
|
|
5971
6011
|
outline: none;
|
|
5972
6012
|
padding: 0;
|
|
5973
6013
|
background: transparent;
|
|
5974
6014
|
}
|
|
5975
|
-
[data-v-
|
|
6015
|
+
[data-v-d6fb2049] .cm-placeholder {
|
|
5976
6016
|
color: var(--scalar-color-3);
|
|
5977
6017
|
}
|
|
5978
|
-
[data-v-
|
|
6018
|
+
[data-v-d6fb2049] .cm-content {
|
|
5979
6019
|
font-family: var(--scalar-font-code);
|
|
5980
6020
|
font-size: var(--scalar-small);
|
|
5981
6021
|
max-height: 20px;
|
|
5982
6022
|
padding: 8px 0;
|
|
5983
6023
|
}
|
|
5984
6024
|
/* Tooltip helper */
|
|
5985
|
-
[data-v-
|
|
6025
|
+
[data-v-d6fb2049] .cm-tooltip {
|
|
5986
6026
|
background: transparent !important;
|
|
5987
6027
|
filter: brightness(var(--scalar-lifted-brightness));
|
|
5988
6028
|
border-radius: var(--scalar-radius);
|
|
@@ -5991,43 +6031,43 @@ to {
|
|
|
5991
6031
|
outline: none !important;
|
|
5992
6032
|
overflow: hidden !important;
|
|
5993
6033
|
}
|
|
5994
|
-
[data-v-
|
|
6034
|
+
[data-v-d6fb2049] .cm-tooltip-autocomplete ul li {
|
|
5995
6035
|
padding: 3px 6px !important;
|
|
5996
6036
|
}
|
|
5997
|
-
[data-v-
|
|
6037
|
+
[data-v-d6fb2049] .cm-completionIcon-type:after {
|
|
5998
6038
|
color: var(--scalar-color-3) !important;
|
|
5999
6039
|
}
|
|
6000
|
-
[data-v-
|
|
6040
|
+
[data-v-d6fb2049] .cm-tooltip-autocomplete ul li[aria-selected] {
|
|
6001
6041
|
background: var(--scalar-background-2) !important;
|
|
6002
6042
|
color: var(--scalar-color-1) !important;
|
|
6003
6043
|
}
|
|
6004
|
-
[data-v-
|
|
6044
|
+
[data-v-d6fb2049] .cm-tooltip-autocomplete ul {
|
|
6005
6045
|
padding: 6px !important;
|
|
6006
6046
|
position: relative;
|
|
6007
6047
|
}
|
|
6008
|
-
[data-v-
|
|
6048
|
+
[data-v-d6fb2049] .cm-tooltip-autocomplete ul li:hover {
|
|
6009
6049
|
border-radius: 3px;
|
|
6010
6050
|
color: var(--scalar-color-1) !important;
|
|
6011
6051
|
background: var(--scalar-background-3) !important;
|
|
6012
6052
|
}
|
|
6013
6053
|
/* Disable active line highlighting */
|
|
6014
|
-
[data-v-
|
|
6054
|
+
[data-v-d6fb2049] .cm-activeLine,[data-v-d6fb2049] .cm-activeLineGutter {
|
|
6015
6055
|
background-color: transparent;
|
|
6016
6056
|
}
|
|
6017
6057
|
/* Color selection matching */
|
|
6018
|
-
[data-v-
|
|
6058
|
+
[data-v-d6fb2049] .cm-selectionMatch,[data-v-d6fb2049] .cm-matchingBracket {
|
|
6019
6059
|
border-radius: var(--scalar-radius);
|
|
6020
6060
|
background: var(--scalar-background-4) !important;
|
|
6021
6061
|
}
|
|
6022
6062
|
/* Color Picker Swatches */
|
|
6023
|
-
[data-v-
|
|
6063
|
+
[data-v-d6fb2049] .cm-css-color-picker-wrapper {
|
|
6024
6064
|
display: inline-flex;
|
|
6025
6065
|
outline: 1px solid var(--scalar-background-3);
|
|
6026
6066
|
border-radius: 3px;
|
|
6027
6067
|
overflow: hidden;
|
|
6028
6068
|
}
|
|
6029
6069
|
/* Number gutter */
|
|
6030
|
-
[data-v-
|
|
6070
|
+
[data-v-d6fb2049] .cm-gutters {
|
|
6031
6071
|
background-color: transparent;
|
|
6032
6072
|
border-right: none;
|
|
6033
6073
|
color: var(--scalar-color-3);
|
|
@@ -6035,7 +6075,7 @@ to {
|
|
|
6035
6075
|
line-height: 22px;
|
|
6036
6076
|
border-radius: 0 0 0 3px;
|
|
6037
6077
|
}
|
|
6038
|
-
[data-v-
|
|
6078
|
+
[data-v-d6fb2049] .cm-gutters:before {
|
|
6039
6079
|
content: '';
|
|
6040
6080
|
position: absolute;
|
|
6041
6081
|
top: 2px;
|
|
@@ -6045,7 +6085,7 @@ to {
|
|
|
6045
6085
|
border-radius: var(--scalar-radius) 0 0 var(--scalar-radius);
|
|
6046
6086
|
background-color: var(--scalar-background-1);
|
|
6047
6087
|
}
|
|
6048
|
-
[data-v-
|
|
6088
|
+
[data-v-d6fb2049] .cm-gutterElement {
|
|
6049
6089
|
font-family: var(--scalar-font-code) !important;
|
|
6050
6090
|
padding-left: 0px !important;
|
|
6051
6091
|
padding-right: 6px !important;
|
|
@@ -6054,16 +6094,16 @@ to {
|
|
|
6054
6094
|
justify-content: flex-end;
|
|
6055
6095
|
position: relative;
|
|
6056
6096
|
}
|
|
6057
|
-
[data-v-
|
|
6097
|
+
[data-v-d6fb2049] .cm-lineNumbers .cm-gutterElement {
|
|
6058
6098
|
min-width: fit-content;
|
|
6059
6099
|
}
|
|
6060
|
-
[data-v-
|
|
6100
|
+
[data-v-d6fb2049] .cm-gutter + .cm-gutter :not(.cm-foldGutter) .cm-gutterElement {
|
|
6061
6101
|
padding-left: 0 !important;
|
|
6062
6102
|
}
|
|
6063
|
-
[data-v-
|
|
6103
|
+
[data-v-d6fb2049] .cm-scroller {
|
|
6064
6104
|
overflow: auto;
|
|
6065
6105
|
}
|
|
6066
|
-
.line-wrapping[data-v-
|
|
6106
|
+
.line-wrapping[data-v-d6fb2049]:focus-within .cm-content {
|
|
6067
6107
|
display: inline-table;
|
|
6068
6108
|
min-height: fit-content;
|
|
6069
6109
|
padding: 3px 6px;
|
|
@@ -6139,21 +6179,21 @@ to {
|
|
|
6139
6179
|
margin-top: 0;
|
|
6140
6180
|
}
|
|
6141
6181
|
|
|
6142
|
-
[data-v-
|
|
6182
|
+
[data-v-d37cbfcc] .cm-editor {
|
|
6143
6183
|
height: 100%;
|
|
6144
6184
|
outline: none;
|
|
6145
6185
|
width: 100%;
|
|
6146
6186
|
}
|
|
6147
|
-
[data-v-
|
|
6187
|
+
[data-v-d37cbfcc] .cm-line {
|
|
6148
6188
|
padding: 0;
|
|
6149
6189
|
}
|
|
6150
|
-
[data-v-
|
|
6190
|
+
[data-v-d37cbfcc] .cm-content {
|
|
6151
6191
|
padding: 0;
|
|
6152
6192
|
display: flex;
|
|
6153
6193
|
align-items: center;
|
|
6154
6194
|
font-size: var(--scalar-small);
|
|
6155
6195
|
}
|
|
6156
|
-
.scroll-timeline-x[data-v-
|
|
6196
|
+
.scroll-timeline-x[data-v-d37cbfcc] {
|
|
6157
6197
|
-ms-overflow-style: none;
|
|
6158
6198
|
/* Fade the URL at the viewport edges. Mask lives on the scrollport (this
|
|
6159
6199
|
element) rather than on `.cm-scroller`, whose width follows the URL's
|
|
@@ -6166,31 +6206,31 @@ to {
|
|
|
6166
6206
|
transparent 100%
|
|
6167
6207
|
);
|
|
6168
6208
|
}
|
|
6169
|
-
.scroll-timeline-x-hidden[data-v-
|
|
6209
|
+
.scroll-timeline-x-hidden[data-v-d37cbfcc] {
|
|
6170
6210
|
overflow-x: auto;
|
|
6171
6211
|
}
|
|
6172
|
-
.scroll-timeline-x-hidden[data-v-
|
|
6212
|
+
.scroll-timeline-x-hidden[data-v-d37cbfcc] .cm-scroller {
|
|
6173
6213
|
scrollbar-width: none;
|
|
6174
6214
|
-ms-overflow-style: none;
|
|
6175
6215
|
padding-right: 20px;
|
|
6176
6216
|
overflow: auto;
|
|
6177
6217
|
}
|
|
6178
|
-
.scroll-timeline-x-hidden[data-v-
|
|
6218
|
+
.scroll-timeline-x-hidden[data-v-d37cbfcc]::-webkit-scrollbar {
|
|
6179
6219
|
width: 0;
|
|
6180
6220
|
height: 0;
|
|
6181
6221
|
display: none;
|
|
6182
6222
|
}
|
|
6183
|
-
.scroll-timeline-x-hidden[data-v-
|
|
6223
|
+
.scroll-timeline-x-hidden[data-v-d37cbfcc] .cm-scroller::-webkit-scrollbar {
|
|
6184
6224
|
width: 0;
|
|
6185
6225
|
height: 0;
|
|
6186
6226
|
display: none;
|
|
6187
6227
|
}
|
|
6188
|
-
.scroll-timeline-x-address[data-v-
|
|
6228
|
+
.scroll-timeline-x-address[data-v-d37cbfcc] {
|
|
6189
6229
|
line-height: 27px;
|
|
6190
6230
|
scrollbar-width: none; /* Firefox */
|
|
6191
6231
|
}
|
|
6192
6232
|
/* make clickable are to left of send button */
|
|
6193
|
-
.scroll-timeline-x-address[data-v-
|
|
6233
|
+
.scroll-timeline-x-address[data-v-d37cbfcc]:after {
|
|
6194
6234
|
content: '';
|
|
6195
6235
|
position: absolute;
|
|
6196
6236
|
height: 100%;
|
|
@@ -6198,12 +6238,12 @@ to {
|
|
|
6198
6238
|
right: 0;
|
|
6199
6239
|
cursor: text;
|
|
6200
6240
|
}
|
|
6201
|
-
.scroll-timeline-x-address[data-v-
|
|
6241
|
+
.scroll-timeline-x-address[data-v-d37cbfcc]:empty:before {
|
|
6202
6242
|
content: 'Enter URL or cURL request';
|
|
6203
6243
|
color: var(--scalar-color-3);
|
|
6204
6244
|
pointer-events: none;
|
|
6205
6245
|
}
|
|
6206
|
-
.address-bar-bg-states[data-v-
|
|
6246
|
+
.address-bar-bg-states[data-v-d37cbfcc] {
|
|
6207
6247
|
--scalar-address-bar-bg: color-mix(
|
|
6208
6248
|
in srgb,
|
|
6209
6249
|
var(--scalar-background-1),
|
|
@@ -6211,12 +6251,16 @@ to {
|
|
|
6211
6251
|
);
|
|
6212
6252
|
background: var(--scalar-address-bar-bg);
|
|
6213
6253
|
}
|
|
6214
|
-
.address-bar-bg-states[data-v-
|
|
6254
|
+
.address-bar-bg-states[data-v-d37cbfcc]:has(.cm-focused) {
|
|
6215
6255
|
--scalar-address-bar-bg: var(--scalar-background-1);
|
|
6216
6256
|
border-color: var(--scalar-border-color);
|
|
6217
6257
|
outline-width: 1px;
|
|
6218
6258
|
outline-style: solid;
|
|
6219
6259
|
}
|
|
6260
|
+
.address-bar-bg-states:has(.cm-focused) .fade-left[data-v-d37cbfcc],
|
|
6261
|
+
.address-bar-bg-states:has(.cm-focused) .fade-right[data-v-d37cbfcc] {
|
|
6262
|
+
--scalar-address-bar-bg: var(--scalar-background-1);
|
|
6263
|
+
}
|
|
6220
6264
|
|
|
6221
6265
|
.app-exit-button[data-v-42c563b3] {
|
|
6222
6266
|
color: white;
|
|
@@ -6315,33 +6359,110 @@ to {
|
|
|
6315
6359
|
display: none;
|
|
6316
6360
|
}
|
|
6317
6361
|
|
|
6318
|
-
[data-v-
|
|
6319
|
-
|
|
6362
|
+
.code-input-lite[data-v-1974e80d] {
|
|
6363
|
+
/* Flex so the editor centres vertically in whatever height the cell gives us.
|
|
6364
|
+
Font properties inherit so we adopt the surrounding typography. */
|
|
6365
|
+
display: flex;
|
|
6366
|
+
align-items: center;
|
|
6320
6367
|
}
|
|
6321
|
-
[data-v-
|
|
6368
|
+
.code-input-lite__editor[data-v-1974e80d] {
|
|
6369
|
+
/* Everything font-related inherits from the surrounding context. */
|
|
6370
|
+
font: inherit;
|
|
6371
|
+
letter-spacing: inherit;
|
|
6372
|
+
flex: 1;
|
|
6373
|
+
min-width: 0;
|
|
6374
|
+
background: transparent;
|
|
6375
|
+
outline: none;
|
|
6376
|
+
color: var(--scalar-color-1);
|
|
6377
|
+
caret-color: var(--scalar-color-1);
|
|
6378
|
+
/* Single-line: horizontal scroll keeps the caret visible for long values;
|
|
6379
|
+
the scrollbar itself is hidden (would be noisy inside a table cell). */
|
|
6380
|
+
white-space: pre;
|
|
6381
|
+
overflow-x: auto;
|
|
6382
|
+
overflow-y: hidden;
|
|
6383
|
+
scrollbar-width: none;
|
|
6384
|
+
padding: 0 0.5em;
|
|
6385
|
+
box-sizing: border-box;
|
|
6386
|
+
line-height: 1.44;
|
|
6387
|
+
/* Positioning context for the absolutely positioned placeholder. */
|
|
6388
|
+
position: relative;
|
|
6389
|
+
}
|
|
6390
|
+
.code-input-lite__editor[data-v-1974e80d]::-webkit-scrollbar {
|
|
6391
|
+
display: none;
|
|
6392
|
+
}
|
|
6393
|
+
|
|
6394
|
+
/* Absolute so the placeholder does not occupy flow space inside the
|
|
6395
|
+
contenteditable; otherwise the caret would land after it on focus.
|
|
6396
|
+
`pointer-events: none` lets clicks fall through to focus the editor.
|
|
6397
|
+
Hidden on focus so it never renders on top of the text caret. */
|
|
6398
|
+
.code-input-lite--empty .code-input-lite__editor[data-v-1974e80d]:not(:focus)::before {
|
|
6399
|
+
content: attr(data-placeholder);
|
|
6400
|
+
color: var(--scalar-color-3);
|
|
6401
|
+
pointer-events: none;
|
|
6402
|
+
position: absolute;
|
|
6403
|
+
top: 0;
|
|
6404
|
+
bottom: 0;
|
|
6405
|
+
left: 0.5em;
|
|
6406
|
+
display: flex;
|
|
6322
6407
|
align-items: center;
|
|
6408
|
+
}
|
|
6409
|
+
.code-input-lite--error .code-input-lite__editor[data-v-1974e80d] {
|
|
6410
|
+
outline: 1px solid var(--scalar-color-red);
|
|
6411
|
+
}
|
|
6412
|
+
|
|
6413
|
+
/* Pill styling. Each pill is `<span contenteditable="false">name</span>` —
|
|
6414
|
+
an atomic widget; the caret lands before or after it, never inside. */
|
|
6415
|
+
.scalar-pill {
|
|
6416
|
+
color: var(--scalar-color-2);
|
|
6417
|
+
border-radius: 30px;
|
|
6418
|
+
display: inline-block;
|
|
6419
|
+
font-family: var(--scalar-font-code);
|
|
6420
|
+
font-size: 0.9em;
|
|
6421
|
+
line-height: 1.4;
|
|
6422
|
+
vertical-align: baseline;
|
|
6423
|
+
background: var(--scalar-background-3);
|
|
6424
|
+
padding: 0.125em 0.6em;
|
|
6425
|
+
margin-right: 0.35em;
|
|
6426
|
+
cursor: text;
|
|
6427
|
+
/* Single click selects the whole pill — chip/mention model, deletes in one go. */
|
|
6428
|
+
user-select: all;
|
|
6429
|
+
-webkit-user-select: all;
|
|
6430
|
+
}
|
|
6431
|
+
.dark-mode .scalar-pill {
|
|
6432
|
+
background: color-mix(
|
|
6433
|
+
in srgb,
|
|
6434
|
+
var(--tw-bg-base, var(--scalar-color-1)),
|
|
6435
|
+
transparent 90%
|
|
6436
|
+
);
|
|
6437
|
+
}
|
|
6438
|
+
.light-mode .scalar-pill {
|
|
6439
|
+
background: var(--scalar-background-3);
|
|
6440
|
+
}
|
|
6441
|
+
.scalar-pill--context-fn {
|
|
6442
|
+
/* Inset box-shadow as a border so the layout box stays identical to plain pills. */
|
|
6443
|
+
box-shadow: 0 0 0 1px
|
|
6444
|
+
color-mix(in srgb, var(--scalar-color-3), transparent 35%) inset;
|
|
6445
|
+
}
|
|
6446
|
+
.dark-mode .scalar-pill--context-fn {
|
|
6447
|
+
background: color-mix(in srgb, var(--scalar-background-3), transparent 55%);
|
|
6448
|
+
}
|
|
6449
|
+
.light-mode .scalar-pill--context-fn {
|
|
6450
|
+
background: color-mix(in srgb, var(--scalar-background-3), transparent 40%);
|
|
6451
|
+
}
|
|
6452
|
+
|
|
6453
|
+
[data-v-e83eb7d0] .code-input-lite__editor {
|
|
6323
6454
|
background-color: transparent;
|
|
6324
|
-
display: flex;
|
|
6325
6455
|
font-family: var(--scalar-font);
|
|
6326
6456
|
font-size: var(--scalar-small);
|
|
6327
6457
|
padding: 5px 8px;
|
|
6328
|
-
width: 100%;
|
|
6329
|
-
}
|
|
6330
|
-
[data-v-36811e28] .cm-content:has(.cm-pill) {
|
|
6331
|
-
padding: 5px 8px;
|
|
6332
6458
|
}
|
|
6333
|
-
[data-v-
|
|
6334
|
-
margin-right: 0.
|
|
6459
|
+
[data-v-e83eb7d0] .scalar-pill:not(:last-of-type) {
|
|
6460
|
+
margin-right: 0.15em;
|
|
6335
6461
|
}
|
|
6336
|
-
[data-v-
|
|
6462
|
+
[data-v-e83eb7d0] .scalar-pill:not(:first-of-type) {
|
|
6337
6463
|
margin-left: 0.5px;
|
|
6338
6464
|
}
|
|
6339
|
-
[data-v-
|
|
6340
|
-
overflow: hidden;
|
|
6341
|
-
padding: 0;
|
|
6342
|
-
text-overflow: ellipsis;
|
|
6343
|
-
}
|
|
6344
|
-
.filemask[data-v-36811e28] {
|
|
6465
|
+
.filemask[data-v-e83eb7d0] {
|
|
6345
6466
|
mask-image: linear-gradient(
|
|
6346
6467
|
to right,
|
|
6347
6468
|
transparent 0,
|
|
@@ -6375,42 +6496,27 @@ to {
|
|
|
6375
6496
|
scrollbar-width: none;
|
|
6376
6497
|
}
|
|
6377
6498
|
|
|
6378
|
-
[data-v-
|
|
6379
|
-
padding: 0;
|
|
6380
|
-
}
|
|
6381
|
-
[data-v-1ee3c31d] .cm-content {
|
|
6382
|
-
align-items: center;
|
|
6499
|
+
[data-v-a6f4752a] .code-input-lite__editor {
|
|
6383
6500
|
background-color: transparent;
|
|
6384
|
-
display: flex;
|
|
6385
6501
|
font-family: var(--scalar-font);
|
|
6386
6502
|
font-size: var(--scalar-small);
|
|
6387
6503
|
padding: 5px 8px;
|
|
6388
|
-
width: 100%;
|
|
6389
6504
|
}
|
|
6390
|
-
[data-v-
|
|
6391
|
-
|
|
6392
|
-
}
|
|
6393
|
-
[data-v-1ee3c31d] .cm-content .cm-pill:not(:last-of-type) {
|
|
6394
|
-
margin-right: 0.5px;
|
|
6505
|
+
[data-v-a6f4752a] .scalar-pill:not(:last-of-type) {
|
|
6506
|
+
margin-right: 0.15em;
|
|
6395
6507
|
}
|
|
6396
|
-
[data-v-
|
|
6508
|
+
[data-v-a6f4752a] .scalar-pill:not(:first-of-type) {
|
|
6397
6509
|
margin-left: 0.5px;
|
|
6398
6510
|
}
|
|
6399
|
-
[data-v-
|
|
6400
|
-
overflow: hidden;
|
|
6401
|
-
padding: 0;
|
|
6402
|
-
text-overflow: ellipsis;
|
|
6403
|
-
word-break: break-word;
|
|
6404
|
-
}
|
|
6405
|
-
.required[data-v-1ee3c31d]::after {
|
|
6511
|
+
.required[data-v-a6f4752a]::after {
|
|
6406
6512
|
content: 'Required';
|
|
6407
6513
|
}
|
|
6408
6514
|
/* Tailwind placeholder is busted */
|
|
6409
|
-
input[data-v-
|
|
6515
|
+
input[data-v-a6f4752a]::placeholder {
|
|
6410
6516
|
color: var(--scalar-color-3);
|
|
6411
6517
|
}
|
|
6412
6518
|
/* we want our inputs to look like a password input but not be one */
|
|
6413
|
-
.scalar-password-input[data-v-
|
|
6519
|
+
.scalar-password-input[data-v-a6f4752a] {
|
|
6414
6520
|
text-security: disc;
|
|
6415
6521
|
-webkit-text-security: disc;
|
|
6416
6522
|
-moz-text-security: disc;
|
|
@@ -6618,32 +6724,18 @@ to {
|
|
|
6618
6724
|
bottom: 0;
|
|
6619
6725
|
}
|
|
6620
6726
|
|
|
6621
|
-
[data-v-
|
|
6622
|
-
padding: 0;
|
|
6623
|
-
}
|
|
6624
|
-
[data-v-69be2d6c] .cm-content {
|
|
6625
|
-
align-items: center;
|
|
6727
|
+
[data-v-5b336842] .code-input-lite__editor {
|
|
6626
6728
|
background-color: transparent;
|
|
6627
|
-
display: flex;
|
|
6628
6729
|
font-family: var(--scalar-font);
|
|
6629
6730
|
font-size: var(--scalar-small);
|
|
6630
6731
|
padding: 5px 8px;
|
|
6631
|
-
width: 100%;
|
|
6632
|
-
}
|
|
6633
|
-
[data-v-69be2d6c] .cm-content:has(.cm-pill) {
|
|
6634
|
-
padding: 5px 8px;
|
|
6635
6732
|
}
|
|
6636
|
-
[data-v-
|
|
6637
|
-
margin-right: 0.
|
|
6733
|
+
[data-v-5b336842] .scalar-pill:not(:last-of-type) {
|
|
6734
|
+
margin-right: 0.15em;
|
|
6638
6735
|
}
|
|
6639
|
-
[data-v-
|
|
6736
|
+
[data-v-5b336842] .scalar-pill:not(:first-of-type) {
|
|
6640
6737
|
margin-left: 0.5px;
|
|
6641
6738
|
}
|
|
6642
|
-
[data-v-69be2d6c] .cm-line {
|
|
6643
|
-
overflow: hidden;
|
|
6644
|
-
padding: 0;
|
|
6645
|
-
text-overflow: ellipsis;
|
|
6646
|
-
}
|
|
6647
6739
|
/*! tailwindcss v4.2.1 | MIT License | https://tailwindcss.com */
|
|
6648
6740
|
.scalar .scalar-app-layout[data-v-77897d1c] {
|
|
6649
6741
|
background: var(--scalar-background-1);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process-security-schemes.d.ts","sourceRoot":"","sources":["../../../../../../src/v2/blocks/operation-code-sample/helpers/operation-to-har/process-security-schemes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAA;AACzF,OAAO,KAAK,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,YAAY,CAAA;AAGvD,KAAK,8BAA8B,GAAG;IACpC,OAAO,EAAE,UAAU,CAAC,SAAS,CAAC,CAAA;IAC9B,WAAW,EAAE,UAAU,CAAC,aAAa,CAAC,CAAA;IACtC,OAAO,EAAE,UAAU,CAAC,SAAS,CAAC,CAAA;CAC/B,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GACjC,iBAAiB,0BAA0B,EAAE,KAC5C,
|
|
1
|
+
{"version":3,"file":"process-security-schemes.d.ts","sourceRoot":"","sources":["../../../../../../src/v2/blocks/operation-code-sample/helpers/operation-to-har/process-security-schemes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAA;AACzF,OAAO,KAAK,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,YAAY,CAAA;AAGvD,KAAK,8BAA8B,GAAG;IACpC,OAAO,EAAE,UAAU,CAAC,SAAS,CAAC,CAAA;IAC9B,WAAW,EAAE,UAAU,CAAC,aAAa,CAAC,CAAA;IACtC,OAAO,EAAE,UAAU,CAAC,SAAS,CAAC,CAAA;CAC/B,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GACjC,iBAAiB,0BAA0B,EAAE,KAC5C,8BA2EF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process-security-schemes.js","names":[],"sources":["../../../../../../src/v2/blocks/operation-code-sample/helpers/operation-to-har/process-security-schemes.ts"],"sourcesContent":["import type { SecuritySchemeObjectSecret } from '@scalar/workspace-store/request-example'\nimport type { Request as HarRequest } from 'har-format'\nimport { encode } from 'js-base64'\n\ntype ProcessedSecuritySchemesReturn = {\n headers: HarRequest['headers']\n queryString: HarRequest['queryString']\n cookies: HarRequest['cookies']\n}\n\n/**\n * Process security schemes into whichever parameters they are applicable to\n *\n * TODO: we probably want to be able to disable YOUR_SECRET_TOKEN placeholder text + or allow it to be customzied\n */\nexport const processSecuritySchemes = (\n securitySchemes: SecuritySchemeObjectSecret[],\n): ProcessedSecuritySchemesReturn => {\n const result: ProcessedSecuritySchemesReturn = {\n headers: [],\n queryString: [],\n cookies: [],\n }\n\n for (const scheme of securitySchemes) {\n // Handle apiKey type\n if (scheme.type === 'apiKey') {\n const value = scheme['x-scalar-secret-token'] || 'YOUR_SECRET_TOKEN'\n if (!scheme.name) {\n continue\n }\n\n const param = { name: scheme.name, value }\n\n switch (scheme.in) {\n case 'header':\n result.headers.push(param)\n break\n case 'query':\n result.queryString.push(param)\n break\n case 'cookie':\n result.cookies.push(param)\n break\n }\n continue\n }\n\n // Handle http type\n if (scheme.type === 'http') {\n if (scheme.scheme === 'basic') {\n const username = scheme['x-scalar-secret-username'] || ''\n const password = scheme['x-scalar-secret-password'] || ''\n\n const value = `${username}:${password}`\n const auth = value === ':' ? 'username:password' : encode(value)\n\n result.headers.push({\n name: 'Authorization',\n value: `Basic ${auth}`,\n })\n } else if (scheme.scheme === 'bearer') {\n const token = scheme['x-scalar-secret-token'] || 'YOUR_SECRET_TOKEN'\n\n result.headers.push({\n name: 'Authorization',\n value: `Bearer ${token}`,\n })\n }\n continue\n }\n\n // Handle oauth2 type\n if (scheme.type === 'oauth2' && scheme.flows) {\n const flows = Object.values(scheme.flows)\n\n // Find the first flow with a token\n const flow = flows.find((f) => f['x-scalar-secret-token'])\n const token = flow?.['x-scalar-secret-token'] || 'YOUR_SECRET_TOKEN'\n\n result.headers.push({\n name: 'Authorization',\n value: `Bearer ${token}`,\n })\n }\n }\n\n return result\n}\n"],"mappings":";;;;;;;AAeA,IAAa,0BACX,oBACmC;CACnC,MAAM,SAAyC;EAC7C,SAAS,EAAE;EACX,aAAa,EAAE;EACf,SAAS,EAAE;EACZ;AAED,MAAK,MAAM,UAAU,iBAAiB;AAEpC,MAAI,OAAO,SAAS,UAAU;GAC5B,MAAM,QAAQ,OAAO,4BAA4B;AACjD,OAAI,CAAC,OAAO,KACV;GAGF,MAAM,QAAQ;IAAE,MAAM,OAAO;IAAM;IAAO;AAE1C,WAAQ,OAAO,IAAf;IACE,KAAK;AACH,YAAO,QAAQ,KAAK,MAAM;AAC1B;IACF,KAAK;AACH,YAAO,YAAY,KAAK,MAAM;AAC9B;IACF,KAAK;AACH,YAAO,QAAQ,KAAK,MAAM;AAC1B;;AAEJ;;AAIF,MAAI,OAAO,SAAS,QAAQ;AAC1B,OAAI,OAAO,WAAW,SAAS;
|
|
1
|
+
{"version":3,"file":"process-security-schemes.js","names":[],"sources":["../../../../../../src/v2/blocks/operation-code-sample/helpers/operation-to-har/process-security-schemes.ts"],"sourcesContent":["import type { SecuritySchemeObjectSecret } from '@scalar/workspace-store/request-example'\nimport type { Request as HarRequest } from 'har-format'\nimport { encode } from 'js-base64'\n\ntype ProcessedSecuritySchemesReturn = {\n headers: HarRequest['headers']\n queryString: HarRequest['queryString']\n cookies: HarRequest['cookies']\n}\n\n/**\n * Process security schemes into whichever parameters they are applicable to\n *\n * TODO: we probably want to be able to disable YOUR_SECRET_TOKEN placeholder text + or allow it to be customzied\n */\nexport const processSecuritySchemes = (\n securitySchemes: SecuritySchemeObjectSecret[],\n): ProcessedSecuritySchemesReturn => {\n const result: ProcessedSecuritySchemesReturn = {\n headers: [],\n queryString: [],\n cookies: [],\n }\n\n for (const scheme of securitySchemes) {\n // Handle apiKey type\n if (scheme.type === 'apiKey') {\n const value = scheme['x-scalar-secret-token'] || 'YOUR_SECRET_TOKEN'\n if (!scheme.name) {\n continue\n }\n\n const param = { name: scheme.name, value }\n\n switch (scheme.in) {\n case 'header':\n result.headers.push(param)\n break\n case 'query':\n result.queryString.push(param)\n break\n case 'cookie':\n result.cookies.push(param)\n break\n }\n continue\n }\n\n // Handle http type\n if (scheme.type === 'http') {\n if (scheme.scheme === 'basic') {\n const username = scheme['x-scalar-secret-username'] || ''\n const password = scheme['x-scalar-secret-password'] || ''\n\n // The snippet is documentation, so we always show an Authorization header. When both\n // fields are empty we render a readable `username:password` placeholder, mirroring the\n // `YOUR_SECRET_TOKEN` placeholder used by the other schemes. (The real request omits the\n // header entirely in that case — see buildRequestSecurity.)\n const value = `${username}:${password}`\n const auth = value === ':' ? 'username:password' : encode(value)\n\n result.headers.push({\n name: 'Authorization',\n value: `Basic ${auth}`,\n })\n } else if (scheme.scheme === 'bearer') {\n const token = scheme['x-scalar-secret-token'] || 'YOUR_SECRET_TOKEN'\n\n result.headers.push({\n name: 'Authorization',\n value: `Bearer ${token}`,\n })\n }\n continue\n }\n\n // Handle oauth2 type\n if (scheme.type === 'oauth2' && scheme.flows) {\n const flows = Object.values(scheme.flows)\n\n // Find the first flow with a token\n const flow = flows.find((f) => f['x-scalar-secret-token'])\n const token = flow?.['x-scalar-secret-token'] || 'YOUR_SECRET_TOKEN'\n\n result.headers.push({\n name: 'Authorization',\n value: `Bearer ${token}`,\n })\n }\n }\n\n return result\n}\n"],"mappings":";;;;;;;AAeA,IAAa,0BACX,oBACmC;CACnC,MAAM,SAAyC;EAC7C,SAAS,EAAE;EACX,aAAa,EAAE;EACf,SAAS,EAAE;EACZ;AAED,MAAK,MAAM,UAAU,iBAAiB;AAEpC,MAAI,OAAO,SAAS,UAAU;GAC5B,MAAM,QAAQ,OAAO,4BAA4B;AACjD,OAAI,CAAC,OAAO,KACV;GAGF,MAAM,QAAQ;IAAE,MAAM,OAAO;IAAM;IAAO;AAE1C,WAAQ,OAAO,IAAf;IACE,KAAK;AACH,YAAO,QAAQ,KAAK,MAAM;AAC1B;IACF,KAAK;AACH,YAAO,YAAY,KAAK,MAAM;AAC9B;IACF,KAAK;AACH,YAAO,QAAQ,KAAK,MAAM;AAC1B;;AAEJ;;AAIF,MAAI,OAAO,SAAS,QAAQ;AAC1B,OAAI,OAAO,WAAW,SAAS;IAQ7B,MAAM,QAAQ,GAPG,OAAO,+BAA+B,GAO7B,GANT,OAAO,+BAA+B;IAOvD,MAAM,OAAO,UAAU,MAAM,sBAAsB,OAAO,MAAM;AAEhE,WAAO,QAAQ,KAAK;KAClB,MAAM;KACN,OAAO,SAAS;KACjB,CAAC;cACO,OAAO,WAAW,UAAU;IACrC,MAAM,QAAQ,OAAO,4BAA4B;AAEjD,WAAO,QAAQ,KAAK;KAClB,MAAM;KACN,OAAO,UAAU;KAClB,CAAC;;AAEJ;;AAIF,MAAI,OAAO,SAAS,YAAY,OAAO,OAAO;GAK5C,MAAM,QAJQ,OAAO,OAAO,OAAO,MAAM,CAGtB,MAAM,MAAM,EAAE,yBAAyB,GACrC,4BAA4B;AAEjD,UAAO,QAAQ,KAAK;IAClB,MAAM;IACN,OAAO,UAAU;IAClB,CAAC;;;AAIN,QAAO"}
|
|
@@ -3,7 +3,7 @@ export { default as HttpMethod } from './components/HttpMethod.vue.js';
|
|
|
3
3
|
export { default as OperationCodeSample } from './components/OperationCodeSample.vue.js';
|
|
4
4
|
export { filterClientsByQuery } from './helpers/filter-clients-by-query.js';
|
|
5
5
|
export { DEFAULT_CLIENT, type SelectedClientId, findClient, isClient, isSelectedClient } from './helpers/find-client.js';
|
|
6
|
-
export { generateClientOptions } from './helpers/generate-client-options.js';
|
|
6
|
+
export { generateClientOptions, getCustomClientIds } from './helpers/generate-client-options.js';
|
|
7
7
|
export { getResolvedRefDeep } from './helpers/get-resolved-ref-deep.js';
|
|
8
8
|
export type { ClientOption, ClientOptionGroup, CustomClientOption, CustomClientOptionGroup } from './types';
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/blocks/operation-code-sample/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,gCAAgC,CAAA;AACzE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,sCAAsC,CAAA;AACrF,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAA;AACxE,OAAO,EAAE,cAAc,EAAE,KAAK,gBAAgB,EAAE,UAAU,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACrH,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/blocks/operation-code-sample/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,gCAAgC,CAAA;AACzE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,sCAAsC,CAAA;AACrF,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAA;AACxE,OAAO,EAAE,cAAc,EAAE,KAAK,gBAAgB,EAAE,UAAU,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACrH,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AAC7F,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAA;AACpE,YAAY,EAAE,YAAY,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAA"}
|
|
@@ -3,6 +3,6 @@ import HttpMethod_default from "./components/HttpMethod.vue.js";
|
|
|
3
3
|
import { getResolvedRefDeep } from "./helpers/get-resolved-ref-deep.js";
|
|
4
4
|
import { filterClientsByQuery } from "./helpers/filter-clients-by-query.js";
|
|
5
5
|
import { DEFAULT_CLIENT, findClient, isClient, isSelectedClient } from "./helpers/find-client.js";
|
|
6
|
-
import { generateClientOptions } from "./helpers/generate-client-options.js";
|
|
6
|
+
import { generateClientOptions, getCustomClientIds } from "./helpers/generate-client-options.js";
|
|
7
7
|
import OperationCodeSample_default from "./components/OperationCodeSample.vue.js";
|
|
8
|
-
export { DEFAULT_CLIENT, ExamplePicker_default as ExamplePicker, HttpMethod_default as HttpMethod, OperationCodeSample_default as OperationCodeSample, filterClientsByQuery, findClient, generateClientOptions, getResolvedRefDeep, isClient, isSelectedClient };
|
|
8
|
+
export { DEFAULT_CLIENT, ExamplePicker_default as ExamplePicker, HttpMethod_default as HttpMethod, OperationCodeSample_default as OperationCodeSample, filterClientsByQuery, findClient, generateClientOptions, getCustomClientIds, getResolvedRefDeep, isClient, isSelectedClient };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestTable.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/request-block/components/RequestTable.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestTable.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/request-block/components/RequestTable.vue"],"names":[],"mappings":"AAgIA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AAGnH,OAAwB,EACtB,KAAK,QAAQ,EACd,MAAM,0DAA0D,CAAA;AAOjE,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,QAAQ,EAAE,CAAA;IAChB,8BAA8B;IAC9B,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,aAAa,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,WAAW,EAAE,kBAAkB,CAAA;CAChC,CAAC;AAsOF,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;cApNN,MAAM;eACL,MAAM,GAAG,IAAI,GAAG,SAAS;oBACpB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAFb,MAAM;eACL,MAAM,GAAG,IAAI,GAAG,SAAS;oBACpB,OAAO;;;;;kFAqNvB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -2,7 +2,7 @@ import _plugin_vue_export_helper_default from "../../../../_virtual/_plugin-vue_
|
|
|
2
2
|
import RequestTable_vue_vue_type_script_setup_true_lang_default from "./RequestTable.vue.script.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
//#region src/v2/blocks/request-block/components/RequestTable.vue
|
|
5
|
-
var RequestTable_default = /* @__PURE__ */ _plugin_vue_export_helper_default(RequestTable_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-
|
|
5
|
+
var RequestTable_default = /* @__PURE__ */ _plugin_vue_export_helper_default(RequestTable_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-e83eb7d0"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { RequestTable_default as default };
|
|
8
8
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestTable.vue.js","names":[],"sources":["../../../../../src/v2/blocks/request-block/components/RequestTable.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport { computed } from 'vue'\n\nimport RequestTableRow, {\n type TableRow,\n} from '@/v2/blocks/request-block/components/RequestTableRow.vue'\nimport {\n DataTable,\n DataTableHeader,\n DataTableRow,\n} from '@/v2/components/data-table'\n\nconst {\n data,\n hasCheckboxDisabled,\n showUploadButton,\n showAddRowPlaceholder = true,\n environment,\n} = defineProps<{\n data: TableRow[]\n /** Hide the enabled column */\n hasCheckboxDisabled?: boolean\n invalidParams?: Set<string>\n label?: string\n showUploadButton?: boolean\n showAddRowPlaceholder?: boolean\n environment: XScalarEnvironment\n}>()\n\n/**\n * Make this component more generic that can be used also for the operation body\n */\nconst emit = defineEmits<{\n (\n e: 'upsertRow',\n index: number,\n payload: {\n name: string\n value: string | File | undefined\n isDisabled: boolean\n },\n ): void\n (e: 'deleteRow', index: number): void\n\n /**\n * File upload events\n *\n * Each row has its own upload button, so we need to know which row to update\n * when the file is selected.\n */\n (e: 'uploadFile', index: number): void\n (e: 'removeFile', index: number): void\n (e: 'navigate', route: NonNullable<TableRow['globalRoute']>): void\n}>()\n\nconst columns = computed(() => {\n if (showUploadButton) {\n return ['36px', '', '', 'auto']\n }\n return ['36px', '', '']\n})\n\n/** Add the last empty row (for ui purposes only) */\nconst displayData = computed(() => {\n if (!showAddRowPlaceholder) {\n return data\n }\n\n const last = data.at(-1)\n\n if (!last || last.name !== '' || last.value !== '') {\n return [...data, { name: '', value: '', isDisabled: true }]\n }\n\n return data\n})\n</script>\n<template>\n <DataTable\n class=\"group/table flex-1\"\n :columns=\"columns\">\n <DataTableRow class=\"sr-only !block\">\n <DataTableHeader>{{ label }} Enabled</DataTableHeader>\n <DataTableHeader>{{ label }} Key</DataTableHeader>\n <DataTableHeader>{{ label }} Value</DataTableHeader>\n </DataTableRow>\n\n <RequestTableRow\n v-for=\"(row, index) in displayData\"\n :key=\"index\"\n :data=\"row\"\n :environment=\"environment\"\n :hasCheckboxDisabled=\"hasCheckboxDisabled\"\n :invalidParams=\"invalidParams\"\n :label=\"label\"\n :showUploadButton=\"showUploadButton\"\n @deleteRow=\"emit('deleteRow', index)\"\n @navigate=\"(route) => emit('navigate', route)\"\n @removeFile=\"emit('removeFile', index)\"\n @uploadFile=\"emit('uploadFile', index)\"\n @upsertRow=\"(payload) => emit('upsertRow', index, payload)\" />\n </DataTable>\n</template>\n<style scoped>\n:deep(.
|
|
1
|
+
{"version":3,"file":"RequestTable.vue.js","names":[],"sources":["../../../../../src/v2/blocks/request-block/components/RequestTable.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport { computed } from 'vue'\n\nimport RequestTableRow, {\n type TableRow,\n} from '@/v2/blocks/request-block/components/RequestTableRow.vue'\nimport {\n DataTable,\n DataTableHeader,\n DataTableRow,\n} from '@/v2/components/data-table'\n\nconst {\n data,\n hasCheckboxDisabled,\n showUploadButton,\n showAddRowPlaceholder = true,\n environment,\n} = defineProps<{\n data: TableRow[]\n /** Hide the enabled column */\n hasCheckboxDisabled?: boolean\n invalidParams?: Set<string>\n label?: string\n showUploadButton?: boolean\n showAddRowPlaceholder?: boolean\n environment: XScalarEnvironment\n}>()\n\n/**\n * Make this component more generic that can be used also for the operation body\n */\nconst emit = defineEmits<{\n (\n e: 'upsertRow',\n index: number,\n payload: {\n name: string\n value: string | File | undefined\n isDisabled: boolean\n },\n ): void\n (e: 'deleteRow', index: number): void\n\n /**\n * File upload events\n *\n * Each row has its own upload button, so we need to know which row to update\n * when the file is selected.\n */\n (e: 'uploadFile', index: number): void\n (e: 'removeFile', index: number): void\n (e: 'navigate', route: NonNullable<TableRow['globalRoute']>): void\n}>()\n\nconst columns = computed(() => {\n if (showUploadButton) {\n return ['36px', '', '', 'auto']\n }\n return ['36px', '', '']\n})\n\n/** Add the last empty row (for ui purposes only) */\nconst displayData = computed(() => {\n if (!showAddRowPlaceholder) {\n return data\n }\n\n const last = data.at(-1)\n\n if (!last || last.name !== '' || last.value !== '') {\n return [...data, { name: '', value: '', isDisabled: true }]\n }\n\n return data\n})\n</script>\n<template>\n <DataTable\n class=\"group/table flex-1\"\n :columns=\"columns\">\n <DataTableRow class=\"sr-only !block\">\n <DataTableHeader>{{ label }} Enabled</DataTableHeader>\n <DataTableHeader>{{ label }} Key</DataTableHeader>\n <DataTableHeader>{{ label }} Value</DataTableHeader>\n </DataTableRow>\n\n <RequestTableRow\n v-for=\"(row, index) in displayData\"\n :key=\"index\"\n :data=\"row\"\n :environment=\"environment\"\n :hasCheckboxDisabled=\"hasCheckboxDisabled\"\n :invalidParams=\"invalidParams\"\n :label=\"label\"\n :showUploadButton=\"showUploadButton\"\n @deleteRow=\"emit('deleteRow', index)\"\n @navigate=\"(route) => emit('navigate', route)\"\n @removeFile=\"emit('removeFile', index)\"\n @uploadFile=\"emit('uploadFile', index)\"\n @upsertRow=\"(payload) => emit('upsertRow', index, payload)\" />\n </DataTable>\n</template>\n<style scoped>\n:deep(.code-input-lite__editor) {\n background-color: transparent;\n font-family: var(--scalar-font);\n font-size: var(--scalar-small);\n padding: 5px 8px;\n}\n:deep(.scalar-pill:not(:last-of-type)) {\n margin-right: 0.15em;\n}\n:deep(.scalar-pill:not(:first-of-type)) {\n margin-left: 0.5px;\n}\n.filemask {\n mask-image: linear-gradient(\n to right,\n transparent 0,\n var(--scalar-background-2) 20px\n );\n}\n</style>\n"],"mappings":""}
|