@scalar/api-client 2.14.0 → 2.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +54 -0
- package/dist/libs/string-template.d.ts +2 -0
- package/dist/libs/string-template.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.js +28 -51
- package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +0 -12
- package/dist/v2/blocks/operation-block/components/Header.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.js +3 -3
- package/dist/v2/blocks/operation-block/components/Header.vue2.js +26 -28
- package/dist/v2/blocks/operation-block/helpers/build-request-parameters.d.ts +33 -0
- package/dist/v2/blocks/operation-block/helpers/build-request-parameters.d.ts.map +1 -0
- package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts +18 -0
- package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts.map +1 -0
- package/dist/v2/blocks/operation-block/helpers/decode-buffer.d.ts +7 -0
- package/dist/v2/blocks/operation-block/helpers/decode-buffer.d.ts.map +1 -0
- package/dist/v2/blocks/operation-block/helpers/get-delimiter.d.ts +8 -0
- package/dist/v2/blocks/operation-block/helpers/get-delimiter.d.ts.map +1 -0
- package/dist/v2/blocks/operation-block/helpers/get-example.d.ts +4 -0
- package/dist/v2/blocks/operation-block/helpers/get-example.d.ts.map +1 -0
- package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.js +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue2.js +134 -125
- package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts +2 -0
- package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue.js +2 -2
- package/dist/v2/blocks/request-block/components/RequestBody.vue2.js +11 -10
- package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts +2 -2
- package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +2 -4
- 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/RequestTableRow.vue.d.ts +2 -2
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js +10 -10
- package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.d.ts +1 -1
- package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.js +21 -15
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts +4 -13
- 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.vue2.js +106 -70
- package/dist/v2/components/code-input/CodeInput.vue.d.ts +10 -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.vue2.js +65 -51
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts +4 -0
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/v2/components/sidebar/Sidebar.vue.js +42 -39
- package/dist/v2/features/app/App.vue.d.ts.map +1 -1
- package/dist/v2/features/app/App.vue.js +64 -66
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue.js +2 -2
- package/dist/v2/features/app/components/AppSidebar.vue2.js +193 -106
- package/dist/v2/features/app/components/ItemDecorator.vue.d.ts +22 -0
- package/dist/v2/features/app/components/ItemDecorator.vue.d.ts.map +1 -0
- package/dist/v2/features/app/components/ItemDecorator.vue.js +138 -0
- package/dist/v2/features/app/components/ItemDecorator.vue2.js +4 -0
- package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.d.ts +8 -0
- package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.d.ts.map +1 -1
- package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.js +76 -68
- package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.d.ts +8 -0
- package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.d.ts.map +1 -1
- package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.js +83 -75
- package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.d.ts +4 -0
- package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.d.ts.map +1 -1
- package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.js +32 -34
- package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts +16 -0
- package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts.map +1 -1
- package/dist/v2/features/command-palette/hooks/use-command-palette-state.js +24 -21
- package/dist/v2/features/operation/Operation.vue.js +1 -1
- package/dist/v2/features/settings/DocumentSettings.vue.js +2 -2
- package/dist/v2/features/settings/DocumentSettings.vue2.js +1 -1
- package/dist/v2/helpers/storage.d.ts.map +1 -1
- package/dist/v2/helpers/storage.js +5 -5
- package/dist/v2/hooks/use-workspace-client-events.d.ts.map +1 -1
- package/dist/v2/hooks/use-workspace-client-events.js +102 -61
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +21 -21
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarListbox as T, ScalarButton as
|
|
1
|
+
import { defineComponent as B, ref as h, computed as p, watch as O, createBlock as x, openBlock as u, withCtx as n, createVNode as i, createTextVNode as j, createElementVNode as m, unref as c, normalizeClass as z, toDisplayString as b, createElementBlock as w, createCommentVNode as U, Fragment as L, renderList as R } from "vue";
|
|
2
|
+
import { ScalarListbox as T, ScalarButton as _, ScalarIcon as I, ScalarDropdown as A, ScalarDropdownItem as F } from "@scalar/components";
|
|
3
3
|
import { useRouter as P } from "vue-router";
|
|
4
|
-
import
|
|
4
|
+
import y from "../../../blocks/operation-code-sample/components/HttpMethod.vue.js";
|
|
5
5
|
import q from "./CommandActionForm.vue.js";
|
|
6
6
|
import G from "./CommandActionInput.vue.js";
|
|
7
7
|
const H = { class: "flex flex-1 gap-1" }, J = {
|
|
@@ -12,84 +12,92 @@ const H = { class: "flex flex-1 gap-1" }, J = {
|
|
|
12
12
|
class: "text-c-3"
|
|
13
13
|
}, M = { class: "flex items-center gap-2" }, Q = { class: "custom-scroll max-h-40" }, W = { class: "truncate" }, X = {
|
|
14
14
|
name: "CommandPaletteExample"
|
|
15
|
-
}, oe = /* @__PURE__ */
|
|
15
|
+
}, oe = /* @__PURE__ */ B({
|
|
16
16
|
...X,
|
|
17
17
|
props: {
|
|
18
|
-
workspaceStore: {}
|
|
18
|
+
workspaceStore: {},
|
|
19
|
+
documentId: {},
|
|
20
|
+
operationId: {}
|
|
19
21
|
},
|
|
20
22
|
emits: ["close", "back"],
|
|
21
|
-
setup(
|
|
22
|
-
const
|
|
23
|
-
() => Object.entries(
|
|
24
|
-
([
|
|
25
|
-
id:
|
|
26
|
-
label: a.info.title ||
|
|
23
|
+
setup(s, { emit: D }) {
|
|
24
|
+
const k = D, V = P(), v = h(""), g = p(() => v.value.trim()), f = p(
|
|
25
|
+
() => Object.entries(s.workspaceStore.workspace.documents).map(
|
|
26
|
+
([e, a]) => ({
|
|
27
|
+
id: e,
|
|
28
|
+
label: a.info.title || e
|
|
27
29
|
})
|
|
28
30
|
)
|
|
29
|
-
), l =
|
|
30
|
-
|
|
31
|
-
),
|
|
31
|
+
), l = h(
|
|
32
|
+
s.documentId ? f.value.find((e) => e.id === s.documentId) : f.value[0] ?? void 0
|
|
33
|
+
), S = (e) => {
|
|
32
34
|
const a = [];
|
|
33
|
-
for (const
|
|
34
|
-
|
|
35
|
+
for (const t of e)
|
|
36
|
+
t.type === "operation" && a.push(t), "children" in t && t.children && a.push(...S(t.children));
|
|
35
37
|
return a;
|
|
36
|
-
},
|
|
38
|
+
}, r = p(() => {
|
|
37
39
|
if (!l.value)
|
|
38
40
|
return [];
|
|
39
|
-
const
|
|
40
|
-
if (!
|
|
41
|
+
const e = s.workspaceStore.workspace.documents[l.value.id];
|
|
42
|
+
if (!e || !e["x-scalar-navigation"])
|
|
41
43
|
return [];
|
|
42
|
-
const a =
|
|
43
|
-
return
|
|
44
|
-
id:
|
|
45
|
-
label: `${
|
|
46
|
-
path:
|
|
47
|
-
method:
|
|
44
|
+
const a = e["x-scalar-navigation"];
|
|
45
|
+
return S(a.children ?? []).map((d) => ({
|
|
46
|
+
id: d.id,
|
|
47
|
+
label: `${d.method.toUpperCase()} ${d.path}`,
|
|
48
|
+
path: d.path,
|
|
49
|
+
method: d.method
|
|
48
50
|
}));
|
|
49
|
-
})
|
|
50
|
-
|
|
51
|
+
}), o = h(
|
|
52
|
+
s.operationId ? r.value.find(
|
|
53
|
+
(e) => e.id === s.operationId
|
|
54
|
+
) : void 0
|
|
55
|
+
);
|
|
56
|
+
O(
|
|
51
57
|
l,
|
|
52
58
|
() => {
|
|
53
|
-
o.value =
|
|
59
|
+
o.value = s.operationId ? r.value.find(
|
|
60
|
+
(e) => e.id === s.operationId
|
|
61
|
+
) : r.value[0] ?? void 0;
|
|
54
62
|
},
|
|
55
63
|
{ immediate: !0 }
|
|
56
64
|
);
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
},
|
|
60
|
-
|
|
65
|
+
const N = (e) => {
|
|
66
|
+
e && (o.value = e);
|
|
67
|
+
}, C = p(() => !g.value || !l.value || !o.value), E = () => {
|
|
68
|
+
C.value || !l.value || !o.value || (V.push({
|
|
61
69
|
name: "example",
|
|
62
70
|
params: {
|
|
63
71
|
documentSlug: l.value.id,
|
|
64
72
|
pathEncoded: encodeURIComponent(o.value.path),
|
|
65
73
|
method: o.value.method,
|
|
66
|
-
exampleName:
|
|
74
|
+
exampleName: g.value
|
|
67
75
|
}
|
|
68
|
-
}),
|
|
69
|
-
},
|
|
70
|
-
|
|
76
|
+
}), k("close"));
|
|
77
|
+
}, $ = (e) => {
|
|
78
|
+
k("back", e);
|
|
71
79
|
};
|
|
72
|
-
return (
|
|
73
|
-
disabled:
|
|
74
|
-
onSubmit:
|
|
80
|
+
return (e, a) => (u(), x(q, {
|
|
81
|
+
disabled: C.value,
|
|
82
|
+
onSubmit: E
|
|
75
83
|
}, {
|
|
76
84
|
options: n(() => [
|
|
77
|
-
|
|
78
|
-
|
|
85
|
+
m("div", H, [
|
|
86
|
+
i(c(T), {
|
|
79
87
|
modelValue: l.value,
|
|
80
|
-
"onUpdate:modelValue": a[1] || (a[1] = (
|
|
81
|
-
options:
|
|
88
|
+
"onUpdate:modelValue": a[1] || (a[1] = (t) => l.value = t),
|
|
89
|
+
options: f.value
|
|
82
90
|
}, {
|
|
83
91
|
default: n(() => [
|
|
84
|
-
|
|
92
|
+
i(c(_), {
|
|
85
93
|
class: "hover:bg-b-2 max-h-8 w-[150px] min-w-[150px] justify-between gap-1 p-2 text-xs",
|
|
86
94
|
variant: "outlined"
|
|
87
95
|
}, {
|
|
88
96
|
default: n(() => [
|
|
89
|
-
|
|
90
|
-
class:
|
|
91
|
-
},
|
|
92
|
-
|
|
97
|
+
m("span", {
|
|
98
|
+
class: z(l.value ? "text-c-1 truncate" : "text-c-3")
|
|
99
|
+
}, b(l.value ? l.value.label : "Select Document"), 3),
|
|
100
|
+
i(c(I), {
|
|
93
101
|
class: "text-c-3",
|
|
94
102
|
icon: "ChevronDown",
|
|
95
103
|
size: "md"
|
|
@@ -100,21 +108,21 @@ const H = { class: "flex flex-1 gap-1" }, J = {
|
|
|
100
108
|
]),
|
|
101
109
|
_: 1
|
|
102
110
|
}, 8, ["modelValue", "options"]),
|
|
103
|
-
|
|
111
|
+
i(c(A), {
|
|
104
112
|
placement: "bottom",
|
|
105
113
|
resize: ""
|
|
106
114
|
}, {
|
|
107
115
|
items: n(() => [
|
|
108
|
-
|
|
109
|
-
(u(!0),
|
|
110
|
-
key:
|
|
116
|
+
m("div", Q, [
|
|
117
|
+
(u(!0), w(L, null, R(r.value, (t) => (u(), x(c(F), {
|
|
118
|
+
key: t.id,
|
|
111
119
|
class: "flex h-7 w-full items-center justify-between px-1 pr-[26px]",
|
|
112
|
-
onClick: (
|
|
120
|
+
onClick: (d) => N(t)
|
|
113
121
|
}, {
|
|
114
122
|
default: n(() => [
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
method:
|
|
123
|
+
m("span", W, b(t.path), 1),
|
|
124
|
+
i(y, {
|
|
125
|
+
method: t.method
|
|
118
126
|
}, null, 8, ["method"])
|
|
119
127
|
]),
|
|
120
128
|
_: 2
|
|
@@ -122,19 +130,19 @@ const H = { class: "flex flex-1 gap-1" }, J = {
|
|
|
122
130
|
])
|
|
123
131
|
]),
|
|
124
132
|
default: n(() => [
|
|
125
|
-
|
|
133
|
+
i(c(_), {
|
|
126
134
|
class: "hover:bg-b-2 max-h-8 w-full justify-between gap-1 p-2 text-xs",
|
|
127
|
-
disabled: !
|
|
135
|
+
disabled: !r.value.length,
|
|
128
136
|
variant: "outlined"
|
|
129
137
|
}, {
|
|
130
138
|
default: n(() => [
|
|
131
|
-
o.value ? (u(),
|
|
132
|
-
|
|
133
|
-
o.value ? (u(),
|
|
139
|
+
o.value ? (u(), w("span", J, b(o.value.path), 1)) : (u(), w("span", K, " Select Operation ")),
|
|
140
|
+
m("div", M, [
|
|
141
|
+
o.value ? (u(), x(y, {
|
|
134
142
|
key: 0,
|
|
135
143
|
method: o.value.method
|
|
136
|
-
}, null, 8, ["method"])) :
|
|
137
|
-
|
|
144
|
+
}, null, 8, ["method"])) : U("", !0),
|
|
145
|
+
i(c(I), {
|
|
138
146
|
class: "text-c-3",
|
|
139
147
|
icon: "ChevronDown",
|
|
140
148
|
size: "md"
|
|
@@ -149,15 +157,15 @@ const H = { class: "flex flex-1 gap-1" }, J = {
|
|
|
149
157
|
])
|
|
150
158
|
]),
|
|
151
159
|
submit: n(() => [...a[2] || (a[2] = [
|
|
152
|
-
|
|
160
|
+
j("Create Example", -1)
|
|
153
161
|
])]),
|
|
154
162
|
default: n(() => [
|
|
155
|
-
|
|
156
|
-
modelValue:
|
|
157
|
-
"onUpdate:modelValue": a[0] || (a[0] = (
|
|
163
|
+
i(G, {
|
|
164
|
+
modelValue: v.value,
|
|
165
|
+
"onUpdate:modelValue": a[0] || (a[0] = (t) => v.value = t),
|
|
158
166
|
label: "Example Name",
|
|
159
167
|
placeholder: "Example Name",
|
|
160
|
-
onDelete:
|
|
168
|
+
onDelete: $
|
|
161
169
|
}, null, 8, ["modelValue"])
|
|
162
170
|
]),
|
|
163
171
|
_: 1
|
|
@@ -23,6 +23,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
23
23
|
workspaceStore: WorkspaceStore;
|
|
24
24
|
/** Event bus for emitting operation creation events */
|
|
25
25
|
eventBus: WorkspaceEventBus;
|
|
26
|
+
/** Preselected document id to create the request in */
|
|
27
|
+
documentId?: string;
|
|
28
|
+
/** Preselected tag id to add the request to (optional) */
|
|
29
|
+
tagId?: string;
|
|
26
30
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
27
31
|
close: () => any;
|
|
28
32
|
back: (keyboardEvent: KeyboardEvent) => any;
|
|
@@ -31,6 +35,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
31
35
|
workspaceStore: WorkspaceStore;
|
|
32
36
|
/** Event bus for emitting operation creation events */
|
|
33
37
|
eventBus: WorkspaceEventBus;
|
|
38
|
+
/** Preselected document id to create the request in */
|
|
39
|
+
documentId?: string;
|
|
40
|
+
/** Preselected tag id to add the request to (optional) */
|
|
41
|
+
tagId?: string;
|
|
34
42
|
}> & Readonly<{
|
|
35
43
|
onClose?: (() => any) | undefined;
|
|
36
44
|
onBack?: ((keyboardEvent: KeyboardEvent) => any) | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandPaletteRequest.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/command-palette/components/CommandPaletteRequest.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CommandPaletteRequest.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/command-palette/components/CommandPaletteRequest.vue"],"names":[],"mappings":"AA8WA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAUvE;;;;;;;;;;;;;;;;;GAiBG;;IAGD,iEAAiE;oBACjD,cAAc;IAC9B,uDAAuD;cAC7C,iBAAiB;IAC3B,uDAAuD;iBAC1C,MAAM;IACnB,0DAA0D;YAClD,MAAM;;;;;IAPd,iEAAiE;oBACjD,cAAc;IAC9B,uDAAuD;cAC7C,iBAAiB;IAC3B,uDAAuD;iBAC1C,MAAM;IACnB,0DAA0D;YAClD,MAAM;;;;;AAThB,wBAmkBC"}
|
|
@@ -1,39 +1,41 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarListbox as
|
|
3
|
-
import { HTTP_METHODS as
|
|
4
|
-
import { useRouter as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
const
|
|
1
|
+
import { defineComponent as U, ref as p, computed as v, watch as O, createBlock as h, openBlock as m, withCtx as o, createVNode as s, createTextVNode as H, createElementVNode as r, unref as n, normalizeClass as T, toDisplayString as w, createCommentVNode as L, createElementBlock as V, Fragment as _, renderList as I } from "vue";
|
|
2
|
+
import { ScalarListbox as W, ScalarButton as k, ScalarIcon as S, ScalarDropdown as y, ScalarDropdownItem as z } from "@scalar/components";
|
|
3
|
+
import { HTTP_METHODS as F } from "@scalar/helpers/http/http-methods";
|
|
4
|
+
import { useRouter as A } from "vue-router";
|
|
5
|
+
import B from "../../../blocks/operation-code-sample/components/HttpMethod.vue.js";
|
|
6
|
+
import G from "./CommandActionForm.vue.js";
|
|
7
|
+
import J from "./CommandActionInput.vue.js";
|
|
8
|
+
const K = { class: "flex flex-1 gap-1" }, Q = { class: "flex items-center gap-2" }, X = { class: "custom-scroll max-h-40" }, Y = { class: "custom-scroll max-h-40" }, Z = { class: "truncate" }, ee = {
|
|
9
9
|
name: "CommandPaletteRequest"
|
|
10
|
-
},
|
|
11
|
-
...
|
|
10
|
+
}, ce = /* @__PURE__ */ U({
|
|
11
|
+
...ee,
|
|
12
12
|
props: {
|
|
13
13
|
workspaceStore: {},
|
|
14
|
-
eventBus: {}
|
|
14
|
+
eventBus: {},
|
|
15
|
+
documentId: {},
|
|
16
|
+
tagId: {}
|
|
15
17
|
},
|
|
16
18
|
emits: ["close", "back"],
|
|
17
|
-
setup(
|
|
18
|
-
const
|
|
19
|
-
() => Object.entries(
|
|
19
|
+
setup(u, { emit: N }) {
|
|
20
|
+
const g = N, $ = A(), b = p("/"), c = v(() => b.value.trim()), x = v(
|
|
21
|
+
() => Object.entries(u.workspaceStore.workspace.documents).map(
|
|
20
22
|
([e, a]) => ({
|
|
21
23
|
id: e,
|
|
22
24
|
label: a.info.title || e
|
|
23
25
|
})
|
|
24
26
|
)
|
|
25
|
-
),
|
|
27
|
+
), C = F.map((e) => ({
|
|
26
28
|
id: e,
|
|
27
29
|
label: e.toUpperCase(),
|
|
28
30
|
method: e
|
|
29
31
|
})), t = p(
|
|
30
|
-
|
|
31
|
-
),
|
|
32
|
-
|
|
33
|
-
),
|
|
32
|
+
u.documentId ? x.value.find((e) => e.id === u.documentId) : x.value[0] ?? void 0
|
|
33
|
+
), i = p(
|
|
34
|
+
C.find((e) => e.method === "get")
|
|
35
|
+
), f = v(() => {
|
|
34
36
|
if (!t.value)
|
|
35
37
|
return [];
|
|
36
|
-
const e =
|
|
38
|
+
const e = u.workspaceStore.workspace.documents[t.value.id];
|
|
37
39
|
return e ? [
|
|
38
40
|
{ id: "", label: "No Tag" },
|
|
39
41
|
...e.tags?.map((a) => ({
|
|
@@ -41,63 +43,69 @@ const J = { class: "flex flex-1 gap-1" }, K = { class: "flex items-center gap-2"
|
|
|
41
43
|
label: a.name
|
|
42
44
|
})) ?? []
|
|
43
45
|
] : [];
|
|
44
|
-
}),
|
|
45
|
-
|
|
46
|
+
}), d = p(
|
|
47
|
+
u.tagId ? f.value.find((e) => e.id === u.tagId) : void 0
|
|
48
|
+
);
|
|
49
|
+
O(t, () => {
|
|
50
|
+
d.value = f.value.find((e) => e.id === "");
|
|
51
|
+
});
|
|
52
|
+
const P = v(() => {
|
|
53
|
+
if (!t.value || !i.value || !c.value)
|
|
46
54
|
return !1;
|
|
47
|
-
const e =
|
|
48
|
-
return !!e?.paths?.[a]?.[
|
|
49
|
-
}),
|
|
50
|
-
e && (
|
|
51
|
-
},
|
|
55
|
+
const e = u.workspaceStore.workspace.documents[t.value.id], a = c.value.startsWith("/") ? c.value : `/${c.value}`;
|
|
56
|
+
return !!e?.paths?.[a]?.[i.value.method];
|
|
57
|
+
}), D = v(() => !!(!c.value || !t.value || !i.value || P.value)), j = (e) => {
|
|
58
|
+
e && (i.value = e);
|
|
59
|
+
}, q = (e) => {
|
|
52
60
|
e && (d.value = e);
|
|
53
|
-
},
|
|
54
|
-
|
|
61
|
+
}, E = () => {
|
|
62
|
+
D.value || !t.value || !i.value || !u.workspaceStore.workspace.documents[t.value.id] || (u.eventBus.emit("operation:create:operation", {
|
|
55
63
|
documentName: t.value.id,
|
|
56
|
-
path:
|
|
57
|
-
method:
|
|
64
|
+
path: c.value,
|
|
65
|
+
method: i.value.method,
|
|
58
66
|
operation: {
|
|
59
67
|
tags: d.value?.id ? [d.value.id] : void 0
|
|
60
68
|
},
|
|
61
69
|
callback: (a) => {
|
|
62
70
|
if (a) {
|
|
63
|
-
|
|
64
|
-
const l =
|
|
65
|
-
|
|
71
|
+
u.workspaceStore.buildSidebar(t.value?.id ?? "");
|
|
72
|
+
const l = c.value.startsWith("/") ? c.value : `/${c.value}`;
|
|
73
|
+
$.push({
|
|
66
74
|
name: "example",
|
|
67
75
|
params: {
|
|
68
76
|
documentSlug: t.value?.id,
|
|
69
77
|
pathEncoded: encodeURIComponent(l),
|
|
70
|
-
method:
|
|
78
|
+
method: i.value?.method,
|
|
71
79
|
exampleName: "default"
|
|
72
80
|
}
|
|
73
81
|
});
|
|
74
82
|
}
|
|
75
83
|
}
|
|
76
|
-
}),
|
|
77
|
-
},
|
|
78
|
-
|
|
84
|
+
}), g("close"));
|
|
85
|
+
}, R = (e) => {
|
|
86
|
+
g("back", e);
|
|
79
87
|
};
|
|
80
|
-
return (e, a) => (m(),
|
|
81
|
-
disabled:
|
|
82
|
-
onSubmit:
|
|
88
|
+
return (e, a) => (m(), h(G, {
|
|
89
|
+
disabled: D.value,
|
|
90
|
+
onSubmit: E
|
|
83
91
|
}, {
|
|
84
92
|
options: o(() => [
|
|
85
|
-
r("div",
|
|
86
|
-
n(
|
|
93
|
+
r("div", K, [
|
|
94
|
+
s(n(W), {
|
|
87
95
|
modelValue: t.value,
|
|
88
96
|
"onUpdate:modelValue": a[1] || (a[1] = (l) => t.value = l),
|
|
89
|
-
options:
|
|
97
|
+
options: x.value
|
|
90
98
|
}, {
|
|
91
99
|
default: o(() => [
|
|
92
|
-
n(
|
|
100
|
+
s(n(k), {
|
|
93
101
|
class: "hover:bg-b-2 max-h-8 w-[150px] min-w-[150px] justify-between gap-1 p-2 text-xs",
|
|
94
102
|
variant: "outlined"
|
|
95
103
|
}, {
|
|
96
104
|
default: o(() => [
|
|
97
105
|
r("span", {
|
|
98
|
-
class:
|
|
99
|
-
},
|
|
100
|
-
n(
|
|
106
|
+
class: T(t.value ? "text-c-1 truncate" : "text-c-3")
|
|
107
|
+
}, w(t.value ? t.value.label : "Select Document"), 3),
|
|
108
|
+
s(n(S), {
|
|
101
109
|
class: "text-c-3",
|
|
102
110
|
icon: "ChevronDown",
|
|
103
111
|
size: "md"
|
|
@@ -108,19 +116,19 @@ const J = { class: "flex flex-1 gap-1" }, K = { class: "flex items-center gap-2"
|
|
|
108
116
|
]),
|
|
109
117
|
_: 1
|
|
110
118
|
}, 8, ["modelValue", "options"]),
|
|
111
|
-
n(
|
|
119
|
+
s(n(y), {
|
|
112
120
|
placement: "bottom",
|
|
113
121
|
resize: ""
|
|
114
122
|
}, {
|
|
115
123
|
items: o(() => [
|
|
116
|
-
r("div",
|
|
117
|
-
(m(!0),
|
|
124
|
+
r("div", X, [
|
|
125
|
+
(m(!0), V(_, null, I(n(C), (l) => (m(), h(n(z), {
|
|
118
126
|
key: l.id,
|
|
119
127
|
class: "flex h-7 w-full items-center justify-center px-1",
|
|
120
|
-
onClick: (
|
|
128
|
+
onClick: (M) => j(l)
|
|
121
129
|
}, {
|
|
122
130
|
default: o(() => [
|
|
123
|
-
|
|
131
|
+
s(B, {
|
|
124
132
|
method: l.method
|
|
125
133
|
}, null, 8, ["method"])
|
|
126
134
|
]),
|
|
@@ -129,17 +137,17 @@ const J = { class: "flex flex-1 gap-1" }, K = { class: "flex items-center gap-2"
|
|
|
129
137
|
])
|
|
130
138
|
]),
|
|
131
139
|
default: o(() => [
|
|
132
|
-
n(
|
|
140
|
+
s(n(k), {
|
|
133
141
|
class: "hover:bg-b-2 max-h-8 w-[100px] min-w-[100px] justify-between gap-1 p-2 text-xs",
|
|
134
142
|
variant: "outlined"
|
|
135
143
|
}, {
|
|
136
144
|
default: o(() => [
|
|
137
|
-
r("div",
|
|
138
|
-
|
|
145
|
+
r("div", Q, [
|
|
146
|
+
i.value ? (m(), h(B, {
|
|
139
147
|
key: 0,
|
|
140
|
-
method:
|
|
141
|
-
}, null, 8, ["method"])) :
|
|
142
|
-
n(
|
|
148
|
+
method: i.value.method
|
|
149
|
+
}, null, 8, ["method"])) : L("", !0),
|
|
150
|
+
s(n(S), {
|
|
143
151
|
class: "text-c-3",
|
|
144
152
|
icon: "ChevronDown",
|
|
145
153
|
size: "md"
|
|
@@ -151,35 +159,35 @@ const J = { class: "flex flex-1 gap-1" }, K = { class: "flex items-center gap-2"
|
|
|
151
159
|
]),
|
|
152
160
|
_: 1
|
|
153
161
|
}),
|
|
154
|
-
n(
|
|
162
|
+
s(n(y), {
|
|
155
163
|
placement: "bottom",
|
|
156
164
|
resize: ""
|
|
157
165
|
}, {
|
|
158
166
|
items: o(() => [
|
|
159
|
-
r("div",
|
|
160
|
-
(m(!0),
|
|
167
|
+
r("div", Y, [
|
|
168
|
+
(m(!0), V(_, null, I(f.value, (l) => (m(), h(n(z), {
|
|
161
169
|
key: l.id,
|
|
162
170
|
class: "flex h-7 w-full items-center px-1",
|
|
163
|
-
onClick: (
|
|
171
|
+
onClick: (M) => q(l)
|
|
164
172
|
}, {
|
|
165
173
|
default: o(() => [
|
|
166
|
-
r("span",
|
|
174
|
+
r("span", Z, w(l.label), 1)
|
|
167
175
|
]),
|
|
168
176
|
_: 2
|
|
169
177
|
}, 1032, ["onClick"]))), 128))
|
|
170
178
|
])
|
|
171
179
|
]),
|
|
172
180
|
default: o(() => [
|
|
173
|
-
n(
|
|
181
|
+
s(n(k), {
|
|
174
182
|
class: "hover:bg-b-2 max-h-8 w-full justify-between gap-1 p-2 text-xs",
|
|
175
|
-
disabled: !
|
|
183
|
+
disabled: !f.value.length,
|
|
176
184
|
variant: "outlined"
|
|
177
185
|
}, {
|
|
178
186
|
default: o(() => [
|
|
179
187
|
r("span", {
|
|
180
|
-
class:
|
|
181
|
-
},
|
|
182
|
-
n(
|
|
188
|
+
class: T(d.value ? "text-c-1 truncate" : "text-c-3")
|
|
189
|
+
}, w(d.value ? d.value.label : "Select Tag (Optional)"), 3),
|
|
190
|
+
s(n(S), {
|
|
183
191
|
class: "text-c-3",
|
|
184
192
|
icon: "ChevronDown",
|
|
185
193
|
size: "md"
|
|
@@ -193,15 +201,15 @@ const J = { class: "flex flex-1 gap-1" }, K = { class: "flex items-center gap-2"
|
|
|
193
201
|
])
|
|
194
202
|
]),
|
|
195
203
|
submit: o(() => [...a[2] || (a[2] = [
|
|
196
|
-
|
|
204
|
+
H("Create Request", -1)
|
|
197
205
|
])]),
|
|
198
206
|
default: o(() => [
|
|
199
|
-
|
|
200
|
-
modelValue:
|
|
201
|
-
"onUpdate:modelValue": a[0] || (a[0] = (l) =>
|
|
207
|
+
s(J, {
|
|
208
|
+
modelValue: b.value,
|
|
209
|
+
"onUpdate:modelValue": a[0] || (a[0] = (l) => b.value = l),
|
|
202
210
|
label: "Request Path",
|
|
203
211
|
placeholder: "/users",
|
|
204
|
-
onDelete:
|
|
212
|
+
onDelete: R
|
|
205
213
|
}, null, 8, ["modelValue"])
|
|
206
214
|
]),
|
|
207
215
|
_: 1
|
|
@@ -209,5 +217,5 @@ const J = { class: "flex flex-1 gap-1" }, K = { class: "flex items-center gap-2"
|
|
|
209
217
|
}
|
|
210
218
|
});
|
|
211
219
|
export {
|
|
212
|
-
|
|
220
|
+
ce as default
|
|
213
221
|
};
|
|
@@ -22,6 +22,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
22
22
|
workspaceStore: WorkspaceStore;
|
|
23
23
|
/** Event bus for emitting tag creation events */
|
|
24
24
|
eventBus: WorkspaceEventBus;
|
|
25
|
+
/** Preselected document id to create the tag in */
|
|
26
|
+
documentId?: string;
|
|
25
27
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
26
28
|
close: () => any;
|
|
27
29
|
back: (keyboardEvent: KeyboardEvent) => any;
|
|
@@ -30,6 +32,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
30
32
|
workspaceStore: WorkspaceStore;
|
|
31
33
|
/** Event bus for emitting tag creation events */
|
|
32
34
|
eventBus: WorkspaceEventBus;
|
|
35
|
+
/** Preselected document id to create the tag in */
|
|
36
|
+
documentId?: string;
|
|
33
37
|
}> & Readonly<{
|
|
34
38
|
onClose?: (() => any) | undefined;
|
|
35
39
|
onBack?: ((keyboardEvent: KeyboardEvent) => any) | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandPaletteTag.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/command-palette/components/CommandPaletteTag.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CommandPaletteTag.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/command-palette/components/CommandPaletteTag.vue"],"names":[],"mappings":"AA2JA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAOvE;;;;;;;;;;;;;;;;GAgBG;;IAGD,2DAA2D;oBAC3C,cAAc;IAC9B,iDAAiD;cACvC,iBAAiB;IAC3B,mDAAmD;iBACtC,MAAM;;;;;IALnB,2DAA2D;oBAC3C,cAAc;IAC9B,iDAAiD;cACvC,iBAAiB;IAC3B,mDAAmD;iBACtC,MAAM;;;;;AAPrB,wBA6OC"}
|