@scalar/api-client 2.22.3 → 2.23.2
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 +49 -0
- package/dist/style.css +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +13 -3
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.js +68 -68
- package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts +5 -3
- package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request-security.js +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request.d.ts +3 -2
- package/dist/v2/blocks/operation-block/helpers/build-request.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/index.d.ts +2 -1
- package/dist/v2/blocks/operation-block/index.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/index.js +7 -4
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts +3 -2
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js +2 -2
- package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts +3 -2
- package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/get-secrets.d.ts +2 -2
- package/dist/v2/blocks/operation-code-sample/helpers/get-secrets.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.d.ts +3 -2
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-security-schemes.d.ts +2 -2
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-security-schemes.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts +8 -5
- package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.js +2 -2
- package/dist/v2/blocks/request-block/RequestBlock.vue2.js +4 -4
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.js +49 -45
- package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts +4 -2
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +18 -181
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +118 -107
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts +3 -2
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.js +30 -33
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts +11 -178
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js +107 -110
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/auth-options.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/auth-options.js +5 -29
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts +6 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.js +85 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.d.ts +9 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.js +15 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts +3 -2
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts +23 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/index.d.ts +2 -2
- package/dist/v2/blocks/scalar-auth-selector-block/index.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/index.js +4 -6
- package/dist/v2/features/app/App.vue.d.ts.map +1 -1
- package/dist/v2/features/app/App.vue.js +127 -92
- package/dist/v2/features/app/app-state.d.ts +1 -1
- package/dist/v2/features/app/app-state.d.ts.map +1 -1
- package/dist/v2/features/app/app-state.js +145 -142
- package/dist/v2/features/app/helpers/routes.d.ts +1 -1
- package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
- package/dist/v2/features/app/helpers/routes.js +31 -25
- package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Authentication.vue.js +1 -1
- package/dist/v2/features/collection/components/Authentication.vue2.js +14 -11
- package/dist/v2/features/import-listener/ImportListener.vue.d.ts +52 -0
- package/dist/v2/features/import-listener/ImportListener.vue.d.ts.map +1 -0
- package/dist/v2/features/import-listener/ImportListener.vue.js +91 -0
- package/dist/v2/features/import-listener/ImportListener.vue2.js +4 -0
- package/dist/v2/features/import-listener/components/DropEventListener.vue.d.ts +7 -0
- package/dist/v2/features/import-listener/components/DropEventListener.vue.d.ts.map +1 -0
- package/dist/v2/features/import-listener/components/DropEventListener.vue.js +81 -0
- package/dist/v2/features/import-listener/components/DropEventListener.vue2.js +4 -0
- package/dist/v2/features/import-listener/components/ImportModal.vue.d.ts +40 -0
- package/dist/v2/features/import-listener/components/ImportModal.vue.d.ts.map +1 -0
- package/dist/v2/features/import-listener/components/ImportModal.vue.js +170 -0
- package/dist/v2/features/import-listener/components/ImportModal.vue3.js +5 -0
- package/dist/v2/features/import-listener/components/WorkspaceSelector.vue.d.ts +29 -0
- package/dist/v2/features/import-listener/components/WorkspaceSelector.vue.d.ts.map +1 -0
- package/dist/v2/features/import-listener/components/WorkspaceSelector.vue.js +83 -0
- package/dist/v2/features/import-listener/components/WorkspaceSelector.vue2.js +4 -0
- package/dist/v2/features/import-listener/helpers/generate-unique-slug.d.ts +16 -0
- package/dist/v2/features/import-listener/helpers/generate-unique-slug.d.ts.map +1 -0
- package/dist/v2/features/import-listener/helpers/generate-unique-slug.js +11 -0
- package/dist/v2/features/import-listener/helpers/get-url-query-parameter.d.ts +8 -0
- package/dist/v2/features/import-listener/helpers/get-url-query-parameter.d.ts.map +1 -0
- package/dist/v2/features/import-listener/helpers/get-url-query-parameter.js +4 -0
- package/dist/v2/features/import-listener/helpers/import-document-to-workspace.d.ts +30 -0
- package/dist/v2/features/import-listener/helpers/import-document-to-workspace.d.ts.map +1 -0
- package/dist/v2/features/import-listener/helpers/import-document-to-workspace.js +33 -0
- package/dist/v2/features/import-listener/helpers/load-document-from-source.d.ts +15 -0
- package/dist/v2/features/import-listener/helpers/load-document-from-source.d.ts.map +1 -0
- package/dist/v2/features/import-listener/helpers/load-document-from-source.js +28 -0
- package/dist/v2/features/import-listener/helpers/wait-for-condition.d.ts +15 -0
- package/dist/v2/features/import-listener/helpers/wait-for-condition.d.ts.map +1 -0
- package/dist/v2/features/import-listener/helpers/wait-for-condition.js +16 -0
- package/dist/v2/features/import-listener/index.d.ts +2 -0
- package/dist/v2/features/import-listener/index.d.ts.map +1 -0
- package/dist/v2/features/import-listener/index.js +4 -0
- package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
- package/dist/v2/features/modal/Modal.vue.js +1 -1
- package/dist/v2/features/modal/Modal.vue2.js +14 -12
- package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
- package/dist/v2/features/operation/Operation.vue.js +44 -35
- package/dist/v2/features/operation/helpers/get-selected-security.d.ts +3 -5
- package/dist/v2/features/operation/helpers/get-selected-security.d.ts.map +1 -1
- package/dist/v2/workspace-events.d.ts.map +1 -1
- package/dist/v2/workspace-events.js +116 -109
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +19 -14
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.bench.d.ts +0 -2
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.bench.d.ts.map +0 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/convert-security-scheme-secrets.d.ts +0 -8
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/convert-security-scheme-secrets.d.ts.map +0 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/convert-security-scheme-secrets.js +0 -33
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-auth-config.d.ts +0 -7
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-auth-config.d.ts.map +0 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-auth-config.js +0 -13
|
@@ -1,59 +1,61 @@
|
|
|
1
1
|
import { isDefined as A } from "@scalar/helpers/array/is-defined";
|
|
2
|
-
import { sortByOrder as
|
|
3
|
-
import { isHttpMethod as
|
|
4
|
-
import { createSidebarState as
|
|
2
|
+
import { sortByOrder as V } from "@scalar/helpers/array/sort-by-order";
|
|
3
|
+
import { isHttpMethod as Y } from "@scalar/helpers/http/is-http-method";
|
|
4
|
+
import { createSidebarState as j, generateReverseIndex as z } from "@scalar/sidebar";
|
|
5
5
|
import { createWorkspaceStore as C } from "@scalar/workspace-store/client";
|
|
6
6
|
import { createWorkspaceEventBus as J } from "@scalar/workspace-store/events";
|
|
7
7
|
import { generateUniqueValue as M } from "@scalar/workspace-store/helpers/generate-unique-value";
|
|
8
|
-
import { getParentEntry as
|
|
8
|
+
import { getParentEntry as d } from "@scalar/workspace-store/navigation";
|
|
9
9
|
import { createWorkspaceStorePersistence as G } from "@scalar/workspace-store/persistence";
|
|
10
10
|
import { persistencePlugin as Q } from "@scalar/workspace-store/plugins/client";
|
|
11
11
|
import { extensions as X } from "@scalar/workspace-store/schemas/extensions";
|
|
12
12
|
import { shallowRef as E, computed as i, ref as p, watch as Z } from "vue";
|
|
13
13
|
import { getActiveEnvironment as ee } from "../../helpers/get-active-environment.js";
|
|
14
|
-
import { getTabDetails as
|
|
15
|
-
import { slugify as
|
|
14
|
+
import { getTabDetails as ae } from "../../helpers/get-tab-details.js";
|
|
15
|
+
import { slugify as te } from "../../helpers/slugify.js";
|
|
16
16
|
import { workspaceStorage as ne } from "../../helpers/storage.js";
|
|
17
17
|
import { initializeAppEventHandlers as re } from "./app-events.js";
|
|
18
|
-
const oe = 1e3,
|
|
18
|
+
const oe = 1e3, w = J({
|
|
19
19
|
debug: !1
|
|
20
|
-
}), v = p(void 0), k = p(void 0),
|
|
20
|
+
}), v = p(void 0), k = p(void 0), x = p(void 0), B = p(void 0), O = p(void 0), L = p(void 0), h = p(!1), l = E(null);
|
|
21
21
|
Z(l, (e) => {
|
|
22
|
-
e && e.afterEach((
|
|
22
|
+
e && e.afterEach((a) => ge(a));
|
|
23
23
|
});
|
|
24
|
-
const
|
|
25
|
-
function c(e,
|
|
26
|
-
const
|
|
27
|
-
if (typeof
|
|
28
|
-
return e === "method" ?
|
|
24
|
+
const m = i(() => l.value?.currentRoute.value ?? null);
|
|
25
|
+
function c(e, a) {
|
|
26
|
+
const t = a?.params[e];
|
|
27
|
+
if (typeof t == "string")
|
|
28
|
+
return e === "method" ? t && Y(t) ? t : void 0 : decodeURIComponent(t);
|
|
29
29
|
}
|
|
30
|
-
const W = E(null), I = p([]), o = E(null), T = i(() => o.value?.workspace.documents[
|
|
31
|
-
I.value = await
|
|
32
|
-
(e) => e.map(({ teamUid:
|
|
33
|
-
id:
|
|
34
|
-
teamUid:
|
|
35
|
-
namespace:
|
|
30
|
+
const W = E(null), I = p([]), o = E(null), T = i(() => o.value?.workspace.documents[x.value ?? ""] || null), se = i(() => ee(o.value, T.value)), { workspace: g } = await G(), f = (e, a) => `${e}/${a}`;
|
|
31
|
+
I.value = await g.getAll().then(
|
|
32
|
+
(e) => e.map(({ teamUid: a, namespace: t, slug: n, name: u }) => ({
|
|
33
|
+
id: f(t, n),
|
|
34
|
+
teamUid: a,
|
|
35
|
+
namespace: t,
|
|
36
36
|
slug: n,
|
|
37
37
|
label: u
|
|
38
38
|
}))
|
|
39
39
|
);
|
|
40
|
-
const ce = async ({ namespace: e, slug:
|
|
41
|
-
plugins: [
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
const ce = async ({ namespace: e, slug: a }) => C({
|
|
41
|
+
plugins: [
|
|
42
|
+
await Q({ workspaceId: f(e, a), debounceDelay: oe })
|
|
43
|
+
]
|
|
44
|
+
}), ue = async (e, a) => {
|
|
45
|
+
const t = await g.getItem({ namespace: e, slug: a });
|
|
46
|
+
if (!t)
|
|
45
47
|
return {
|
|
46
48
|
success: !1
|
|
47
49
|
};
|
|
48
|
-
const n = await ce({ namespace: e, slug:
|
|
49
|
-
return n.loadWorkspace(
|
|
50
|
+
const n = await ce({ namespace: e, slug: a });
|
|
51
|
+
return n.loadWorkspace(t.workspace), W.value = { id: f(t.namespace, t.slug), label: t.name }, o.value = n, {
|
|
50
52
|
success: !0,
|
|
51
53
|
workspace: n.workspace
|
|
52
54
|
};
|
|
53
55
|
}, le = async ({
|
|
54
56
|
name: e,
|
|
55
|
-
teamUid:
|
|
56
|
-
namespace:
|
|
57
|
+
teamUid: a,
|
|
58
|
+
namespace: t,
|
|
57
59
|
slug: n
|
|
58
60
|
}) => {
|
|
59
61
|
const u = C();
|
|
@@ -74,274 +76,275 @@ const ce = async ({ namespace: e, slug: t }) => C({
|
|
|
74
76
|
"x-scalar-icon": "interface-edit-tool-pencil"
|
|
75
77
|
}
|
|
76
78
|
});
|
|
77
|
-
const s = await
|
|
78
|
-
{ namespace:
|
|
79
|
+
const s = await g.setItem(
|
|
80
|
+
{ namespace: t, slug: n },
|
|
79
81
|
{
|
|
80
82
|
name: e,
|
|
81
|
-
teamUid:
|
|
83
|
+
teamUid: a,
|
|
82
84
|
workspace: u.exportWorkspace()
|
|
83
85
|
}
|
|
84
86
|
);
|
|
85
87
|
return I.value.push({
|
|
86
|
-
id:
|
|
88
|
+
id: f(s.namespace, s.slug),
|
|
87
89
|
teamUid: s.teamUid,
|
|
88
90
|
namespace: s.namespace,
|
|
89
91
|
slug: s.slug,
|
|
90
92
|
label: s.name
|
|
91
93
|
}), s;
|
|
92
|
-
},
|
|
94
|
+
}, N = async (e, a) => {
|
|
93
95
|
await l.value?.push({
|
|
94
96
|
name: "workspace.environment",
|
|
95
|
-
params: { namespace: e, workspaceSlug:
|
|
97
|
+
params: { namespace: e, workspaceSlug: a }
|
|
96
98
|
});
|
|
97
|
-
},
|
|
99
|
+
}, P = async ({
|
|
98
100
|
key: e,
|
|
99
|
-
name:
|
|
101
|
+
name: a
|
|
100
102
|
}) => {
|
|
101
103
|
o.value = null;
|
|
102
|
-
const
|
|
103
|
-
defaultValue: e?.slug ??
|
|
104
|
+
const t = await M({
|
|
105
|
+
defaultValue: e?.slug ?? a,
|
|
104
106
|
// Use the provided id if it exists, otherwise use the name
|
|
105
|
-
validation: async (s) => !await
|
|
107
|
+
validation: async (s) => !await g.has({ namespace: e?.namespace ?? "local", slug: s }),
|
|
106
108
|
maxRetries: 100,
|
|
107
|
-
transformation:
|
|
109
|
+
transformation: te
|
|
108
110
|
});
|
|
109
|
-
if (!
|
|
111
|
+
if (!t)
|
|
110
112
|
return;
|
|
111
113
|
const n = {
|
|
112
114
|
teamUid: e?.teamUid,
|
|
113
115
|
namespace: e?.namespace,
|
|
114
|
-
slug:
|
|
115
|
-
name:
|
|
116
|
+
slug: t,
|
|
117
|
+
name: a
|
|
116
118
|
}, u = await le(n);
|
|
117
|
-
return await
|
|
118
|
-
}, ie = async (e,
|
|
119
|
-
o.value = null,
|
|
120
|
-
const
|
|
121
|
-
if (
|
|
122
|
-
const u =
|
|
123
|
-
D && await l.value?.replace(
|
|
119
|
+
return await N(u.namespace, u.slug), u;
|
|
120
|
+
}, ie = async (e, a) => {
|
|
121
|
+
o.value = null, h.value = !0;
|
|
122
|
+
const t = await ue(e, a);
|
|
123
|
+
if (t.success) {
|
|
124
|
+
const u = t.workspace["x-scalar-active-tab"] ?? 0, s = t.workspace["x-scalar-tabs"], D = s?.[u];
|
|
125
|
+
D && await l.value?.replace({
|
|
126
|
+
path: D.path,
|
|
127
|
+
query: m.value?.query ?? {}
|
|
128
|
+
}), s && u >= s.length && w.emit("tabs:update:tabs", {
|
|
124
129
|
"x-scalar-active-tab": 0
|
|
125
|
-
}), s ||
|
|
126
|
-
"x-scalar-tabs": [U(
|
|
130
|
+
}), s || w.emit("tabs:update:tabs", {
|
|
131
|
+
"x-scalar-tabs": [U(m.value)],
|
|
127
132
|
"x-scalar-active-tab": 0
|
|
128
|
-
}),
|
|
133
|
+
}), h.value = !1;
|
|
129
134
|
return;
|
|
130
135
|
}
|
|
131
|
-
const n = await
|
|
136
|
+
const n = await P({
|
|
132
137
|
name: "Default Workspace",
|
|
133
138
|
key: { slug: "default" }
|
|
134
139
|
});
|
|
135
|
-
if (
|
|
140
|
+
if (h.value = !1, !n)
|
|
136
141
|
return console.error("Failed to create the default workspace, something went wrong, can not load the workspace");
|
|
137
142
|
r.reset();
|
|
138
|
-
},
|
|
143
|
+
}, _ = i(() => {
|
|
139
144
|
const e = o.value;
|
|
140
145
|
if (!e)
|
|
141
146
|
return [];
|
|
142
|
-
const
|
|
143
|
-
return
|
|
144
|
-
}), r =
|
|
147
|
+
const a = e.workspace["x-scalar-order"] ?? Object.keys(e.workspace.documents);
|
|
148
|
+
return V(Object.keys(e.workspace.documents), a, (t) => t).map((t) => e.workspace.documents[t]?.["x-scalar-navigation"]).filter(A);
|
|
149
|
+
}), r = j(_), y = ({
|
|
145
150
|
document: e,
|
|
146
|
-
path:
|
|
147
|
-
method:
|
|
151
|
+
path: a,
|
|
152
|
+
method: t,
|
|
148
153
|
example: n
|
|
149
|
-
}) => JSON.stringify([e,
|
|
154
|
+
}) => JSON.stringify([e, a, t, n].filter(A)), R = i(
|
|
150
155
|
() => z({
|
|
151
|
-
items:
|
|
156
|
+
items: _.value,
|
|
152
157
|
nestedKey: "children",
|
|
153
158
|
filter: (e) => e.type === "document" || e.type === "operation" || e.type === "example",
|
|
154
159
|
getId: (e) => {
|
|
155
|
-
const
|
|
156
|
-
return
|
|
157
|
-
document:
|
|
158
|
-
path:
|
|
159
|
-
method:
|
|
160
|
+
const a = d("document", e), t = d("operation", e);
|
|
161
|
+
return y({
|
|
162
|
+
document: a?.name ?? "",
|
|
163
|
+
path: t?.path,
|
|
164
|
+
method: t?.method,
|
|
160
165
|
example: e.type === "example" ? e.name : void 0
|
|
161
166
|
});
|
|
162
167
|
}
|
|
163
168
|
})
|
|
164
169
|
), b = (e) => {
|
|
165
|
-
const
|
|
166
|
-
return
|
|
167
|
-
|
|
170
|
+
const a = R.value.get(y(e));
|
|
171
|
+
return a || R.value.get(
|
|
172
|
+
y({
|
|
168
173
|
document: e.document,
|
|
169
174
|
path: e.path,
|
|
170
175
|
method: e.method
|
|
171
176
|
})
|
|
172
177
|
);
|
|
173
|
-
},
|
|
174
|
-
const
|
|
175
|
-
if (!
|
|
178
|
+
}, $ = (e) => {
|
|
179
|
+
const a = r.getEntryById(e);
|
|
180
|
+
if (!a) {
|
|
176
181
|
console.warn(`Could not find sidebar entry with id ${e} to select`);
|
|
177
182
|
return;
|
|
178
183
|
}
|
|
179
|
-
if (
|
|
184
|
+
if (a.type === "document") {
|
|
180
185
|
if (r.selectedItem.value === e) {
|
|
181
186
|
r.setExpanded(e, !r.isExpanded(e));
|
|
182
187
|
return;
|
|
183
188
|
}
|
|
184
189
|
return r.setSelected(e), r.setExpanded(e, !0), l.value?.push({
|
|
185
190
|
name: "document.overview",
|
|
186
|
-
params: { documentSlug:
|
|
191
|
+
params: { documentSlug: a.name }
|
|
187
192
|
});
|
|
188
193
|
}
|
|
189
|
-
if (
|
|
194
|
+
if (a.type === "operation") {
|
|
190
195
|
if (r.isSelected(e)) {
|
|
191
196
|
r.setExpanded(e, !r.isExpanded(e));
|
|
192
197
|
return;
|
|
193
198
|
}
|
|
194
|
-
const
|
|
195
|
-
return
|
|
199
|
+
const t = a.children?.find((n) => n.type === "example");
|
|
200
|
+
return t ? (r.setSelected(t.id), r.setExpanded(t.id, !0)) : r.setSelected(e), l.value?.push({
|
|
196
201
|
name: "example",
|
|
197
202
|
params: {
|
|
198
|
-
documentSlug:
|
|
199
|
-
pathEncoded: encodeURIComponent(
|
|
200
|
-
method:
|
|
201
|
-
exampleName:
|
|
203
|
+
documentSlug: d("document", a)?.name,
|
|
204
|
+
pathEncoded: encodeURIComponent(a.path),
|
|
205
|
+
method: a.method,
|
|
206
|
+
exampleName: t?.name ?? "default"
|
|
202
207
|
}
|
|
203
208
|
});
|
|
204
209
|
}
|
|
205
|
-
if (
|
|
210
|
+
if (a.type === "example") {
|
|
206
211
|
r.setSelected(e);
|
|
207
|
-
const
|
|
212
|
+
const t = d("operation", a);
|
|
208
213
|
return l.value?.push({
|
|
209
214
|
name: "example",
|
|
210
215
|
params: {
|
|
211
|
-
documentSlug:
|
|
212
|
-
pathEncoded: encodeURIComponent(
|
|
213
|
-
method:
|
|
214
|
-
exampleName:
|
|
216
|
+
documentSlug: d("document", a)?.name,
|
|
217
|
+
pathEncoded: encodeURIComponent(t?.path ?? ""),
|
|
218
|
+
method: t?.method,
|
|
219
|
+
exampleName: a.name
|
|
215
220
|
}
|
|
216
221
|
});
|
|
217
222
|
}
|
|
218
|
-
if (
|
|
223
|
+
if (a.type === "text")
|
|
219
224
|
return l.value?.push({
|
|
220
225
|
name: "document.overview",
|
|
221
226
|
params: {
|
|
222
|
-
documentSlug:
|
|
227
|
+
documentSlug: d("document", a)?.name
|
|
223
228
|
}
|
|
224
229
|
});
|
|
225
230
|
r.setExpanded(e, !r.isExpanded(e));
|
|
226
231
|
}, pe = async () => {
|
|
227
232
|
if (!o.value)
|
|
228
233
|
return;
|
|
229
|
-
const e = o.value.workspace["x-scalar-active-tab"] ?? 0,
|
|
230
|
-
|
|
234
|
+
const e = o.value.workspace["x-scalar-active-tab"] ?? 0, a = o.value.workspace["x-scalar-tabs"]?.[e];
|
|
235
|
+
a && await l.value?.replace(a.path);
|
|
231
236
|
}, F = (e) => {
|
|
232
237
|
e && o.value?.buildSidebar(e);
|
|
233
238
|
}, me = (e) => {
|
|
234
|
-
const
|
|
235
|
-
if (!
|
|
239
|
+
const a = T.value?.["x-scalar-navigation"]?.name;
|
|
240
|
+
if (!a)
|
|
236
241
|
return;
|
|
237
|
-
const
|
|
238
|
-
document:
|
|
242
|
+
const t = b({
|
|
243
|
+
document: a,
|
|
239
244
|
path: e.path,
|
|
240
245
|
method: e.method,
|
|
241
246
|
example: e.exampleKey
|
|
242
247
|
});
|
|
243
|
-
(!
|
|
244
|
-
}, de = 288, ve = i(() => o.value?.workspace?.["x-scalar-sidebar-width"] ?? de), fe = (e) => o.value?.update("x-scalar-sidebar-width", e),
|
|
245
|
-
const
|
|
248
|
+
(!t || t.type !== "example") && (F(a), m.value && H(m.value));
|
|
249
|
+
}, de = 288, ve = i(() => o.value?.workspace?.["x-scalar-sidebar-width"] ?? de), fe = (e) => o.value?.update("x-scalar-sidebar-width", e), S = p(!0), he = "x-scalar-tabs", we = "x-scalar-active-tab", U = (e) => {
|
|
250
|
+
const a = c("method", e), t = c("pathEncoded", e), n = c("documentSlug", e), u = c("workspaceSlug", e);
|
|
246
251
|
return {
|
|
247
|
-
...
|
|
252
|
+
...ae({
|
|
248
253
|
workspace: u,
|
|
249
254
|
document: n,
|
|
250
|
-
path:
|
|
251
|
-
method:
|
|
255
|
+
path: t,
|
|
256
|
+
method: a,
|
|
252
257
|
getEntryByLocation: b
|
|
253
258
|
}),
|
|
254
|
-
path:
|
|
259
|
+
path: m.value?.path ?? ""
|
|
255
260
|
};
|
|
256
|
-
}, K = i(() => o.value?.workspace[he] ?? [U(
|
|
257
|
-
const
|
|
258
|
-
if (!
|
|
261
|
+
}, K = i(() => o.value?.workspace[he] ?? [U(m.value)]), xe = i(() => o.value?.workspace[we] ?? 0), q = async (e) => {
|
|
262
|
+
const a = K.value[e];
|
|
263
|
+
if (!a) {
|
|
259
264
|
console.warn(`Cannot copy URL: tab at index ${e} does not exist`);
|
|
260
265
|
return;
|
|
261
266
|
}
|
|
262
|
-
const
|
|
267
|
+
const t = `${window.location.origin}${a.path}`;
|
|
263
268
|
try {
|
|
264
|
-
await navigator.clipboard.writeText(
|
|
269
|
+
await navigator.clipboard.writeText(t);
|
|
265
270
|
} catch (n) {
|
|
266
271
|
console.error("Failed to copy URL to clipboard:", n);
|
|
267
272
|
}
|
|
268
273
|
}, ge = (e) => {
|
|
269
|
-
const
|
|
270
|
-
if (v.value = c("namespace", e), k.value =
|
|
271
|
-
if (e.path !== "" && ne.setCurrentPath(e.path),
|
|
272
|
-
return ie(v.value,
|
|
273
|
-
|
|
274
|
-
return o?.value?.update("x-scalar-active-document", a);
|
|
275
|
-
be(e), V(e);
|
|
274
|
+
const a = c("workspaceSlug", e), t = c("documentSlug", e);
|
|
275
|
+
if (v.value = c("namespace", e), k.value = a, x.value = t, B.value = c("method", e), O.value = c("pathEncoded", e), L.value = c("exampleName", e), !(!v.value || !a)) {
|
|
276
|
+
if (e.path !== "" && ne.setCurrentPath(e.path), f(v.value, a) !== W.value?.id)
|
|
277
|
+
return ie(v.value, a);
|
|
278
|
+
t && t !== o.value?.workspace[X.workspace.activeDocument] && o?.value?.update("x-scalar-active-document", t), be(e), H(e);
|
|
276
279
|
}
|
|
277
280
|
}, be = (e) => {
|
|
278
|
-
const
|
|
279
|
-
!n || n.path === e.path || (t
|
|
280
|
-
},
|
|
281
|
-
const
|
|
282
|
-
if (!
|
|
281
|
+
const a = o.value?.workspace["x-scalar-tabs"] ?? [], t = o.value?.workspace["x-scalar-active-tab"] ?? 0, n = a[t];
|
|
282
|
+
!n || n.path === e.path || (a[t] = U(e));
|
|
283
|
+
}, H = (e) => {
|
|
284
|
+
const a = c("documentSlug", e);
|
|
285
|
+
if (!a) {
|
|
283
286
|
r.setSelected(null);
|
|
284
287
|
return;
|
|
285
288
|
}
|
|
286
|
-
const
|
|
287
|
-
document:
|
|
289
|
+
const t = b({
|
|
290
|
+
document: a,
|
|
288
291
|
path: c("pathEncoded", e),
|
|
289
292
|
method: c("method", e),
|
|
290
293
|
example: c("exampleName", e)
|
|
291
294
|
});
|
|
292
|
-
|
|
295
|
+
t && (r.setSelected(t.id), r.setExpanded(t.id, !0));
|
|
293
296
|
};
|
|
294
297
|
re({
|
|
295
|
-
eventBus:
|
|
298
|
+
eventBus: w,
|
|
296
299
|
router: l,
|
|
297
300
|
store: o,
|
|
298
301
|
navigateToCurrentTab: pe,
|
|
299
302
|
rebuildSidebar: F,
|
|
300
303
|
onAfterExampleCreation: me,
|
|
301
|
-
onSelectSidebarItem:
|
|
302
|
-
onCopyTabUrl: (e) =>
|
|
303
|
-
onToggleSidebar: () =>
|
|
304
|
+
onSelectSidebarItem: $,
|
|
305
|
+
onCopyTabUrl: (e) => q(e),
|
|
306
|
+
onToggleSidebar: () => S.value = !S.value
|
|
304
307
|
});
|
|
305
|
-
function
|
|
308
|
+
function _e(e) {
|
|
306
309
|
return e && (l.value = e), {
|
|
307
310
|
/** Active workspace store */
|
|
308
311
|
store: o,
|
|
309
312
|
sidebar: {
|
|
310
313
|
state: r,
|
|
311
314
|
width: ve,
|
|
312
|
-
isOpen:
|
|
313
|
-
handleSelectItem:
|
|
315
|
+
isOpen: S,
|
|
316
|
+
handleSelectItem: $,
|
|
314
317
|
handleSidebarWidthUpdate: fe,
|
|
315
318
|
getEntryByLocation: b
|
|
316
319
|
},
|
|
317
320
|
tabs: {
|
|
318
321
|
state: K,
|
|
319
322
|
activeTabIndex: xe,
|
|
320
|
-
copyTabUrl:
|
|
323
|
+
copyTabUrl: q
|
|
321
324
|
},
|
|
322
325
|
workspace: {
|
|
323
|
-
create:
|
|
326
|
+
create: P,
|
|
324
327
|
workspaceList: I,
|
|
325
328
|
activeWorkspace: W,
|
|
326
|
-
navigateToWorkspace:
|
|
327
|
-
isOpen: i(() => !!(k.value && !
|
|
329
|
+
navigateToWorkspace: N,
|
|
330
|
+
isOpen: i(() => !!(k.value && !x.value))
|
|
328
331
|
},
|
|
329
|
-
eventBus:
|
|
332
|
+
eventBus: w,
|
|
330
333
|
router: l,
|
|
331
|
-
currentRoute:
|
|
332
|
-
loading:
|
|
334
|
+
currentRoute: m,
|
|
335
|
+
loading: h,
|
|
333
336
|
activeEntities: {
|
|
334
337
|
namespace: v,
|
|
335
338
|
workspaceSlug: k,
|
|
336
|
-
documentSlug:
|
|
339
|
+
documentSlug: x,
|
|
337
340
|
path: O,
|
|
338
341
|
method: B,
|
|
339
|
-
exampleName:
|
|
342
|
+
exampleName: L
|
|
340
343
|
},
|
|
341
344
|
environment: se,
|
|
342
345
|
document: T
|
|
343
346
|
};
|
|
344
347
|
}
|
|
345
348
|
export {
|
|
346
|
-
|
|
349
|
+
_e as useAppState
|
|
347
350
|
};
|
|
@@ -3,7 +3,7 @@ import type { WorkspaceStore } from '@scalar/workspace-store/client';
|
|
|
3
3
|
import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
|
|
4
4
|
import type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments';
|
|
5
5
|
import type { WorkspaceDocument } from '@scalar/workspace-store/schemas/workspace';
|
|
6
|
-
import type { MergedSecuritySchemes } from '../../../../v2/blocks/scalar-auth-selector-block/helpers/merge-
|
|
6
|
+
import type { MergedSecuritySchemes } from '../../../../v2/blocks/scalar-auth-selector-block/helpers/merge-security.js';
|
|
7
7
|
import type { ClientPlugin } from '../../../../v2/helpers/plugins.js';
|
|
8
8
|
import type { ClientLayout } from '../../../../v2/types/layout';
|
|
9
9
|
/** These props are provided at the route level */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/helpers/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/helpers/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAEnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAA;AAGlF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+DAA+D,CAAA;AAU1G,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAExD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,kDAAkD;AAClD,MAAM,MAAM,UAAU,GAAG;IACvB,YAAY,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAClC,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,MAAM,EAAE,YAAY,CAAA;IACpB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,kBAAkB,CAAA;IAC/B,eAAe,EAAE,qBAAqB,CAAA;IACtC,cAAc,EAAE,cAAc,CAAA;IAC9B,eAAe,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;IAC9C,OAAO,EAAE,YAAY,EAAE,CAAA;CAGxB,CAAA;AAED,oCAAoC;AACpC,MAAM,MAAM,eAAe,GAAG,UAAU,GACtC,CACI;IACE,cAAc,EAAE,UAAU,CAAA;IAC1B,QAAQ,EAAE,iBAAiB,CAAA;CAC5B,GACD;IACE,cAAc,EAAE,WAAW,CAAA;IAC3B,QAAQ,EAAE,IAAI,CAAA;CACf,CACJ,CAAA;AAEH,MAAM,MAAM,0BAA0B,GAClC,WAAW,GACX,eAAe,GACf,cAAc,GACd,aAAa,GACb,QAAQ,GACR,aAAa,CAAA;AAEjB,kFAAkF;AAClF,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCAlBK,UAAU;8BAChB,iBAAiB;;oCAGX,WAAW;8BACjB,IAAI;;oCALE,UAAU;8BAChB,iBAAiB;;oCAGX,WAAW;8BACjB,IAAI;;;;;;;;;;;;;;;gCALE,UAAU;0BAChB,iBAAiB;;gCAGX,WAAW;0BACjB,IAAI;;gCALE,UAAU;0BAChB,iBAAiB;;gCAGX,WAAW;0BACjB,IAAI;;;;;;;;;IAgIM,CAAA"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import o from "../../collection/components/
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
|
|
1
|
+
import { mergeSearchParams as i } from "@scalar/helpers/url/merge-urls";
|
|
2
|
+
import s from "../../collection/components/Authentication.vue.js";
|
|
3
|
+
import o from "../../collection/components/Cookies.vue.js";
|
|
4
|
+
import n from "../../collection/components/Environment.vue.js";
|
|
5
|
+
import h from "../../collection/components/Overview.vue.js";
|
|
6
|
+
import d from "../../collection/components/Servers.vue.js";
|
|
7
|
+
import a from "../../collection/components/Settings.vue.js";
|
|
8
|
+
import f from "../../collection/DocumentCollection.vue.js";
|
|
9
|
+
import u from "../../collection/WorkspaceCollection.vue.js";
|
|
10
|
+
import l from "../../operation/Operation.vue.js";
|
|
11
|
+
import { workspaceStorage as m } from "../../../helpers/storage.js";
|
|
12
|
+
const A = [
|
|
12
13
|
{
|
|
13
14
|
path: "/@:namespace/:workspaceSlug",
|
|
14
15
|
children: [
|
|
@@ -19,13 +20,13 @@ const g = [
|
|
|
19
20
|
{
|
|
20
21
|
name: "example",
|
|
21
22
|
path: "path/:pathEncoded/method/:method/example/:exampleName",
|
|
22
|
-
component:
|
|
23
|
+
component: l
|
|
23
24
|
},
|
|
24
25
|
// Document Page
|
|
25
26
|
{
|
|
26
27
|
name: "document",
|
|
27
28
|
path: "",
|
|
28
|
-
component:
|
|
29
|
+
component: f,
|
|
29
30
|
children: [
|
|
30
31
|
// Redirect to overview
|
|
31
32
|
{
|
|
@@ -39,37 +40,37 @@ const g = [
|
|
|
39
40
|
{
|
|
40
41
|
name: "document.overview",
|
|
41
42
|
path: "overview",
|
|
42
|
-
component:
|
|
43
|
+
component: h
|
|
43
44
|
},
|
|
44
45
|
// Document servers
|
|
45
46
|
{
|
|
46
47
|
name: "document.servers",
|
|
47
48
|
path: "servers",
|
|
48
|
-
component:
|
|
49
|
+
component: d
|
|
49
50
|
},
|
|
50
51
|
// Document environment
|
|
51
52
|
{
|
|
52
53
|
name: "document.environment",
|
|
53
54
|
path: "environment",
|
|
54
|
-
component:
|
|
55
|
+
component: n
|
|
55
56
|
},
|
|
56
57
|
// Document authentication
|
|
57
58
|
{
|
|
58
59
|
name: "document.authentication",
|
|
59
60
|
path: "authentication",
|
|
60
|
-
component:
|
|
61
|
+
component: s
|
|
61
62
|
},
|
|
62
63
|
// Document cookies
|
|
63
64
|
{
|
|
64
65
|
name: "document.cookies",
|
|
65
66
|
path: "cookies",
|
|
66
|
-
component:
|
|
67
|
+
component: o
|
|
67
68
|
},
|
|
68
69
|
// Document settings
|
|
69
70
|
{
|
|
70
71
|
name: "document.settings",
|
|
71
72
|
path: "settings",
|
|
72
|
-
component:
|
|
73
|
+
component: a
|
|
73
74
|
}
|
|
74
75
|
]
|
|
75
76
|
}
|
|
@@ -79,25 +80,25 @@ const g = [
|
|
|
79
80
|
{
|
|
80
81
|
name: "workspace",
|
|
81
82
|
path: "",
|
|
82
|
-
component:
|
|
83
|
+
component: u,
|
|
83
84
|
children: [
|
|
84
85
|
// Workspace environment
|
|
85
86
|
{
|
|
86
87
|
name: "workspace.environment",
|
|
87
88
|
path: "environment",
|
|
88
|
-
component:
|
|
89
|
+
component: n
|
|
89
90
|
},
|
|
90
91
|
// Workspace cookies
|
|
91
92
|
{
|
|
92
93
|
name: "workspace.cookies",
|
|
93
94
|
path: "cookies",
|
|
94
|
-
component:
|
|
95
|
+
component: o
|
|
95
96
|
},
|
|
96
97
|
// Workspace settings
|
|
97
98
|
{
|
|
98
99
|
name: "workspace.settings",
|
|
99
100
|
path: "settings",
|
|
100
|
-
component:
|
|
101
|
+
component: a
|
|
101
102
|
}
|
|
102
103
|
]
|
|
103
104
|
}
|
|
@@ -105,9 +106,14 @@ const g = [
|
|
|
105
106
|
},
|
|
106
107
|
{
|
|
107
108
|
path: "/:pathMatch(.*)*",
|
|
108
|
-
redirect: () =>
|
|
109
|
+
redirect: () => {
|
|
110
|
+
const e = "/@local/local/drafts/overview", r = m.getLastPath() ?? e;
|
|
111
|
+
m.setCurrentPath(e);
|
|
112
|
+
const t = new URL(r, "http://example.com"), c = new URLSearchParams(window.location.search), p = i(t.searchParams, c);
|
|
113
|
+
return `${t.pathname}?${p.toString()}`;
|
|
114
|
+
}
|
|
109
115
|
}
|
|
110
116
|
];
|
|
111
117
|
export {
|
|
112
|
-
|
|
118
|
+
A as ROUTES
|
|
113
119
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Authentication.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/Authentication.vue"],"names":[],"mappings":";;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Authentication.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/Authentication.vue"],"names":[],"mappings":";;;;;;;;;;;;;AA+OA,wBAMG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import t from "./Authentication.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import o from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const c = /* @__PURE__ */ o(t, [["__scopeId", "data-v-
|
|
4
|
+
const c = /* @__PURE__ */ o(t, [["__scopeId", "data-v-1bfafc56"]]);
|
|
5
5
|
export {
|
|
6
6
|
c as default
|
|
7
7
|
};
|