@scalar/api-client 2.1.45 → 2.1.47
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 +39 -0
- package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBar.vue.js +2 -2
- package/dist/components/AddressBar/AddressBar.vue2.js +66 -58
- package/dist/components/AddressBar/AddressBarHistory.vue.js +2 -2
- package/dist/components/AddressBar/AddressBarHistory.vue2.js +8 -8
- package/dist/components/AddressBar/AddressBarServer.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBarServer.vue.js +40 -39
- package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
- package/dist/components/CodeInput/CodeInput.vue.js +1 -1
- package/dist/components/CodeInput/CodeInput.vue2.js +7 -7
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +32 -26
- package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.js +14 -9
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue.js +4 -4
- package/dist/components/CommandPalette/TheCommandPalette.vue2.js +15 -10
- package/dist/components/ContextBar.vue.d.ts +1 -1
- package/dist/components/ContextBar.vue.d.ts.map +1 -1
- package/dist/components/ContextBar.vue.js +2 -2
- package/dist/components/ContextBar.vue2.js +30 -19
- package/dist/components/DataTable/DataTableCheckbox.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableCheckbox.vue.js +17 -17
- package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableInput.vue.js +2 -2
- package/dist/components/DataTable/DataTableInput.vue2.js +10 -10
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -1
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +23 -18
- package/dist/components/Form/Form.vue.js +15 -15
- package/dist/components/HttpMethod/HttpMethod.vue.d.ts +2 -2
- package/dist/components/ImportCollection/DropEventListener.vue.d.ts +2 -2
- package/dist/components/ImportCollection/DropEventListener.vue.js +6 -6
- package/dist/components/ImportCollection/ImportCollectionListener.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/ImportCollectionListener.vue.js +22 -21
- package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts +1 -0
- package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/ImportCollectionModal.vue.js +87 -74
- package/dist/components/ImportCollection/ImportNowButton.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/ImportNowButton.vue.js +14 -13
- package/dist/components/ImportCollection/PasteEventListener.vue.d.ts +2 -2
- package/dist/components/ImportCollection/PasteEventListener.vue.js +5 -5
- package/dist/components/ImportCollection/UrlQueryParameterChecker.vue.d.ts +2 -2
- package/dist/components/ImportCollection/UrlQueryParameterChecker.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/UrlQueryParameterChecker.vue.js +10 -5
- package/dist/components/ImportCollection/WorkspaceSelector.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/WorkspaceSelector.vue.js +43 -33
- package/dist/components/ImportCollection/hooks/useUrlPrefetcher.d.ts +1 -0
- package/dist/components/ImportCollection/hooks/useUrlPrefetcher.d.ts.map +1 -1
- package/dist/components/ImportCollection/hooks/useUrlPrefetcher.js +31 -21
- package/dist/components/Search/useSearch.d.ts +2 -0
- package/dist/components/Search/useSearch.d.ts.map +1 -1
- package/dist/components/Search/useSearch.js +25 -24
- package/dist/components/SideNav/DownloadAppButton.vue.d.ts +3 -0
- package/dist/components/SideNav/DownloadAppButton.vue.d.ts.map +1 -0
- package/dist/components/SideNav/DownloadAppButton.vue.js +7 -0
- package/dist/components/SideNav/DownloadAppButton.vue2.js +33 -0
- package/dist/components/SideNav/SideHelp.vue.d.ts.map +1 -1
- package/dist/components/SideNav/SideHelp.vue.js +55 -53
- package/dist/components/SideNav/SideNav.vue.d.ts.map +1 -1
- package/dist/components/SideNav/SideNav.vue.js +82 -5
- package/dist/components/SideNav/SideNav.vue2.js +2 -72
- package/dist/components/{SubpageHeader.vue.d.ts → SideNav/SideNavGroup.vue.d.ts} +3 -3
- package/dist/components/SideNav/SideNavGroup.vue.d.ts.map +1 -0
- package/dist/components/SideNav/SideNavGroup.vue.js +16 -0
- package/dist/components/SideNav/SideNavGroup.vue2.js +4 -0
- package/dist/components/SideNav/SideNavLink.vue.d.ts +5 -5
- package/dist/components/SideNav/SideNavLink.vue.d.ts.map +1 -1
- package/dist/components/SideNav/SideNavLink.vue.js +31 -34
- package/dist/components/SideNav/SideNavRouterLink.vue.d.ts +25 -0
- package/dist/components/SideNav/SideNavRouterLink.vue.d.ts.map +1 -0
- package/dist/components/SideNav/SideNavRouterLink.vue.js +29 -0
- package/dist/components/SideNav/SideNavRouterLink.vue2.js +4 -0
- package/dist/components/Sidebar/SidebarButton.vue.d.ts +1 -4
- package/dist/components/Sidebar/SidebarButton.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarButton.vue.js +17 -17
- package/dist/components/Sidebar/SidebarToggle.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarToggle.vue.js +16 -15
- package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
- package/dist/components/TopNav/TopNav.vue.js +2 -2
- package/dist/components/TopNav/TopNav.vue2.js +14 -14
- package/dist/components/TopNav/TopNavItem.vue.d.ts +2 -2
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +31 -31
- package/dist/components/ViewLayout/ViewLayoutSection.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutSection.vue.js +13 -21
- package/dist/hooks/index.d.ts +2 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +6 -4
- package/dist/hooks/useLayout.d.ts +13 -0
- package/dist/hooks/useLayout.d.ts.map +1 -0
- package/dist/hooks/useLayout.js +7 -0
- package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
- package/dist/layouts/App/ApiClientApp.vue.js +37 -37
- package/dist/layouts/App/MainLayout.vue.d.ts.map +1 -1
- package/dist/layouts/App/MainLayout.vue.js +21 -13
- package/dist/layouts/App/create-api-client-app.d.ts +28 -28
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/App/create-api-client-app.js +10 -8
- package/dist/layouts/Modal/ApiClientModal.vue.d.ts +3 -1
- package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/layouts/Modal/ApiClientModal.vue.js +2 -2
- package/dist/layouts/Modal/ApiClientModal.vue2.js +37 -25
- package/dist/layouts/Modal/create-api-client-modal.d.ts +56 -56
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Modal/create-api-client-modal.js +8 -7
- package/dist/layouts/Web/ApiClientWeb.vue.d.ts.map +1 -1
- package/dist/layouts/Web/ApiClientWeb.vue.js +30 -30
- package/dist/layouts/Web/create-api-client-web.d.ts +28 -28
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/layouts/Web/create-api-client-web.js +9 -7
- package/dist/libs/create-client.d.ts +35 -29
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/create-client.js +55 -42
- package/dist/libs/hot-keys.d.ts +1 -1
- package/dist/router.d.ts +4 -41
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +18 -149
- package/dist/routes.d.ts +150 -0
- package/dist/routes.d.ts.map +1 -0
- package/dist/routes.js +182 -0
- package/dist/store/collections.d.ts +4 -4
- package/dist/store/cookies.d.ts +4 -4
- package/dist/store/request-example.d.ts +4 -4
- package/dist/store/requests.d.ts +4 -4
- package/dist/store/router-params.js +1 -1
- package/dist/store/security-schemes.d.ts +4 -4
- package/dist/store/store.d.ts +56 -56
- package/dist/store/store.d.ts.map +1 -1
- package/dist/store/store.js +90 -90
- package/dist/store/tags.d.ts +4 -4
- package/dist/store/workspace.d.ts +4 -4
- package/dist/style.css +1 -1
- package/dist/views/Cookies/CookieRaw.vue.js +10 -10
- package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
- package/dist/views/Cookies/Cookies.vue2.js +52 -53
- package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
- package/dist/views/Environment/Environment.vue2.js +79 -80
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +20 -15
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +146 -108
- package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestParams.vue.js +53 -52
- package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestSection.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestSection.vue2.js +102 -97
- package/dist/views/Request/RequestSection/RequestTable.vue.d.ts +2 -2
- package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestTable.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestTable.vue2.js +44 -40
- package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebar.vue.js +2 -2
- package/dist/views/Request/RequestSidebar.vue2.js +152 -134
- package/dist/views/Request/RequestSidebarItem.vue.d.ts +2 -2
- 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 +129 -115
- package/dist/views/Request/RequestSidebarItemMenu.vue2.js +6 -6
- package/dist/views/Request/RequestSubpageHeader.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSubpageHeader.vue.js +1 -1
- package/dist/views/Request/RequestSubpageHeader.vue2.js +36 -34
- package/dist/views/Request/ResponseSection/ResponseBody.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseBody.vue.js +21 -21
- package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.js +13 -10
- package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue2.js +0 -2
- package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue.js +8 -8
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +3 -3
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +32 -33
- package/dist/views/Request/ResponseSection/ResponseHeaders.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseHeaders.vue.js +61 -55
- package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.js +32 -25
- package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +102 -70
- package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -1
- package/dist/views/Request/components/WorkspaceDropdown.vue.js +60 -50
- package/dist/views/Request/types/sidebar-item.d.ts +2 -1
- package/dist/views/Request/types/sidebar-item.d.ts.map +1 -1
- package/dist/views/Servers/Servers.vue.d.ts.map +1 -1
- package/dist/views/Servers/Servers.vue2.js +12 -7
- package/package.json +10 -8
- package/dist/components/SubpageHeader.vue.d.ts.map +0 -1
- package/dist/components/ViewLayout/ViewLayoutSection.vue2.js +0 -4
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts +0 -7
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +0 -1
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import { loadAllResources as j } from "./local-storage.js";
|
|
2
|
-
import { workspaceSchema as
|
|
3
|
-
import { LS_KEYS as
|
|
4
|
-
import { DATA_VERSION_LS_LEY as
|
|
5
|
-
import { createApp as
|
|
6
|
-
import { createWorkspaceStore as
|
|
7
|
-
const
|
|
8
|
-
el:
|
|
2
|
+
import { workspaceSchema as P } from "@scalar/oas-utils/entities/workspace";
|
|
3
|
+
import { LS_KEYS as L, objectMerge as E } from "@scalar/oas-utils/helpers";
|
|
4
|
+
import { DATA_VERSION_LS_LEY as K, DATA_VERSION as R } from "@scalar/oas-utils/migrations";
|
|
5
|
+
import { createApp as T, watch as W } from "vue";
|
|
6
|
+
import { createWorkspaceStore as F } from "../store/store.js";
|
|
7
|
+
const $ = ({
|
|
8
|
+
el: x,
|
|
9
9
|
appComponent: A,
|
|
10
10
|
configuration: t = {},
|
|
11
11
|
isReadOnly: c = !1,
|
|
12
12
|
store: M,
|
|
13
13
|
persistData: b = !0,
|
|
14
14
|
mountOnInitialize: I = !0,
|
|
15
|
-
|
|
15
|
+
layout: O = "desktop",
|
|
16
|
+
router: u
|
|
16
17
|
}) => {
|
|
17
|
-
const a = M ||
|
|
18
|
+
const a = M || F(u, {
|
|
18
19
|
useLocalStorage: b,
|
|
19
20
|
defaultProxyUrl: t.proxyUrl
|
|
20
21
|
});
|
|
21
|
-
if (localStorage.getItem(
|
|
22
|
+
if (localStorage.getItem(L.WORKSPACE) && !c) {
|
|
22
23
|
const e = {};
|
|
23
24
|
let r = 0, l = 0, s = "";
|
|
24
25
|
for (s in localStorage)
|
|
@@ -30,9 +31,9 @@ const V = ({
|
|
|
30
31
|
name: "Workspace",
|
|
31
32
|
isReadOnly: c,
|
|
32
33
|
proxyUrl: t.proxyUrl
|
|
33
|
-
}), localStorage.setItem(
|
|
34
|
+
}), localStorage.setItem(K, R);
|
|
34
35
|
else {
|
|
35
|
-
const e =
|
|
36
|
+
const e = P.parse({
|
|
36
37
|
uid: "default",
|
|
37
38
|
name: "Workspace",
|
|
38
39
|
isReadOnly: !0,
|
|
@@ -40,20 +41,20 @@ const V = ({
|
|
|
40
41
|
});
|
|
41
42
|
a.workspaceMutators.rawAdd(e);
|
|
42
43
|
}
|
|
43
|
-
const
|
|
44
|
-
|
|
44
|
+
const p = T(A);
|
|
45
|
+
p.use(u), p.provide("workspace", a), p.provide("layout", O);
|
|
45
46
|
const {
|
|
46
|
-
activeCollection:
|
|
47
|
+
activeCollection: d,
|
|
47
48
|
activeWorkspace: o,
|
|
48
49
|
collectionMutators: v,
|
|
49
|
-
importSpecFile:
|
|
50
|
-
importSpecFromUrl:
|
|
50
|
+
importSpecFile: w,
|
|
51
|
+
importSpecFromUrl: q,
|
|
51
52
|
modalState: h,
|
|
52
|
-
requests:
|
|
53
|
+
requests: i,
|
|
53
54
|
securitySchemes: C,
|
|
54
|
-
servers:
|
|
55
|
+
servers: S,
|
|
55
56
|
workspaceMutators: m
|
|
56
|
-
} = a, U = (e =
|
|
57
|
+
} = a, U = (e = x) => {
|
|
57
58
|
if (!e) {
|
|
58
59
|
console.error(
|
|
59
60
|
"[@scalar/api-client-modal] Could not create the API client.",
|
|
@@ -62,7 +63,7 @@ const V = ({
|
|
|
62
63
|
);
|
|
63
64
|
return;
|
|
64
65
|
}
|
|
65
|
-
|
|
66
|
+
p.mount(e);
|
|
66
67
|
};
|
|
67
68
|
o.value && (I && U(), t != null && t.proxyUrl && m.edit(
|
|
68
69
|
o.value.uid,
|
|
@@ -73,12 +74,12 @@ const V = ({
|
|
|
73
74
|
"themeId",
|
|
74
75
|
t == null ? void 0 : t.themeId
|
|
75
76
|
));
|
|
76
|
-
const
|
|
77
|
-
e != null && e.url ? await
|
|
77
|
+
const y = async (e) => {
|
|
78
|
+
e != null && e.url ? await q(e.url, o.value.uid, {
|
|
78
79
|
proxy: t == null ? void 0 : t.proxyUrl,
|
|
79
80
|
setCollectionSecurity: !0,
|
|
80
81
|
...t
|
|
81
|
-
}) : e != null && e.content ? await
|
|
82
|
+
}) : e != null && e.content ? await w(e == null ? void 0 : e.content, o.value.uid, {
|
|
82
83
|
setCollectionSecurity: !0,
|
|
83
84
|
...t
|
|
84
85
|
}) : console.error(
|
|
@@ -89,35 +90,35 @@ const V = ({
|
|
|
89
90
|
};
|
|
90
91
|
return {
|
|
91
92
|
/** The vue app instance for the modal, be careful with this */
|
|
92
|
-
app:
|
|
93
|
-
updateSpec:
|
|
93
|
+
app: p,
|
|
94
|
+
updateSpec: y,
|
|
94
95
|
/**
|
|
95
96
|
* Update the API client config
|
|
96
97
|
*
|
|
97
98
|
* Deletes the current store before importing again for now, in the future will Diff
|
|
98
99
|
*/
|
|
99
100
|
updateConfig(e, r = !0) {
|
|
100
|
-
r ? Object.assign(t ?? {}, e) :
|
|
101
|
+
r ? Object.assign(t ?? {}, e) : E(t ?? {}, e), e.spec && (a.collectionMutators.reset(), a.requestMutators.reset(), a.requestExampleMutators.reset(), a.securitySchemeMutators.reset(), a.serverMutators.reset(), a.tagMutators.reset(), m.edit(o.value.uid, "collections", []), y(e.spec));
|
|
101
102
|
},
|
|
102
103
|
/** Update the currently selected server via URL */
|
|
103
104
|
updateServer: (e) => {
|
|
104
105
|
var l;
|
|
105
|
-
const r = Object.values(
|
|
106
|
-
r &&
|
|
107
|
-
(l =
|
|
106
|
+
const r = Object.values(S).find((s) => s.url === e);
|
|
107
|
+
r && d.value && v.edit(
|
|
108
|
+
(l = d.value) == null ? void 0 : l.uid,
|
|
108
109
|
"selectedServerUid",
|
|
109
110
|
r.uid
|
|
110
111
|
);
|
|
111
112
|
},
|
|
112
113
|
/** Update the currently selected server via URL */
|
|
113
114
|
onUpdateServer: (e) => {
|
|
114
|
-
|
|
115
|
+
W(
|
|
115
116
|
() => {
|
|
116
117
|
var r;
|
|
117
|
-
return (r =
|
|
118
|
+
return (r = d.value) == null ? void 0 : r.selectedServerUid;
|
|
118
119
|
},
|
|
119
120
|
(r) => {
|
|
120
|
-
const l = Object.values(
|
|
121
|
+
const l = Object.values(S).find((s) => s.uid === r);
|
|
121
122
|
l != null && l.url && e(l.url);
|
|
122
123
|
}
|
|
123
124
|
);
|
|
@@ -130,25 +131,31 @@ const V = ({
|
|
|
130
131
|
propertyKey: r,
|
|
131
132
|
value: l
|
|
132
133
|
}) => {
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
`auth.${
|
|
134
|
+
const k = Object.values(C).find((_) => _.nameKey === e);
|
|
135
|
+
k && d.value && v.edit(
|
|
136
|
+
d.value.uid,
|
|
137
|
+
`auth.${k.uid}.${r}`,
|
|
137
138
|
// @ts-expect-error why typescript why
|
|
138
139
|
l
|
|
139
140
|
);
|
|
140
141
|
},
|
|
141
142
|
/** Route to a method + path */
|
|
142
143
|
route: (e) => {
|
|
143
|
-
const r = Object.values(
|
|
144
|
+
const r = Object.values(i).find(
|
|
144
145
|
({ path: l, method: s }) => l === e.path && s.toUpperCase() === e.method.toUpperCase()
|
|
145
146
|
);
|
|
146
|
-
r &&
|
|
147
|
+
r && u.push({
|
|
148
|
+
name: "request",
|
|
149
|
+
params: {
|
|
150
|
+
workspace: "default",
|
|
151
|
+
request: r.uid
|
|
152
|
+
}
|
|
153
|
+
});
|
|
147
154
|
},
|
|
148
155
|
/** Open the API client modal and optionally route to a request */
|
|
149
156
|
open: (e) => {
|
|
150
157
|
if (e) {
|
|
151
|
-
const r = Object.values(
|
|
158
|
+
const r = Object.values(i).find(
|
|
152
159
|
({ path: l, method: s }) => e ? (
|
|
153
160
|
// The given operation
|
|
154
161
|
l === e.path && s.toUpperCase() === e.method.toUpperCase()
|
|
@@ -157,7 +164,13 @@ const V = ({
|
|
|
157
164
|
!0
|
|
158
165
|
)
|
|
159
166
|
);
|
|
160
|
-
r &&
|
|
167
|
+
r && u.push({
|
|
168
|
+
name: "request",
|
|
169
|
+
params: {
|
|
170
|
+
workspace: "default",
|
|
171
|
+
request: r.uid
|
|
172
|
+
}
|
|
173
|
+
});
|
|
161
174
|
}
|
|
162
175
|
h.open = !0;
|
|
163
176
|
},
|
|
@@ -170,5 +183,5 @@ const V = ({
|
|
|
170
183
|
};
|
|
171
184
|
};
|
|
172
185
|
export {
|
|
173
|
-
|
|
186
|
+
$ as createApiClient
|
|
174
187
|
};
|
package/dist/libs/hot-keys.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export declare const getModifiers: (modifiers: HotKeyModifiers) => ("metaKey" |
|
|
|
24
24
|
* This is the brain of the operation, we turn keybindings -> events
|
|
25
25
|
*/
|
|
26
26
|
export declare const handleHotKeyDown: (ev: KeyboardEvent, eventBus: EventBus<HotKeyEvent>, { hotKeys, modifiers, }?: {
|
|
27
|
-
hotKeys?: Partial<Record<"" | "
|
|
27
|
+
hotKeys?: Partial<Record<"" | "0" | "1" | "n" | "a" | "b" | "i" | "p" | "q" | "s" | "u" | "." | "g" | ";" | "/" | "=" | "-" | "k" | "v" | "2" | "ArrowLeft" | "ArrowRight" | "Delete" | "Backspace" | "3" | "4" | "5" | "6" | "Space" | "Tab" | "Enter" | "Escape" | "ArrowDown" | "ArrowUp" | "End" | "Home" | "PageDown" | "PageUp" | "7" | "8" | "9" | "c" | "d" | "e" | "f" | "h" | "j" | "l" | "m" | "o" | "r" | "t" | "w" | "x" | "y" | "z" | "*" | "+" | "F1" | "F2" | "F3" | "F4" | "F5" | "F6" | "F7" | "F8" | "F9" | "F10" | "F11" | "F12" | "," | "`" | "[" | "\\" | "]", {
|
|
28
28
|
event: "closeModal" | "navigateSearchResultsDown" | "selectSearchResult" | "navigateSearchResultsUp" | "openCommandPalette" | "createNew" | "toggleSidebar" | "addTopNav" | "closeTopNav" | "navigateTopNavLeft" | "navigateTopNavRight" | "focusAddressBar" | "jumpToTab" | "jumpToLastTab" | "focusRequestSearch";
|
|
29
29
|
modifiers?: ("Meta" | "Control" | "Shift" | "Alt" | "default")[] | undefined;
|
|
30
30
|
}>> | undefined;
|
package/dist/router.d.ts
CHANGED
|
@@ -1,45 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
export declare enum PathId {
|
|
3
|
-
Request = "request",
|
|
4
|
-
Examples = "examples",
|
|
5
|
-
Cookies = "cookies",
|
|
6
|
-
Collection = "collection",
|
|
7
|
-
Schema = "schema",
|
|
8
|
-
Environment = "environment",
|
|
9
|
-
Servers = "servers",
|
|
10
|
-
Workspace = "workspace",
|
|
11
|
-
Settings = "settings"
|
|
12
|
-
}
|
|
13
|
-
/** Routes required by the API client modal */
|
|
14
|
-
export declare const modalRoutes: ({
|
|
15
|
-
path: string;
|
|
16
|
-
redirect: string;
|
|
17
|
-
children?: undefined;
|
|
18
|
-
} | {
|
|
19
|
-
path: string;
|
|
20
|
-
children: ({
|
|
21
|
-
path: string;
|
|
22
|
-
redirect: (to: import("vue-router").RouteLocation) => string;
|
|
23
|
-
name?: undefined;
|
|
24
|
-
component?: undefined;
|
|
25
|
-
} | {
|
|
26
|
-
name: PathId;
|
|
27
|
-
path: string;
|
|
28
|
-
component: () => Promise<typeof import("./views/Request/Request.vue.js")>;
|
|
29
|
-
redirect?: undefined;
|
|
30
|
-
})[];
|
|
31
|
-
redirect?: undefined;
|
|
32
|
-
})[];
|
|
1
|
+
export { PathId, saveActiveWorkspace } from './routes.js';
|
|
33
2
|
/** Router for the API client app */
|
|
34
|
-
export declare const createWebHistoryRouter: () => Router;
|
|
3
|
+
export declare const createWebHistoryRouter: () => import("vue-router").Router;
|
|
35
4
|
/** Router factory for the API client app (but using hash history) */
|
|
36
|
-
export declare const createWebHashRouter: () => Router;
|
|
5
|
+
export declare const createWebHashRouter: () => import("vue-router").Router;
|
|
37
6
|
/** Router factory for the API Client modal */
|
|
38
|
-
export declare const createModalRouter: () => Router;
|
|
39
|
-
/** Save the active workspace in localstorage for when the client reloads */
|
|
40
|
-
export declare function saveWorkspace(to: RouteLocationNormalized): void;
|
|
41
|
-
/** Redirect to the saved workspace or the default workspace */
|
|
42
|
-
export declare function redirectToDefaultWorkspace(): string;
|
|
43
|
-
/** If we try to navigate to a entity UID that does not exist then we fallback to the default */
|
|
44
|
-
export declare function fallbackMissingParams(router: Router, key: PathId, item: Record<string, any> | undefined): void;
|
|
7
|
+
export declare const createModalRouter: () => import("vue-router").Router;
|
|
45
8
|
//# sourceMappingURL=router.d.ts.map
|
package/dist/router.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../src/router.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../src/router.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAEtD,oCAAoC;AACpC,eAAO,MAAM,sBAAsB,mCAI/B,CAAA;AAEJ,qEAAqE;AACrE,eAAO,MAAM,mBAAmB,mCAI5B,CAAA;AAEJ,8CAA8C;AAC9C,eAAO,MAAM,iBAAiB,mCAI1B,CAAA"}
|
package/dist/router.js
CHANGED
|
@@ -1,151 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
path: "request/:request",
|
|
15
|
-
component: () => import("./views/Request/Request.vue.js")
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
name: "examples",
|
|
19
|
-
path: "request/:request/examples/:examples",
|
|
20
|
-
component: () => import("./views/Request/Request.vue.js")
|
|
21
|
-
}
|
|
22
|
-
], h = [
|
|
23
|
-
{
|
|
24
|
-
path: "/",
|
|
25
|
-
redirect: "/workspace/default/request/default"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
path: "/workspace",
|
|
29
|
-
redirect: "/workspace/default/request/default"
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
path: "/workspace/:workspace",
|
|
33
|
-
children: c
|
|
34
|
-
}
|
|
35
|
-
], n = [
|
|
36
|
-
{
|
|
37
|
-
path: "/",
|
|
38
|
-
redirect: o
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
path: "/workspace",
|
|
42
|
-
redirect: o
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
path: "/workspace/:workspace",
|
|
46
|
-
children: [
|
|
47
|
-
...c,
|
|
48
|
-
// {
|
|
49
|
-
// path: 'collection',
|
|
50
|
-
// redirect: (to) =>
|
|
51
|
-
// `${to.fullPath.replace(/\/$/, '')}/default`,
|
|
52
|
-
// },
|
|
53
|
-
// {
|
|
54
|
-
// name: PathId.Collection,
|
|
55
|
-
// path: `collection/:${PathId.Collection}`,
|
|
56
|
-
// component: () => import('./views/Collection/Collection.vue'),
|
|
57
|
-
// children: [
|
|
58
|
-
// // Nested collection request
|
|
59
|
-
// {
|
|
60
|
-
// path: `request/${PathId.Request}`,
|
|
61
|
-
// component: () => import('./views/Request/Request.vue.js'),
|
|
62
|
-
// },
|
|
63
|
-
// ],
|
|
64
|
-
// },
|
|
65
|
-
/** Components will map to each section of the spec components object */
|
|
66
|
-
// {
|
|
67
|
-
// path: 'components',
|
|
68
|
-
// redirect: '/components/schemas/default',
|
|
69
|
-
// children: [
|
|
70
|
-
// {
|
|
71
|
-
// path: `schemas/:${PathId.Schema}`,
|
|
72
|
-
// component: () => import('@/views/Components/Schemas/Schemas.vue'),
|
|
73
|
-
// },
|
|
74
|
-
// ],
|
|
75
|
-
// },
|
|
76
|
-
{
|
|
77
|
-
path: "environment",
|
|
78
|
-
redirect: (e) => `${e.fullPath.replace(/\/$/, "")}/default`
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
name: "environment",
|
|
82
|
-
path: "environment/:environment",
|
|
83
|
-
component: () => import("./views/Environment/Environment.vue.js")
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
path: "cookies",
|
|
87
|
-
redirect: (e) => `${e.fullPath.replace(/\/$/, "")}/default`
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
name: "cookies",
|
|
91
|
-
path: "cookies/:cookies",
|
|
92
|
-
component: () => import("./views/Cookies/Cookies.vue.js")
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
path: "servers",
|
|
96
|
-
redirect: (e) => `${e.fullPath.replace(/\/$/, "")}/default`
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
name: "servers",
|
|
100
|
-
path: "servers/:servers",
|
|
101
|
-
component: () => import("./views/Servers/Servers.vue.js")
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
path: "settings",
|
|
105
|
-
redirect: (e) => `${e.fullPath.replace(/\/$/, "")}/general`
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
name: "settings",
|
|
109
|
-
path: "settings/:settings",
|
|
110
|
-
component: () => import("./views/Settings/Settings.vue.js")
|
|
111
|
-
}
|
|
112
|
-
]
|
|
113
|
-
}
|
|
114
|
-
], k = () => r({
|
|
115
|
-
history: u(),
|
|
116
|
-
routes: n
|
|
117
|
-
}), d = () => r({
|
|
118
|
-
history: i(),
|
|
119
|
-
routes: n
|
|
120
|
-
}), v = () => r({
|
|
121
|
-
history: m(),
|
|
122
|
-
routes: h
|
|
123
|
-
}), p = "activeWorkspace";
|
|
124
|
-
function w(e) {
|
|
125
|
-
const t = e.params.workspace;
|
|
126
|
-
t && localStorage.setItem(p, `${t}`);
|
|
127
|
-
}
|
|
128
|
-
function o() {
|
|
129
|
-
return `/workspace/${localStorage.getItem(p) ?? "default"}/request/default`;
|
|
130
|
-
}
|
|
131
|
-
function q(e, t, l) {
|
|
132
|
-
var a, s;
|
|
133
|
-
e.currentRoute.value && // If the item is missing then we know the UID is no longer in use and redirect to the default
|
|
134
|
-
!l && ((a = e.currentRoute.value) != null && a.params[t]) && ((s = e.currentRoute.value) == null ? void 0 : s.params[t]) !== "default" && // We only redirect if the key is missing for the matching route
|
|
135
|
-
e.currentRoute.value.path.includes(t) && e.push({
|
|
136
|
-
params: {
|
|
137
|
-
...e.currentRoute.value.params,
|
|
138
|
-
[t]: "default"
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
}
|
|
1
|
+
import { routes as t, modalRoutes as r } from "./routes.js";
|
|
2
|
+
import { PathId as p, saveActiveWorkspace as R } from "./routes.js";
|
|
3
|
+
import { createRouter as e, createWebHistory as o, createWebHashHistory as s, createMemoryHistory as a } from "vue-router";
|
|
4
|
+
const y = () => e({
|
|
5
|
+
history: o(),
|
|
6
|
+
routes: t
|
|
7
|
+
}), m = () => e({
|
|
8
|
+
history: s(),
|
|
9
|
+
routes: t
|
|
10
|
+
}), u = () => e({
|
|
11
|
+
history: a(),
|
|
12
|
+
routes: r
|
|
13
|
+
});
|
|
142
14
|
export {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
h as modalRoutes,
|
|
149
|
-
o as redirectToDefaultWorkspace,
|
|
150
|
-
w as saveWorkspace
|
|
15
|
+
p as PathId,
|
|
16
|
+
u as createModalRouter,
|
|
17
|
+
m as createWebHashRouter,
|
|
18
|
+
y as createWebHistoryRouter,
|
|
19
|
+
R as saveActiveWorkspace
|
|
151
20
|
};
|
package/dist/routes.d.ts
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import type { RouteLocationNormalized } from 'vue-router';
|
|
2
|
+
export declare enum PathId {
|
|
3
|
+
Request = "request",
|
|
4
|
+
Examples = "examples",
|
|
5
|
+
Cookies = "cookies",
|
|
6
|
+
Collection = "collection",
|
|
7
|
+
Schema = "schema",
|
|
8
|
+
Environment = "environment",
|
|
9
|
+
Servers = "servers",
|
|
10
|
+
Workspace = "workspace",
|
|
11
|
+
Settings = "settings"
|
|
12
|
+
}
|
|
13
|
+
/** Save the active workspace in localStorage for when the client reloads */
|
|
14
|
+
export declare function saveActiveWorkspace(to: RouteLocationNormalized): void;
|
|
15
|
+
/** Redirect to the saved workspace or the default workspace */
|
|
16
|
+
export declare function redirectToActiveWorkspace(): {
|
|
17
|
+
name: string;
|
|
18
|
+
params?: undefined;
|
|
19
|
+
} | {
|
|
20
|
+
name: string;
|
|
21
|
+
params: {
|
|
22
|
+
workspace: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
/** Routes required by the API client modal */
|
|
26
|
+
export declare const modalRoutes: ({
|
|
27
|
+
name: string;
|
|
28
|
+
path: string;
|
|
29
|
+
redirect: typeof redirectToActiveWorkspace;
|
|
30
|
+
children?: undefined;
|
|
31
|
+
} | {
|
|
32
|
+
name: string;
|
|
33
|
+
path: string;
|
|
34
|
+
redirect: {
|
|
35
|
+
name: string;
|
|
36
|
+
params: {
|
|
37
|
+
workspace: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
children?: undefined;
|
|
41
|
+
} | {
|
|
42
|
+
name: string;
|
|
43
|
+
path: string;
|
|
44
|
+
redirect: {
|
|
45
|
+
name: string;
|
|
46
|
+
params?: undefined;
|
|
47
|
+
};
|
|
48
|
+
children: ({
|
|
49
|
+
name: string;
|
|
50
|
+
path: string;
|
|
51
|
+
redirect: (to: import("vue-router").RouteLocation) => {
|
|
52
|
+
name: string;
|
|
53
|
+
params: {
|
|
54
|
+
request: string;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
component?: undefined;
|
|
58
|
+
} | {
|
|
59
|
+
name: string;
|
|
60
|
+
path: string;
|
|
61
|
+
component: () => Promise<typeof import("./views/Request/Request.vue.js")>;
|
|
62
|
+
redirect?: undefined;
|
|
63
|
+
})[];
|
|
64
|
+
})[];
|
|
65
|
+
/** Routes for the API client app */
|
|
66
|
+
export declare const routes: ({
|
|
67
|
+
name: string;
|
|
68
|
+
path: string;
|
|
69
|
+
redirect: typeof redirectToActiveWorkspace;
|
|
70
|
+
children?: undefined;
|
|
71
|
+
} | {
|
|
72
|
+
name: string;
|
|
73
|
+
path: string;
|
|
74
|
+
redirect: {
|
|
75
|
+
name: string;
|
|
76
|
+
params: {
|
|
77
|
+
workspace: string;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
children?: undefined;
|
|
81
|
+
} | {
|
|
82
|
+
name: string;
|
|
83
|
+
path: string;
|
|
84
|
+
redirect: {
|
|
85
|
+
name: string;
|
|
86
|
+
params?: undefined;
|
|
87
|
+
};
|
|
88
|
+
children: ({
|
|
89
|
+
name: string;
|
|
90
|
+
path: string;
|
|
91
|
+
redirect: (to: import("vue-router").RouteLocation) => {
|
|
92
|
+
name: string;
|
|
93
|
+
params: {
|
|
94
|
+
request: string;
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
component?: undefined;
|
|
98
|
+
} | {
|
|
99
|
+
name: string;
|
|
100
|
+
path: string;
|
|
101
|
+
component: () => Promise<typeof import("./views/Request/Request.vue.js")>;
|
|
102
|
+
redirect?: undefined;
|
|
103
|
+
} | {
|
|
104
|
+
name: string;
|
|
105
|
+
path: string;
|
|
106
|
+
redirect: (to: import("vue-router").RouteLocation) => {
|
|
107
|
+
name: string;
|
|
108
|
+
params: {
|
|
109
|
+
environment: string;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
component?: undefined;
|
|
113
|
+
} | {
|
|
114
|
+
name: string;
|
|
115
|
+
path: string;
|
|
116
|
+
component: () => Promise<typeof import("./views/Environment/Environment.vue.js")>;
|
|
117
|
+
redirect?: undefined;
|
|
118
|
+
} | {
|
|
119
|
+
name: string;
|
|
120
|
+
path: string;
|
|
121
|
+
redirect: (to: import("vue-router").RouteLocation) => {
|
|
122
|
+
name: string;
|
|
123
|
+
params: {
|
|
124
|
+
cookies: string;
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
component?: undefined;
|
|
128
|
+
} | {
|
|
129
|
+
name: string;
|
|
130
|
+
path: string;
|
|
131
|
+
redirect: (to: import("vue-router").RouteLocation) => {
|
|
132
|
+
name: string;
|
|
133
|
+
params: {
|
|
134
|
+
servers: string;
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
component?: undefined;
|
|
138
|
+
} | {
|
|
139
|
+
name: string;
|
|
140
|
+
path: string;
|
|
141
|
+
redirect: (to: import("vue-router").RouteLocation) => {
|
|
142
|
+
name: string;
|
|
143
|
+
params: {
|
|
144
|
+
settings: string;
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
component?: undefined;
|
|
148
|
+
})[];
|
|
149
|
+
})[];
|
|
150
|
+
//# sourceMappingURL=routes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAkB,MAAM,YAAY,CAAA;AAEzE,oBAAY,MAAM;IAChB,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,MAAM,WAAW;IACjB,WAAW,gBAAgB;IAC3B,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,QAAQ,aAAa;CACtB;AAKD,4EAA4E;AAC5E,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,uBAAuB,QAM9D;AAED,+DAA+D;AAC/D,wBAAgB,yBAAyB;;;;;;;;EAkBxC;AAgCD,8CAA8C;AAC9C,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAwBI,CAAA;AAE5B,oCAAoC;AACpC,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA0GS,CAAA"}
|