@scalar/api-client 2.3.23 → 2.3.25
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 +47 -0
- package/dist/components/CodeInput/CodeInput.vue.d.ts +3 -0
- 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 +73 -66
- package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +20 -20
- package/dist/components/DataTable/DataTableInput.vue.d.ts +6 -1
- package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
- package/dist/layouts/App/create-api-client-app.d.ts +60 -10
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/create-api-client-modal.d.ts +122 -22
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Web/ApiClientWeb.vue.d.ts.map +1 -1
- package/dist/layouts/Web/create-api-client-web.d.ts +60 -10
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +60 -10
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/store/active-entities.d.ts +10 -0
- package/dist/store/active-entities.d.ts.map +1 -1
- package/dist/store/collections.d.ts +52 -2
- package/dist/store/collections.d.ts.map +1 -1
- package/dist/store/requests.d.ts +2 -2
- package/dist/store/security-schemes.d.ts.map +1 -1
- package/dist/store/store.d.ts +54 -4
- package/dist/store/store.d.ts.map +1 -1
- package/dist/store/tags.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestParams.vue.js +66 -55
- package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestPathParams.vue.js +34 -23
- package/dist/views/Request/RequestSection/RequestTable.vue.d.ts +2 -2
- package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestTable.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestTable.vue2.js +90 -73
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue2.js +36 -36
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/dist/views/Request/libs/index.d.ts +1 -0
- package/dist/views/Request/libs/index.d.ts.map +1 -1
- package/dist/views/Request/libs/index.js +17 -6
- package/dist/views/Request/libs/watch-mode.js +1 -1
- package/package.json +15 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,52 @@
|
|
|
1
1
|
# @scalar/api-client
|
|
2
2
|
|
|
3
|
+
## 2.3.25
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 0ff02e3: feat: adds request table row deletion
|
|
8
|
+
- 98fa8a0: fix: decreases import collection modal preview font size
|
|
9
|
+
- 2109da5: feat: use live sync mutator for changes to config (do not blindly re-create state)
|
|
10
|
+
- 0ff02e3: feat: adds request table input wrapping
|
|
11
|
+
- Updated dependencies [fa8ed84]
|
|
12
|
+
- Updated dependencies [fa8ed84]
|
|
13
|
+
- Updated dependencies [8d54857]
|
|
14
|
+
- Updated dependencies [1f8ac99]
|
|
15
|
+
- @scalar/openapi-types@0.2.1
|
|
16
|
+
- @scalar/oas-utils@0.2.135
|
|
17
|
+
- @scalar/components@0.13.52
|
|
18
|
+
- @scalar/openapi-parser@0.10.16
|
|
19
|
+
- @scalar/postman-to-openapi@0.2.8
|
|
20
|
+
- @scalar/types@0.1.10
|
|
21
|
+
- @scalar/import@0.3.18
|
|
22
|
+
- @scalar/use-codemirror@0.11.97
|
|
23
|
+
- @scalar/snippetz@0.2.19
|
|
24
|
+
- @scalar/themes@0.10.2
|
|
25
|
+
- @scalar/use-hooks@0.1.44
|
|
26
|
+
- @scalar/icons@0.3.1
|
|
27
|
+
|
|
28
|
+
## 2.3.24
|
|
29
|
+
|
|
30
|
+
### Patch Changes
|
|
31
|
+
|
|
32
|
+
- 3cb857d: fix: updates import collection modal transition style
|
|
33
|
+
- 3cb857d: fix: updates web layout background style target
|
|
34
|
+
- Updated dependencies [17e7d02]
|
|
35
|
+
- Updated dependencies [2b61d8e]
|
|
36
|
+
- Updated dependencies [49f1297]
|
|
37
|
+
- Updated dependencies [ab4cf5a]
|
|
38
|
+
- @scalar/types@0.1.9
|
|
39
|
+
- @scalar/components@0.13.51
|
|
40
|
+
- @scalar/use-hooks@0.1.43
|
|
41
|
+
- @scalar/icons@0.3.0
|
|
42
|
+
- @scalar/oas-utils@0.2.134
|
|
43
|
+
- @scalar/openapi-parser@0.10.16
|
|
44
|
+
- @scalar/snippetz@0.2.19
|
|
45
|
+
- @scalar/themes@0.10.1
|
|
46
|
+
- @scalar/use-codemirror@0.11.96
|
|
47
|
+
- @scalar/import@0.3.17
|
|
48
|
+
- @scalar/postman-to-openapi@0.2.7
|
|
49
|
+
|
|
3
50
|
## 2.3.23
|
|
4
51
|
|
|
5
52
|
### Patch Changes
|
|
@@ -30,6 +30,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
30
30
|
environment: Environment;
|
|
31
31
|
envVariables: EnvVariable[];
|
|
32
32
|
workspace: Workspace;
|
|
33
|
+
lineWrapping?: boolean;
|
|
33
34
|
}, {
|
|
34
35
|
/** Expose focus method */
|
|
35
36
|
focus: () => void;
|
|
@@ -71,6 +72,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
71
72
|
environment: Environment;
|
|
72
73
|
envVariables: EnvVariable[];
|
|
73
74
|
workspace: Workspace;
|
|
75
|
+
lineWrapping?: boolean;
|
|
74
76
|
}> & Readonly<{
|
|
75
77
|
onSubmit?: (v: string) => any;
|
|
76
78
|
"onUpdate:modelValue"?: (v: string) => any;
|
|
@@ -86,6 +88,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
86
88
|
disableCloseBrackets: boolean;
|
|
87
89
|
withVariables: boolean;
|
|
88
90
|
isCopyable: boolean;
|
|
91
|
+
lineWrapping: boolean;
|
|
89
92
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
90
93
|
warning?(_: {}): any;
|
|
91
94
|
icon?(_: {}): any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/CodeInput.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CodeInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/CodeInput.vue"],"names":[],"mappings":"AAuhBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAErE,OAAO,EAIL,KAAK,kBAAkB,EAExB,MAAM,wBAAwB,CAAA;AAG/B,OAAO,EAAyC,KAAK,GAAG,EAAE,MAAM,KAAK,CAAA;AAGrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;;kBAYxC,OAAO;eACV,OAAO;gBACN,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;eACJ,MAAM,EAAE;WACZ,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS;eACzB,OAAO;oBACF,OAAO;iBACV,OAAO;iBACP,OAAO;cACV,MAAM,GAAG,MAAM;iBACZ,WAAW;kBACV,WAAW,EAAE;eAChB,SAAS;mBACL,OAAO;;IAqLxB,0BAA0B;;0BAxIC,MAAM;0BA0BN,MAAM;wBAOR,MAAM;;;;;;;;;;kBAxGf,OAAO;eACV,OAAO;gBACN,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;eACJ,MAAM,EAAE;WACZ,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS;eACzB,OAAO;oBACF,OAAO;iBACV,OAAO;iBACP,OAAO;cACV,MAAM,GAAG,MAAM;iBACZ,WAAW;kBACV,WAAW,EAAE;eAChB,SAAS;mBACL,OAAO;;;;;;;cARX,OAAO;cAjBP,OAAO;iBADJ,OAAO;gBAIR,OAAO;sBAGD,OAAO;kBAMX,OAAO;0BACC,OAAO;mBAKd,OAAO;gBAEV,OAAO;kBAKL,OAAO;;qBAkiBI,GAAG;kBACN,GAAG;;AAhkB9B,wBA2nBC;AAeD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,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 m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-af9a0fc0"]]);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
m as default
|
|
8
8
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as j, useAttrs as H, ref as d, toRef as r, watch as J, computed as I, openBlock as n, createElementBlock as s, Fragment as Q, normalizeClass as G, unref as i, createElementVNode as m, toDisplayString as X, createBlock as y, mergeProps as Y, withKeys as g, withModifiers as N, createVNode as Z, createCommentVNode as p, createTextVNode as k, renderSlot as R } from "vue";
|
|
2
2
|
import { ScalarIcon as _ } from "@scalar/components";
|
|
3
3
|
import { prettyPrintJson as ee } from "@scalar/oas-utils/helpers";
|
|
4
|
-
import { useCodeMirror as oe, useDropdown as
|
|
4
|
+
import { useCodeMirror as oe, useDropdown as le, colorPicker as te } from "@scalar/use-codemirror";
|
|
5
5
|
import { useClipboard as ne } from "@scalar/use-hooks/useClipboard";
|
|
6
6
|
import { nanoid as ae } from "nanoid";
|
|
7
7
|
import re from "../../views/Environment/EnvironmentVariableDropdown.vue.js";
|
|
8
|
-
import
|
|
9
|
-
import { pillPlugin as se, backspaceCommand as
|
|
10
|
-
import { useLayout as
|
|
11
|
-
const
|
|
8
|
+
import B from "../DataTable/DataTableInputSelect.vue.js";
|
|
9
|
+
import { pillPlugin as se, backspaceCommand as ue } from "./codeVariableWidget.js";
|
|
10
|
+
import { useLayout as ie } from "../../hooks/useLayout.js";
|
|
11
|
+
const de = { class: "whitespace-nowrap" }, pe = ["id"], fe = {
|
|
12
12
|
key: 0,
|
|
13
13
|
class: "scalar-code-copy z-context"
|
|
14
|
-
},
|
|
14
|
+
}, me = {
|
|
15
15
|
key: 1,
|
|
16
16
|
class: "z-context text-c-2 absolute bottom-1 right-1.5 hidden font-sans group-has-[:focus-visible]/input:block",
|
|
17
17
|
role: "alert"
|
|
@@ -20,11 +20,14 @@ const ie = { class: "whitespace-nowrap" }, pe = ["id"], me = {
|
|
|
20
20
|
class: "centered-y text-orange absolute right-7 text-xs"
|
|
21
21
|
}, be = {
|
|
22
22
|
key: 6,
|
|
23
|
-
class: "
|
|
23
|
+
class: "centered-y group-has-[.cm-focused]:z-1 absolute right-0 flex h-full items-center p-1.5"
|
|
24
24
|
}, ye = {
|
|
25
|
+
key: 7,
|
|
26
|
+
class: "required centered-y text-xxs text-c-3 group-[.error]:text-red bg-b-1 pointer-events-none absolute right-0 mr-0.5 pr-2 pt-px opacity-100 shadow-[-8px_0_4px_var(--scalar-background-1)] transition-opacity duration-150 group-[.alert]:bg-transparent group-[.error]:bg-transparent group-[.alert]:shadow-none group-[.error]:shadow-none peer-has-[.cm-focused]:opacity-0"
|
|
27
|
+
}, ge = {
|
|
25
28
|
inheritAttrs: !1
|
|
26
|
-
},
|
|
27
|
-
...
|
|
29
|
+
}, De = /* @__PURE__ */ j({
|
|
30
|
+
...ge,
|
|
28
31
|
__name: "CodeInput",
|
|
29
32
|
props: {
|
|
30
33
|
colorPicker: { type: Boolean, default: !1 },
|
|
@@ -52,39 +55,40 @@ const ie = { class: "whitespace-nowrap" }, pe = ["id"], me = {
|
|
|
52
55
|
default: {},
|
|
53
56
|
environment: {},
|
|
54
57
|
envVariables: {},
|
|
55
|
-
workspace: {}
|
|
58
|
+
workspace: {},
|
|
59
|
+
lineWrapping: { type: Boolean, default: !1 }
|
|
56
60
|
},
|
|
57
61
|
emits: ["submit", "update:modelValue", "curl", "blur"],
|
|
58
|
-
setup(
|
|
62
|
+
setup(z, { expose: A, emit: M }) {
|
|
59
63
|
var q;
|
|
60
|
-
const o =
|
|
64
|
+
const o = z, u = M, C = H(), O = C.id || `id-${ae()}`, x = d(!1), v = d(!1), S = d(""), P = d({ left: 0, top: 0 }), c = d(null), { layout: h } = ie(), { copyToClipboard: K } = ne();
|
|
61
65
|
function D(e) {
|
|
62
|
-
var
|
|
63
|
-
return e === o.modelValue ? null : o.importCurl && e.trim().toLowerCase().startsWith("curl") ? (
|
|
66
|
+
var l;
|
|
67
|
+
return e === o.modelValue ? null : o.importCurl && e.trim().toLowerCase().startsWith("curl") ? (u("curl", e), (l = a.value) == null || l.dispatch({
|
|
64
68
|
changes: {
|
|
65
69
|
from: 0,
|
|
66
70
|
to: a.value.state.doc.length,
|
|
67
71
|
insert: String(o.modelValue)
|
|
68
72
|
}
|
|
69
|
-
}), null) : o.handleFieldChange ? o.handleFieldChange(e) :
|
|
73
|
+
}), null) : o.handleFieldChange ? o.handleFieldChange(e) : u("update:modelValue", e);
|
|
70
74
|
}
|
|
71
|
-
function
|
|
72
|
-
return o.handleFieldSubmit ? o.handleFieldSubmit(e) :
|
|
75
|
+
function w(e) {
|
|
76
|
+
return o.handleFieldSubmit ? o.handleFieldSubmit(e) : u("submit", e);
|
|
73
77
|
}
|
|
74
78
|
function T(e) {
|
|
75
|
-
x.value = !1, o.emitOnBlur && o.modelValue &&
|
|
79
|
+
x.value = !1, o.emitOnBlur && o.modelValue && w(e), u("blur", e);
|
|
76
80
|
}
|
|
77
81
|
const V = [];
|
|
78
|
-
o.colorPicker && V.push(
|
|
82
|
+
o.colorPicker && V.push(te), V.push(
|
|
79
83
|
se({
|
|
80
84
|
environment: o.environment,
|
|
81
85
|
envVariables: o.envVariables,
|
|
82
86
|
workspace: o.workspace,
|
|
83
|
-
isReadOnly:
|
|
87
|
+
isReadOnly: h === "modal"
|
|
84
88
|
}),
|
|
85
|
-
|
|
89
|
+
ue
|
|
86
90
|
);
|
|
87
|
-
const F =
|
|
91
|
+
const F = d(null), { codeMirror: a } = oe({
|
|
88
92
|
content: r(
|
|
89
93
|
() => o.modelValue !== void 0 ? String(o.modelValue) : ""
|
|
90
94
|
),
|
|
@@ -103,27 +107,27 @@ const ie = { class: "whitespace-nowrap" }, pe = ["id"], me = {
|
|
|
103
107
|
extensions: V,
|
|
104
108
|
placeholder: r(() => o.placeholder)
|
|
105
109
|
});
|
|
106
|
-
(q = a.value) == null || q.focus(),
|
|
107
|
-
a.value && Object.prototype.hasOwnProperty.call(
|
|
110
|
+
(q = a.value) == null || q.focus(), J(a, () => {
|
|
111
|
+
a.value && Object.prototype.hasOwnProperty.call(C, "autofocus") && a.value.focus();
|
|
108
112
|
});
|
|
109
|
-
const { handleDropdownSelect: L, updateDropdownVisibility: U } =
|
|
113
|
+
const { handleDropdownSelect: L, updateDropdownVisibility: U } = le({
|
|
110
114
|
codeMirror: a,
|
|
111
115
|
query: S,
|
|
112
116
|
showDropdown: v,
|
|
113
117
|
dropdownPosition: P
|
|
114
118
|
}), $ = I(
|
|
115
119
|
() => o.nullable ? ["true", "false", "null"] : ["true", "false"]
|
|
116
|
-
), b = (e,
|
|
117
|
-
var
|
|
118
|
-
v.value ? e === "down" ? (
|
|
119
|
-
},
|
|
120
|
+
), b = (e, l) => {
|
|
121
|
+
var f, t, E;
|
|
122
|
+
v.value ? e === "down" ? (l.preventDefault(), (f = c.value) == null || f.handleArrowKey("down")) : e === "up" ? (l.preventDefault(), (t = c.value) == null || t.handleArrowKey("up")) : e === "enter" && (l.preventDefault(), (E = c.value) == null || E.handleSelect()) : e === "escape" ? o.disableTabIndent || l.stopPropagation() : e === "enter" && l.target instanceof HTMLDivElement && w(l.target.textContent ?? "");
|
|
123
|
+
}, W = I(() => Array.isArray(o.type) ? (
|
|
120
124
|
// Find the first type, that’s not 'null'
|
|
121
125
|
o.type.find((e) => e !== "null") ?? "string"
|
|
122
126
|
) : (
|
|
123
127
|
// If it’s not an array, just return the type
|
|
124
128
|
o.type
|
|
125
129
|
));
|
|
126
|
-
return
|
|
130
|
+
return A({
|
|
127
131
|
/** Expose focus method */
|
|
128
132
|
focus: () => {
|
|
129
133
|
var e;
|
|
@@ -131,69 +135,70 @@ const ie = { class: "whitespace-nowrap" }, pe = ["id"], me = {
|
|
|
131
135
|
},
|
|
132
136
|
// Expose these methods for testing
|
|
133
137
|
handleChange: D,
|
|
134
|
-
handleSubmit:
|
|
138
|
+
handleSubmit: w,
|
|
135
139
|
handleBlur: T,
|
|
136
140
|
booleanOptions: $,
|
|
137
141
|
codeMirror: a,
|
|
138
142
|
modelValue: o.modelValue
|
|
139
|
-
}), (e,
|
|
140
|
-
var
|
|
141
|
-
return n(),
|
|
142
|
-
e.disabled ? (n(),
|
|
143
|
+
}), (e, l) => {
|
|
144
|
+
var f;
|
|
145
|
+
return n(), s(Q, null, [
|
|
146
|
+
e.disabled ? (n(), s("div", {
|
|
143
147
|
key: 0,
|
|
144
|
-
class: G(["text-c-2 flex cursor-default items-center justify-center",
|
|
148
|
+
class: G(["text-c-2 flex cursor-default items-center justify-center", i(h) === "modal" ? "font-code pl-1 pr-2 text-sm" : "px-2"]),
|
|
145
149
|
"data-testid": "code-input-disabled"
|
|
146
150
|
}, [
|
|
147
|
-
m("span",
|
|
148
|
-
], 2)) : o.enum && o.enum.length ? (n(), y(
|
|
151
|
+
m("span", de, X(e.modelValue), 1)
|
|
152
|
+
], 2)) : o.enum && o.enum.length ? (n(), y(B, {
|
|
149
153
|
key: 1,
|
|
150
154
|
default: o.default,
|
|
151
155
|
modelValue: e.modelValue,
|
|
152
|
-
type:
|
|
156
|
+
type: W.value,
|
|
153
157
|
value: o.enum,
|
|
154
|
-
"onUpdate:modelValue":
|
|
155
|
-
}, null, 8, ["default", "modelValue", "type", "value"])) : e.type === "boolean" || (
|
|
158
|
+
"onUpdate:modelValue": l[0] || (l[0] = (t) => u("update:modelValue", t))
|
|
159
|
+
}, null, 8, ["default", "modelValue", "type", "value"])) : e.type === "boolean" || (f = e.type) != null && f.includes("boolean") ? (n(), y(B, {
|
|
156
160
|
key: 2,
|
|
157
161
|
default: o.default,
|
|
158
162
|
modelValue: e.modelValue,
|
|
159
163
|
value: $.value,
|
|
160
|
-
"onUpdate:modelValue":
|
|
161
|
-
}, null, 8, ["default", "modelValue", "value"])) : o.examples && o.examples.length ? (n(), y(
|
|
164
|
+
"onUpdate:modelValue": l[1] || (l[1] = (t) => u("update:modelValue", t))
|
|
165
|
+
}, null, 8, ["default", "modelValue", "value"])) : o.examples && o.examples.length ? (n(), y(B, {
|
|
162
166
|
key: 3,
|
|
163
167
|
default: o.default,
|
|
164
168
|
modelValue: o.modelValue,
|
|
165
169
|
value: o.examples,
|
|
166
|
-
"onUpdate:modelValue":
|
|
167
|
-
}, null, 8, ["default", "modelValue", "value"])) : (n(),
|
|
170
|
+
"onUpdate:modelValue": l[2] || (l[2] = (t) => u("update:modelValue", t))
|
|
171
|
+
}, null, 8, ["default", "modelValue", "value"])) : (n(), s("div", Y({
|
|
168
172
|
key: 4,
|
|
169
|
-
id:
|
|
173
|
+
id: i(O)
|
|
170
174
|
}, e.$attrs, {
|
|
171
175
|
ref_key: "codeMirrorRef",
|
|
172
176
|
ref: F,
|
|
173
177
|
class: ["group/input group-[.alert]:outline-orange group-[.error]:outline-red font-code peer relative w-full overflow-hidden whitespace-nowrap text-xs leading-[1.44] -outline-offset-1 has-[:focus-visible]:rounded-[4px] has-[:focus-visible]:outline", {
|
|
178
|
+
"line-wrapping has-[:focus-visible]:bg-b-1 has-[:focus-visible]:z-1 has-[:focus-visible]:absolute": e.lineWrapping,
|
|
174
179
|
"flow-code-input--error": e.error
|
|
175
180
|
}],
|
|
176
181
|
onKeydown: [
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
182
|
+
l[4] || (l[4] = g(N((t) => b("down", t), ["stop"]), ["down"])),
|
|
183
|
+
l[5] || (l[5] = g((t) => b("enter", t), ["enter"])),
|
|
184
|
+
l[6] || (l[6] = g((t) => b("escape", t), ["escape"])),
|
|
185
|
+
l[7] || (l[7] = g(N((t) => b("up", t), ["stop"]), ["up"]))
|
|
181
186
|
]
|
|
182
187
|
}), [
|
|
183
|
-
e.isCopyable ? (n(),
|
|
188
|
+
e.isCopyable ? (n(), s("div", fe, [
|
|
184
189
|
m("button", {
|
|
185
190
|
class: "copy-button",
|
|
186
191
|
type: "button",
|
|
187
|
-
onClick:
|
|
192
|
+
onClick: l[3] || (l[3] = (t) => i(K)(i(ee)(e.modelValue)))
|
|
188
193
|
}, [
|
|
189
|
-
|
|
190
|
-
Z(
|
|
194
|
+
l[8] || (l[8] = m("span", { class: "sr-only" }, "Copy content", -1)),
|
|
195
|
+
Z(i(_), {
|
|
191
196
|
icon: "Clipboard",
|
|
192
197
|
size: "md"
|
|
193
198
|
})
|
|
194
199
|
])
|
|
195
|
-
])) :
|
|
196
|
-
e.disableTabIndent ?
|
|
200
|
+
])) : p("", !0),
|
|
201
|
+
e.disableTabIndent ? p("", !0) : (n(), s("div", me, l[9] || (l[9] = [
|
|
197
202
|
k(" Press "),
|
|
198
203
|
m("kbd", { class: "-mx-0.25 rounded border px-0.5 font-mono" }, "Esc", -1),
|
|
199
204
|
k(" then "),
|
|
@@ -201,25 +206,27 @@ const ie = { class: "whitespace-nowrap" }, pe = ["id"], me = {
|
|
|
201
206
|
k(" to exit ")
|
|
202
207
|
])))
|
|
203
208
|
], 16, pe)),
|
|
204
|
-
e.$slots.warning ? (n(),
|
|
209
|
+
e.$slots.warning ? (n(), s("div", ce, [
|
|
205
210
|
R(e.$slots, "warning", {}, void 0, !0)
|
|
206
|
-
])) :
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
+
])) : p("", !0),
|
|
212
|
+
e.$slots.icon ? (n(), s("div", be, [
|
|
213
|
+
R(e.$slots, "icon", {}, void 0, !0)
|
|
214
|
+
])) : p("", !0),
|
|
215
|
+
e.required ? (n(), s("div", ye, " Required ")) : p("", !0),
|
|
216
|
+
v.value && e.withVariables && i(h) !== "modal" && e.environment ? (n(), y(re, {
|
|
217
|
+
key: 8,
|
|
211
218
|
ref_key: "dropdownRef",
|
|
212
219
|
ref: c,
|
|
213
220
|
dropdownPosition: P.value,
|
|
214
221
|
envVariables: e.envVariables,
|
|
215
222
|
environment: e.environment,
|
|
216
223
|
query: S.value,
|
|
217
|
-
onSelect:
|
|
218
|
-
}, null, 8, ["dropdownPosition", "envVariables", "environment", "query", "onSelect"])) :
|
|
224
|
+
onSelect: i(L)
|
|
225
|
+
}, null, 8, ["dropdownPosition", "envVariables", "environment", "query", "onSelect"])) : p("", !0)
|
|
219
226
|
], 64);
|
|
220
227
|
};
|
|
221
228
|
}
|
|
222
229
|
});
|
|
223
230
|
export {
|
|
224
|
-
|
|
231
|
+
De as default
|
|
225
232
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandPaletteImport.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteImport.vue"],"names":[],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"CommandPaletteImport.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteImport.vue"],"names":[],"mappings":";;;;;;;AAqxBA,wBAOG"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as G, ref as R, computed as k, watch as D, openBlock as n, createBlock as _, unref as s, withCtx as v, createElementVNode as w, createVNode as C, createTextVNode as f, createElementBlock as
|
|
1
|
+
import { defineComponent as G, ref as R, computed as k, watch as D, openBlock as n, createBlock as _, unref as s, withCtx as v, createElementVNode as w, createVNode as C, createTextVNode as f, createElementBlock as c, Fragment as g, toDisplayString as V, createCommentVNode as H } from "vue";
|
|
2
2
|
import { useLoadingState as K, ScalarButton as T, ScalarIcon as Q, ScalarTooltip as X, ScalarCodeBlock as Z } from "@scalar/components";
|
|
3
3
|
import { useToasts as ee } from "@scalar/use-toasts";
|
|
4
4
|
import { useRouter as te } from "vue-router";
|
|
@@ -10,9 +10,9 @@ import re from "./WatchModeToggle.vue.js";
|
|
|
10
10
|
import { isPostmanCollection as S, getPostmanDocumentDetails as ie, convertPostmanToOpenApi as F } from "../../libs/postman.js";
|
|
11
11
|
import { getOpenApiDocumentDetails as se } from "../../libs/getOpenApiDocumentDetails.js";
|
|
12
12
|
import { isUrl as U } from "../../libs/isUrl.js";
|
|
13
|
-
import { useFileDialog as
|
|
13
|
+
import { useFileDialog as ue } from "../../hooks/useFileDialog.js";
|
|
14
14
|
import { PathId as M } from "../../routes.js";
|
|
15
|
-
import { useWorkspace as
|
|
15
|
+
import { useWorkspace as ce } from "../../store/store.js";
|
|
16
16
|
const me = { class: "flex justify-between" }, de = { class: "flex w-full flex-row items-center justify-between gap-3" }, pe = { class: "w-content bg-b-1 text-xxs text-c-1 pointer-events-none z-10 grid max-w-[320px] gap-1.5 rounded p-2 leading-5 shadow-lg" }, ve = { class: "text-c-2 flex items-center" }, fe = {
|
|
17
17
|
key: 0,
|
|
18
18
|
class: "text-pretty"
|
|
@@ -23,7 +23,7 @@ const me = { class: "flex justify-between" }, de = { class: "flex w-full flex-ro
|
|
|
23
23
|
__name: "CommandPaletteImport",
|
|
24
24
|
emits: ["close", "back"],
|
|
25
25
|
setup(ye, { emit: N }) {
|
|
26
|
-
const P = N, $ = te(), { activeWorkspace: m, activeCollection: B } = ae(), { importSpecFile: b, importSpecFromUrl: W, events: j } =
|
|
26
|
+
const P = N, $ = te(), { activeWorkspace: m, activeCollection: B } = ae(), { importSpecFile: b, importSpecFromUrl: W, events: j } = ce(), { toast: d } = ee(), p = K(), a = R(""), y = R(!0), i = k(() => S(a.value) ? ie(a.value) : se(a.value)), A = k(
|
|
27
27
|
() => i.value ? i.value.type : "json"
|
|
28
28
|
);
|
|
29
29
|
function x(t) {
|
|
@@ -36,14 +36,14 @@ const me = { class: "flex justify-between" }, de = { class: "flex w-full flex-ro
|
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
|
-
const h = k(() => U(a.value)), z = k(() => !!i.value), { open: E } =
|
|
39
|
+
const h = k(() => U(a.value)), z = k(() => !!i.value), { open: E } = ue({
|
|
40
40
|
onChange: async (t) => {
|
|
41
41
|
const e = t == null ? void 0 : t[0];
|
|
42
42
|
if (e) {
|
|
43
43
|
const r = new FileReader();
|
|
44
44
|
r.onload = async (I) => {
|
|
45
|
-
var
|
|
46
|
-
const o = (
|
|
45
|
+
var u, L, O;
|
|
46
|
+
const o = (u = I.target) == null ? void 0 : u.result;
|
|
47
47
|
try {
|
|
48
48
|
if (S(o)) {
|
|
49
49
|
const l = await b(
|
|
@@ -81,7 +81,7 @@ const me = { class: "flex justify-between" }, de = { class: "flex w-full flex-ro
|
|
|
81
81
|
p.startLoading();
|
|
82
82
|
try {
|
|
83
83
|
if (h.value) {
|
|
84
|
-
const [o,
|
|
84
|
+
const [o, u] = await W(
|
|
85
85
|
a.value,
|
|
86
86
|
((t = m.value) == null ? void 0 : t.uid) ?? "",
|
|
87
87
|
{
|
|
@@ -89,7 +89,7 @@ const me = { class: "flex justify-between" }, de = { class: "flex w-full flex-ro
|
|
|
89
89
|
watchMode: y.value
|
|
90
90
|
}
|
|
91
91
|
);
|
|
92
|
-
if (x(
|
|
92
|
+
if (x(u == null ? void 0 : u.collection), o) {
|
|
93
93
|
d(
|
|
94
94
|
"There was a possible CORS error while importing your spec, please make sure this server is allowed in the CORS policy of your OpenAPI document.",
|
|
95
95
|
"error",
|
|
@@ -118,8 +118,8 @@ const me = { class: "flex justify-between" }, de = { class: "flex w-full flex-ro
|
|
|
118
118
|
p.clear(), P("close"), d("Import successful", "info");
|
|
119
119
|
} catch (o) {
|
|
120
120
|
console.error("[importCollection]", o);
|
|
121
|
-
const
|
|
122
|
-
p.invalidate(2e3, !0), d(`Import failed: ${
|
|
121
|
+
const u = (o == null ? void 0 : o.message) || "Unknown error";
|
|
122
|
+
p.invalidate(2e3, !0), d(`Import failed: ${u}`, "error");
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
}
|
|
@@ -175,7 +175,7 @@ const me = { class: "flex justify-between" }, de = { class: "flex w-full flex-ro
|
|
|
175
175
|
content: v(() => [
|
|
176
176
|
w("div", pe, [
|
|
177
177
|
w("div", ve, [
|
|
178
|
-
h.value ? (n(),
|
|
178
|
+
h.value ? (n(), c("span", fe, " Automatically updates the API client when the OpenAPI URL content changes, ensuring your client remains up-to-date. ")) : (n(), c("span", ge, " Watch Mode is only available for URL imports. It automatically updates the API client when the OpenAPI URL content changes. "))
|
|
179
179
|
])
|
|
180
180
|
])
|
|
181
181
|
]),
|
|
@@ -185,15 +185,15 @@ const me = { class: "flex justify-between" }, de = { class: "flex w-full flex-ro
|
|
|
185
185
|
]),
|
|
186
186
|
submit: v(() => [
|
|
187
187
|
e[6] || (e[6] = f(" Import ")),
|
|
188
|
-
h.value ? (n(),
|
|
188
|
+
h.value ? (n(), c(g, { key: 0 }, [
|
|
189
189
|
f(" from URL ")
|
|
190
|
-
], 64)) : i.value && A.value ? (n(),
|
|
191
|
-
i.value.title ? (n(),
|
|
190
|
+
], 64)) : i.value && A.value ? (n(), c(g, { key: 1 }, [
|
|
191
|
+
i.value.title ? (n(), c(g, { key: 0 }, [
|
|
192
192
|
f(' "' + V(i.value.title) + '" ', 1)
|
|
193
|
-
], 64)) : (n(),
|
|
193
|
+
], 64)) : (n(), c(g, { key: 1 }, [
|
|
194
194
|
f(V(i.value.version), 1)
|
|
195
195
|
], 64))
|
|
196
|
-
], 64)) : (n(),
|
|
196
|
+
], 64)) : (n(), c(g, { key: 2 }, [
|
|
197
197
|
f(" Collection ")
|
|
198
198
|
], 64))
|
|
199
199
|
]),
|
|
@@ -204,9 +204,9 @@ const me = { class: "flex justify-between" }, de = { class: "flex w-full flex-ro
|
|
|
204
204
|
placeholder: "OpenAPI/Swagger/Postman URL or cURL",
|
|
205
205
|
onOnDelete: e[0] || (e[0] = (r) => P("back", r)),
|
|
206
206
|
"onUpdate:modelValue": Y
|
|
207
|
-
}, null, 8, ["modelValue"])) : (n(),
|
|
207
|
+
}, null, 8, ["modelValue"])) : (n(), c(g, { key: 1 }, [
|
|
208
208
|
w("div", me, [
|
|
209
|
-
e[4] || (e[4] = w("div", { class: "text-c-2 min-h-8 py-2 pl-
|
|
209
|
+
e[4] || (e[4] = w("div", { class: "text-c-2 min-h-8 w-full py-2 pl-12 text-center text-xs" }, " Preview ", -1)),
|
|
210
210
|
C(s(T), {
|
|
211
211
|
class: "hover:bg-b-2 relative ml-auto max-h-8 gap-1.5 p-2 text-xs",
|
|
212
212
|
variant: "ghost",
|
|
@@ -220,7 +220,7 @@ const me = { class: "flex justify-between" }, de = { class: "flex w-full flex-ro
|
|
|
220
220
|
]),
|
|
221
221
|
i.value && !s(U)(a.value) ? (n(), _(s(Z), {
|
|
222
222
|
key: 0,
|
|
223
|
-
class: "bg-b-2 mt-1 max-h-[40dvh] rounded border
|
|
223
|
+
class: "bg-b-2 mt-1 max-h-[40dvh] rounded border px-2 py-1 text-sm",
|
|
224
224
|
content: a.value,
|
|
225
225
|
copy: !1,
|
|
226
226
|
lang: A.value
|
|
@@ -58,6 +58,7 @@ declare function __VLS_template(): {
|
|
|
58
58
|
readonly environment: Environment;
|
|
59
59
|
readonly envVariables: EnvVariable[];
|
|
60
60
|
readonly workspace: Workspace;
|
|
61
|
+
readonly lineWrapping?: boolean;
|
|
61
62
|
readonly onSubmit?: (v: string) => any;
|
|
62
63
|
readonly "onUpdate:modelValue"?: (v: string) => any;
|
|
63
64
|
readonly onBlur?: (v: string) => any;
|
|
@@ -104,6 +105,7 @@ declare function __VLS_template(): {
|
|
|
104
105
|
environment: Environment;
|
|
105
106
|
envVariables: EnvVariable[];
|
|
106
107
|
workspace: Workspace;
|
|
108
|
+
lineWrapping?: boolean;
|
|
107
109
|
}> & Readonly<{
|
|
108
110
|
onSubmit?: (v: string) => any;
|
|
109
111
|
"onUpdate:modelValue"?: (v: string) => any;
|
|
@@ -132,6 +134,7 @@ declare function __VLS_template(): {
|
|
|
132
134
|
disableCloseBrackets: boolean;
|
|
133
135
|
withVariables: boolean;
|
|
134
136
|
isCopyable: boolean;
|
|
137
|
+
lineWrapping: boolean;
|
|
135
138
|
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
|
|
136
139
|
beforeCreate?: (() => void) | (() => void)[];
|
|
137
140
|
created?: (() => void) | (() => void)[];
|
|
@@ -162,6 +165,7 @@ declare function __VLS_template(): {
|
|
|
162
165
|
disableCloseBrackets: boolean;
|
|
163
166
|
withVariables: boolean;
|
|
164
167
|
isCopyable: boolean;
|
|
168
|
+
lineWrapping: boolean;
|
|
165
169
|
}> & Omit<Readonly<{
|
|
166
170
|
colorPicker?: boolean;
|
|
167
171
|
disabled?: boolean;
|
|
@@ -189,12 +193,13 @@ declare function __VLS_template(): {
|
|
|
189
193
|
environment: Environment;
|
|
190
194
|
envVariables: EnvVariable[];
|
|
191
195
|
workspace: Workspace;
|
|
196
|
+
lineWrapping?: boolean;
|
|
192
197
|
}> & Readonly<{
|
|
193
198
|
onSubmit?: (v: string) => any;
|
|
194
199
|
"onUpdate:modelValue"?: (v: string) => any;
|
|
195
200
|
onBlur?: (v: string) => any;
|
|
196
201
|
onCurl?: (v: string) => any;
|
|
197
|
-
}>, "modelValue" | "handleBlur" | "focus" | "codeMirror" | "handleChange" | "handleSubmit" | "booleanOptions" | ("nullable" | "disabled" | "colorPicker" | "emitOnBlur" | "disableTabIndent" | "disableEnter" | "disableCloseBrackets" | "withVariables" | "isCopyable")> & import("vue").ShallowUnwrapRef<{
|
|
202
|
+
}>, "modelValue" | "handleBlur" | "focus" | "codeMirror" | "handleChange" | "handleSubmit" | "booleanOptions" | ("nullable" | "disabled" | "colorPicker" | "emitOnBlur" | "disableTabIndent" | "disableEnter" | "disableCloseBrackets" | "withVariables" | "isCopyable" | "lineWrapping")> & import("vue").ShallowUnwrapRef<{
|
|
198
203
|
focus: () => void;
|
|
199
204
|
handleChange: (value: string) => void | null;
|
|
200
205
|
handleSubmit: (value: string) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTableInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/DataTableInput.vue"],"names":[],"mappings":"AAuLA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAIrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAO/C,KAAK,WAAW,GAAG;IACf,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,sEAAsE;IACtE,cAAc,CAAC,EAAE,YAAY,GAAG,SAAS,CAAA;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,EAAE,MAAM,GAAG,MAAM,CAAA;IAC3B,0EAA0E;IAC1E,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;IACf,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,SAAS,EAAE,SAAS,CAAA;IACpB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACjC,CAAC;AAgDJ,iBAAS,cAAc;WAuOT,OAAO,IAA6B;;yBAXrB,GAAG;yBACF,GAAG;sBACN,GAAG
|
|
1
|
+
{"version":3,"file":"DataTableInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/DataTableInput.vue"],"names":[],"mappings":"AAuLA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAIrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAO/C,KAAK,WAAW,GAAG;IACf,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,sEAAsE;IACtE,cAAc,CAAC,EAAE,YAAY,GAAG,SAAS,CAAA;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,EAAE,MAAM,GAAG,MAAM,CAAA;IAC3B,0EAA0E;IAC1E,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;IACf,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,SAAS,EAAE,SAAS,CAAA;IACpB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACjC,CAAC;AAgDJ,iBAAS,cAAc;WAuOT,OAAO,IAA6B;;yBAXrB,GAAG;yBACF,GAAG;sBACN,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAkEkrK,GAAG,8CAA8C,GAAG,yBAAyB,GAAG,6DAAmC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EApDr0K;AAoBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;;;cA7TN,OAAO;cAIP,OAAO;2BADM,OAAO;6EAkUjC,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAepG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|