@scalar/api-client 2.5.13 → 2.5.16
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 +77 -0
- package/README.md +1 -1
- package/dist/components/AddressBar/AddressBar.vue.js +1 -1
- package/dist/components/AddressBar/AddressBarHistory.vue.js +1 -1
- package/dist/components/AddressBar/AddressBarHistory.vue2.js +1 -1
- package/dist/components/CodeInput/CodeInput.vue.js +2 -2
- package/dist/components/CodeInput/CodeInput.vue2.js +3 -3
- package/dist/components/CommandPalette/CommandActionInput.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandActionInput.vue.js +11 -10
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +10 -10
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue.js +2 -2
- package/dist/components/CommandPalette/TheCommandPalette.vue2.js +129 -116
- package/dist/components/DataTable/DataTableCell.vue.js +8 -8
- package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableInput.vue.js +2 -2
- package/dist/components/Form/Form.vue.js +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue.d.ts +2 -2
- package/dist/components/ImportCollection/ImportCollectionModal.vue.js +7 -7
- package/dist/components/ImportCollection/PrefetchError.vue.js +1 -1
- package/dist/components/ImportCollection/WorkspaceSelector.vue.js +1 -1
- package/dist/components/ImportCollection/utils/get-openapi-version.d.ts +5 -0
- package/dist/components/ImportCollection/utils/get-openapi-version.d.ts.map +1 -0
- package/dist/components/ImportCollection/utils/get-openapi-version.js +20 -0
- package/dist/components/ImportCollection/utils/get-openapi-version.test.d.ts +2 -0
- package/dist/components/ImportCollection/utils/get-openapi-version.test.d.ts.map +1 -0
- package/dist/components/ImportCollection/utils/import-collection.js +1 -1
- package/dist/components/ImportCollection/utils/{isDocument.d.ts → is-document.d.ts} +2 -2
- package/dist/components/ImportCollection/utils/is-document.d.ts.map +1 -0
- package/dist/components/ImportCollection/utils/is-document.js +9 -0
- package/dist/components/ImportCollection/utils/is-document.test.d.ts +2 -0
- package/dist/components/ImportCollection/utils/is-document.test.d.ts.map +1 -0
- package/dist/components/ImportCollection/utils/is-url.d.ts +5 -0
- package/dist/components/ImportCollection/utils/is-url.d.ts.map +1 -0
- package/dist/components/ImportCollection/utils/is-url.js +9 -0
- package/dist/components/ImportCollection/utils/is-url.test.d.ts +2 -0
- package/dist/components/ImportCollection/utils/is-url.test.d.ts.map +1 -0
- package/dist/components/OpenApiClientButton.vue.js +2 -2
- package/dist/components/Server/ServerDropdown.vue.d.ts.map +1 -1
- package/dist/components/Server/ServerDropdown.vue.js +8 -8
- package/dist/components/Server/ServerSelector.vue.d.ts.map +1 -1
- package/dist/components/Server/ServerSelector.vue.js +13 -13
- package/dist/components/Server/ServerVariablesSelect.vue.d.ts.map +1 -1
- package/dist/components/Server/ServerVariablesSelect.vue.js +3 -3
- package/dist/components/TopNav/TopNav.vue.js +10 -10
- package/dist/components/TopNav/TopNavItem.vue.js +1 -1
- package/dist/components/TopNav/TopNavItem.vue2.js +1 -1
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts +5 -1
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +42 -36
- package/dist/components/ViewLayout/ViewLayoutSection.vue.js +4 -4
- package/dist/hooks/useClientConfig.d.ts +42 -36
- package/dist/hooks/useClientConfig.d.ts.map +1 -1
- package/dist/layouts/App/create-api-client-app.d.ts +202 -162
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/create-api-client-modal.d.ts +404 -324
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Web/create-api-client-web.d.ts +202 -162
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +202 -162
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/find-request.d.ts +5 -5
- package/dist/libs/find-request.d.ts.map +1 -1
- package/dist/libs/get-request-uid-by-path-method.d.ts.map +1 -1
- package/dist/libs/get-request-uid-by-path-method.js +15 -7
- package/dist/libs/send-request/create-request-operation.js +10 -10
- package/dist/libs/send-request/create-request-operation.test.d.ts +33 -33
- package/dist/libs/send-request/create-request-operation.test.d.ts.map +1 -1
- package/dist/libs/send-request/set-request-cookies.d.ts +1 -1
- package/dist/libs/send-request/set-request-cookies.d.ts.map +1 -1
- package/dist/plugins/plugin-manager.d.ts +5 -3
- package/dist/plugins/plugin-manager.d.ts.map +1 -1
- package/dist/plugins/plugin-manager.js +17 -9
- package/dist/plugins/plugin-manager.test.d.ts +2 -0
- package/dist/plugins/plugin-manager.test.d.ts.map +1 -0
- package/dist/store/active-entities.d.ts +33 -33
- package/dist/store/active-entities.d.ts.map +1 -1
- package/dist/store/request-example.d.ts +130 -130
- package/dist/store/request-example.d.ts.map +1 -1
- package/dist/store/requests.d.ts +55 -55
- package/dist/store/requests.d.ts.map +1 -1
- package/dist/store/security-schemes.d.ts +42 -2
- package/dist/store/security-schemes.d.ts.map +1 -1
- package/dist/store/store.d.ts +204 -164
- package/dist/store/store.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/views/Collection/CollectionInfoForm.vue.js +2 -2
- package/dist/views/Collection/components/EnvironmentForm.vue.js +2 -2
- package/dist/views/Collection/components/MarkdownInput.vue.d.ts.map +1 -1
- package/dist/views/Collection/components/MarkdownInput.vue.js +1 -1
- package/dist/views/Collection/components/MarkdownInput.vue2.js +32 -26
- package/dist/views/Cookies/CookieForm.vue.js +1 -1
- package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
- package/dist/views/Cookies/Cookies.vue2.js +67 -61
- package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
- package/dist/views/Environment/Environment.vue2.js +98 -92
- package/dist/views/Request/RequestSection/RequestAuth/DeleteRequestAuthModal.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +126 -122
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue2.js +22 -22
- package/dist/views/Request/RequestSection/RequestBody.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestCodeExample.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestTable.vue.js +1 -1
- package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
- package/dist/views/Request/RequestSidebarItem.vue2.js +9 -9
- package/dist/views/Request/ResponseSection/RequestHeaders.vue.js +9 -9
- package/dist/views/Request/ResponseSection/ResponseBody.vue.js +2 -2
- package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue.js +3 -3
- package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseHeaders.vue.js +9 -9
- package/dist/views/Request/components/WorkspaceDropdown.vue.js +2 -2
- package/dist/views/Request/libs/oauth2.d.ts.map +1 -1
- package/dist/views/Request/libs/oauth2.js +39 -39
- package/dist/views/Settings/SettingsGeneral.vue.js +2 -2
- package/package.json +19 -19
- package/dist/components/ImportCollection/utils/getOpenApiDocumentVersion.d.ts +0 -5
- package/dist/components/ImportCollection/utils/getOpenApiDocumentVersion.d.ts.map +0 -1
- package/dist/components/ImportCollection/utils/getOpenApiDocumentVersion.js +0 -20
- package/dist/components/ImportCollection/utils/isDocument.d.ts.map +0 -1
- package/dist/components/ImportCollection/utils/isDocument.js +0 -7
- package/dist/components/ImportCollection/utils/isUrl.d.ts +0 -3
- package/dist/components/ImportCollection/utils/isUrl.d.ts.map +0 -1
- package/dist/components/ImportCollection/utils/isUrl.js +0 -6
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Dialog as
|
|
3
|
-
import { useModal as
|
|
4
|
-
import { useRouter as
|
|
5
|
-
import { ROUTES as
|
|
6
|
-
import { importCurlCommand as
|
|
7
|
-
import { PathId as
|
|
8
|
-
import { useActiveEntities as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import { useWorkspace as
|
|
17
|
-
const
|
|
1
|
+
import { defineComponent as ae, ref as v, computed as O, watch as le, onMounted as re, onBeforeUnmount as se, createBlock as F, openBlock as r, unref as u, withCtx as A, createElementVNode as C, createVNode as y, createElementBlock as d, createTextVNode as G, createCommentVNode as me, withKeys as S, withModifiers as T, Fragment as D, renderList as Q, withDirectives as ie, toDisplayString as j, vShow as ce, normalizeClass as ue, resolveDynamicComponent as de, mergeProps as pe, nextTick as b } from "vue";
|
|
2
|
+
import { Dialog as fe, DialogPanel as ve, DialogTitle as Ce } from "@headlessui/vue";
|
|
3
|
+
import { useModal as he, ScalarIcon as L } from "@scalar/components";
|
|
4
|
+
import { useRouter as xe } from "vue-router";
|
|
5
|
+
import { ROUTES as ke } from "../../constants.js";
|
|
6
|
+
import { importCurlCommand as ye } from "../../libs/importers/curl.js";
|
|
7
|
+
import { PathId as E } from "../../routes.js";
|
|
8
|
+
import { useActiveEntities as ge } from "../../store/active-entities.js";
|
|
9
|
+
import _e from "./CommandPaletteCollection.vue.js";
|
|
10
|
+
import be from "./CommandPaletteExample.vue.js";
|
|
11
|
+
import we from "./CommandPaletteImport.vue.js";
|
|
12
|
+
import Pe from "./CommandPaletteImportCurl.vue.js";
|
|
13
|
+
import Ie from "./CommandPaletteServer.vue.js";
|
|
14
|
+
import Re from "./CommandPaletteTag.vue.js";
|
|
15
|
+
import Ae from "./CommandPaletteWorkspace.vue.js";
|
|
16
|
+
import { useWorkspace as Se } from "../../store/store.js";
|
|
17
|
+
const Te = {
|
|
18
18
|
key: 0,
|
|
19
19
|
class: "custom-scroll max-h-[50dvh] min-h-0 flex-1 rounded-lg p-1.5"
|
|
20
|
-
},
|
|
20
|
+
}, De = { class: "bg-b-2 focus-within:bg-b-1 sticky top-0 flex items-center rounded-md border border-transparent pl-2 shadow-[0_-8px_0_8px_var(--scalar-background-1),0_0_8px_8px_var(--scalar-background-1)] focus-within:border-(--scalar-background-3)" }, Le = { for: "commandmenu" }, Ee = ["value", "onKeydown"], qe = ["onClick"], Me = {
|
|
21
21
|
key: 0,
|
|
22
22
|
class: "text-c-3 p-2 pt-3 text-center text-sm"
|
|
23
23
|
}, Be = {
|
|
@@ -26,18 +26,19 @@ const Ae = {
|
|
|
26
26
|
}, He = {
|
|
27
27
|
name: "TheCommandPalette"
|
|
28
28
|
}, Ke = {
|
|
29
|
-
"Import from OpenAPI/Swagger/Postman/cURL":
|
|
29
|
+
"Import from OpenAPI/Swagger/Postman/cURL": we,
|
|
30
30
|
"Create Request": "",
|
|
31
|
-
"Create Workspace":
|
|
32
|
-
"Add Tag":
|
|
33
|
-
"Add Server":
|
|
34
|
-
"Create Collection":
|
|
35
|
-
"Add Example":
|
|
36
|
-
"Import from cURL":
|
|
37
|
-
},
|
|
31
|
+
"Create Workspace": Ae,
|
|
32
|
+
"Add Tag": Re,
|
|
33
|
+
"Add Server": Ie,
|
|
34
|
+
"Create Collection": _e,
|
|
35
|
+
"Add Example": be,
|
|
36
|
+
"Import from cURL": Pe
|
|
37
|
+
}, to = /* @__PURE__ */ ae({
|
|
38
38
|
...He,
|
|
39
39
|
setup($e) {
|
|
40
|
-
|
|
40
|
+
var z, N;
|
|
41
|
+
const h = he(), w = xe(), { activeWorkspace: l, activeWorkspaceCollections: J, activeCollection: X } = ge(), { events: p, requestMutators: Y } = Se(), q = [
|
|
41
42
|
{
|
|
42
43
|
label: "",
|
|
43
44
|
commands: [
|
|
@@ -77,18 +78,30 @@ const Ae = {
|
|
|
77
78
|
{
|
|
78
79
|
name: "Add Environment",
|
|
79
80
|
icon: "Brackets",
|
|
80
|
-
path:
|
|
81
|
+
path: {
|
|
82
|
+
name: "environment.default",
|
|
83
|
+
params: {
|
|
84
|
+
[E.Workspace]: ((z = l == null ? void 0 : l.value) == null ? void 0 : z.uid) ?? "default"
|
|
85
|
+
},
|
|
86
|
+
query: { openEnvironmentModal: "true" }
|
|
87
|
+
}
|
|
81
88
|
},
|
|
82
89
|
{
|
|
83
90
|
name: "Add Cookie",
|
|
84
91
|
icon: "Cookie",
|
|
85
|
-
path:
|
|
92
|
+
path: {
|
|
93
|
+
name: "cookies.default",
|
|
94
|
+
params: {
|
|
95
|
+
[E.Workspace]: ((N = l == null ? void 0 : l.value) == null ? void 0 : N.uid) ?? "default"
|
|
96
|
+
},
|
|
97
|
+
query: { openCookieModal: "true" }
|
|
98
|
+
}
|
|
86
99
|
}
|
|
87
100
|
]
|
|
88
101
|
},
|
|
89
102
|
{
|
|
90
103
|
label: "Pages",
|
|
91
|
-
commands:
|
|
104
|
+
commands: ke.map((o) => {
|
|
92
105
|
var e;
|
|
93
106
|
return {
|
|
94
107
|
name: o.displayName,
|
|
@@ -96,148 +109,148 @@ const Ae = {
|
|
|
96
109
|
path: w.resolve({
|
|
97
110
|
...o.to,
|
|
98
111
|
params: {
|
|
99
|
-
[
|
|
112
|
+
[E.Workspace]: ((e = l == null ? void 0 : l.value) == null ? void 0 : e.uid) ?? "default"
|
|
100
113
|
}
|
|
101
114
|
}).href
|
|
102
115
|
};
|
|
103
116
|
})
|
|
104
117
|
}
|
|
105
|
-
], P =
|
|
106
|
-
() =>
|
|
118
|
+
], P = v(), s = v(""), m = v(null), i = v(-1), M = v([]), x = O(
|
|
119
|
+
() => q.reduce((o, e) => {
|
|
107
120
|
const t = e.commands.filter(
|
|
108
121
|
(n) => n.name.toLowerCase().includes(s.value.toLowerCase())
|
|
109
122
|
);
|
|
110
123
|
return [...o, ...t];
|
|
111
124
|
}, [])
|
|
112
|
-
),
|
|
113
|
-
|
|
114
|
-
},
|
|
115
|
-
s.value !== "" && (o == null || o.preventDefault()),
|
|
125
|
+
), f = () => {
|
|
126
|
+
h.hide(), s.value = "", m.value = null, i.value = -1;
|
|
127
|
+
}, Z = (o) => {
|
|
128
|
+
s.value !== "" && (o == null || o.preventDefault()), m.value = null, b(() => {
|
|
116
129
|
var e;
|
|
117
130
|
return (e = g.value) == null ? void 0 : e.focus();
|
|
118
131
|
});
|
|
119
|
-
},
|
|
132
|
+
}, B = (o) => {
|
|
120
133
|
var e;
|
|
121
134
|
if ("path" in o)
|
|
122
|
-
w.push(o.path),
|
|
135
|
+
w.push(o.path), f();
|
|
123
136
|
else if (o.name === "Create Request") {
|
|
124
|
-
const t =
|
|
137
|
+
const t = J.value.find(
|
|
125
138
|
(n) => {
|
|
126
139
|
var a;
|
|
127
140
|
return ((a = n.info) == null ? void 0 : a.title) === "Drafts";
|
|
128
141
|
}
|
|
129
142
|
);
|
|
130
143
|
if (t) {
|
|
131
|
-
const n =
|
|
144
|
+
const n = Y.add({}, t.uid);
|
|
132
145
|
n && (w.push({
|
|
133
146
|
name: "request",
|
|
134
147
|
params: {
|
|
135
|
-
workspace: (e =
|
|
148
|
+
workspace: (e = l.value) == null ? void 0 : e.uid,
|
|
136
149
|
request: n.uid
|
|
137
150
|
}
|
|
138
|
-
}),
|
|
139
|
-
|
|
151
|
+
}), f(), b(() => {
|
|
152
|
+
p.hotKeys.emit({
|
|
140
153
|
focusAddressBar: new KeyboardEvent("keydown", { key: "l" })
|
|
141
154
|
});
|
|
142
155
|
}));
|
|
143
156
|
} else
|
|
144
|
-
|
|
157
|
+
f();
|
|
145
158
|
} else
|
|
146
|
-
|
|
147
|
-
}, g =
|
|
159
|
+
m.value = o.name;
|
|
160
|
+
}, g = v(), H = ({
|
|
148
161
|
commandName: o,
|
|
149
162
|
metaData: e
|
|
150
163
|
} = {}) => {
|
|
151
|
-
|
|
164
|
+
m.value = o ?? null, P.value = e, h.show(), b(() => {
|
|
152
165
|
var t;
|
|
153
166
|
return (t = g.value) == null ? void 0 : t.focus();
|
|
154
167
|
});
|
|
155
168
|
};
|
|
156
|
-
|
|
157
|
-
o &&
|
|
169
|
+
le(s, (o) => {
|
|
170
|
+
o && x.value.length > 0 && (i.value = 0);
|
|
158
171
|
});
|
|
159
|
-
const
|
|
160
|
-
if (!
|
|
172
|
+
const K = (o, e) => {
|
|
173
|
+
if (!h.open) return;
|
|
161
174
|
e.preventDefault();
|
|
162
|
-
const t = o === "up" ? -1 : 1, n =
|
|
163
|
-
|
|
164
|
-
var
|
|
165
|
-
const a = (
|
|
175
|
+
const t = o === "up" ? -1 : 1, n = x.value.length;
|
|
176
|
+
i.value = (i.value + t + n) % n, b(() => {
|
|
177
|
+
var W, V;
|
|
178
|
+
const a = (W = g.value) == null ? void 0 : W.closest(".custom-scroll");
|
|
166
179
|
if (!a) return;
|
|
167
|
-
if (
|
|
180
|
+
if (i.value === 0) {
|
|
168
181
|
a.scrollTop = 0;
|
|
169
182
|
return;
|
|
170
183
|
}
|
|
171
|
-
const
|
|
172
|
-
if (!
|
|
173
|
-
const
|
|
174
|
-
R <
|
|
184
|
+
const c = M.value[i.value];
|
|
185
|
+
if (!c) return;
|
|
186
|
+
const k = (((V = a.querySelector(".sticky")) == null ? void 0 : V.clientHeight) || 0) + 16, _ = 6, R = c.offsetTop, U = R + c.clientHeight, te = a.scrollTop + k, ne = a.scrollTop + a.clientHeight - _;
|
|
187
|
+
R < te ? a.scrollTop = R - k : U > ne && (a.scrollTop = U - a.clientHeight + _);
|
|
175
188
|
});
|
|
176
|
-
}, I =
|
|
177
|
-
() =>
|
|
178
|
-
),
|
|
179
|
-
!I.value ||
|
|
180
|
-
},
|
|
181
|
-
|
|
182
|
-
},
|
|
189
|
+
}, I = O(
|
|
190
|
+
() => x.value[i.value]
|
|
191
|
+
), ee = (o) => {
|
|
192
|
+
!I.value || m.value || (o.preventDefault(), o.stopPropagation(), B(I.value));
|
|
193
|
+
}, $ = (o) => {
|
|
194
|
+
h.open && o != null && o.closeModal && f();
|
|
195
|
+
}, oe = (o) => {
|
|
183
196
|
var e;
|
|
184
197
|
if (o.trim().toLowerCase().startsWith("curl")) {
|
|
185
|
-
|
|
198
|
+
p.commandPalette.emit({
|
|
186
199
|
commandName: "Import from cURL",
|
|
187
200
|
metaData: {
|
|
188
|
-
parsedCurl:
|
|
189
|
-
collectionUid: (e =
|
|
201
|
+
parsedCurl: ye(o),
|
|
202
|
+
collectionUid: (e = X.value) == null ? void 0 : e.uid
|
|
190
203
|
}
|
|
191
204
|
});
|
|
192
205
|
return;
|
|
193
206
|
}
|
|
194
207
|
s.value = o;
|
|
195
208
|
};
|
|
196
|
-
return
|
|
197
|
-
|
|
198
|
-
}),
|
|
199
|
-
|
|
200
|
-
}), (o, e) => (
|
|
201
|
-
open:
|
|
202
|
-
onClose: e[5] || (e[5] = (t) =>
|
|
209
|
+
return re(() => {
|
|
210
|
+
p.commandPalette.on(H), p.hotKeys.on($);
|
|
211
|
+
}), se(() => {
|
|
212
|
+
p.commandPalette.off(H), p.hotKeys.off($);
|
|
213
|
+
}), (o, e) => (r(), F(u(fe), {
|
|
214
|
+
open: u(h).open,
|
|
215
|
+
onClose: e[5] || (e[5] = (t) => f())
|
|
203
216
|
}, {
|
|
204
217
|
default: A(() => [
|
|
205
|
-
e[7] || (e[7] =
|
|
206
|
-
|
|
218
|
+
e[7] || (e[7] = C("div", { class: "commandmenu-overlay z-overlay" }, null, -1)),
|
|
219
|
+
y(u(ve), { class: "commandmenu z-overlay flex flex-col" }, {
|
|
207
220
|
default: A(() => [
|
|
208
|
-
|
|
221
|
+
y(u(Ce), { class: "sr-only" }, {
|
|
209
222
|
default: A(() => e[6] || (e[6] = [
|
|
210
|
-
|
|
223
|
+
G("API Client Command Menu")
|
|
211
224
|
])),
|
|
212
225
|
_: 1
|
|
213
226
|
}),
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
class: "hover:bg-b-3 text-c-3 active:text-c-1 absolute z-1
|
|
227
|
+
m.value ? (r(), d("div", Be, [
|
|
228
|
+
C("button", {
|
|
229
|
+
class: "hover:bg-b-3 text-c-3 active:text-c-1 absolute z-1 mt-[0.5px] rounded p-1.5",
|
|
217
230
|
type: "button",
|
|
218
|
-
onClick: e[3] || (e[3] = (t) =>
|
|
231
|
+
onClick: e[3] || (e[3] = (t) => m.value = null)
|
|
219
232
|
}, [
|
|
220
|
-
|
|
233
|
+
y(u(L), {
|
|
221
234
|
icon: "ChevronLeft",
|
|
222
235
|
size: "md",
|
|
223
236
|
thickness: "1.5"
|
|
224
237
|
})
|
|
225
238
|
]),
|
|
226
|
-
(
|
|
227
|
-
onBack: e[4] || (e[4] = (t) =>
|
|
228
|
-
onClose:
|
|
239
|
+
(r(), F(de(Ke[m.value]), pe(P.value ? { metaData: P.value } : {}, {
|
|
240
|
+
onBack: e[4] || (e[4] = (t) => Z(t)),
|
|
241
|
+
onClose: f
|
|
229
242
|
}), null, 16))
|
|
230
|
-
])) : (
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
243
|
+
])) : (r(), d("div", Te, [
|
|
244
|
+
C("div", De, [
|
|
245
|
+
C("label", Le, [
|
|
246
|
+
y(u(L), {
|
|
234
247
|
class: "text-c-2 mr-2.5",
|
|
235
248
|
icon: "Search",
|
|
236
249
|
size: "md",
|
|
237
250
|
thickness: "1.5"
|
|
238
251
|
})
|
|
239
252
|
]),
|
|
240
|
-
|
|
253
|
+
C("input", {
|
|
241
254
|
id: "commandmenu",
|
|
242
255
|
ref_key: "commandInputRef",
|
|
243
256
|
ref: g,
|
|
@@ -247,56 +260,56 @@ const Ae = {
|
|
|
247
260
|
placeholder: "Search commands...",
|
|
248
261
|
type: "text",
|
|
249
262
|
value: s.value,
|
|
250
|
-
onInput: e[0] || (e[0] = (t) =>
|
|
263
|
+
onInput: e[0] || (e[0] = (t) => oe(t.target.value)),
|
|
251
264
|
onKeydown: [
|
|
252
|
-
e[1] || (e[1] = S(T((t) =>
|
|
253
|
-
S(T(
|
|
254
|
-
e[2] || (e[2] = S(T((t) =>
|
|
265
|
+
e[1] || (e[1] = S(T((t) => K("down", t), ["stop"]), ["down"])),
|
|
266
|
+
S(T(ee, ["stop"]), ["enter"]),
|
|
267
|
+
e[2] || (e[2] = S(T((t) => K("up", t), ["stop"]), ["up"]))
|
|
255
268
|
]
|
|
256
|
-
}, null, 40,
|
|
269
|
+
}, null, 40, Ee)
|
|
257
270
|
]),
|
|
258
|
-
(
|
|
271
|
+
(r(), d(D, null, Q(q, (t) => (r(), d(D, {
|
|
259
272
|
key: t.label
|
|
260
273
|
}, [
|
|
261
|
-
|
|
274
|
+
ie(C("div", { class: "text-c-3 mt-2 mb-1 px-2 text-xs font-medium" }, j(t.label), 513), [
|
|
262
275
|
[
|
|
263
|
-
|
|
276
|
+
ce,
|
|
264
277
|
t.commands.filter(
|
|
265
278
|
(n) => n.name.toLowerCase().includes(s.value.toLowerCase())
|
|
266
279
|
).length > 0
|
|
267
280
|
]
|
|
268
281
|
]),
|
|
269
|
-
(
|
|
282
|
+
(r(!0), d(D, null, Q(t.commands.filter(
|
|
270
283
|
(n) => n.name.toLowerCase().includes(s.value.toLowerCase())
|
|
271
284
|
), (n) => {
|
|
272
285
|
var a;
|
|
273
|
-
return
|
|
286
|
+
return r(), d("div", {
|
|
274
287
|
key: n.name,
|
|
275
288
|
ref_for: !0,
|
|
276
|
-
ref: (
|
|
277
|
-
if (
|
|
278
|
-
const
|
|
289
|
+
ref: (c) => {
|
|
290
|
+
if (c) {
|
|
291
|
+
const k = x.value.findIndex(
|
|
279
292
|
(_) => _.name === n.name
|
|
280
293
|
);
|
|
281
|
-
|
|
294
|
+
k !== -1 && (M.value[k] = c);
|
|
282
295
|
}
|
|
283
296
|
},
|
|
284
|
-
class:
|
|
297
|
+
class: ue(["commandmenu-item hover:bg-b-2 flex cursor-pointer items-center rounded px-2 py-1.5 text-sm", {
|
|
285
298
|
"bg-b-2": n.name === ((a = I.value) == null ? void 0 : a.name)
|
|
286
299
|
}]),
|
|
287
|
-
onClick: (
|
|
300
|
+
onClick: (c) => B(n)
|
|
288
301
|
}, [
|
|
289
|
-
|
|
302
|
+
y(u(L), {
|
|
290
303
|
class: "text-c-2 mr-2.5",
|
|
291
304
|
icon: n.icon,
|
|
292
305
|
size: "md",
|
|
293
306
|
thickness: "1.5"
|
|
294
307
|
}, null, 8, ["icon"]),
|
|
295
|
-
|
|
296
|
-
], 10,
|
|
308
|
+
G(" " + j(n.name), 1)
|
|
309
|
+
], 10, qe);
|
|
297
310
|
}), 128))
|
|
298
311
|
], 64))), 64)),
|
|
299
|
-
|
|
312
|
+
x.value.length ? me("", !0) : (r(), d("div", Me, " No commands found "))
|
|
300
313
|
]))
|
|
301
314
|
]),
|
|
302
315
|
_: 1
|
|
@@ -308,5 +321,5 @@ const Ae = {
|
|
|
308
321
|
});
|
|
309
322
|
export {
|
|
310
323
|
Ke as PaletteComponents,
|
|
311
|
-
|
|
324
|
+
to as default
|
|
312
325
|
};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { defineComponent as t, createBlock as o, openBlock as a, resolveDynamicComponent as n, mergeProps as s, unref as l, withCtx as p, renderSlot as
|
|
2
|
-
import { useBindCx as
|
|
1
|
+
import { defineComponent as t, createBlock as o, openBlock as a, resolveDynamicComponent as n, mergeProps as s, unref as l, withCtx as p, renderSlot as b } from "vue";
|
|
2
|
+
import { useBindCx as d } from "@scalar/components";
|
|
3
3
|
const f = /* @__PURE__ */ t({
|
|
4
4
|
inheritAttrs: !1,
|
|
5
5
|
__name: "DataTableCell",
|
|
6
6
|
props: {
|
|
7
7
|
is: { default: "td" }
|
|
8
8
|
},
|
|
9
|
-
setup(
|
|
10
|
-
const { cx:
|
|
11
|
-
return (
|
|
12
|
-
l(
|
|
13
|
-
"box-content max-h-8 min-h-8 min-w-8 border-l-0 border-t border-b-0 border-r flex text-
|
|
9
|
+
setup(i) {
|
|
10
|
+
const { cx: r } = d();
|
|
11
|
+
return (e, m) => (a(), o(n(e.is), s(
|
|
12
|
+
l(r)(
|
|
13
|
+
"box-content max-h-8 min-h-8 min-w-8 border-l-0 border-t border-b-0 border-r flex text-base last:border-r-0 group-last:border-b-transparent p-0 m-0 relative"
|
|
14
14
|
),
|
|
15
15
|
{ class: "group-[.alert]:bg-b-alert group-[.error]:bg-b-danger" }
|
|
16
16
|
), {
|
|
17
17
|
default: p(() => [
|
|
18
|
-
|
|
18
|
+
b(e.$slots, "default")
|
|
19
19
|
]),
|
|
20
20
|
_: 3
|
|
21
21
|
}, 16));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTableInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/DataTableInput.vue"],"names":[],"mappings":"AAqMA,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;IAChC,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB,CAAC;AAsDJ,iBAAS,cAAc;WA6OT,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":"AAqMA,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;IAChC,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB,CAAC;AAsDJ,iBAAS,cAAc;WA6OT,OAAO,IAA6B;;yBAXrB,GAAG;yBACF,GAAG;sBACN,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAkE+sI,GAAG,8CAA8C,GAAG,yBAAyB,GAAG,6DAAmC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EApDl2I;AAoBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;;;cA1UN,OAAO;cAIP,OAAO;kBAQH,OAAO;2BATE,OAAO;6EA+UjC,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"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import t from "./DataTableInput.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import a from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const e = /* @__PURE__ */ a(t, [["__scopeId", "data-v-f7d71ae7"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
e as default
|
|
7
7
|
};
|
|
@@ -15,7 +15,7 @@ const B = { key: 0 }, D = { class: "flex flex-1 flex-col gap-1.5" }, F = ["for"]
|
|
|
15
15
|
},
|
|
16
16
|
setup(N) {
|
|
17
17
|
const { activeEnvVariables: f, activeEnvironment: k, activeWorkspace: s } = z(), i = v();
|
|
18
|
-
return (e, T) => (l(), r($, { class: "rounded-b-lg" }, c({
|
|
18
|
+
return (e, T) => (l(), r($, { class: "last:rounded-b-lg" }, c({
|
|
19
19
|
default: o(() => [
|
|
20
20
|
n("div", D, [
|
|
21
21
|
Object.keys(e.data).length > 0 && t(s) ? (l(), r(C, {
|
|
@@ -4,9 +4,9 @@ type __VLS_Props = {
|
|
|
4
4
|
isEditable?: boolean;
|
|
5
5
|
};
|
|
6
6
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
7
|
-
change: (value: "delete" | "get" | "
|
|
7
|
+
change: (value: "delete" | "get" | "options" | "connect" | "head" | "patch" | "post" | "put" | "trace") => any;
|
|
8
8
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
9
|
-
onChange?: (value: "delete" | "get" | "
|
|
9
|
+
onChange?: (value: "delete" | "get" | "options" | "connect" | "head" | "patch" | "post" | "put" | "trace") => any;
|
|
10
10
|
}>, {
|
|
11
11
|
isEditable: boolean;
|
|
12
12
|
isSquare: boolean;
|
|
@@ -10,9 +10,9 @@ import { useUrlPrefetcher as ae } from "./hooks/useUrlPrefetcher.js";
|
|
|
10
10
|
import de from "./ImportNowButton.vue.js";
|
|
11
11
|
import me from "./IntegrationLogo.vue.js";
|
|
12
12
|
import ue from "./PrefetchError.vue.js";
|
|
13
|
-
import {
|
|
14
|
-
import { isDocument as U } from "./utils/
|
|
15
|
-
import { isUrl as A } from "./utils/
|
|
13
|
+
import { getOpenApiVersion as T } from "./utils/get-openapi-version.js";
|
|
14
|
+
import { isDocument as U } from "./utils/is-document.js";
|
|
15
|
+
import { isUrl as A } from "./utils/is-url.js";
|
|
16
16
|
import fe from "./WorkspaceSelector.vue.js";
|
|
17
17
|
import { useActiveEntities as pe } from "../../store/active-entities.js";
|
|
18
18
|
import { useWorkspace as ve } from "../../store/store.js";
|
|
@@ -37,8 +37,8 @@ const he = ["innerHTML"], xe = { class: "relative flex h-screen flex-col justify
|
|
|
37
37
|
},
|
|
38
38
|
emits: ["importFinished"],
|
|
39
39
|
setup(C, { emit: P }) {
|
|
40
|
-
const s = C,
|
|
41
|
-
|
|
40
|
+
const s = C, V = P, { activeWorkspace: p } = pe(), { workspaceMutators: j, events: D } = ve(), { prefetchResult: n, prefetchUrl: w, resetPrefetchResult: S } = ae(), r = Z(), h = W(!0);
|
|
41
|
+
D.hotKeys.on(() => r.hide());
|
|
42
42
|
const z = a(() => {
|
|
43
43
|
try {
|
|
44
44
|
return se(
|
|
@@ -106,11 +106,11 @@ const he = ["innerHTML"], xe = { class: "relative flex h-screen flex-col justify
|
|
|
106
106
|
function q() {
|
|
107
107
|
var c;
|
|
108
108
|
const o = (u) => re.includes(u), t = s.integration && o(s.integration) ? s.integration : "default";
|
|
109
|
-
y.value &&
|
|
109
|
+
y.value && j.edit(
|
|
110
110
|
(c = p.value) == null ? void 0 : c.uid,
|
|
111
111
|
"themeId",
|
|
112
112
|
t
|
|
113
|
-
),
|
|
113
|
+
), V("importFinished");
|
|
114
114
|
}
|
|
115
115
|
return (o, t) => (l(), J(i(ee), {
|
|
116
116
|
size: "full",
|
|
@@ -10,7 +10,7 @@ const a = { class: "w-full text-center text-sm font-medium break-words" }, u = [
|
|
|
10
10
|
},
|
|
11
11
|
setup(p) {
|
|
12
12
|
return (t, e) => (o(), n("div", a, [
|
|
13
|
-
e[0] || (e[0] = r(" We couldn
|
|
13
|
+
e[0] || (e[0] = r(" We couldn't find an OpenAPI document at the provided URL. Please download and import the ")),
|
|
14
14
|
t.url && d(s)(t.url) ? (o(), n("a", {
|
|
15
15
|
key: 0,
|
|
16
16
|
href: t.url,
|
|
@@ -4,7 +4,7 @@ import { useToasts as I } from "@scalar/use-toasts";
|
|
|
4
4
|
import { useRouter as F } from "vue-router";
|
|
5
5
|
import { useActiveEntities as L } from "../../store/active-entities.js";
|
|
6
6
|
import { useWorkspace as P } from "../../store/store.js";
|
|
7
|
-
const R = { class: "flex w-[inherit] items-center text-
|
|
7
|
+
const R = { class: "flex w-[inherit] items-center text-base" }, U = { class: "m-0 flex items-center gap-1 text-sm font-medium" }, q = { class: "line-clamp-1 w-[calc(100%-10px)] text-left text-xs" }, G = { class: "overflow-hidden text-ellipsis" }, H = { class: "flex h-4 w-4 items-center justify-center" }, ee = /* @__PURE__ */ W({
|
|
8
8
|
__name: "WorkspaceSelector",
|
|
9
9
|
setup(J) {
|
|
10
10
|
const { activeWorkspace: i } = L(), { workspaces: g, workspaceMutators: C } = P(), { push: f } = F(), c = E(), { toast: x } = I(), l = D(""), y = (n) => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-openapi-version.d.ts","sourceRoot":"","sources":["../../../../src/components/ImportCollection/utils/get-openapi-version.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,kBAsCrD"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { parse as n } from "yaml";
|
|
2
|
+
import { isDocument as t } from "./is-document.js";
|
|
3
|
+
function o(e) {
|
|
4
|
+
if (!t(e))
|
|
5
|
+
return !1;
|
|
6
|
+
try {
|
|
7
|
+
const r = JSON.parse(e ?? "");
|
|
8
|
+
return typeof (r == null ? void 0 : r.openapi) == "string" ? `OpenAPI ${r.openapi} JSON` : typeof (r == null ? void 0 : r.swagger) == "string" ? `Swagger ${r.swagger} JSON` : !1;
|
|
9
|
+
} catch {
|
|
10
|
+
}
|
|
11
|
+
try {
|
|
12
|
+
const r = n(e ?? "");
|
|
13
|
+
return typeof (r == null ? void 0 : r.openapi) == "string" ? `OpenAPI ${r.openapi} YAML` : typeof (r == null ? void 0 : r.swagger) == "string" ? `Swagger ${r.swagger} YAML` : !1;
|
|
14
|
+
} catch {
|
|
15
|
+
}
|
|
16
|
+
return !1;
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
o as getOpenApiVersion
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-openapi-version.test.d.ts","sourceRoot":"","sources":["../../../../src/components/ImportCollection/utils/get-openapi-version.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/** Checks whether the given string could be an OpenAPI document */
|
|
2
|
-
export declare function isDocument(input: string | null): boolean
|
|
3
|
-
//# sourceMappingURL=
|
|
2
|
+
export declare function isDocument(input: string | null): boolean;
|
|
3
|
+
//# sourceMappingURL=is-document.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-document.d.ts","sourceRoot":"","sources":["../../../../src/components/ImportCollection/utils/is-document.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAcxD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-document.test.d.ts","sourceRoot":"","sources":["../../../../src/components/ImportCollection/utils/is-document.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-url.d.ts","sourceRoot":"","sources":["../../../../src/components/ImportCollection/utils/is-url.ts"],"names":[],"mappings":"AAAA;;IAEI;AACJ,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAgBnD"}
|