@scalar/api-client 2.5.31 → 2.5.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -0
- package/dist/components/AddressBar/AddressBar.vue.js +1 -1
- package/dist/components/AddressBar/AddressBar.vue2.js +120 -128
- package/dist/components/AddressBar/AddressBarHistory.vue.js +1 -1
- package/dist/components/AddressBar/AddressBarHistory.vue2.js +57 -63
- package/dist/components/CodeInput/CodeInput.vue.js +2 -2
- package/dist/components/CodeInput/CodeInput.vue2.js +143 -150
- package/dist/components/CodeInput/codeVariableWidget.js +70 -75
- package/dist/components/CommandPalette/CommandActionInput.vue.js +17 -19
- package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +26 -27
- package/dist/components/CommandPalette/CommandPaletteExample.vue.js +53 -55
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +129 -133
- package/dist/components/CommandPalette/CommandPaletteImportCurl.vue.js +1 -1
- package/dist/components/CommandPalette/CommandPaletteImportCurl.vue2.js +84 -98
- package/dist/components/CommandPalette/CommandPaletteServer.vue.js +64 -74
- package/dist/components/CommandPalette/CommandPaletteTag.vue.js +5 -11
- package/dist/components/CommandPalette/TheCommandPalette.vue.js +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue2.js +164 -183
- package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableInput.vue.js +4 -4
- package/dist/components/DataTable/DataTableInput.vue2.js +31 -31
- package/dist/components/DataTable/DataTableInputSelect.vue.js +1 -2
- package/dist/components/EmptyState.vue.js +1 -1
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +75 -84
- package/dist/components/Form/LabelInput.vue.js +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue.js +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue2.js +11 -11
- package/dist/components/ImportCollection/DropEventListener.vue.js +42 -44
- package/dist/components/ImportCollection/ImportCollectionListener.vue.js +22 -23
- package/dist/components/ImportCollection/ImportCollectionModal.vue.js +141 -149
- package/dist/components/ImportCollection/ImportCollectionModal.vue3.js +1 -1
- package/dist/components/ImportCollection/ImportNowButton.vue.js +22 -23
- package/dist/components/ImportCollection/IntegrationLogo.vue.js +12 -13
- package/dist/components/ImportCollection/PasteEventListener.vue.js +11 -12
- package/dist/components/ImportCollection/WorkspaceSelector.vue.js +69 -76
- package/dist/components/ImportCollection/utils/get-openapi-version.js +8 -8
- package/dist/components/ImportCollection/utils/import-collection.js +14 -14
- package/dist/components/OpenApiClientButton.vue.js +1 -1
- package/dist/components/OpenApiClientButton.vue2.js +10 -10
- package/dist/components/ScalarAsciiArt.vue.js +1 -1
- package/dist/components/ScalarAsciiArt.vue2.js +19 -22
- package/dist/components/Search/useSearch.js +51 -61
- package/dist/components/SectionFilter.vue.js +1 -1
- package/dist/components/SectionFilter.vue2.js +26 -29
- package/dist/components/Server/ServerDropdown.vue.js +70 -96
- package/dist/components/Server/ServerDropdownItem.vue.js +1 -1
- package/dist/components/Server/ServerDropdownItem.vue2.js +57 -67
- package/dist/components/Server/ServerSelector.vue.js +44 -55
- package/dist/components/Server/ServerVariablesForm.vue.js +36 -42
- package/dist/components/Server/ServerVariablesSelect.vue.js +6 -6
- package/dist/components/SideNav/DownloadAppButton.vue.js +1 -1
- package/dist/components/SideNav/SideNav.vue.js +68 -74
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.js +1 -1
- package/dist/components/Sidebar/Sidebar.vue.js +1 -1
- package/dist/components/Sidebar/SidebarListElement.vue.js +2 -2
- package/dist/components/TopNav/TopNav.vue.js +107 -122
- package/dist/components/TopNav/TopNavItem.vue.js +1 -1
- package/dist/hooks/useFileDialog.js +12 -12
- package/dist/hooks/useResponseBody.js +14 -16
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/layouts/App/ApiClientApp.vue.js +50 -56
- package/dist/layouts/App/ApiClientApp.vue3.js +1 -1
- package/dist/layouts/App/create-api-client-app.js +19 -20
- package/dist/layouts/App/index.js +1 -1
- package/dist/layouts/Modal/ApiClientModal.vue.js +1 -1
- package/dist/layouts/Modal/ApiClientModal.vue2.js +18 -21
- package/dist/layouts/Web/ApiClientWeb.vue.js +45 -51
- package/dist/layouts/Web/ApiClientWeb.vue3.js +1 -1
- package/dist/layouts/Web/create-api-client-web.js +19 -20
- package/dist/layouts/Web/index.js +1 -1
- package/dist/libs/create-client.js +102 -109
- package/dist/libs/env-helpers.js +3 -3
- package/dist/libs/event-bus.js +15 -15
- package/dist/libs/extractAttachmentFilename.js +5 -6
- package/dist/libs/find-request.js +9 -10
- package/dist/libs/get-request-uid-by-path-method.js +12 -12
- package/dist/libs/getOpenApiDocumentDetails.js +7 -7
- package/dist/libs/importers/curl.js +3 -3
- package/dist/libs/normalize-headers.js +9 -10
- package/dist/libs/postman.js +15 -17
- package/dist/libs/send-request/build-request-security.js +9 -10
- package/dist/libs/send-request/create-fetch-body.js +11 -12
- package/dist/libs/send-request/create-fetch-query-params.js +13 -13
- package/dist/libs/send-request/create-request-operation.js +83 -84
- package/dist/libs/send-request/decode-buffer.d.ts.map +1 -1
- package/dist/libs/send-request/set-request-cookies.js +12 -12
- package/dist/libs/string-template.js +21 -21
- package/dist/libs/validate-parameters.js +5 -8
- package/dist/plugins/plugin-manager.js +11 -17
- package/dist/store/active-entities.js +90 -117
- package/dist/store/collections.js +41 -42
- package/dist/store/import-spec.js +25 -26
- package/dist/store/request-example.js +20 -24
- package/dist/store/requests.js +63 -81
- package/dist/store/router-params.js +7 -7
- package/dist/store/security-schemes.js +35 -36
- package/dist/store/store.js +2 -2
- package/dist/store/tags.js +20 -21
- package/dist/style.css +1 -1
- package/dist/views/Collection/Collection.vue2.js +21 -22
- package/dist/views/Collection/CollectionAuthentication.vue.js +1 -1
- package/dist/views/Collection/CollectionAuthentication.vue2.js +43 -47
- package/dist/views/Collection/CollectionEnvironment.vue.js +1 -1
- package/dist/views/Collection/CollectionEnvironment.vue2.js +196 -207
- package/dist/views/Collection/CollectionInfoForm.vue.js +1 -1
- package/dist/views/Collection/CollectionInfoForm.vue2.js +34 -41
- package/dist/views/Collection/CollectionNavigation.vue.js +116 -125
- package/dist/views/Collection/CollectionOverview.vue2.js +22 -25
- package/dist/views/Collection/CollectionServerForm.vue.js +39 -45
- package/dist/views/Collection/CollectionServers.vue2.js +88 -98
- package/dist/views/Collection/CollectionSettings.vue.js +1 -1
- package/dist/views/Collection/CollectionSettings.vue2.js +101 -108
- package/dist/views/Collection/components/EnvironmentForm.vue.js +1 -1
- package/dist/views/Collection/components/EnvironmentForm.vue2.js +141 -145
- package/dist/views/Collection/components/MarkdownInput.vue.js +1 -1
- package/dist/views/Collection/components/MarkdownInput.vue2.js +1 -2
- package/dist/views/Components/CodeSnippet/CodeSnippet.vue.js +15 -15
- package/dist/views/Components/CodeSnippet/helpers/convert-to-har-request.js +15 -16
- package/dist/views/Components/CodeSnippet/helpers/get-har-request.js +61 -64
- package/dist/views/Components/CodeSnippet/helpers/get-snippet.js +9 -10
- package/dist/views/Cookies/CookieModal.vue.js +1 -1
- package/dist/views/Cookies/Cookies.vue2.js +90 -93
- package/dist/views/Environment/Environment.vue2.js +267 -295
- package/dist/views/Environment/EnvironmentModal.vue.js +63 -70
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +38 -42
- package/dist/views/Request/Request.vue.js +1 -1
- package/dist/views/Request/Request.vue2.js +60 -67
- package/dist/views/Request/RequestRoot.vue.js +1 -1
- package/dist/views/Request/RequestRoot.vue2.js +78 -89
- package/dist/views/Request/RequestSection/RequestAuth/DeleteRequestAuthModal.vue.js +37 -44
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +44 -45
- package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.js +111 -127
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +120 -139
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.js +97 -97
- package/dist/views/Request/RequestSection/RequestBody.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue2.js +287 -310
- package/dist/views/Request/RequestSection/RequestCodeExample.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestCodeExample.vue2.js +86 -94
- package/dist/views/Request/RequestSection/RequestParams.vue.js +37 -38
- package/dist/views/Request/RequestSection/RequestPathParams.vue.js +36 -38
- package/dist/views/Request/RequestSection/RequestSection.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestSection.vue2.js +28 -31
- package/dist/views/Request/RequestSection/RequestTable.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestTable.vue2.js +49 -52
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue.js +1 -1
- package/dist/views/Request/RequestSection/helpers/filter-security-requirements.js +16 -16
- package/dist/views/Request/RequestSection/helpers/getting-started.js +7 -11
- package/dist/views/Request/RequestSection/helpers/update-scheme.js +7 -8
- package/dist/views/Request/RequestSidebar.vue.js +1 -1
- package/dist/views/Request/RequestSidebar.vue2.js +199 -211
- package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
- package/dist/views/Request/RequestSidebarItem.vue2.js +332 -349
- package/dist/views/Request/RequestSidebarItemMenu.vue.js +1 -1
- package/dist/views/Request/RequestSidebarItemMenu.vue2.js +210 -240
- package/dist/views/Request/RequestSubpageHeader.vue.js +1 -1
- package/dist/views/Request/ResponseSection/RequestHeaders.vue.js +38 -41
- package/dist/views/Request/ResponseSection/ResponseBody.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseBody.vue2.js +58 -64
- package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.js +1 -2
- package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue2.js +20 -23
- package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue3.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +29 -30
- package/dist/views/Request/ResponseSection/ResponseHeaders.vue.js +38 -41
- package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.js +28 -29
- package/dist/views/Request/ResponseSection/ResponseSection.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +128 -140
- package/dist/views/Request/components/WorkspaceDropdown.vue.js +116 -124
- package/dist/views/Request/consts/mediaTypes.js +2 -3
- package/dist/views/Request/handle-drag.js +24 -28
- package/dist/views/Request/hooks/useOpenApiWatcher.js +26 -33
- package/dist/views/Request/libs/auth.js +37 -43
- package/dist/views/Request/libs/oauth2.js +30 -32
- package/dist/views/Request/libs/watch-mode.js +100 -103
- package/dist/views/Settings/SettingsGeneral.vue.js +206 -236
- package/package.json +22 -22
- package/dist/components/AddressBar/AddressBar.vue3.js +0 -4
- package/dist/components/AddressBar/AddressBarHistory.vue3.js +0 -4
- package/dist/components/CodeInput/CodeInput.vue3.js +0 -4
- package/dist/components/CodeInput/CodeInput.vue4.js +0 -4
- package/dist/components/CommandPalette/CommandPaletteImportCurl.vue3.js +0 -4
- package/dist/components/CommandPalette/TheCommandPalette.vue3.js +0 -4
- package/dist/components/DataTable/DataTableInput.vue3.js +0 -4
- package/dist/components/EmptyState.vue3.js +0 -4
- package/dist/components/Form/LabelInput.vue3.js +0 -4
- package/dist/components/HttpMethod/HttpMethod.vue3.js +0 -4
- package/dist/components/ImportCollection/ImportCollectionModal.vue2.js +0 -4
- package/dist/components/OpenApiClientButton.vue3.js +0 -4
- package/dist/components/ScalarAsciiArt.vue3.js +0 -4
- package/dist/components/SectionFilter.vue3.js +0 -4
- package/dist/components/Server/ServerDropdownItem.vue3.js +0 -4
- package/dist/components/SideNav/DownloadAppButton.vue3.js +0 -4
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue3.js +0 -4
- package/dist/components/Sidebar/Sidebar.vue3.js +0 -4
- package/dist/components/Sidebar/SidebarListElement.vue3.js +0 -4
- package/dist/components/Sidebar/SidebarListElement.vue4.js +0 -4
- package/dist/components/TopNav/TopNavItem.vue3.js +0 -4
- package/dist/layouts/App/ApiClientApp.vue2.js +0 -4
- package/dist/layouts/Modal/ApiClientModal.vue3.js +0 -4
- package/dist/layouts/Web/ApiClientWeb.vue2.js +0 -4
- package/dist/style.css.js +0 -4
- package/dist/views/Collection/CollectionAuthentication.vue3.js +0 -4
- package/dist/views/Collection/CollectionEnvironment.vue3.js +0 -4
- package/dist/views/Collection/CollectionInfoForm.vue3.js +0 -4
- package/dist/views/Collection/CollectionSettings.vue3.js +0 -4
- package/dist/views/Collection/components/EnvironmentForm.vue3.js +0 -4
- package/dist/views/Collection/components/MarkdownInput.vue3.js +0 -4
- package/dist/views/Cookies/CookieModal.vue3.js +0 -4
- package/dist/views/Request/Request.vue3.js +0 -4
- package/dist/views/Request/RequestRoot.vue3.js +0 -4
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue3.js +0 -4
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue3.js +0 -4
- package/dist/views/Request/RequestSection/RequestBody.vue3.js +0 -4
- package/dist/views/Request/RequestSection/RequestCodeExample.vue3.js +0 -4
- package/dist/views/Request/RequestSection/RequestSection.vue3.js +0 -4
- package/dist/views/Request/RequestSection/RequestTable.vue3.js +0 -4
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue3.js +0 -4
- package/dist/views/Request/RequestSidebar.vue3.js +0 -4
- package/dist/views/Request/RequestSidebarItem.vue3.js +0 -4
- package/dist/views/Request/RequestSidebarItem.vue4.js +0 -4
- package/dist/views/Request/RequestSidebarItemMenu.vue3.js +0 -4
- package/dist/views/Request/RequestSubpageHeader.vue3.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseBody.vue3.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue3.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue3.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue2.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue3.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue3.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseSection.vue3.js +0 -4
|
@@ -1,133 +1,126 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useModal as
|
|
3
|
-
import { useToasts as
|
|
4
|
-
import { useRouter as
|
|
5
|
-
import { useActiveEntities as
|
|
6
|
-
import { useWorkspace as
|
|
7
|
-
const
|
|
1
|
+
import { defineComponent as S, ref as W, createElementBlock as x, openBlock as d, Fragment as w, createElementVNode as t, createVNode as s, unref as e, withCtx as o, toDisplayString as k, renderList as D, createBlock as z, withModifiers as v, normalizeClass as N, withDirectives as M, vModelText as B, createTextVNode as V } from "vue";
|
|
2
|
+
import { useModal as j, ScalarDropdown as E, ScalarButton as h, ScalarIcon as m, ScalarDropdownItem as _, ScalarDropdownDivider as T, ScalarModal as $ } from "@scalar/components";
|
|
3
|
+
import { useToasts as A } from "@scalar/use-toasts";
|
|
4
|
+
import { useRouter as I } from "vue-router";
|
|
5
|
+
import { useActiveEntities as F } from "../../store/active-entities.js";
|
|
6
|
+
import { useWorkspace as L } from "../../store/store.js";
|
|
7
|
+
const P = { class: "flex w-[inherit] items-center text-base" }, R = { class: "m-0 flex items-center gap-1 text-sm font-medium" }, U = { class: "line-clamp-1 w-[calc(100%-10px)] text-left text-xs" }, q = { class: "overflow-hidden text-ellipsis" }, G = { class: "flex h-4 w-4 items-center justify-center" }, ee = /* @__PURE__ */ S({
|
|
8
8
|
__name: "WorkspaceSelector",
|
|
9
|
-
setup(
|
|
10
|
-
const { activeWorkspace: i } =
|
|
11
|
-
|
|
12
|
-
n !== ((t = i.value) == null ? void 0 : t.uid) && f({
|
|
9
|
+
setup(H) {
|
|
10
|
+
const { activeWorkspace: i } = F(), { workspaces: b, workspaceMutators: g } = L(), { push: u } = I(), c = j(), { toast: f } = A(), r = W(""), C = (l) => {
|
|
11
|
+
l !== i.value?.uid && u({
|
|
13
12
|
name: "workspace",
|
|
14
13
|
params: {
|
|
15
|
-
workspace:
|
|
14
|
+
workspace: l
|
|
16
15
|
}
|
|
17
16
|
});
|
|
18
|
-
},
|
|
19
|
-
if (!
|
|
20
|
-
|
|
17
|
+
}, y = () => {
|
|
18
|
+
if (!r.value.trim()) {
|
|
19
|
+
f("Please enter a name before creating a workspace.", "error");
|
|
21
20
|
return;
|
|
22
21
|
}
|
|
23
|
-
const
|
|
24
|
-
name:
|
|
22
|
+
const l = g.add({
|
|
23
|
+
name: r.value
|
|
25
24
|
});
|
|
26
|
-
|
|
25
|
+
f(`Created new workspace '${l.name}'`), u({
|
|
27
26
|
name: "workspace",
|
|
28
27
|
params: {
|
|
29
|
-
workspace:
|
|
28
|
+
workspace: l.uid
|
|
30
29
|
}
|
|
31
|
-
}),
|
|
30
|
+
}), r.value = "", c.hide();
|
|
32
31
|
};
|
|
33
|
-
return (
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
items:
|
|
37
|
-
(
|
|
32
|
+
return (l, a) => (d(), x(w, null, [
|
|
33
|
+
t("div", P, [
|
|
34
|
+
s(e(E), null, {
|
|
35
|
+
items: o(() => [
|
|
36
|
+
(d(!0), x(w, null, D(e(b), (n, p) => (d(), z(e(_), {
|
|
38
37
|
key: p,
|
|
39
38
|
class: "group/item flex w-full items-center gap-1.5 overflow-hidden text-ellipsis whitespace-nowrap",
|
|
40
|
-
onClick:
|
|
39
|
+
onClick: v((J) => C(p), ["stop"])
|
|
41
40
|
}, {
|
|
42
|
-
default:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
s("span", G, v(o.name), 1)
|
|
58
|
-
];
|
|
59
|
-
}),
|
|
41
|
+
default: o(() => [
|
|
42
|
+
t("div", {
|
|
43
|
+
class: N([
|
|
44
|
+
"flex h-4 w-4 items-center justify-center rounded-full p-[3px]",
|
|
45
|
+
e(i)?.uid === p ? "bg-c-accent text-b-1" : "shadow-border text-transparent"
|
|
46
|
+
])
|
|
47
|
+
}, [
|
|
48
|
+
s(e(m), {
|
|
49
|
+
class: "size-2.5",
|
|
50
|
+
icon: "Checkmark",
|
|
51
|
+
thickness: "3"
|
|
52
|
+
})
|
|
53
|
+
], 2),
|
|
54
|
+
t("span", q, k(n.name), 1)
|
|
55
|
+
]),
|
|
60
56
|
_: 2
|
|
61
57
|
}, 1032, ["onClick"]))), 128)),
|
|
62
|
-
|
|
63
|
-
|
|
58
|
+
s(e(T)),
|
|
59
|
+
s(e(_), {
|
|
64
60
|
class: "flex items-center gap-1.5",
|
|
65
|
-
onClick:
|
|
61
|
+
onClick: a[0] || (a[0] = (n) => e(c).show())
|
|
66
62
|
}, {
|
|
67
|
-
default:
|
|
68
|
-
|
|
69
|
-
|
|
63
|
+
default: o(() => [
|
|
64
|
+
t("div", G, [
|
|
65
|
+
s(e(m), {
|
|
70
66
|
icon: "Add",
|
|
71
67
|
size: "sm"
|
|
72
68
|
})
|
|
73
69
|
]),
|
|
74
|
-
|
|
70
|
+
a[2] || (a[2] = t("span", null, "New Workspace", -1))
|
|
75
71
|
]),
|
|
76
72
|
_: 1,
|
|
77
73
|
__: [2]
|
|
78
74
|
})
|
|
79
75
|
]),
|
|
80
|
-
default:
|
|
81
|
-
|
|
76
|
+
default: o(() => [
|
|
77
|
+
s(e(h), {
|
|
82
78
|
class: "text-c-1 hover:bg-b-2 text-c-3 line-clamp-1 h-full w-fit justify-start px-1.5 py-1 font-normal",
|
|
83
79
|
fullWidth: "",
|
|
84
80
|
variant: "ghost"
|
|
85
81
|
}, {
|
|
86
|
-
default:
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
s(
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
])
|
|
96
|
-
];
|
|
97
|
-
}),
|
|
82
|
+
default: o(() => [
|
|
83
|
+
t("div", R, [
|
|
84
|
+
t("h2", U, k(e(i)?.name), 1),
|
|
85
|
+
s(e(m), {
|
|
86
|
+
icon: "ChevronDown",
|
|
87
|
+
size: "md"
|
|
88
|
+
})
|
|
89
|
+
])
|
|
90
|
+
]),
|
|
98
91
|
_: 1
|
|
99
92
|
})
|
|
100
93
|
]),
|
|
101
94
|
_: 1
|
|
102
95
|
})
|
|
103
96
|
]),
|
|
104
|
-
|
|
97
|
+
s(e($), {
|
|
105
98
|
bodyClass: "m-0 p-1 rounded-lg border-t-0",
|
|
106
99
|
class: "z-overlay absolute",
|
|
107
100
|
size: "xxs",
|
|
108
101
|
state: e(c),
|
|
109
102
|
variant: "form"
|
|
110
103
|
}, {
|
|
111
|
-
default:
|
|
112
|
-
|
|
104
|
+
default: o(() => [
|
|
105
|
+
t("form", {
|
|
113
106
|
class: "flex gap-1",
|
|
114
|
-
onSubmit:
|
|
107
|
+
onSubmit: v(y, ["prevent"])
|
|
115
108
|
}, [
|
|
116
|
-
|
|
117
|
-
"onUpdate:modelValue":
|
|
109
|
+
M(t("input", {
|
|
110
|
+
"onUpdate:modelValue": a[1] || (a[1] = (n) => r.value = n),
|
|
118
111
|
class: "min-h-8 w-full flex-1 border-none p-1.5 text-sm outline-none",
|
|
119
112
|
placeholder: "New Workspace",
|
|
120
113
|
type: "text"
|
|
121
114
|
}, null, 512), [
|
|
122
|
-
[
|
|
115
|
+
[B, r.value]
|
|
123
116
|
]),
|
|
124
|
-
|
|
117
|
+
s(e(h), {
|
|
125
118
|
class: "max-h-8 p-0 px-3 text-xs",
|
|
126
|
-
disabled: !
|
|
119
|
+
disabled: !r.value.trim(),
|
|
127
120
|
type: "submit"
|
|
128
121
|
}, {
|
|
129
|
-
default:
|
|
130
|
-
|
|
122
|
+
default: o(() => a[3] || (a[3] = [
|
|
123
|
+
V(" Continue ")
|
|
131
124
|
])),
|
|
132
125
|
_: 1,
|
|
133
126
|
__: [3]
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { parse as
|
|
2
|
-
import { isDocument as
|
|
3
|
-
function
|
|
4
|
-
if (!
|
|
1
|
+
import { parse as t } from "yaml";
|
|
2
|
+
import { isDocument as n } from "./is-document.js";
|
|
3
|
+
function a(e) {
|
|
4
|
+
if (!n(e))
|
|
5
5
|
return !1;
|
|
6
6
|
try {
|
|
7
7
|
const r = JSON.parse(e ?? "");
|
|
8
|
-
return typeof
|
|
8
|
+
return typeof r?.openapi == "string" ? `OpenAPI ${r.openapi} JSON` : typeof r?.swagger == "string" ? `Swagger ${r.swagger} JSON` : !1;
|
|
9
9
|
} catch {
|
|
10
10
|
}
|
|
11
11
|
try {
|
|
12
|
-
const r =
|
|
13
|
-
return typeof
|
|
12
|
+
const r = t(e ?? "");
|
|
13
|
+
return typeof r?.openapi == "string" ? `OpenAPI ${r.openapi} YAML` : typeof r?.swagger == "string" ? `Swagger ${r.swagger} YAML` : !1;
|
|
14
14
|
} catch {
|
|
15
15
|
}
|
|
16
16
|
return !1;
|
|
17
17
|
}
|
|
18
18
|
export {
|
|
19
|
-
|
|
19
|
+
a as getOpenApiVersion
|
|
20
20
|
};
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { isUrl as
|
|
2
|
-
async function
|
|
3
|
-
store:
|
|
1
|
+
import { isUrl as c } from "./is-url.js";
|
|
2
|
+
async function y({
|
|
3
|
+
store: o,
|
|
4
4
|
workspace: i,
|
|
5
|
-
source:
|
|
5
|
+
source: t,
|
|
6
6
|
watchMode: n,
|
|
7
|
-
onSuccess:
|
|
8
|
-
onError:
|
|
7
|
+
onSuccess: l,
|
|
8
|
+
onError: e
|
|
9
9
|
}) {
|
|
10
10
|
try {
|
|
11
|
-
if (
|
|
12
|
-
if (
|
|
13
|
-
const [
|
|
11
|
+
if (t && i) {
|
|
12
|
+
if (c(t)) {
|
|
13
|
+
const [m, p] = await o.importSpecFromUrl(t, i.uid, {
|
|
14
14
|
proxyUrl: i.proxyUrl,
|
|
15
15
|
watchMode: n
|
|
16
16
|
});
|
|
17
|
-
|
|
17
|
+
m || l(p?.collection);
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
|
-
const r = await
|
|
21
|
-
|
|
20
|
+
const r = await o.importSpecFile(t, i.uid);
|
|
21
|
+
l(r?.collection);
|
|
22
22
|
}
|
|
23
23
|
} catch (r) {
|
|
24
|
-
|
|
24
|
+
e(r);
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
export {
|
|
28
|
-
|
|
28
|
+
y as importCollection
|
|
29
29
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as i, computed as s, createElementBlock as
|
|
1
|
+
import { defineComponent as i, computed as s, createElementBlock as l, createCommentVNode as m, openBlock as u, createVNode as d, createTextVNode as f, unref as g } from "vue";
|
|
2
2
|
import { ScalarIcon as h } from "@scalar/components";
|
|
3
3
|
import { makeUrlAbsolute as p } from "@scalar/oas-utils/helpers";
|
|
4
4
|
const k = ["href"], L = /* @__PURE__ */ i({
|
|
@@ -10,25 +10,25 @@ const k = ["href"], L = /* @__PURE__ */ i({
|
|
|
10
10
|
integration: {},
|
|
11
11
|
url: {}
|
|
12
12
|
},
|
|
13
|
-
setup(
|
|
13
|
+
setup(t) {
|
|
14
14
|
const c = s(() => {
|
|
15
|
-
const n =
|
|
15
|
+
const n = t.url ?? (typeof window < "u" ? window.location.href : void 0);
|
|
16
16
|
if (!n)
|
|
17
17
|
return;
|
|
18
|
-
const
|
|
19
|
-
if (!
|
|
18
|
+
const o = p(n);
|
|
19
|
+
if (!o?.length)
|
|
20
20
|
return;
|
|
21
21
|
const e = new URL(
|
|
22
|
-
|
|
22
|
+
t.isDevelopment ? "http://localhost:5065" : "https://client.scalar.com"
|
|
23
23
|
);
|
|
24
|
-
if (e.searchParams.set("url",
|
|
24
|
+
if (e.searchParams.set("url", o), t.integration !== null && e.searchParams.set("integration", t.integration ?? "vue"), e.searchParams.set("utm_source", "api-reference"), e.searchParams.set("utm_medium", "button"), e.searchParams.set("utm_campaign", t.buttonSource), t.source === "gitbook") {
|
|
25
25
|
e.searchParams.set("utm_source", "gitbook");
|
|
26
26
|
const r = document.querySelector("img.dark\\:block[alt='Logo']"), a = document.querySelector("img.dark\\:hidden[alt='Logo']");
|
|
27
27
|
r && r instanceof HTMLImageElement && e.searchParams.set("dark_logo", encodeURIComponent(r.src)), a && a instanceof HTMLImageElement && e.searchParams.set("light_logo", encodeURIComponent(a.src));
|
|
28
28
|
}
|
|
29
29
|
return e.toString();
|
|
30
30
|
});
|
|
31
|
-
return (n,
|
|
31
|
+
return (n, o) => c.value ? (u(), l("a", {
|
|
32
32
|
key: 0,
|
|
33
33
|
class: "open-api-client-button",
|
|
34
34
|
href: c.value,
|
|
@@ -39,8 +39,8 @@ const k = ["href"], L = /* @__PURE__ */ i({
|
|
|
39
39
|
size: "xs",
|
|
40
40
|
thickness: "2.5"
|
|
41
41
|
}),
|
|
42
|
-
|
|
43
|
-
], 8, k)) :
|
|
42
|
+
o[0] || (o[0] = f(" Open API Client "))
|
|
43
|
+
], 8, k)) : m("", !0);
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
46
|
export {
|
|
@@ -1,40 +1,37 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as d, computed as g, createElementBlock as a, openBlock as i, normalizeClass as h, Fragment as f, renderList as y, normalizeStyle as r, createElementVNode as v, toDisplayString as x } from "vue";
|
|
2
|
+
const c = 500, o = 100, k = /* @__PURE__ */ d({
|
|
3
3
|
__name: "ScalarAsciiArt",
|
|
4
4
|
props: {
|
|
5
5
|
art: {},
|
|
6
6
|
animate: { type: Boolean }
|
|
7
7
|
},
|
|
8
|
-
setup(
|
|
9
|
-
const
|
|
10
|
-
`)),
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
return (a, s) => (o(), i("div", {
|
|
8
|
+
setup(m) {
|
|
9
|
+
const p = m, e = g(() => p.art.split(`
|
|
10
|
+
`)), u = (t, l) => ({
|
|
11
|
+
animationDuration: `${t * o}ms, ${c}ms`,
|
|
12
|
+
animationTimingFunction: `steps(${t}), step-end`,
|
|
13
|
+
animationDelay: `${l * o}ms, 0ms`,
|
|
14
|
+
animationIterationCount: `1, ${((e.value?.length ?? 0) + (e.value?.[e.value?.length - 1]?.length ?? 0) + 5) * o / c}`
|
|
15
|
+
});
|
|
16
|
+
return (t, l) => (i(), a("div", {
|
|
20
17
|
"aria-hidden": "true",
|
|
21
|
-
class:
|
|
18
|
+
class: h(["ascii-art font-code flex flex-col items-start text-[6px] leading-[7px]", { "ascii-art-animate": t.animate }]),
|
|
22
19
|
role: "presentation",
|
|
23
20
|
inert: ""
|
|
24
21
|
}, [
|
|
25
|
-
(
|
|
26
|
-
key:
|
|
22
|
+
(i(!0), a(f, null, y(e.value, (n, s) => (i(), a("span", {
|
|
23
|
+
key: s,
|
|
27
24
|
class: "inline-block",
|
|
28
|
-
style:
|
|
25
|
+
style: r({ width: `calc(${n.length + 1}ch)` })
|
|
29
26
|
}, [
|
|
30
|
-
|
|
27
|
+
v("span", {
|
|
31
28
|
class: "inline-block whitespace-pre overflow-hidden",
|
|
32
|
-
style:
|
|
33
|
-
},
|
|
29
|
+
style: r(u(n.length, s))
|
|
30
|
+
}, x(n), 5)
|
|
34
31
|
], 4))), 128))
|
|
35
32
|
], 2));
|
|
36
33
|
}
|
|
37
34
|
});
|
|
38
35
|
export {
|
|
39
|
-
|
|
36
|
+
k as default
|
|
40
37
|
};
|
|
@@ -1,88 +1,78 @@
|
|
|
1
|
-
import { PathId as
|
|
2
|
-
import { useActiveEntities as
|
|
3
|
-
import { isDefined as
|
|
4
|
-
import
|
|
5
|
-
import { ref as
|
|
6
|
-
import { useRouter as
|
|
7
|
-
import { useWorkspace as
|
|
8
|
-
function
|
|
9
|
-
const
|
|
1
|
+
import { PathId as k } from "../../routes.js";
|
|
2
|
+
import { useActiveEntities as F } from "../../store/active-entities.js";
|
|
3
|
+
import { isDefined as I, shouldIgnoreEntity as S } from "@scalar/oas-utils/helpers";
|
|
4
|
+
import H from "fuse.js";
|
|
5
|
+
import { ref as l, watch as y, computed as T, nextTick as L } from "vue";
|
|
6
|
+
import { useRouter as M } from "vue-router";
|
|
7
|
+
import { useWorkspace as P } from "../../store/store.js";
|
|
8
|
+
function N() {
|
|
9
|
+
const h = M(), { activeWorkspace: W, activeWorkspaceRequests: f, activeWorkspaceCollections: b } = F(), { requests: E, tags: w } = P(), n = l([]), c = l([]), s = l(0), o = l(""), r = l(null), m = l([]), p = new H(n.value, {
|
|
10
10
|
keys: ["title", "description", "body"]
|
|
11
|
-
}),
|
|
12
|
-
|
|
11
|
+
}), x = () => {
|
|
12
|
+
o.value = "", s.value = 0, c.value = [], r.value instanceof HTMLInputElement && r.value.blur();
|
|
13
13
|
}, d = (e) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
path: t.path,
|
|
31
|
-
link: (o = u == null ? void 0 : u.resolve({
|
|
32
|
-
name: "request",
|
|
33
|
-
params: {
|
|
34
|
-
[S.Request]: t.uid,
|
|
35
|
-
[S.Workspace]: (s = E.value) == null ? void 0 : s.uid
|
|
36
|
-
}
|
|
37
|
-
})) == null ? void 0 : o.href
|
|
38
|
-
};
|
|
39
|
-
}), p.setCollection(c.value);
|
|
14
|
+
n.value = e.filter((t) => !S(t)).filter((t) => !!!b.value?.find(
|
|
15
|
+
(a) => a.requests.includes(t.uid)
|
|
16
|
+
)?.tags.map((a) => w[a]).filter(I).filter((a) => t.tags?.includes(a.name)).filter((a) => S(a)).length).map((t) => ({
|
|
17
|
+
id: t.uid,
|
|
18
|
+
title: t.summary ?? t.method,
|
|
19
|
+
description: t.description ?? "",
|
|
20
|
+
httpVerb: t.method,
|
|
21
|
+
path: t.path,
|
|
22
|
+
link: h?.resolve({
|
|
23
|
+
name: "request",
|
|
24
|
+
params: {
|
|
25
|
+
[k.Request]: t.uid,
|
|
26
|
+
[k.Workspace]: W.value?.uid
|
|
27
|
+
}
|
|
28
|
+
})?.href
|
|
29
|
+
})), p.setCollection(n.value);
|
|
40
30
|
}, R = () => {
|
|
41
|
-
|
|
31
|
+
s.value = 0, c.value = p.search(o.value);
|
|
42
32
|
};
|
|
43
|
-
|
|
44
|
-
e.length ? R() :
|
|
33
|
+
y(o, (e) => {
|
|
34
|
+
e.length ? R() : c.value = [];
|
|
45
35
|
});
|
|
46
|
-
const
|
|
47
|
-
const t = e === "up" ? -1 : 1,
|
|
48
|
-
|
|
49
|
-
const
|
|
50
|
-
|
|
36
|
+
const A = (e) => {
|
|
37
|
+
const t = e === "up" ? -1 : 1, i = u.value.length;
|
|
38
|
+
s.value = (s.value + t + i) % i, L(() => {
|
|
39
|
+
const v = m.value[s.value];
|
|
40
|
+
v instanceof HTMLElement && v.scrollIntoView({
|
|
51
41
|
behavior: "smooth",
|
|
52
42
|
block: "center"
|
|
53
43
|
});
|
|
54
44
|
});
|
|
55
|
-
},
|
|
56
|
-
if (
|
|
57
|
-
const e =
|
|
45
|
+
}, C = () => {
|
|
46
|
+
if (s.value >= 0) {
|
|
47
|
+
const e = u.value[s.value];
|
|
58
48
|
e && g(e);
|
|
59
49
|
}
|
|
60
|
-
},
|
|
61
|
-
|
|
50
|
+
}, D = T(() => f.value.map((e) => E[e]).filter(I));
|
|
51
|
+
y(
|
|
62
52
|
f,
|
|
63
53
|
() => {
|
|
64
|
-
d(
|
|
54
|
+
d(D.value);
|
|
65
55
|
},
|
|
66
56
|
{ immediate: !0 }
|
|
67
57
|
);
|
|
68
58
|
const g = (e) => {
|
|
69
|
-
|
|
70
|
-
},
|
|
59
|
+
h.push(e.item.id), x();
|
|
60
|
+
}, u = T(() => o.value.length === 0 ? n.value.map((e) => ({
|
|
71
61
|
item: e
|
|
72
|
-
})) :
|
|
62
|
+
})) : c.value);
|
|
73
63
|
return {
|
|
74
|
-
searchText:
|
|
75
|
-
searchResultsWithPlaceholderResults:
|
|
76
|
-
selectedSearchResult:
|
|
64
|
+
searchText: o,
|
|
65
|
+
searchResultsWithPlaceholderResults: u,
|
|
66
|
+
selectedSearchResult: s,
|
|
77
67
|
onSearchResultClick: g,
|
|
78
68
|
fuseSearch: R,
|
|
79
|
-
searchInputRef:
|
|
69
|
+
searchInputRef: r,
|
|
80
70
|
searchResultRefs: m,
|
|
81
|
-
navigateSearchResults:
|
|
82
|
-
selectSearchResult:
|
|
71
|
+
navigateSearchResults: A,
|
|
72
|
+
selectSearchResult: C,
|
|
83
73
|
populateFuseDataArray: d
|
|
84
74
|
};
|
|
85
75
|
}
|
|
86
76
|
export {
|
|
87
|
-
|
|
77
|
+
N as useSearch
|
|
88
78
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as x, mergeModels as p, useModel as h, ref as g, createElementBlock as
|
|
1
|
+
import { defineComponent as x, mergeModels as p, useModel as h, ref as g, createElementBlock as u, openBlock as i, withKeys as f, createElementVNode as c, Fragment as b, renderList as k, createBlock as y, withCtx as V, createTextVNode as w, toDisplayString as m, createVNode as S, unref as q, nextTick as B } from "vue";
|
|
2
2
|
import { ScalarIcon as C } from "@scalar/components";
|
|
3
3
|
import I from "./SectionFilterButton.vue.js";
|
|
4
4
|
const _ = { class: "request-section-content request-section-content-filter fade-request-section-content text-c-3 pointer-events-auto relative hidden w-full justify-end gap-[1.5px] rounded py-1.75 text-xs xl:flex" }, $ = { class: "filter-button context-bar-group-hover:text-c-1 absolute -right-[30px] flex items-center" }, F = { class: "context-bar-group-hover:hidden mr-1.5" }, K = /* @__PURE__ */ x({
|
|
@@ -11,47 +11,44 @@ const _ = { class: "request-section-content request-section-content-filter fade-
|
|
|
11
11
|
modelModifiers: {}
|
|
12
12
|
}),
|
|
13
13
|
emits: ["update:modelValue"],
|
|
14
|
-
setup(
|
|
15
|
-
const t = h(
|
|
16
|
-
const o =
|
|
17
|
-
t.value =
|
|
18
|
-
if (
|
|
19
|
-
const
|
|
14
|
+
setup(n) {
|
|
15
|
+
const t = h(n, "modelValue"), s = g(), a = (l) => {
|
|
16
|
+
const o = l === "prev" ? -1 : 1, e = t.value ? n.filters.indexOf(t.value) : 0, r = n.filters.length, v = (e + o + r) % r;
|
|
17
|
+
t.value = n.filters[v], B(() => {
|
|
18
|
+
if (s.value) {
|
|
19
|
+
const d = s.value.querySelector(
|
|
20
20
|
'button[aria-selected="true"]'
|
|
21
21
|
);
|
|
22
|
-
|
|
22
|
+
d && d.focus();
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
|
-
return (
|
|
26
|
+
return (l, o) => (i(), u("div", {
|
|
27
27
|
ref_key: "tablist",
|
|
28
|
-
ref:
|
|
28
|
+
ref: s,
|
|
29
29
|
class: "filter-hover context-bar-group ml-auto hidden lg:flex",
|
|
30
30
|
role: "tablist",
|
|
31
31
|
onKeydown: [
|
|
32
|
-
o[0] || (o[0] =
|
|
33
|
-
o[1] || (o[1] =
|
|
32
|
+
o[0] || (o[0] = f((e) => a("prev"), ["left"])),
|
|
33
|
+
o[1] || (o[1] = f((e) => a("next"), ["right"]))
|
|
34
34
|
]
|
|
35
35
|
}, [
|
|
36
36
|
c("div", _, [
|
|
37
|
-
(i(!0),
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
_: 2
|
|
51
|
-
}, 1032, ["controls", "selected", "onClick"]);
|
|
52
|
-
}), 128)),
|
|
37
|
+
(i(!0), u(b, null, k(l.filters, (e) => (i(), y(I, {
|
|
38
|
+
key: e,
|
|
39
|
+
class: "filter-hover-item",
|
|
40
|
+
controls: l.filterIds?.[e],
|
|
41
|
+
role: "tab",
|
|
42
|
+
selected: t.value === e,
|
|
43
|
+
onClick: (r) => t.value = e
|
|
44
|
+
}, {
|
|
45
|
+
default: V(() => [
|
|
46
|
+
w(m(e), 1)
|
|
47
|
+
]),
|
|
48
|
+
_: 2
|
|
49
|
+
}, 1032, ["controls", "selected", "onClick"]))), 128)),
|
|
53
50
|
c("div", $, [
|
|
54
|
-
c("span", F,
|
|
51
|
+
c("span", F, m(t.value), 1),
|
|
55
52
|
S(q(C), {
|
|
56
53
|
icon: "FilterList",
|
|
57
54
|
size: "md",
|