@scalar/api-client 2.1.37 → 2.1.39
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 +33 -0
- package/dist/components/AddressBar/AddressBarServer.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBarServer.vue.js +8 -7
- package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
- package/dist/components/CodeInput/CodeInput.vue.js +2 -2
- package/dist/components/CodeInput/CodeInput.vue2.js +43 -42
- package/dist/components/CodeInput/codeVariableWidget.d.ts +1 -2
- package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -1
- package/dist/components/CodeInput/codeVariableWidget.js +38 -40
- package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/ImportCollectionModal.vue.js +5 -5
- package/dist/components/OpenApiClientButton.vue.d.ts +4 -4
- package/dist/components/OpenApiClientButton.vue.d.ts.map +1 -1
- package/dist/components/OpenApiClientButton.vue.js +2 -2
- package/dist/components/OpenApiClientButton.vue2.js +14 -11
- package/dist/components/SideNav/SideNav.vue.d.ts.map +1 -1
- package/dist/components/SideNav/SideNav.vue.js +2 -2
- package/dist/components/SideNav/SideNav.vue2.js +42 -29
- package/dist/components/Sidebar/SidebarListElement.vue.d.ts +2 -0
- package/dist/components/Sidebar/SidebarListElement.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarListElement.vue.js +1 -1
- package/dist/components/Sidebar/SidebarListElement.vue2.js +32 -28
- package/dist/layouts/App/create-api-client-app.d.ts +70 -6
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/create-api-client-modal.d.ts +140 -12
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Web/create-api-client-web.d.ts +70 -6
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +76 -9
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/create-client.js +92 -80
- package/dist/store/collections.d.ts +1 -0
- package/dist/store/collections.d.ts.map +1 -1
- package/dist/store/cookies.d.ts +1 -0
- package/dist/store/cookies.d.ts.map +1 -1
- package/dist/store/environment.d.ts +1 -0
- package/dist/store/environment.d.ts.map +1 -1
- package/dist/store/environment.js +6 -7
- package/dist/store/request-example.d.ts +1 -0
- package/dist/store/request-example.d.ts.map +1 -1
- package/dist/store/requests.d.ts +55 -4
- package/dist/store/requests.d.ts.map +1 -1
- package/dist/store/security-schemes.d.ts +2 -1
- package/dist/store/security-schemes.d.ts.map +1 -1
- package/dist/store/security-schemes.js +9 -9
- package/dist/store/servers.d.ts +1 -0
- package/dist/store/servers.d.ts.map +1 -1
- package/dist/store/store.d.ts +138 -10
- package/dist/store/store.d.ts.map +1 -1
- package/dist/store/tags.d.ts +1 -0
- package/dist/store/tags.d.ts.map +1 -1
- package/dist/store/workspace.d.ts +1 -0
- package/dist/store/workspace.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
- package/dist/views/Environment/Environment.vue2.js +98 -83
- package/dist/views/Environment/EnvironmentColorModal.vue.d.ts +16 -0
- package/dist/views/Environment/EnvironmentColorModal.vue.d.ts.map +1 -0
- package/dist/views/Environment/EnvironmentColorModal.vue.js +40 -0
- package/dist/views/Environment/EnvironmentColorModal.vue2.js +4 -0
- package/dist/views/Environment/EnvironmentColors.vue.d.ts.map +1 -1
- package/dist/views/Environment/EnvironmentColors.vue.js +84 -29
- package/dist/views/Environment/EnvironmentModal.vue.d.ts +20 -0
- package/dist/views/Environment/EnvironmentModal.vue.d.ts.map +1 -0
- package/dist/views/Environment/EnvironmentModal.vue.js +52 -0
- package/dist/views/Environment/EnvironmentModal.vue2.js +4 -0
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts +2 -0
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +51 -50
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +12 -12
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# @scalar/api-client
|
|
2
2
|
|
|
3
|
+
## 2.1.39
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- bd8e253: fix: import collection animation
|
|
8
|
+
- b9b42f6: fix(api-client): api client button is always visible
|
|
9
|
+
|
|
10
|
+
## 2.1.38
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- cf4e9c4: fix(components): resize and scroll scalar listbox and dropdown
|
|
15
|
+
- 743474e: feat: adds environment custom colors
|
|
16
|
+
- cfe9b85: fix: added safe parsing for oauth examples
|
|
17
|
+
- 0fb3a41: fix: sets default environment variable value
|
|
18
|
+
- 417e0c7: feat(api-client): add download button to scalar web
|
|
19
|
+
- 0e19781: feat: fix reactivitiy of references + client
|
|
20
|
+
- Updated dependencies [fb798c8]
|
|
21
|
+
- Updated dependencies [cf4e9c4]
|
|
22
|
+
- Updated dependencies [3bec045]
|
|
23
|
+
- Updated dependencies [743474e]
|
|
24
|
+
- Updated dependencies [cfe9b85]
|
|
25
|
+
- Updated dependencies [4d45f7b]
|
|
26
|
+
- Updated dependencies [6599473]
|
|
27
|
+
- Updated dependencies [bb3dc9d]
|
|
28
|
+
- Updated dependencies [0e19781]
|
|
29
|
+
- @scalar/types@0.0.18
|
|
30
|
+
- @scalar/components@0.12.63
|
|
31
|
+
- @scalar/oas-utils@0.2.65
|
|
32
|
+
- @scalar/themes@0.9.45
|
|
33
|
+
- @scalar/object-utils@1.1.11
|
|
34
|
+
- @scalar/use-codemirror@0.11.30
|
|
35
|
+
|
|
3
36
|
## 2.1.37
|
|
4
37
|
|
|
5
38
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddressBarServer.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBarServer.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"AddressBarServer.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBarServer.vue"],"names":[],"mappings":";AAgZA,wBAKG"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as O, computed as c, watch as R, openBlock as l, createBlock as S, unref as n, withCtx as
|
|
1
|
+
import { defineComponent as O, computed as c, watch as R, openBlock as l, createBlock as S, unref as n, withCtx as w, createElementBlock as o, createCommentVNode as v, Fragment as m, renderList as g, createVNode as p, createElementVNode as i, withModifiers as V, toDisplayString as b } from "vue";
|
|
2
2
|
import { ScalarDropdown as W, ScalarDropdownDivider as C, ScalarDropdownItem as E, ScalarIcon as I } from "@scalar/components";
|
|
3
3
|
import D from "./AddressBarServerItem.vue.js";
|
|
4
4
|
import { useWorkspace as L } from "../../store/store.js";
|
|
@@ -12,7 +12,7 @@ const M = {
|
|
|
12
12
|
__name: "AddressBarServer",
|
|
13
13
|
setup(P) {
|
|
14
14
|
const {
|
|
15
|
-
activeRequest:
|
|
15
|
+
activeRequest: k,
|
|
16
16
|
activeCollection: h,
|
|
17
17
|
activeServer: x,
|
|
18
18
|
isReadOnly: A,
|
|
@@ -22,7 +22,7 @@ const M = {
|
|
|
22
22
|
} = L(), d = c(
|
|
23
23
|
() => {
|
|
24
24
|
var t, e;
|
|
25
|
-
return (e = (t =
|
|
25
|
+
return (e = (t = k.value) == null ? void 0 : t.servers) == null ? void 0 : e.map((r) => {
|
|
26
26
|
var s;
|
|
27
27
|
return {
|
|
28
28
|
id: r,
|
|
@@ -47,7 +47,7 @@ const M = {
|
|
|
47
47
|
return ((t = d.value) == null ? void 0 : t.length) && ((e = u.value) == null ? void 0 : e.length);
|
|
48
48
|
}
|
|
49
49
|
);
|
|
50
|
-
R([h,
|
|
50
|
+
R([h, k], ([t, e]) => {
|
|
51
51
|
!t || t.selectedServerUid || e != null && e.selectedServerUid || B.edit(
|
|
52
52
|
t.uid,
|
|
53
53
|
"selectedServerUid",
|
|
@@ -64,9 +64,10 @@ const M = {
|
|
|
64
64
|
var r, s;
|
|
65
65
|
return d.value && ((r = d.value) == null ? void 0 : r.length) > 1 || u.value && ((s = u.value) == null ? void 0 : s.length) > 1 ? (l(), S(n(W), {
|
|
66
66
|
key: 0,
|
|
67
|
+
class: "w-max",
|
|
67
68
|
teleport: ".scalar-client"
|
|
68
69
|
}, {
|
|
69
|
-
items:
|
|
70
|
+
items: w(() => [
|
|
70
71
|
_.value ? (l(), o("div", M, " Request Servers ")) : v("", !0),
|
|
71
72
|
(l(!0), o(m, null, g(d.value, (a) => (l(), S(D, {
|
|
72
73
|
key: a.id,
|
|
@@ -85,7 +86,7 @@ const M = {
|
|
|
85
86
|
n(A) ? v("", !0) : (l(), o(m, { key: 2 }, [
|
|
86
87
|
p(n(C)),
|
|
87
88
|
p(n(E), null, {
|
|
88
|
-
default:
|
|
89
|
+
default: w(() => [
|
|
89
90
|
i("div", {
|
|
90
91
|
class: "font-code text-xxs flex items-center gap-1.5",
|
|
91
92
|
onClick: U
|
|
@@ -103,7 +104,7 @@ const M = {
|
|
|
103
104
|
})
|
|
104
105
|
], 64))
|
|
105
106
|
]),
|
|
106
|
-
default:
|
|
107
|
+
default: w(() => [
|
|
107
108
|
i("button", {
|
|
108
109
|
class: "font-code lg:text-sm text-xs whitespace-nowrap border border-b-3 border-solid rounded px-1.5 py-0.5 text-c-2",
|
|
109
110
|
type: "button",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/CodeInput.vue"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"CodeInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/CodeInput.vue"],"names":[],"mappings":"AAAA,OAmYO,EAGL,KAAK,kBAAkB,EAGxB,MAAM,wBAAwB,CAAA;;kBAcb,OAAO;gBACT,MAAM,GAAG,MAAM;YACnB,OAAO;iBACF,OAAO;kBACN,OAAO;WACd,OAAO;uBACK,OAAO;eACf,kBAAkB;wBACT,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;wBACnB,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;kBACzB,MAAM;eACT,OAAO;mBACH,OAAO;2BACC,OAAO;WACvB,MAAM,EAAE;WACR,MAAM;eACF,OAAO;oBACF,OAAO;iBACV,OAAO;;;;;;;;kBAlBN,OAAO;gBACT,MAAM,GAAG,MAAM;YACnB,OAAO;iBACF,OAAO;kBACN,OAAO;WACd,OAAO;uBACK,OAAO;eACf,kBAAkB;wBACT,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;wBACnB,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;kBACzB,MAAM;eACT,OAAO;mBACH,OAAO;2BACC,OAAO;WACvB,MAAM,EAAE;WACR,MAAM;eACF,OAAO;oBACF,OAAO;iBACV,OAAO;;;;;;gBAfP,OAAO;iBAHN,OAAO;sBAMF,OAAO;kBAMX,OAAO;0BACC,OAAO;cAGnB,OAAO;mBACF,OAAO;;qBA8WG,GAAG;kBACN,GAAG;;AAnY9B,wBA6bC;AAcD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -2,7 +2,7 @@ import o from "./CodeInput.vue2.js";
|
|
|
2
2
|
/* empty css */
|
|
3
3
|
/* empty css */
|
|
4
4
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
-
const
|
|
5
|
+
const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-9645481b"]]);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
a as default
|
|
8
8
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as j, useAttrs as L, ref as u, toRef as r, watch as Q, computed as
|
|
1
|
+
import { defineComponent as j, useAttrs as L, ref as u, toRef as r, watch as Q, computed as y, openBlock as a, createElementBlock as c, Fragment as z, createBlock as v, mergeProps as G, unref as i, withKeys as h, withModifiers as _, renderSlot as D, createCommentVNode as w } from "vue";
|
|
2
2
|
import { useCodeMirror as H, useDropdown as J, colorPicker as X } from "@scalar/use-codemirror";
|
|
3
3
|
import { nanoid as Y } from "nanoid";
|
|
4
4
|
import q from "../DataTable/DataTableInputSelect.vue.js";
|
|
@@ -13,7 +13,7 @@ const te = ["id"], ne = {
|
|
|
13
13
|
class: "required absolute centered-y right-0 pt-px pr-2 text-xxs text-c-3 bg-b-1 shadow-[-8px_0_4px_var(--scalar-background-1)] opacity-100 duration-150 transition-opacity peer-has-[.cm-focused]:opacity-0 pointer-events-none"
|
|
14
14
|
}, ae = {
|
|
15
15
|
inheritAttrs: !1
|
|
16
|
-
},
|
|
16
|
+
}, fe = /* @__PURE__ */ j({
|
|
17
17
|
...ae,
|
|
18
18
|
__name: "CodeInput",
|
|
19
19
|
props: {
|
|
@@ -38,94 +38,94 @@ const te = ["id"], ne = {
|
|
|
38
38
|
importCurl: { type: Boolean }
|
|
39
39
|
},
|
|
40
40
|
emits: ["submit", "update:modelValue", "curl"],
|
|
41
|
-
setup(
|
|
42
|
-
var
|
|
43
|
-
const o =
|
|
41
|
+
setup(R, { expose: $, emit: O }) {
|
|
42
|
+
var F;
|
|
43
|
+
const o = R, s = O, g = L(), K = g.id || `id-${Y()}`, V = u(!1), m = u(!1), B = u(""), k = u({ left: 0, top: 0 }), p = u(null), { activeEnvVariables: C, isReadOnly: S, activeEnvironment: x, router: M } = le();
|
|
44
44
|
function A(e) {
|
|
45
45
|
var l;
|
|
46
|
-
return e === o.modelValue ? null : o.importCurl && e.trim().toLowerCase().startsWith("curl") ? (
|
|
46
|
+
return e === o.modelValue ? null : o.importCurl && e.trim().toLowerCase().startsWith("curl") ? (s("curl", e), (l = n.value) == null || l.dispatch({
|
|
47
47
|
changes: {
|
|
48
48
|
from: 0,
|
|
49
49
|
to: n.value.state.doc.length,
|
|
50
50
|
insert: String(o.modelValue)
|
|
51
51
|
}
|
|
52
|
-
}), null) : o.handleFieldChange ? o.handleFieldChange(e) :
|
|
52
|
+
}), null) : o.handleFieldChange ? o.handleFieldChange(e) : s("update:modelValue", e);
|
|
53
53
|
}
|
|
54
54
|
function I(e) {
|
|
55
|
-
return o.handleFieldSubmit ? o.handleFieldSubmit(e) :
|
|
55
|
+
return o.handleFieldSubmit ? o.handleFieldSubmit(e) : s("submit", e);
|
|
56
56
|
}
|
|
57
57
|
function N(e) {
|
|
58
|
-
|
|
58
|
+
V.value = !1, o.emitOnBlur && o.modelValue && I(e);
|
|
59
59
|
}
|
|
60
|
-
const
|
|
61
|
-
o.colorPicker &&
|
|
60
|
+
const f = [];
|
|
61
|
+
o.colorPicker && f.push(X), f.push(
|
|
62
62
|
Z({
|
|
63
|
-
|
|
64
|
-
activeEnvVariables:
|
|
65
|
-
isReadOnly:
|
|
63
|
+
activeEnvironment: x,
|
|
64
|
+
activeEnvVariables: C,
|
|
65
|
+
isReadOnly: S
|
|
66
66
|
}),
|
|
67
67
|
ee
|
|
68
68
|
);
|
|
69
|
-
const
|
|
69
|
+
const E = u(null), { codeMirror: n } = H({
|
|
70
70
|
content: r(
|
|
71
71
|
() => o.modelValue !== void 0 ? String(o.modelValue) : ""
|
|
72
72
|
),
|
|
73
73
|
onChange: (e) => {
|
|
74
74
|
A(e), U();
|
|
75
75
|
},
|
|
76
|
-
onFocus: () =>
|
|
76
|
+
onFocus: () => V.value = !0,
|
|
77
77
|
onBlur: (e) => N(e),
|
|
78
|
-
codeMirrorRef:
|
|
78
|
+
codeMirrorRef: E,
|
|
79
79
|
disableTabIndent: r(() => o.disableTabIndent),
|
|
80
80
|
disableEnter: r(() => o.disableEnter),
|
|
81
81
|
disableCloseBrackets: r(() => o.disableCloseBrackets),
|
|
82
82
|
lineNumbers: r(() => o.lineNumbers),
|
|
83
83
|
language: r(() => o.language),
|
|
84
84
|
lint: r(() => o.lint),
|
|
85
|
-
extensions:
|
|
85
|
+
extensions: f,
|
|
86
86
|
placeholder: r(() => o.placeholder)
|
|
87
87
|
});
|
|
88
|
-
(
|
|
89
|
-
n.value && Object.prototype.hasOwnProperty.call(
|
|
88
|
+
(F = n.value) == null || F.focus(), Q(n, () => {
|
|
89
|
+
n.value && Object.prototype.hasOwnProperty.call(g, "autofocus") && n.value.focus();
|
|
90
90
|
});
|
|
91
91
|
const { handleDropdownSelect: T, updateDropdownVisibility: U } = J({
|
|
92
92
|
codeMirror: n,
|
|
93
|
-
query:
|
|
94
|
-
showDropdown:
|
|
95
|
-
dropdownPosition:
|
|
96
|
-
}), W =
|
|
93
|
+
query: B,
|
|
94
|
+
showDropdown: m,
|
|
95
|
+
dropdownPosition: k
|
|
96
|
+
}), W = y(() => {
|
|
97
97
|
var e;
|
|
98
98
|
return o.type === "boolean" || (e = o.type) != null && e.includes("boolean") || o.nullable ? ["true", "false", "null"] : ["true", "false"];
|
|
99
99
|
});
|
|
100
|
-
|
|
100
|
+
$({
|
|
101
101
|
focus: () => {
|
|
102
102
|
var e;
|
|
103
103
|
(e = n.value) == null || e.focus();
|
|
104
104
|
}
|
|
105
105
|
});
|
|
106
106
|
const b = (e, l) => {
|
|
107
|
-
var
|
|
108
|
-
|
|
107
|
+
var d, t, P;
|
|
108
|
+
m.value && (e === "down" ? (l.preventDefault(), (d = p.value) == null || d.handleArrowKey("down")) : e === "up" ? (l.preventDefault(), (t = p.value) == null || t.handleArrowKey("up")) : e === "enter" && (l.preventDefault(), (P = p.value) == null || P.handleSelect()));
|
|
109
109
|
};
|
|
110
110
|
return (e, l) => {
|
|
111
|
-
var
|
|
111
|
+
var d;
|
|
112
112
|
return a(), c(z, null, [
|
|
113
|
-
o.enum && o.enum.length ? (a(),
|
|
113
|
+
o.enum && o.enum.length ? (a(), v(q, {
|
|
114
114
|
key: 0,
|
|
115
115
|
modelValue: o.modelValue,
|
|
116
116
|
value: o.enum,
|
|
117
|
-
"onUpdate:modelValue": l[0] || (l[0] = (t) =>
|
|
118
|
-
}, null, 8, ["modelValue", "value"])) : o.type === "boolean" || (
|
|
117
|
+
"onUpdate:modelValue": l[0] || (l[0] = (t) => s("update:modelValue", t))
|
|
118
|
+
}, null, 8, ["modelValue", "value"])) : o.type === "boolean" || (d = o.type) != null && d.includes("boolean") ? (a(), v(q, {
|
|
119
119
|
key: 1,
|
|
120
120
|
modelValue: o.modelValue,
|
|
121
121
|
value: W.value,
|
|
122
|
-
"onUpdate:modelValue": l[1] || (l[1] = (t) =>
|
|
122
|
+
"onUpdate:modelValue": l[1] || (l[1] = (t) => s("update:modelValue", t))
|
|
123
123
|
}, null, 8, ["modelValue", "value"])) : (a(), c("div", G({
|
|
124
124
|
key: 2,
|
|
125
|
-
id:
|
|
125
|
+
id: i(K)
|
|
126
126
|
}, e.$attrs, {
|
|
127
127
|
ref_key: "codeMirrorRef",
|
|
128
|
-
ref:
|
|
128
|
+
ref: E,
|
|
129
129
|
class: ["peer font-code w-full whitespace-nowrap overflow-hidden text-xs leading-[1.44] relative", {
|
|
130
130
|
"flow-code-input--error": e.error
|
|
131
131
|
}],
|
|
@@ -140,20 +140,21 @@ const te = ["id"], ne = {
|
|
|
140
140
|
])) : w("", !0),
|
|
141
141
|
D(e.$slots, "icon", {}, void 0, !0),
|
|
142
142
|
e.required ? (a(), c("div", re, " Required ")) : w("", !0),
|
|
143
|
-
|
|
143
|
+
m.value && o.withVariables && !i(S) ? (a(), v(oe, {
|
|
144
144
|
key: 5,
|
|
145
145
|
ref_key: "dropdownRef",
|
|
146
146
|
ref: p,
|
|
147
|
-
activeEnvVariables:
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
147
|
+
activeEnvVariables: y(() => i(C)),
|
|
148
|
+
activeEnvironment: y(() => i(x)),
|
|
149
|
+
dropdownPosition: k.value,
|
|
150
|
+
query: B.value,
|
|
151
|
+
router: i(M),
|
|
152
|
+
onSelect: i(T)
|
|
153
|
+
}, null, 8, ["activeEnvVariables", "activeEnvironment", "dropdownPosition", "query", "router", "onSelect"])) : w("", !0)
|
|
153
154
|
], 64);
|
|
154
155
|
};
|
|
155
156
|
}
|
|
156
157
|
});
|
|
157
158
|
export {
|
|
158
|
-
|
|
159
|
+
fe as default
|
|
159
160
|
};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import type { WorkspaceStore } from '../../store/index.js';
|
|
2
|
-
import type { Environment } from '@scalar/oas-utils/entities/environment';
|
|
3
2
|
import { Decoration, type DecorationSet, EditorView, ViewPlugin, type ViewUpdate } from '@scalar/use-codemirror';
|
|
4
3
|
type ActiveParsedEnvironments = WorkspaceStore['activeEnvVariables'];
|
|
5
4
|
type IsReadOnly = WorkspaceStore['isReadOnly'];
|
|
6
5
|
export declare const pillPlugin: (props: {
|
|
7
|
-
|
|
6
|
+
activeEnvironment: WorkspaceStore["activeEnvironment"];
|
|
8
7
|
activeEnvVariables: ActiveParsedEnvironments;
|
|
9
8
|
isReadOnly: IsReadOnly;
|
|
10
9
|
}) => ViewPlugin<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codeVariableWidget.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/codeVariableWidget.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"codeVariableWidget.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/codeVariableWidget.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAI7C,OAAO,EACL,UAAU,EACV,KAAK,aAAa,EAClB,UAAU,EAEV,UAAU,EACV,KAAK,UAAU,EAEhB,MAAM,wBAAwB,CAAA;AAI/B,KAAK,wBAAwB,GAAG,cAAc,CAAC,oBAAoB,CAAC,CAAA;AACpE,KAAK,UAAU,GAAG,cAAc,CAAC,YAAY,CAAC,CAAA;AAqH9C,eAAO,MAAM,UAAU,UAAW;IAChC,iBAAiB,EAAE,cAAc,CAAC,mBAAmB,CAAC,CAAA;IACtD,kBAAkB,EAAE,wBAAwB,CAAA;IAC5C,UAAU,EAAE,UAAU,CAAA;CACvB;iBAGkB,aAAa;mBAMX,UAAU;2BAMF,UAAU;EAiCpC,CAAA;AAEH,eAAO,MAAM,gBAAgB,uCA8B3B,CAAA"}
|
|
@@ -1,37 +1,35 @@
|
|
|
1
1
|
var v = Object.defineProperty;
|
|
2
|
-
var u = (
|
|
3
|
-
var l = (
|
|
2
|
+
var u = (a, t, e) => t in a ? v(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
|
|
3
|
+
var l = (a, t, e) => u(a, typeof t != "symbol" ? t + "" : t, e);
|
|
4
4
|
import { ScalarButton as h, ScalarIcon as f, ScalarTooltip as b } from "@scalar/components";
|
|
5
5
|
import { variableRegex as g } from "@scalar/oas-utils/helpers";
|
|
6
|
-
import { ViewPlugin as x, RangeSetBuilder as y, Decoration as
|
|
7
|
-
import { defineComponent as
|
|
8
|
-
import { parseEnvVariables as
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
(a) => a.key === "color"
|
|
13
|
-
)) == null ? void 0 : e.value) || "grey";
|
|
14
|
-
};
|
|
15
|
-
class c extends E {
|
|
16
|
-
constructor(e, a, i, s) {
|
|
6
|
+
import { ViewPlugin as x, RangeSetBuilder as y, Decoration as E, EditorView as w, WidgetType as N } from "@scalar/use-codemirror";
|
|
7
|
+
import { defineComponent as C, h as o, createApp as V } from "vue";
|
|
8
|
+
import { parseEnvVariables as D } from "../../libs/environment-parser.js";
|
|
9
|
+
const R = (a) => a.value ? a.value.color : "#8E8E8E";
|
|
10
|
+
class c extends N {
|
|
11
|
+
constructor(e, i, n, s) {
|
|
17
12
|
super();
|
|
18
13
|
l(this, "app");
|
|
19
|
-
l(this, "
|
|
14
|
+
l(this, "activeEnvironment");
|
|
20
15
|
l(this, "activeEnvVariables");
|
|
21
16
|
l(this, "isReadOnly");
|
|
22
|
-
this.variableName = e, this.variableName = e, this.
|
|
17
|
+
this.variableName = e, this.variableName = e, this.activeEnvironment = i, this.activeEnvVariables = n, this.isReadOnly = s;
|
|
23
18
|
}
|
|
24
19
|
toDOM() {
|
|
25
20
|
const e = document.createElement("span");
|
|
26
21
|
e.className = "cm-pill", e.textContent = `${this.variableName}`;
|
|
27
|
-
const
|
|
22
|
+
const i = C({
|
|
28
23
|
props: { variableName: { type: String, default: null } },
|
|
29
24
|
render: () => {
|
|
30
|
-
const
|
|
25
|
+
const n = D(this.activeEnvVariables.value).find(
|
|
31
26
|
(r) => r.key === this.variableName
|
|
32
27
|
);
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
n && e.style.setProperty(
|
|
29
|
+
"--tw-bg-base",
|
|
30
|
+
R(this.activeEnvironment)
|
|
31
|
+
);
|
|
32
|
+
const s = n ? o("div", { class: "p-2" }, n.value) : o("div", { class: "divide-y divide-1/2 grid" }, [
|
|
35
33
|
o("span", { class: "p-2" }, "Variable not found"),
|
|
36
34
|
!this.isReadOnly && o("div", { class: "p-1" }, [
|
|
37
35
|
o(
|
|
@@ -72,7 +70,7 @@ class c extends E {
|
|
|
72
70
|
);
|
|
73
71
|
}
|
|
74
72
|
});
|
|
75
|
-
return this.app =
|
|
73
|
+
return this.app = V(i, { variableName: this.variableName }), this.app.mount(e), e;
|
|
76
74
|
}
|
|
77
75
|
destroy() {
|
|
78
76
|
this.app && this.app.unmount();
|
|
@@ -84,7 +82,7 @@ class c extends E {
|
|
|
84
82
|
return !1;
|
|
85
83
|
}
|
|
86
84
|
}
|
|
87
|
-
const
|
|
85
|
+
const T = (a) => x.fromClass(
|
|
88
86
|
class {
|
|
89
87
|
constructor(t) {
|
|
90
88
|
l(this, "decorations");
|
|
@@ -95,20 +93,20 @@ const P = (n) => x.fromClass(
|
|
|
95
93
|
}
|
|
96
94
|
buildDecorations(t) {
|
|
97
95
|
const e = new y();
|
|
98
|
-
for (const { from:
|
|
99
|
-
const s = t.state.doc.sliceString(
|
|
96
|
+
for (const { from: i, to: n } of t.visibleRanges) {
|
|
97
|
+
const s = t.state.doc.sliceString(i, n);
|
|
100
98
|
let r;
|
|
101
99
|
for (; (r = g.exec(s)) !== null; ) {
|
|
102
|
-
const d =
|
|
100
|
+
const d = i + r.index, m = d + r[0].length, p = r[1];
|
|
103
101
|
e.add(
|
|
104
102
|
d,
|
|
105
103
|
m,
|
|
106
|
-
|
|
104
|
+
E.widget({
|
|
107
105
|
widget: new c(
|
|
108
106
|
p,
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
107
|
+
a.activeEnvironment,
|
|
108
|
+
a.activeEnvVariables,
|
|
109
|
+
a.isReadOnly
|
|
112
110
|
),
|
|
113
111
|
side: 1
|
|
114
112
|
})
|
|
@@ -121,25 +119,25 @@ const P = (n) => x.fromClass(
|
|
|
121
119
|
{
|
|
122
120
|
decorations: (t) => t.decorations
|
|
123
121
|
}
|
|
124
|
-
),
|
|
125
|
-
keydown(
|
|
126
|
-
if (
|
|
127
|
-
const { state: e } = t, { from:
|
|
128
|
-
if (
|
|
122
|
+
), $ = w.domEventHandlers({
|
|
123
|
+
keydown(a, t) {
|
|
124
|
+
if (a.key === "Backspace") {
|
|
125
|
+
const { state: e } = t, { from: i, to: n } = e.selection.main;
|
|
126
|
+
if (i === 0 && n === e.doc.length)
|
|
129
127
|
return t.dispatch({
|
|
130
128
|
changes: { from: 0, to: e.doc.length },
|
|
131
129
|
selection: { anchor: 0 }
|
|
132
|
-
}),
|
|
133
|
-
if (
|
|
130
|
+
}), a.preventDefault(), !0;
|
|
131
|
+
if (i === n && i > 0 && e.doc.sliceString(i - 2, i) === "}}")
|
|
134
132
|
return t.dispatch({
|
|
135
|
-
changes: { from:
|
|
136
|
-
selection: { anchor:
|
|
137
|
-
}),
|
|
133
|
+
changes: { from: i - 2, to: n },
|
|
134
|
+
selection: { anchor: i - 2 }
|
|
135
|
+
}), a.preventDefault(), !0;
|
|
138
136
|
}
|
|
139
137
|
return !1;
|
|
140
138
|
}
|
|
141
139
|
});
|
|
142
140
|
export {
|
|
143
|
-
|
|
144
|
-
|
|
141
|
+
$ as backspaceCommand,
|
|
142
|
+
T as pillPlugin
|
|
145
143
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImportCollectionModal.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/ImportCollectionModal.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"ImportCollectionModal.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/ImportCollectionModal.vue"],"names":[],"mappings":";YAkVU,MAAM,GAAG,IAAI;iBACR,MAAM,GAAG,IAAI;;;;YADlB,MAAM,GAAG,IAAI;iBACR,MAAM,GAAG,IAAI;;;;AAic5B,wBASG"}
|
|
@@ -4,7 +4,7 @@ import { useUrlPrefetcher as Y } from "./hooks/useUrlPrefetcher.js";
|
|
|
4
4
|
import { getOpenApiDocumentVersion as M } from "./utils/getOpenApiDocumentVersion.js";
|
|
5
5
|
import { isDocument as A } from "./utils/isDocument.js";
|
|
6
6
|
import { isUrl as h } from "./utils/isUrl.js";
|
|
7
|
-
import { useModal as
|
|
7
|
+
import { useModal as L, ScalarModal as U, ScalarIcon as P, ScalarCodeBlock as Z } from "@scalar/components";
|
|
8
8
|
import { isLocalUrl as ee } from "@scalar/oas-utils/helpers";
|
|
9
9
|
import { normalize as te } from "@scalar/openapi-parser";
|
|
10
10
|
import oe from "./ImportNowButton.vue.js";
|
|
@@ -28,7 +28,7 @@ const le = { class: "flex flex-col h-screen justify-center px-6 overflow-hidden
|
|
|
28
28
|
},
|
|
29
29
|
emits: ["importFinished"],
|
|
30
30
|
setup(S) {
|
|
31
|
-
const n = S, { activeWorkspace: V, events: z } = ne(), { prefetchResult: r, prefetchUrl: D } = Y(), l =
|
|
31
|
+
const n = S, { activeWorkspace: V, events: z } = ne(), { prefetchResult: r, prefetchUrl: D } = Y(), l = L(), E = L(), j = w(""), d = w(!0);
|
|
32
32
|
z.hotKeys.on(() => l.hide());
|
|
33
33
|
const B = c(() => {
|
|
34
34
|
try {
|
|
@@ -51,7 +51,7 @@ const le = { class: "flex flex-col h-screen justify-center px-6 overflow-hidden
|
|
|
51
51
|
}
|
|
52
52
|
);
|
|
53
53
|
const $ = c(() => !!n.source && h(n.source)), F = c(() => !!n.source && A(n.source)), O = c(() => r.url && ee(r.url)), m = (o) => {
|
|
54
|
-
($.value || F.value) && l.open ? document.body.classList.add("has-import-url") : document.body.classList.remove("has-import-url");
|
|
54
|
+
document.body.classList.remove("has-no-import-url"), ($.value || F.value) && l.open ? document.body.classList.add("has-import-url") : document.body.classList.remove("has-import-url");
|
|
55
55
|
}, T = () => {
|
|
56
56
|
document.body.classList.remove("has-import-url"), document.body.classList.add("has-no-import-url");
|
|
57
57
|
};
|
|
@@ -71,7 +71,7 @@ const le = { class: "flex flex-col h-screen justify-center px-6 overflow-hidden
|
|
|
71
71
|
document.body.classList.remove("has-import-url"), document.body.classList.remove("has-no-import-url");
|
|
72
72
|
}), (o, t) => {
|
|
73
73
|
const q = H("PrefetchError");
|
|
74
|
-
return a(), p(s(
|
|
74
|
+
return a(), p(s(U), {
|
|
75
75
|
size: "full",
|
|
76
76
|
state: s(l)
|
|
77
77
|
}, {
|
|
@@ -154,7 +154,7 @@ const le = { class: "flex flex-col h-screen justify-center px-6 overflow-hidden
|
|
|
154
154
|
], -1))
|
|
155
155
|
])
|
|
156
156
|
]),
|
|
157
|
-
i(s(
|
|
157
|
+
i(s(U), {
|
|
158
158
|
size: "md",
|
|
159
159
|
state: s(E),
|
|
160
160
|
title: "Error Details",
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{
|
|
2
2
|
buttonSource: "sidebar" | "modal";
|
|
3
3
|
isDevelopment?: boolean;
|
|
4
|
-
integration?: string | null
|
|
5
|
-
url?: string
|
|
4
|
+
integration?: string | null;
|
|
5
|
+
url?: string;
|
|
6
6
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
7
7
|
buttonSource: "sidebar" | "modal";
|
|
8
8
|
isDevelopment?: boolean;
|
|
9
|
-
integration?: string | null
|
|
10
|
-
url?: string
|
|
9
|
+
integration?: string | null;
|
|
10
|
+
url?: string;
|
|
11
11
|
}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
12
|
export default _default;
|
|
13
13
|
//# sourceMappingURL=OpenApiClientButton.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenApiClientButton.vue.d.ts","sourceRoot":"","sources":["../../src/components/OpenApiClientButton.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"OpenApiClientButton.vue.d.ts","sourceRoot":"","sources":["../../src/components/OpenApiClientButton.vue"],"names":[],"mappings":";kBA6FgB,SAAS,GAAG,OAAO;oBACjB,OAAO;kBACT,MAAM,GAAG,IAAI;UACrB,MAAM;;kBAHE,SAAS,GAAG,OAAO;oBACjB,OAAO;kBACT,MAAM,GAAG,IAAI;UACrB,MAAM;;AA0Fd,wBAMG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import t from "./OpenApiClientButton.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import o from "../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const f = /* @__PURE__ */ o(t, [["__scopeId", "data-v-3d5f00c1"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
f as default
|
|
7
7
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as o, computed as a, openBlock as i, createElementBlock as s, createVNode as c, unref as m, createTextVNode as u, createCommentVNode as l } from "vue";
|
|
2
2
|
import { ScalarIcon as p } from "@scalar/components";
|
|
3
3
|
import { makeUrlAbsolute as f } from "@scalar/oas-utils/helpers";
|
|
4
|
-
const h = ["href"],
|
|
4
|
+
const h = ["href"], v = /* @__PURE__ */ o({
|
|
5
5
|
__name: "OpenApiClientButton",
|
|
6
6
|
props: {
|
|
7
7
|
buttonSource: {},
|
|
@@ -9,14 +9,17 @@ const h = ["href"], P = /* @__PURE__ */ a({
|
|
|
9
9
|
integration: {},
|
|
10
10
|
url: {}
|
|
11
11
|
},
|
|
12
|
-
setup(
|
|
13
|
-
const r =
|
|
12
|
+
setup(t) {
|
|
13
|
+
const r = a(() => {
|
|
14
|
+
const n = f(t.url);
|
|
15
|
+
if (!(n != null && n.length))
|
|
16
|
+
return;
|
|
14
17
|
const e = new URL(
|
|
15
|
-
|
|
16
|
-
)
|
|
17
|
-
return
|
|
18
|
+
t.isDevelopment ? "http://localhost:5065" : "https://client.scalar.com"
|
|
19
|
+
);
|
|
20
|
+
return e.searchParams.set("url", n), t.integration !== null && e.searchParams.set("integration", t.integration ?? "vue"), e.searchParams.set("utm_source", "api-reference"), e.searchParams.set("utm_medium", "button"), e.searchParams.set("utm_campaign", t.buttonSource), e.toString();
|
|
18
21
|
});
|
|
19
|
-
return (
|
|
22
|
+
return (n, e) => r.value ? (i(), s("a", {
|
|
20
23
|
key: 0,
|
|
21
24
|
class: "open-api-client-button",
|
|
22
25
|
href: r.value,
|
|
@@ -27,10 +30,10 @@ const h = ["href"], P = /* @__PURE__ */ a({
|
|
|
27
30
|
size: "xs",
|
|
28
31
|
thickness: "2.5"
|
|
29
32
|
}),
|
|
30
|
-
|
|
31
|
-
], 8, h)) :
|
|
33
|
+
e[0] || (e[0] = u(" Open API Client "))
|
|
34
|
+
], 8, h)) : l("", !0);
|
|
32
35
|
}
|
|
33
36
|
});
|
|
34
37
|
export {
|
|
35
|
-
|
|
38
|
+
v as default
|
|
36
39
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SideNav.vue.d.ts","sourceRoot":"","sources":["../../../src/components/SideNav/SideNav.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"SideNav.vue.d.ts","sourceRoot":"","sources":["../../../src/components/SideNav/SideNav.vue"],"names":[],"mappings":";AAiPA,wBAKG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./SideNav.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-fa61e0e1"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
f as default
|
|
7
7
|
};
|