@scalar/api-client 2.29.4 → 2.31.1
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 +95 -0
- package/dist/components/DataTable/DataTableCell.vue.js +1 -1
- package/dist/components/Server/ServerSelector.vue.d.ts.map +1 -1
- package/dist/components/Server/ServerSelector.vue.js +5 -5
- package/dist/components/Sidebar/Sidebar.vue.js +3 -3
- package/dist/components/Sidebar/Sidebar.vue2.js +1 -1
- package/dist/components/ViewLayout/ViewLayout.vue.js +1 -1
- package/dist/style.css +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +9 -69
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.js +74 -76
- package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +15 -8
- package/dist/v2/blocks/operation-block/components/Header.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.js +2 -2
- package/dist/v2/blocks/operation-block/components/Header.vue2.js +29 -28
- package/dist/v2/blocks/operation-code-sample/helpers/get-resolved-ref-deep.d.ts +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/get-resolved-ref-deep.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/get-resolved-ref-deep.js +18 -21
- package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.js +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue2.js +22 -21
- package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +12 -0
- package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +12 -0
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBody.vue.js +2 -2
- package/dist/v2/blocks/response-block/components/ResponseBody.vue2.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.js +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts +13 -8
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +2 -2
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +97 -85
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js +7 -7
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js +7 -7
- package/dist/v2/components/data-table/DataTableCell.vue.js +1 -1
- package/dist/v2/components/server/ServerDropdown.vue.d.ts +16 -5
- package/dist/v2/components/server/ServerDropdown.vue.d.ts.map +1 -1
- package/dist/v2/components/server/ServerDropdown.vue.js +27 -24
- package/dist/v2/features/app/app-events.d.ts.map +1 -1
- package/dist/v2/features/app/app-events.js +29 -14
- package/dist/v2/features/app/app-state.d.ts.map +1 -1
- package/dist/v2/features/app/app-state.js +57 -57
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue.js +2 -2
- package/dist/v2/features/app/components/AppSidebar.vue2.js +171 -148
- package/dist/v2/features/app/components/DownloadAppButton.vue.js +1 -1
- package/dist/v2/features/app/components/DownloadAppButton.vue2.js +1 -1
- package/dist/v2/features/app/helpers/routes.d.ts +42 -12
- package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
- package/dist/v2/features/app/helpers/routes.js +57 -26
- package/dist/v2/features/collection/OperationCollection.vue.d.ts +6 -0
- package/dist/v2/features/collection/OperationCollection.vue.d.ts.map +1 -0
- package/dist/v2/features/collection/OperationCollection.vue.js +83 -0
- package/dist/v2/features/collection/OperationCollection.vue2.js +4 -0
- package/dist/v2/features/collection/components/Authentication.vue.d.ts +2 -2
- 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 +100 -49
- package/dist/v2/features/collection/components/Cookies.vue.d.ts +9 -4
- package/dist/v2/features/collection/components/Cookies.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Cookies.vue.js +12 -10
- package/dist/v2/features/collection/components/Environment.vue.d.ts +9 -4
- package/dist/v2/features/collection/components/Environment.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Environment.vue.js +18 -16
- package/dist/v2/features/collection/components/LabelInput.vue.d.ts +6 -2
- package/dist/v2/features/collection/components/LabelInput.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/LabelInput.vue.js +2 -2
- package/dist/v2/features/collection/components/LabelInput.vue2.js +20 -18
- package/dist/v2/features/collection/components/Overview.vue.d.ts +2 -2
- package/dist/v2/features/collection/components/Overview.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Overview.vue.js +1 -1
- package/dist/v2/features/collection/components/Overview.vue2.js +177 -75
- package/dist/v2/features/collection/components/Servers.vue.d.ts +2 -2
- package/dist/v2/features/collection/components/Servers.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Servers.vue.js +154 -98
- package/dist/v2/features/collection/components/Settings.vue.d.ts +2 -2
- package/dist/v2/features/collection/components/Tabs.vue.d.ts +2 -1
- package/dist/v2/features/collection/components/Tabs.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Tabs.vue.js +25 -27
- package/dist/v2/features/collection/helpers/get-default-operation-security-toggle.d.ts +12 -0
- package/dist/v2/features/collection/helpers/get-default-operation-security-toggle.d.ts.map +1 -0
- package/dist/v2/features/collection/helpers/get-default-operation-security-toggle.js +13 -0
- package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
- package/dist/v2/features/operation/Operation.vue.js +61 -63
- package/dist/v2/features/operation/helpers/get-selected-security.d.ts +5 -3
- package/dist/v2/features/operation/helpers/get-selected-security.d.ts.map +1 -1
- package/dist/v2/features/operation/helpers/get-selected-security.js +7 -8
- package/dist/v2/features/operation/helpers/get-selected-server.d.ts +8 -6
- package/dist/v2/features/operation/helpers/get-selected-server.d.ts.map +1 -1
- package/dist/v2/features/operation/helpers/get-selected-server.js +2 -2
- package/dist/v2/helpers/drag-handle-factory.d.ts.map +1 -1
- package/dist/v2/helpers/drag-handle-factory.js +41 -41
- package/dist/v2/workspace-events.d.ts.map +1 -1
- package/dist/v2/workspace-events.js +25 -15
- package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
- package/dist/views/Request/RequestSidebarItem.vue2.js +24 -24
- package/dist/views/Request/ResponseSection/ResponseBody.vue.js +2 -2
- package/dist/views/Request/ResponseSection/ResponseBody.vue2.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseBodyStreaming.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +17 -17
- package/dist/v2/helpers/remove-circular.d.ts +0 -15
- package/dist/v2/helpers/remove-circular.d.ts.map +0 -1
- package/dist/v2/helpers/remove-circular.js +0 -18
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { mergeSearchParams as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
1
|
+
import { mergeSearchParams as d } from "@scalar/helpers/url/merge-urls";
|
|
2
|
+
import o from "../../collection/components/Authentication.vue.js";
|
|
3
|
+
import n from "../../collection/components/Cookies.vue.js";
|
|
4
|
+
import a from "../../collection/components/Environment.vue.js";
|
|
5
|
+
import m from "../../collection/components/Overview.vue.js";
|
|
6
|
+
import r from "../../collection/components/Servers.vue.js";
|
|
7
|
+
import c from "../../collection/components/Settings.vue.js";
|
|
8
8
|
import u from "../../collection/DocumentCollection.vue.js";
|
|
9
|
+
import v from "../../collection/OperationCollection.vue.js";
|
|
9
10
|
import f from "../../collection/WorkspaceCollection.vue.js";
|
|
11
|
+
import { workspaceStorage as p } from "../../../helpers/storage.js";
|
|
10
12
|
import l from "../../operation/Operation.vue.js";
|
|
11
|
-
|
|
12
|
-
const A = [
|
|
13
|
+
const R = [
|
|
13
14
|
{
|
|
14
15
|
path: "/@:namespace/:workspaceSlug",
|
|
15
16
|
children: [
|
|
@@ -18,9 +19,39 @@ const A = [
|
|
|
18
19
|
children: [
|
|
19
20
|
// Example page
|
|
20
21
|
{
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
path: "path/:pathEncoded/method/:method",
|
|
23
|
+
children: [
|
|
24
|
+
{
|
|
25
|
+
name: "example",
|
|
26
|
+
path: "example/:exampleName",
|
|
27
|
+
component: l
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: "operation",
|
|
31
|
+
path: "",
|
|
32
|
+
component: v,
|
|
33
|
+
redirect: {
|
|
34
|
+
name: "operation.overview"
|
|
35
|
+
},
|
|
36
|
+
children: [
|
|
37
|
+
{
|
|
38
|
+
name: "operation.overview",
|
|
39
|
+
path: "overview",
|
|
40
|
+
component: m
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: "operation.servers",
|
|
44
|
+
path: "servers",
|
|
45
|
+
component: r
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: "operation.authentication",
|
|
49
|
+
path: "authentication",
|
|
50
|
+
component: o
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
]
|
|
24
55
|
},
|
|
25
56
|
// Document Page
|
|
26
57
|
{
|
|
@@ -40,37 +71,37 @@ const A = [
|
|
|
40
71
|
{
|
|
41
72
|
name: "document.overview",
|
|
42
73
|
path: "overview",
|
|
43
|
-
component:
|
|
74
|
+
component: m
|
|
44
75
|
},
|
|
45
76
|
// Document servers
|
|
46
77
|
{
|
|
47
78
|
name: "document.servers",
|
|
48
79
|
path: "servers",
|
|
49
|
-
component:
|
|
80
|
+
component: r
|
|
50
81
|
},
|
|
51
82
|
// Document environment
|
|
52
83
|
{
|
|
53
84
|
name: "document.environment",
|
|
54
85
|
path: "environment",
|
|
55
|
-
component:
|
|
86
|
+
component: a
|
|
56
87
|
},
|
|
57
88
|
// Document authentication
|
|
58
89
|
{
|
|
59
90
|
name: "document.authentication",
|
|
60
91
|
path: "authentication",
|
|
61
|
-
component:
|
|
92
|
+
component: o
|
|
62
93
|
},
|
|
63
94
|
// Document cookies
|
|
64
95
|
{
|
|
65
96
|
name: "document.cookies",
|
|
66
97
|
path: "cookies",
|
|
67
|
-
component:
|
|
98
|
+
component: n
|
|
68
99
|
},
|
|
69
100
|
// Document settings
|
|
70
101
|
{
|
|
71
102
|
name: "document.settings",
|
|
72
103
|
path: "settings",
|
|
73
|
-
component:
|
|
104
|
+
component: c
|
|
74
105
|
}
|
|
75
106
|
]
|
|
76
107
|
}
|
|
@@ -86,19 +117,19 @@ const A = [
|
|
|
86
117
|
{
|
|
87
118
|
name: "workspace.environment",
|
|
88
119
|
path: "environment",
|
|
89
|
-
component:
|
|
120
|
+
component: a
|
|
90
121
|
},
|
|
91
122
|
// Workspace cookies
|
|
92
123
|
{
|
|
93
124
|
name: "workspace.cookies",
|
|
94
125
|
path: "cookies",
|
|
95
|
-
component:
|
|
126
|
+
component: n
|
|
96
127
|
},
|
|
97
128
|
// Workspace settings
|
|
98
129
|
{
|
|
99
130
|
name: "workspace.settings",
|
|
100
131
|
path: "settings",
|
|
101
|
-
component:
|
|
132
|
+
component: c
|
|
102
133
|
}
|
|
103
134
|
]
|
|
104
135
|
}
|
|
@@ -107,13 +138,13 @@ const A = [
|
|
|
107
138
|
{
|
|
108
139
|
path: "/:pathMatch(.*)*",
|
|
109
140
|
redirect: () => {
|
|
110
|
-
const e = "/@local/default/document/drafts/overview",
|
|
111
|
-
|
|
112
|
-
const t = new URL(
|
|
113
|
-
return `${t.pathname}?${
|
|
141
|
+
const e = "/@local/default/document/drafts/overview", i = p.getLastPath() ?? e;
|
|
142
|
+
p.setCurrentPath(e);
|
|
143
|
+
const t = new URL(i, "http://example.com"), s = new URLSearchParams(window.location.search), h = d(t.searchParams, s);
|
|
144
|
+
return `${t.pathname}?${h.toString()}`;
|
|
114
145
|
}
|
|
115
146
|
}
|
|
116
147
|
];
|
|
117
148
|
export {
|
|
118
|
-
|
|
149
|
+
R as ROUTES
|
|
119
150
|
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { RouteProps } from '../../../v2/features/app/helpers/routes.js';
|
|
2
|
+
/** Document collection page — tabs for Overview, Servers, Auth, Environment, Cookies, and Settings. */
|
|
3
|
+
declare const _default: typeof __VLS_export;
|
|
4
|
+
export default _default;
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<RouteProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<RouteProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
//# sourceMappingURL=OperationCollection.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OperationCollection.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/collection/OperationCollection.vue"],"names":[],"mappings":"AAkHA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAMlE,uGAAuG;wBAClF,OAAO,YAAY;AAAxC,wBAAyC;AAGzC,QAAA,MAAM,YAAY,gSAyLd,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { defineComponent as f, computed as m, ref as h, watch as v, createElementBlock as i, openBlock as u, createElementVNode as o, createVNode as s, unref as x, mergeProps as _ } from "vue";
|
|
2
|
+
import { isHttpMethod as y } from "@scalar/helpers/http/is-http-method";
|
|
3
|
+
import { getResolvedRef as w } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
4
|
+
import { RouterView as g } from "vue-router";
|
|
5
|
+
import k from "./components/LabelInput.vue.js";
|
|
6
|
+
import b from "./components/Tabs.vue.js";
|
|
7
|
+
const S = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "custom-scroll h-full"
|
|
10
|
+
}, V = { class: "w-full md:mx-auto md:max-w-180" }, B = ["aria-label"], U = { class: "group relative ml-1.25" }, $ = { class: "px-1.5 py-8" }, C = {
|
|
11
|
+
key: 1,
|
|
12
|
+
class: "flex w-full flex-1 items-center justify-center"
|
|
13
|
+
}, N = {}, P = /* @__PURE__ */ f({
|
|
14
|
+
...N,
|
|
15
|
+
__name: "OperationCollection",
|
|
16
|
+
props: {
|
|
17
|
+
documentSlug: {},
|
|
18
|
+
document: {},
|
|
19
|
+
eventBus: {},
|
|
20
|
+
layout: {},
|
|
21
|
+
path: {},
|
|
22
|
+
method: {},
|
|
23
|
+
exampleName: {},
|
|
24
|
+
environment: {},
|
|
25
|
+
securitySchemes: {},
|
|
26
|
+
workspaceStore: {},
|
|
27
|
+
activeWorkspace: {},
|
|
28
|
+
plugins: {},
|
|
29
|
+
customThemes: {}
|
|
30
|
+
},
|
|
31
|
+
setup(p) {
|
|
32
|
+
const e = p, n = m(() => {
|
|
33
|
+
if (!(!e.path || !e.method))
|
|
34
|
+
return w(e.document?.paths?.[e.path]?.[e.method]);
|
|
35
|
+
}), l = h(n.value?.summary ?? "");
|
|
36
|
+
v(
|
|
37
|
+
() => n.value?.summary,
|
|
38
|
+
(r) => {
|
|
39
|
+
l.value = r ?? "";
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
const d = (r) => {
|
|
43
|
+
const { path: t, method: a } = e;
|
|
44
|
+
!t || !a || !y(a) || e.eventBus.emit("operation:update:meta", {
|
|
45
|
+
meta: { path: t, method: a },
|
|
46
|
+
payload: {
|
|
47
|
+
summary: r.trim()
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}, c = m(() => !e.path || !e.method ? "Untitled Operation" : `${e.method.toUpperCase()} ${e.path}`);
|
|
51
|
+
return (r, t) => n.value !== void 0 ? (u(), i("div", S, [
|
|
52
|
+
o("div", V, [
|
|
53
|
+
o("div", {
|
|
54
|
+
"aria-label": `title: ${l.value}`,
|
|
55
|
+
class: "mx-auto flex h-fit w-full flex-row items-center gap-2 pt-8 pb-3 md:max-w-180"
|
|
56
|
+
}, [
|
|
57
|
+
o("div", U, [
|
|
58
|
+
s(k, {
|
|
59
|
+
modelValue: l.value,
|
|
60
|
+
"onUpdate:modelValue": t[0] || (t[0] = (a) => l.value = a),
|
|
61
|
+
class: "text-xl font-bold",
|
|
62
|
+
inputId: "operationSummary",
|
|
63
|
+
placeholder: c.value,
|
|
64
|
+
onBlur: d
|
|
65
|
+
}, null, 8, ["modelValue", "placeholder"])
|
|
66
|
+
])
|
|
67
|
+
], 8, B),
|
|
68
|
+
s(b, { type: "operation" }),
|
|
69
|
+
o("div", $, [
|
|
70
|
+
s(x(g), _(e, { collectionType: "operation" }), null, 16)
|
|
71
|
+
])
|
|
72
|
+
])
|
|
73
|
+
])) : (u(), i("div", C, [...t[1] || (t[1] = [
|
|
74
|
+
o("div", { class: "flex h-full flex-col items-center justify-center" }, [
|
|
75
|
+
o("h1", { class: "text-2xl font-bold" }, "Operation not found"),
|
|
76
|
+
o("p", { class: "text-gray-500" }, " The operation you are looking for does not exist. ")
|
|
77
|
+
], -1)
|
|
78
|
+
])]));
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
export {
|
|
82
|
+
P as default
|
|
83
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
declare const __VLS_export: import("vue").DefineComponent<(import("../../../../v2/features/app/helpers/routes.js").RouteProps & {
|
|
2
|
-
collectionType: "document";
|
|
2
|
+
collectionType: "document" | "operation";
|
|
3
3
|
document: import("@scalar/workspace-store/schemas").WorkspaceDocument;
|
|
4
4
|
}) | (import("../../../../v2/features/app/helpers/routes.js").RouteProps & {
|
|
5
5
|
collectionType: "workspace";
|
|
6
6
|
document: null;
|
|
7
7
|
}), {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<(import("../../../../v2/features/app/helpers/routes.js").RouteProps & {
|
|
8
|
-
collectionType: "document";
|
|
8
|
+
collectionType: "document" | "operation";
|
|
9
9
|
document: import("@scalar/workspace-store/schemas").WorkspaceDocument;
|
|
10
10
|
}) | (import("../../../../v2/features/app/helpers/routes.js").RouteProps & {
|
|
11
11
|
collectionType: "workspace";
|
|
@@ -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":"AAghBA,QAAA,MAAM,YAAY;;;;;;;;;;;;kGAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -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 i = /* @__PURE__ */ o(t, [["__scopeId", "data-v-
|
|
4
|
+
const i = /* @__PURE__ */ o(t, [["__scopeId", "data-v-60f72663"]]);
|
|
5
5
|
export {
|
|
6
6
|
i as default
|
|
7
7
|
};
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarToggle as
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
|
|
1
|
+
import { defineComponent as A, computed as n, ref as B, watchEffect as N, createBlock as O, openBlock as s, createSlots as U, withCtx as c, createElementVNode as o, normalizeClass as d, createVNode as v, unref as h, createElementBlock as y, Fragment as f, createTextVNode as u } from "vue";
|
|
2
|
+
import { ScalarToggle as b } from "@scalar/components";
|
|
3
|
+
import { isHttpMethod as R } from "@scalar/helpers/http/is-http-method";
|
|
4
|
+
import { getResolvedRef as V } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
5
|
+
import { getDefaultOperationSecurityToggle as q } from "../helpers/get-default-operation-security-toggle.js";
|
|
6
|
+
import C from "../../settings/components/Section.vue.js";
|
|
7
|
+
import { getActiveProxyUrl as E } from "../../../helpers/get-active-proxy-url.js";
|
|
8
|
+
import { getServers as M } from "../../../helpers/get-servers.js";
|
|
9
|
+
import P from "../../../blocks/scalar-auth-selector-block/components/AuthSelector.vue.js";
|
|
10
|
+
const $ = { class: "flex h-8 items-center" }, K = /* @__PURE__ */ A({
|
|
7
11
|
__name: "Authentication",
|
|
8
12
|
props: {
|
|
9
13
|
documentSlug: {},
|
|
@@ -22,61 +26,108 @@ const x = { class: "flex h-8 items-center" }, V = /* @__PURE__ */ d({
|
|
|
22
26
|
collectionType: {}
|
|
23
27
|
},
|
|
24
28
|
setup(e) {
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
29
|
+
const r = n(() => e.collectionType === "operation" ? {
|
|
30
|
+
type: "operation",
|
|
31
|
+
path: e.path ?? "",
|
|
32
|
+
method: e.method ?? "get"
|
|
33
|
+
} : { type: "document" }), i = n(() => e.collectionType === "operation" ? !e.path || !R(e.method) ? null : V(e.document?.paths?.[e.path]?.[e.method]) : null), a = B(!1);
|
|
34
|
+
N(() => {
|
|
35
|
+
a.value = q({
|
|
36
|
+
authStore: e.workspaceStore.auth,
|
|
37
|
+
documentName: e.documentSlug,
|
|
38
|
+
...r.value
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
const S = n(() => e.collectionType === "operation" ? e.workspaceStore.auth.getAuthSelectedSchemas({
|
|
42
|
+
type: "operation",
|
|
43
|
+
documentName: e.documentSlug,
|
|
44
|
+
path: e.path ?? "",
|
|
45
|
+
method: e.method ?? "get"
|
|
46
|
+
}) : e.workspaceStore.auth.getAuthSelectedSchemas({
|
|
47
|
+
type: "document",
|
|
48
|
+
documentName: e.documentSlug
|
|
49
|
+
})), g = n(() => e.collectionType === "operation" ? i.value?.security ?? [] : e.document?.security ?? []), p = n(
|
|
50
|
+
() => E(
|
|
51
|
+
e.workspaceStore.workspace["x-scalar-active-proxy"],
|
|
52
|
+
e.layout
|
|
53
|
+
) ?? ""
|
|
54
|
+
), m = n(() => M(i.value?.servers ?? e.document?.servers, {
|
|
55
|
+
documentUrl: e.document?.["x-scalar-original-source-url"]
|
|
56
|
+
})), k = n(() => {
|
|
57
|
+
const l = e.document?.["x-scalar-selected-server"], T = i.value?.["x-scalar-selected-server"] ?? l;
|
|
58
|
+
return m.value.find(({ url: w }) => w === T) ?? m.value[0] ?? null;
|
|
59
|
+
}), x = (l) => {
|
|
60
|
+
if (r.value.type === "operation")
|
|
61
|
+
return a.value = l, l ? e.eventBus.emit("auth:update:selected-security-schemes", {
|
|
62
|
+
selectedRequirements: [],
|
|
63
|
+
newSchemes: [],
|
|
64
|
+
meta: r.value
|
|
65
|
+
}) : e.eventBus.emit("auth:clear:selected-security-schemes", {
|
|
66
|
+
meta: r.value
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
return (l, t) => (s(), O(C, null, U({
|
|
70
|
+
title: c(() => [
|
|
71
|
+
t[0] || (t[0] = u("Authentication", -1))
|
|
47
72
|
]),
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
class:
|
|
73
|
+
description: c(() => [
|
|
74
|
+
e.collectionType === "operation" ? (s(), y(f, { key: 0 }, [
|
|
75
|
+
t[1] || (t[1] = o("span", { class: "block" }, " Override authentication for this operation with the toggle. ", -1)),
|
|
76
|
+
t[2] || (t[2] = o("span", { class: "mt-1 block" }, [
|
|
77
|
+
o("strong", null, "On"),
|
|
78
|
+
u(" — Authentication below applies only to this operation. ")
|
|
79
|
+
], -1)),
|
|
80
|
+
t[3] || (t[3] = o("span", { class: "mt-1 block" }, [
|
|
81
|
+
o("strong", null, "Off"),
|
|
82
|
+
u(" — This operation uses document-level authentication from the OpenAPI spec. ")
|
|
83
|
+
], -1))
|
|
84
|
+
], 64)) : (s(), y(f, { key: 1 }, [
|
|
85
|
+
u(" Configure authentication for this document. Selected authentication applies to all operations unless overridden at the operation level. ")
|
|
86
|
+
], 64))
|
|
87
|
+
]),
|
|
88
|
+
default: c(() => [
|
|
89
|
+
o("div", {
|
|
90
|
+
class: d(
|
|
91
|
+
e.collectionType === "operation" && !a.value && "cursor-not-allowed"
|
|
92
|
+
)
|
|
51
93
|
}, [
|
|
52
|
-
|
|
53
|
-
class:
|
|
94
|
+
v(h(P), {
|
|
95
|
+
class: d([
|
|
54
96
|
"scalar-collection-auth border-none!",
|
|
55
|
-
!
|
|
97
|
+
e.collectionType === "operation" && !a.value && "pointer-events-none opacity-50 mix-blend-luminosity"
|
|
56
98
|
]),
|
|
99
|
+
createAnySecurityScheme: !0,
|
|
57
100
|
environment: e.environment,
|
|
58
101
|
eventBus: e.eventBus,
|
|
59
102
|
isStatic: "",
|
|
60
|
-
meta:
|
|
61
|
-
proxyUrl:
|
|
62
|
-
|
|
63
|
-
e.layout
|
|
64
|
-
) ?? "",
|
|
65
|
-
securityRequirements: e.document?.security ?? [],
|
|
103
|
+
meta: r.value,
|
|
104
|
+
proxyUrl: p.value,
|
|
105
|
+
securityRequirements: g.value,
|
|
66
106
|
securitySchemes: e.securitySchemes,
|
|
67
|
-
selectedSecurity:
|
|
68
|
-
|
|
69
|
-
documentName: e.documentSlug
|
|
70
|
-
}),
|
|
71
|
-
server: m.value,
|
|
107
|
+
selectedSecurity: S.value,
|
|
108
|
+
server: k.value,
|
|
72
109
|
title: "Authentication"
|
|
73
|
-
}, null, 8, ["class", "environment", "eventBus", "proxyUrl", "securityRequirements", "securitySchemes", "selectedSecurity", "server"])
|
|
110
|
+
}, null, 8, ["class", "environment", "eventBus", "meta", "proxyUrl", "securityRequirements", "securitySchemes", "selectedSecurity", "server"])
|
|
74
111
|
], 2)
|
|
75
112
|
]),
|
|
76
|
-
_:
|
|
77
|
-
}
|
|
113
|
+
_: 2
|
|
114
|
+
}, [
|
|
115
|
+
e.collectionType === "operation" ? {
|
|
116
|
+
name: "actions",
|
|
117
|
+
fn: c(() => [
|
|
118
|
+
o("div", $, [
|
|
119
|
+
v(h(b), {
|
|
120
|
+
class: "w-4",
|
|
121
|
+
modelValue: a.value,
|
|
122
|
+
"onUpdate:modelValue": x
|
|
123
|
+
}, null, 8, ["modelValue"])
|
|
124
|
+
])
|
|
125
|
+
]),
|
|
126
|
+
key: "0"
|
|
127
|
+
} : void 0
|
|
128
|
+
]), 1024));
|
|
78
129
|
}
|
|
79
130
|
});
|
|
80
131
|
export {
|
|
81
|
-
|
|
132
|
+
K as default
|
|
82
133
|
};
|
|
@@ -1,16 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cookies section for the collection.
|
|
3
|
+
* Renders document or workspace cookies and lets users manage key-value data
|
|
4
|
+
* sent with API requests (e.g. session tokens, auth, preferences).
|
|
5
|
+
*/
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|
|
1
8
|
declare const __VLS_export: import("vue").DefineComponent<(import("../../../../v2/features/app/helpers/routes.js").RouteProps & {
|
|
2
|
-
collectionType: "document";
|
|
9
|
+
collectionType: "document" | "operation";
|
|
3
10
|
document: import("@scalar/workspace-store/schemas").WorkspaceDocument;
|
|
4
11
|
}) | (import("../../../../v2/features/app/helpers/routes.js").RouteProps & {
|
|
5
12
|
collectionType: "workspace";
|
|
6
13
|
document: null;
|
|
7
14
|
}), {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<(import("../../../../v2/features/app/helpers/routes.js").RouteProps & {
|
|
8
|
-
collectionType: "document";
|
|
15
|
+
collectionType: "document" | "operation";
|
|
9
16
|
document: import("@scalar/workspace-store/schemas").WorkspaceDocument;
|
|
10
17
|
}) | (import("../../../../v2/features/app/helpers/routes.js").RouteProps & {
|
|
11
18
|
collectionType: "workspace";
|
|
12
19
|
document: null;
|
|
13
20
|
})> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
|
-
declare const _default: typeof __VLS_export;
|
|
15
|
-
export default _default;
|
|
16
21
|
//# sourceMappingURL=Cookies.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Cookies.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/Cookies.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Cookies.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/Cookies.vue"],"names":[],"mappings":"AAqDA;;;;GAIG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAKzC,QAAA,MAAM,YAAY;;;;;;;;;;;;kGA4Ed,CAAC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as s, computed as i, createBlock as r, createCommentVNode as u, openBlock as a, withCtx as t, createVNode as m, unref as d, createTextVNode as n, createElementVNode as c } from "vue";
|
|
2
2
|
import k from "../../settings/components/Section.vue.js";
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
|
|
3
|
+
import p from "../../global-cookies/components/CookiesTable.vue.js";
|
|
4
|
+
const f = {
|
|
5
|
+
name: "Cookies"
|
|
6
|
+
}, C = /* @__PURE__ */ s({
|
|
7
|
+
...f,
|
|
6
8
|
props: {
|
|
7
9
|
documentSlug: {},
|
|
8
10
|
document: {},
|
|
@@ -21,27 +23,27 @@ const T = /* @__PURE__ */ c({
|
|
|
21
23
|
},
|
|
22
24
|
setup(e) {
|
|
23
25
|
const l = i(() => (e.collectionType === "document" ? e.document["x-scalar-cookies"] : e.workspaceStore.workspace["x-scalar-cookies"]) ?? []);
|
|
24
|
-
return (
|
|
26
|
+
return (y, o) => e.collectionType !== "operation" ? (a(), r(k, { key: 0 }, {
|
|
25
27
|
title: t(() => [...o[0] || (o[0] = [
|
|
26
28
|
n("Cookies", -1)
|
|
27
29
|
])]),
|
|
28
30
|
description: t(() => [...o[1] || (o[1] = [
|
|
29
31
|
n(" Manage your collection's cookies here.", -1),
|
|
30
|
-
|
|
32
|
+
c("br", null, null, -1),
|
|
31
33
|
n("Cookies allow you to store and send key-value data with your API requests—often used for things like session tokens, authentication, and saving user preferences.", -1),
|
|
32
|
-
|
|
34
|
+
c("br", null, null, -1)
|
|
33
35
|
])]),
|
|
34
36
|
default: t(() => [
|
|
35
|
-
|
|
37
|
+
m(d(p), {
|
|
36
38
|
collectionType: e.collectionType,
|
|
37
39
|
cookies: l.value,
|
|
38
40
|
eventBus: e.eventBus
|
|
39
41
|
}, null, 8, ["collectionType", "cookies", "eventBus"])
|
|
40
42
|
]),
|
|
41
43
|
_: 1
|
|
42
|
-
}));
|
|
44
|
+
})) : u("", !0);
|
|
43
45
|
}
|
|
44
46
|
});
|
|
45
47
|
export {
|
|
46
|
-
|
|
48
|
+
C as default
|
|
47
49
|
};
|
|
@@ -1,16 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Environment variables section for the collection.
|
|
3
|
+
* Renders document or workspace environments and lets users set variables
|
|
4
|
+
* that can be referenced in request inputs via {{ variable }}.
|
|
5
|
+
*/
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|
|
1
8
|
declare const __VLS_export: import("vue").DefineComponent<(import("../../../../v2/features/app/helpers/routes.js").RouteProps & {
|
|
2
|
-
collectionType: "document";
|
|
9
|
+
collectionType: "document" | "operation";
|
|
3
10
|
document: import("@scalar/workspace-store/schemas").WorkspaceDocument;
|
|
4
11
|
}) | (import("../../../../v2/features/app/helpers/routes.js").RouteProps & {
|
|
5
12
|
collectionType: "workspace";
|
|
6
13
|
document: null;
|
|
7
14
|
}), {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<(import("../../../../v2/features/app/helpers/routes.js").RouteProps & {
|
|
8
|
-
collectionType: "document";
|
|
15
|
+
collectionType: "document" | "operation";
|
|
9
16
|
document: import("@scalar/workspace-store/schemas").WorkspaceDocument;
|
|
10
17
|
}) | (import("../../../../v2/features/app/helpers/routes.js").RouteProps & {
|
|
11
18
|
collectionType: "workspace";
|
|
12
19
|
document: null;
|
|
13
20
|
})> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
|
-
declare const _default: typeof __VLS_export;
|
|
15
|
-
export default _default;
|
|
16
21
|
//# sourceMappingURL=Environment.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Environment.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/Environment.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Environment.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/Environment.vue"],"names":[],"mappings":"AAgEA;;;;GAIG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAKzC,QAAA,MAAM,YAAY;;;;;;;;;;;;kGAoFd,CAAC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { defineComponent as i, computed as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
|
|
1
|
+
import { defineComponent as i, computed as c, createBlock as l, createCommentVNode as m, openBlock as s, withCtx as n, createVNode as u, unref as v, createTextVNode as o, createElementVNode as d } from "vue";
|
|
2
|
+
import p from "../../settings/components/Section.vue.js";
|
|
3
|
+
import f from "../../environments/EnvironmentsList.vue.js";
|
|
4
|
+
const y = {
|
|
5
|
+
name: "Environment"
|
|
6
|
+
}, B = /* @__PURE__ */ i({
|
|
7
|
+
...y,
|
|
6
8
|
props: {
|
|
7
9
|
documentSlug: {},
|
|
8
10
|
document: {},
|
|
@@ -20,30 +22,30 @@ const T = /* @__PURE__ */ i({
|
|
|
20
22
|
collectionType: {}
|
|
21
23
|
},
|
|
22
24
|
setup(e) {
|
|
23
|
-
const
|
|
25
|
+
const r = c(
|
|
24
26
|
() => (e.collectionType === "document" ? e.document["x-scalar-environments"] : e.workspaceStore.workspace["x-scalar-environments"]) ?? {}
|
|
25
|
-
), a =
|
|
26
|
-
return (
|
|
27
|
-
title:
|
|
27
|
+
), a = c(() => e.workspaceStore.workspace["x-scalar-active-environment"]);
|
|
28
|
+
return (k, t) => e.collectionType !== "operation" ? (s(), l(p, { key: 0 }, {
|
|
29
|
+
title: n(() => [...t[0] || (t[0] = [
|
|
28
30
|
o("Environment Variables", -1)
|
|
29
31
|
])]),
|
|
30
|
-
description:
|
|
32
|
+
description: n(() => [...t[1] || (t[1] = [
|
|
31
33
|
o(" Set environment variables at your collection level. Use ", -1),
|
|
32
|
-
|
|
34
|
+
d("code", { class: "font-code text-c-2" }, " {{ variable }} ", -1),
|
|
33
35
|
o(" to add / search among the selected environment's variables in your request inputs. ", -1)
|
|
34
36
|
])]),
|
|
35
|
-
default:
|
|
36
|
-
|
|
37
|
+
default: n(() => [
|
|
38
|
+
u(v(f), {
|
|
37
39
|
activeEnvironment: a.value,
|
|
38
40
|
collectionType: e.collectionType,
|
|
39
|
-
environments:
|
|
41
|
+
environments: r.value,
|
|
40
42
|
eventBus: e.eventBus
|
|
41
43
|
}, null, 8, ["activeEnvironment", "collectionType", "environments", "eventBus"])
|
|
42
44
|
]),
|
|
43
45
|
_: 1
|
|
44
|
-
}));
|
|
46
|
+
})) : m("", !0);
|
|
45
47
|
}
|
|
46
48
|
});
|
|
47
49
|
export {
|
|
48
|
-
|
|
50
|
+
B as default
|
|
49
51
|
};
|