@scalar/api-client 2.0.12 → 2.0.14
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 +26 -0
- package/dist/App.vue.d.ts.map +1 -1
- package/dist/App.vue.js +51 -28
- package/dist/Modal/api-client-modal.d.ts +2 -1
- package/dist/Modal/api-client-modal.d.ts.map +1 -1
- package/dist/Modal/api-client-modal.js +49 -40
- package/dist/components/ActionModal/ActionModalFolder.vue.js +37 -35
- package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBar.vue.js +1 -1
- package/dist/components/AddressBar/AddressBar.vue2.js +44 -44
- package/dist/components/AddressBar/AddressBarServer.vue.d.ts +1 -14
- package/dist/components/AddressBar/AddressBarServer.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBarServer.vue.js +54 -59
- package/dist/components/CodeInput/CodeInput.vue.d.ts +2 -0
- 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 +16 -14
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.js +15 -17
- package/dist/components/Sidebar/Sidebar.vue.js +5 -5
- package/dist/components/Sidebar/SidebarListElementActions.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarListElementActions.vue.js +12 -12
- package/dist/components/TopNav/TopNavItem.vue.d.ts.map +1 -1
- package/dist/components/TopNav/TopNavItem.vue.js +1 -1
- package/dist/components/TopNav/TopNavItem.vue2.js +10 -7
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -9
- package/dist/libs/index.d.ts +1 -0
- package/dist/libs/index.d.ts.map +1 -1
- package/dist/libs/index.js +10 -8
- package/dist/libs/local-storage.d.ts +9 -0
- package/dist/libs/local-storage.d.ts.map +1 -0
- package/dist/libs/local-storage.js +36 -0
- package/dist/router.d.ts +2 -2
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +13 -13
- package/dist/store/workspace.d.ts +511 -269
- package/dist/store/workspace.d.ts.map +1 -1
- package/dist/store/workspace.js +213 -157
- package/dist/style.css +1 -1
- package/dist/views/Request/Request.vue.d.ts.map +1 -1
- package/dist/views/Request/Request.vue.js +1 -1
- package/dist/views/Request/Request.vue2.js +105 -102
- package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue.js +1 -0
- 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 +25 -25
- package/dist/views/Request/ResponseSection/ResponseBody.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseBody.vue.js +2 -2
- package/dist/views/Request/ResponseSection/ResponseBody.vue2.js +56 -56
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +11 -11
- package/package.json +7 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./TopNavItem.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-9a892de6"]]);
|
|
5
5
|
export {
|
|
6
6
|
r as default
|
|
7
7
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as m, openBlock as
|
|
2
|
-
import
|
|
3
|
-
import { ScalarTooltip as
|
|
1
|
+
import { defineComponent as m, openBlock as s, createBlock as i, unref as n, withCtx as l, createElementVNode as o, normalizeClass as p, createVNode as a, toDisplayString as f, createCommentVNode as k } from "vue";
|
|
2
|
+
import v from "../ScalarHotkey.vue.js";
|
|
3
|
+
import { ScalarTooltip as y, ScalarIcon as c } from "@scalar/components";
|
|
4
4
|
const d = { class: "nav-item-icon-copy flex flex-1 items-center justify-center gap-1.5" }, u = { class: "nav-item-copy text-xs" }, b = /* @__PURE__ */ m({
|
|
5
5
|
__name: "TopNavItem",
|
|
6
6
|
props: {
|
|
@@ -11,7 +11,7 @@ const d = { class: "nav-item-icon-copy flex flex-1 items-center justify-center g
|
|
|
11
11
|
},
|
|
12
12
|
emits: ["click", "close"],
|
|
13
13
|
setup(C) {
|
|
14
|
-
return (e, t) => (
|
|
14
|
+
return (e, t) => (s(), i(n(y), {
|
|
15
15
|
class: "scalar-client",
|
|
16
16
|
delay: 500,
|
|
17
17
|
resize: "",
|
|
@@ -35,15 +35,18 @@ const d = { class: "nav-item-icon-copy flex flex-1 items-center justify-center g
|
|
|
35
35
|
type: "button",
|
|
36
36
|
onClick: t[0] || (t[0] = (r) => e.$emit("close"))
|
|
37
37
|
}, [
|
|
38
|
-
a(n(c), {
|
|
38
|
+
a(n(c), {
|
|
39
|
+
class: "stroke-[1.75]",
|
|
40
|
+
icon: "Close"
|
|
41
|
+
})
|
|
39
42
|
])
|
|
40
43
|
], 2)
|
|
41
44
|
]),
|
|
42
45
|
content: l(() => [
|
|
43
|
-
e.hotkey ? (
|
|
46
|
+
e.hotkey ? (s(), i(v, {
|
|
44
47
|
key: 0,
|
|
45
48
|
hotkey: e.hotkey
|
|
46
|
-
}, null, 8, ["hotkey"])) :
|
|
49
|
+
}, null, 8, ["hotkey"])) : k("", !0)
|
|
47
50
|
]),
|
|
48
51
|
_: 1
|
|
49
52
|
}));
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { default as ScalarClient } from './App.vue.js';
|
|
2
2
|
export * from './Modal/index.js';
|
|
3
3
|
export { useWorkspace } from './store/workspace.js';
|
|
4
|
-
export {
|
|
4
|
+
export { modalRouter } from './router.js';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,WAAW,CAAA;AACnD,cAAc,SAAS,CAAA;AAEvB,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAEhD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,WAAW,CAAA;AACnD,cAAc,SAAS,CAAA;AAEvB,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAEhD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { default as
|
|
1
|
+
import { default as t } from "./App.vue.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import { useWorkspace as l } from "./store/workspace.js";
|
|
4
|
-
import {
|
|
5
|
-
import { default as
|
|
6
|
-
import { createScalarApiClient as
|
|
4
|
+
import { modalRouter as f } from "./router.js";
|
|
5
|
+
import { default as i } from "./Modal/ApiClientModal.vue.js";
|
|
6
|
+
import { createScalarApiClient as c } from "./Modal/api-client-modal.js";
|
|
7
7
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
f as
|
|
12
|
-
s as createScalarApiClient,
|
|
8
|
+
i as ApiClientModal,
|
|
9
|
+
t as ScalarClient,
|
|
10
|
+
c as createScalarApiClient,
|
|
11
|
+
f as modalRouter,
|
|
13
12
|
l as useWorkspace
|
|
14
13
|
};
|
package/dist/libs/index.d.ts
CHANGED
package/dist/libs/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/libs/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/libs/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA"}
|
package/dist/libs/index.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { formatBytes as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { formatBytes as r, formatMs as t } from "./formatters.js";
|
|
2
|
+
import { loadAllResources as m } from "./local-storage.js";
|
|
3
|
+
import { syncPathParamsFromURL as a } from "./pathParams.js";
|
|
4
|
+
import { sendRequest as p } from "./sendRequest.js";
|
|
5
|
+
import { executeRequestBus as R } from "./eventBusses/executeRequestBus.js";
|
|
5
6
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
R as executeRequestBus,
|
|
8
|
+
r as formatBytes,
|
|
8
9
|
t as formatMs,
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
m as loadAllResources,
|
|
11
|
+
p as sendRequest,
|
|
12
|
+
a as syncPathParamsFromURL
|
|
11
13
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { useWorkspace } from '../store/workspace.js';
|
|
2
|
+
/**
|
|
3
|
+
* Loads all resources from localStorage into mutators on app start
|
|
4
|
+
* We use the raw mutator.add here instead of the custom ones because we do NOT want any side effects
|
|
5
|
+
*
|
|
6
|
+
* Currently not working for workspace
|
|
7
|
+
*/
|
|
8
|
+
export declare const loadAllResources: (mutators: ReturnType<typeof useWorkspace>, workspaceUid?: string) => void;
|
|
9
|
+
//# sourceMappingURL=local-storage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-storage.d.ts","sourceRoot":"","sources":["../../src/libs/local-storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAcrD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,aACjB,UAAU,CAAC,OAAO,YAAY,CAAC,gCAoE1C,CAAA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { LS_KEYS as e } from "@scalar/object-utils/mutator-record";
|
|
2
|
+
const h = (t, o = "default") => {
|
|
3
|
+
const {
|
|
4
|
+
collectionMutators: s,
|
|
5
|
+
cookieMutators: a,
|
|
6
|
+
environmentMutators: r,
|
|
7
|
+
folderMutators: c,
|
|
8
|
+
requestExampleMutators: l,
|
|
9
|
+
requestMutators: E,
|
|
10
|
+
serverMutators: u,
|
|
11
|
+
securitySchemeMutators: S,
|
|
12
|
+
workspaceMutators: O
|
|
13
|
+
} = t;
|
|
14
|
+
Object.values(
|
|
15
|
+
JSON.parse(localStorage.getItem(e.COLLECTION) || "{}")
|
|
16
|
+
).forEach(s.rawAdd), Object.values(
|
|
17
|
+
JSON.parse(localStorage.getItem(e.COOKIE) || "{}")
|
|
18
|
+
).forEach(a.add), Object.values(
|
|
19
|
+
JSON.parse(localStorage.getItem(e.ENVIRONMENT) || "{}")
|
|
20
|
+
).forEach(r.add), Object.values(
|
|
21
|
+
JSON.parse(localStorage.getItem(e.FOLDER) || "{}")
|
|
22
|
+
).forEach(c.rawAdd), Object.values(
|
|
23
|
+
JSON.parse(localStorage.getItem(e.REQUEST_EXAMPLE) || "{}")
|
|
24
|
+
).forEach(l.rawAdd), Object.values(
|
|
25
|
+
JSON.parse(localStorage.getItem(e.REQUEST) || "{}")
|
|
26
|
+
).forEach(E.rawAdd), Object.values(
|
|
27
|
+
JSON.parse(localStorage.getItem(e.SERVER) || "{}")
|
|
28
|
+
).forEach(u.rawAdd), Object.values(
|
|
29
|
+
JSON.parse(localStorage.getItem(e.SECURITY_SCHEME) || "{}")
|
|
30
|
+
).forEach(S.add), Object.values(
|
|
31
|
+
JSON.parse(localStorage.getItem(e.WORKSPACE + o) || "{}")
|
|
32
|
+
).forEach(O.add);
|
|
33
|
+
};
|
|
34
|
+
export {
|
|
35
|
+
h as loadAllResources
|
|
36
|
+
};
|
package/dist/router.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export declare enum PathId {
|
|
|
8
8
|
Server = "server"
|
|
9
9
|
}
|
|
10
10
|
/** Routes required by the client modal */
|
|
11
|
-
export declare const
|
|
11
|
+
export declare const modalRoutes: ({
|
|
12
12
|
path: string;
|
|
13
13
|
redirect: string;
|
|
14
14
|
component?: undefined;
|
|
@@ -19,7 +19,7 @@ export declare const clientRoutes: ({
|
|
|
19
19
|
})[];
|
|
20
20
|
export declare const router: import("vue-router").Router;
|
|
21
21
|
/** Creates the in memory client router */
|
|
22
|
-
export declare const
|
|
22
|
+
export declare const modalRouter: import("vue-router").Router;
|
|
23
23
|
export declare const activeRouterParams: import("vue").ComputedRef<{
|
|
24
24
|
collection: string;
|
|
25
25
|
environment: string;
|
package/dist/router.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../src/router.ts"],"names":[],"mappings":"AAGA,oBAAY,MAAM;IAChB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,MAAM,WAAW;IACjB,WAAW,gBAAgB;IAC3B,MAAM,WAAW;CAClB;AAED,0CAA0C;AAC1C,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../src/router.ts"],"names":[],"mappings":"AAGA,oBAAY,MAAM;IAChB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,MAAM,WAAW;IACjB,WAAW,gBAAgB;IAC3B,MAAM,WAAW;CAClB;AAED,0CAA0C;AAC1C,eAAO,MAAM,WAAW;;;;;;;;IAcvB,CAAA;AAyDD,eAAO,MAAM,MAAM,6BAGjB,CAAA;AAEF,0CAA0C;AAC1C,eAAO,MAAM,WAAW,6BAGtB,CAAA;AAEF,eAAO,MAAM,kBAAkB;;;;;;;;EAyB7B,CAAA;AAEF,gGAAgG;AAChG,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,QAmBtC"}
|
package/dist/router.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
import { createRouter as c, createWebHistory as l, createMemoryHistory as
|
|
1
|
+
import { computed as m } from "vue";
|
|
2
|
+
import { createRouter as c, createWebHistory as l, createMemoryHistory as i } from "vue-router";
|
|
3
3
|
var u = /* @__PURE__ */ ((e) => (e.Request = "request", e.Example = "example", e.Cookies = "cookies", e.Collection = "collection", e.Schema = "schema", e.Environment = "environment", e.Server = "server", e))(u || {});
|
|
4
4
|
const s = [
|
|
5
5
|
{ path: "/", redirect: "/request/default" },
|
|
@@ -71,10 +71,10 @@ const s = [
|
|
|
71
71
|
], t = c({
|
|
72
72
|
history: l(),
|
|
73
73
|
routes: p
|
|
74
|
-
}),
|
|
75
|
-
history:
|
|
74
|
+
}), n = c({
|
|
75
|
+
history: i(),
|
|
76
76
|
routes: s
|
|
77
|
-
}),
|
|
77
|
+
}), d = m(() => {
|
|
78
78
|
const e = {
|
|
79
79
|
collection: "default",
|
|
80
80
|
environment: "default",
|
|
@@ -83,15 +83,15 @@ const s = [
|
|
|
83
83
|
schema: "default",
|
|
84
84
|
cookies: "default",
|
|
85
85
|
server: "default"
|
|
86
|
-
}, o =
|
|
86
|
+
}, o = n.currentRoute.value.matched.length ? n.currentRoute.value : t.currentRoute.value;
|
|
87
87
|
return o && Object.values(u).forEach((r) => {
|
|
88
88
|
o.params[r] && (e[r] = o.params[r]);
|
|
89
89
|
}), e;
|
|
90
90
|
});
|
|
91
|
-
function
|
|
92
|
-
var r,
|
|
91
|
+
function f(e, o) {
|
|
92
|
+
var r, a;
|
|
93
93
|
t.currentRoute.value && // If the item is missing then we know the UID is no longer in use and redirect to the default
|
|
94
|
-
!o && ((r = t.currentRoute.value) != null && r.params[e]) && ((
|
|
94
|
+
!o && ((r = t.currentRoute.value) != null && r.params[e]) && ((a = t.currentRoute.value) == null ? void 0 : a.params[e]) !== "default" && // We only redirect if the key is missing for the matching route
|
|
95
95
|
t.currentRoute.value.path.includes(e) && t.push({
|
|
96
96
|
params: {
|
|
97
97
|
...t.currentRoute.value.params,
|
|
@@ -101,9 +101,9 @@ function d(e, o) {
|
|
|
101
101
|
}
|
|
102
102
|
export {
|
|
103
103
|
u as PathId,
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
104
|
+
d as activeRouterParams,
|
|
105
|
+
f as fallbackMissingParams,
|
|
106
|
+
n as modalRouter,
|
|
107
|
+
s as modalRoutes,
|
|
108
108
|
t as router
|
|
109
109
|
};
|