@scalar/api-client 2.3.32 → 2.3.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -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 +63 -61
- package/dist/components/DataTable/DataTable.vue.js +1 -1
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -1
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +58 -48
- package/dist/components/Sidebar/SidebarListElement.vue.d.ts +2 -2
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +34 -32
- package/dist/components/ViewLayout/ViewLayoutSection.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutSection.vue.js +6 -6
- package/dist/hooks/useClientConfig.d.ts +3 -0
- package/dist/hooks/useClientConfig.d.ts.map +1 -1
- package/dist/layouts/App/create-api-client-app.d.ts +64 -24
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/create-api-client-modal.d.ts +128 -48
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Web/create-api-client-web.d.ts +64 -24
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +64 -24
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/index.js +26 -25
- package/dist/libs/local-storage.d.ts +8 -0
- package/dist/libs/local-storage.d.ts.map +1 -1
- package/dist/libs/local-storage.js +28 -24
- package/dist/libs/send-request/create-request-operation.d.ts.map +1 -1
- package/dist/libs/send-request/create-request-operation.js +8 -8
- package/dist/libs/send-request/create-request-operation.test.d.ts +2 -2
- package/dist/libs/send-request/create-request-operation.test.d.ts.map +1 -1
- package/dist/libs/send-request/decode-buffer.js +4 -4
- package/dist/store/active-entities.d.ts +2 -2
- package/dist/store/active-entities.d.ts.map +1 -1
- package/dist/store/request-example.d.ts +22 -22
- package/dist/store/request-example.d.ts.map +1 -1
- package/dist/store/security-schemes.d.ts +42 -2
- package/dist/store/security-schemes.d.ts.map +1 -1
- package/dist/store/store.d.ts +64 -24
- package/dist/store/store.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/views/Collection/CollectionAuthentication.vue.d.ts.map +1 -1
- package/dist/views/Collection/CollectionAuthentication.vue.js +1 -1
- package/dist/views/Collection/CollectionAuthentication.vue2.js +32 -32
- package/dist/views/Collection/CollectionEnvironment.vue.d.ts.map +1 -1
- package/dist/views/Collection/CollectionEnvironment.vue.js +3 -2
- package/dist/views/Collection/CollectionEnvironment.vue2.js +233 -9
- package/dist/views/Collection/CollectionNavigation.vue.js +36 -36
- package/dist/views/Collection/CollectionServers.vue.d.ts.map +1 -1
- package/dist/views/Collection/CollectionServers.vue2.js +6 -6
- package/dist/views/Collection/components/EnvironmentForm.vue.d.ts +13 -0
- package/dist/views/Collection/components/EnvironmentForm.vue.d.ts.map +1 -0
- package/dist/views/Collection/components/EnvironmentForm.vue.js +7 -0
- package/dist/views/Collection/components/EnvironmentForm.vue2.js +274 -0
- package/dist/views/Components/CodeSnippet/helpers/convert-to-har-request.d.ts.map +1 -1
- package/dist/views/Components/CodeSnippet/helpers/convert-to-har-request.js +35 -34
- package/dist/views/Environment/EnvironmentModal.vue.d.ts.map +1 -1
- package/dist/views/Environment/EnvironmentModal.vue.js +32 -28
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts +1 -0
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +67 -65
- package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.js +94 -97
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts +1 -0
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +116 -99
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts +1 -0
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +27 -25
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.d.ts +1 -0
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue2.js +114 -73
- 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 +15 -15
- package/dist/views/Request/RequestSection/helpers/update-scheme.d.ts +8 -0
- package/dist/views/Request/RequestSection/helpers/update-scheme.d.ts.map +1 -0
- package/dist/views/Request/RequestSection/helpers/update-scheme.js +17 -0
- package/dist/views/Request/RequestSection/helpers/update-scheme.test.d.ts +2 -0
- package/dist/views/Request/RequestSection/helpers/update-scheme.test.d.ts.map +1 -0
- package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebar.vue.js +1 -1
- package/dist/views/Request/RequestSidebar.vue2.js +87 -84
- package/dist/views/Request/ResponseSection/ResponseBody.vue.js +2 -2
- package/dist/views/Request/ResponseSection/ResponseBody.vue2.js +21 -21
- package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.js +11 -11
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/dist/views/Request/consts/index.js +7 -5
- package/dist/views/Request/consts/mediaTypes.d.ts +4 -0
- package/dist/views/Request/consts/mediaTypes.d.ts.map +1 -1
- package/dist/views/Request/consts/mediaTypes.js +21 -4
- package/dist/views/Request/consts/mediaTypes.test.d.ts +2 -0
- package/dist/views/Request/consts/mediaTypes.test.d.ts.map +1 -0
- package/dist/views/Request/libs/oauth2.d.ts.map +1 -1
- package/dist/views/Request/libs/oauth2.js +53 -47
- package/package.json +11 -11
|
@@ -1,80 +1,117 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
1
|
+
import { defineComponent as L, computed as F, ref as P, onMounted as R, createElementBlock as i, openBlock as l, Fragment as s, renderList as C, createBlock as S, createCommentVNode as v, unref as d, normalizeClass as g, withCtx as n, createVNode as u, createTextVNode as m, toDisplayString as _, mergeProps as V, createElementVNode as A, capitalize as U } from "vue";
|
|
2
|
+
import { ScalarMarkdown as q } from "@scalar/components";
|
|
3
|
+
import { isDefined as I } from "@scalar/oas-utils/helpers";
|
|
4
|
+
import { CLIENT_LS_KEYS as N } from "../../../../libs/local-storage.js";
|
|
5
|
+
import { useWorkspace as z } from "../../../../store/store.js";
|
|
6
|
+
import { updateScheme as D } from "../helpers/update-scheme.js";
|
|
7
|
+
import H from "./OAuth2.vue.js";
|
|
4
8
|
import w from "./RequestAuthDataTableInput.vue.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
const
|
|
9
|
+
import f from "../../../../components/DataTable/DataTableRow.vue.js";
|
|
10
|
+
import j from "../../../../components/DataTable/DataTableCell.vue.js";
|
|
11
|
+
const Q = {
|
|
8
12
|
key: 0,
|
|
9
13
|
class: "flex min-h-8 border-t text-sm"
|
|
10
|
-
},
|
|
11
|
-
key: 5,
|
|
12
|
-
class: "text-c-3 bg-b-1 flex min-h-[calc(4rem+1px)] items-center justify-center border-t px-4 text-sm"
|
|
13
|
-
}, J = /* @__PURE__ */ F({
|
|
14
|
+
}, J = { class: "flex h-8 max-w-full gap-2.5 overflow-x-auto px-3" }, Y = ["onClick"], W = { class: "relative z-10" }, ne = /* @__PURE__ */ L({
|
|
14
15
|
__name: "RequestAuthTab",
|
|
15
16
|
props: {
|
|
16
17
|
collection: {},
|
|
17
18
|
environment: {},
|
|
18
19
|
envVariables: {},
|
|
19
20
|
layout: {},
|
|
21
|
+
persistAuth: { type: Boolean, default: !1 },
|
|
20
22
|
securitySchemeUids: {},
|
|
21
23
|
server: {},
|
|
22
24
|
workspace: {}
|
|
23
25
|
},
|
|
24
26
|
setup(c) {
|
|
25
|
-
const {
|
|
27
|
+
const T = z(), { collectionMutators: B, securitySchemes: x, securitySchemeMutators: M } = T, $ = F(
|
|
26
28
|
() => c.securitySchemeUids.map((t) => ({
|
|
27
|
-
scheme:
|
|
29
|
+
scheme: x[t]
|
|
28
30
|
}))
|
|
29
|
-
),
|
|
30
|
-
const r = t.description ? `: ${t.description}` : "", e = `${
|
|
31
|
+
), p = P(""), O = (t) => {
|
|
32
|
+
const r = t.description ? `: ${t.description}` : "", e = `${U(t.nameKey)}${r || `: ${t.type}`}`;
|
|
31
33
|
if (t.type === "apiKey")
|
|
32
|
-
return `${
|
|
34
|
+
return `${U(t.nameKey)}${r || `: ${t.in}`}`;
|
|
33
35
|
if (t.type === "oauth2") {
|
|
34
36
|
const o = Object.values(t.flows ?? {})[0];
|
|
35
|
-
return `${
|
|
37
|
+
return `${U(t.nameKey)}: ${p.value ? p.value : (o == null ? void 0 : o.type) ?? ""}${r}`;
|
|
36
38
|
}
|
|
37
|
-
return t.type === "http" ? `${
|
|
38
|
-
}, k = (t, r, e) =>
|
|
39
|
+
return t.type === "http" ? `${U(t.nameKey)}: ${t.scheme}${r}` : `${e}${r}`;
|
|
40
|
+
}, k = (t, r, e) => {
|
|
41
|
+
D(t, r, e, T, c.persistAuth);
|
|
42
|
+
};
|
|
43
|
+
R(() => {
|
|
44
|
+
if (!c.persistAuth)
|
|
45
|
+
return;
|
|
46
|
+
const t = JSON.parse(
|
|
47
|
+
localStorage.getItem(N.AUTH) ?? "{}"
|
|
48
|
+
), r = Object.keys(x).reduce(
|
|
49
|
+
(e, o) => {
|
|
50
|
+
const a = x[o];
|
|
51
|
+
return a && (e[a.nameKey] = a.uid), e;
|
|
52
|
+
},
|
|
53
|
+
{}
|
|
54
|
+
);
|
|
55
|
+
Object.entries(t).forEach(([e, o]) => {
|
|
56
|
+
const a = r[e];
|
|
57
|
+
a && Object.entries(o).forEach(([E, K]) => {
|
|
58
|
+
M.edit(a, E, K);
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
try {
|
|
62
|
+
const o = JSON.parse(
|
|
63
|
+
localStorage.getItem(N.SELECTED_SECURITY_SCHEMES) ?? ""
|
|
64
|
+
).map((a) => Array.isArray(a) ? a.map((y) => r[y]).filter(I) : r[a]).filter(I);
|
|
65
|
+
B.edit(c.collection.uid, "selectedSecuritySchemeUids", o);
|
|
66
|
+
} catch {
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
const b = {
|
|
39
70
|
environment: c.environment,
|
|
40
71
|
envVariables: c.envVariables,
|
|
41
72
|
workspace: c.workspace
|
|
42
73
|
};
|
|
43
|
-
return (t, r) => (
|
|
74
|
+
return (t, r) => (l(!0), i(s, null, C($.value, ({ scheme: e }) => (l(), i(s, {
|
|
44
75
|
key: e == null ? void 0 : e.uid
|
|
45
76
|
}, [
|
|
46
|
-
|
|
77
|
+
$.value.length > 1 ? (l(), S(d(f), {
|
|
47
78
|
key: 0,
|
|
48
|
-
class:
|
|
79
|
+
class: g({
|
|
49
80
|
"request-example-references-header": t.layout === "reference"
|
|
50
81
|
})
|
|
51
82
|
}, {
|
|
52
|
-
default:
|
|
53
|
-
u(d(
|
|
54
|
-
class:
|
|
83
|
+
default: n(() => [
|
|
84
|
+
u(d(j), {
|
|
85
|
+
class: g(["text-c-2 flex items-center pl-3", t.layout === "reference" && "border-b"])
|
|
55
86
|
}, {
|
|
56
|
-
default:
|
|
57
|
-
|
|
87
|
+
default: n(() => [
|
|
88
|
+
m(_(O(e)), 1)
|
|
58
89
|
]),
|
|
59
90
|
_: 2
|
|
60
91
|
}, 1032, ["class"])
|
|
61
92
|
]),
|
|
62
93
|
_: 2
|
|
63
94
|
}, 1032, ["class"])) : v("", !0),
|
|
64
|
-
e != null && e.description &&
|
|
65
|
-
default:
|
|
66
|
-
u(d(
|
|
67
|
-
|
|
68
|
-
|
|
95
|
+
e != null && e.description && $.value.length <= 1 ? (l(), S(d(f), { key: 1 }, {
|
|
96
|
+
default: n(() => [
|
|
97
|
+
u(d(j), {
|
|
98
|
+
"aria-label": e.description,
|
|
99
|
+
class: "text-c-2 auth-description-container group/auth -mb-0.25 flex items-center whitespace-nowrap outline-none hover:whitespace-normal"
|
|
100
|
+
}, {
|
|
101
|
+
default: n(() => [
|
|
102
|
+
u(d(q), {
|
|
103
|
+
class: "auth-description z-1 bg-b-1 text-c-2 outline-b-3 top-0 line-clamp-1 h-full w-full px-3 py-1.5 group-hover/auth:line-clamp-none",
|
|
104
|
+
value: e.description
|
|
105
|
+
}, null, 8, ["value"])
|
|
69
106
|
]),
|
|
70
107
|
_: 2
|
|
71
|
-
},
|
|
108
|
+
}, 1032, ["aria-label"])
|
|
72
109
|
]),
|
|
73
110
|
_: 2
|
|
74
111
|
}, 1024)) : v("", !0),
|
|
75
|
-
(e == null ? void 0 : e.type) === "http" ? (
|
|
76
|
-
e.scheme === "bearer" ? (
|
|
77
|
-
default:
|
|
112
|
+
(e == null ? void 0 : e.type) === "http" ? (l(), i(s, { key: 2 }, [
|
|
113
|
+
e.scheme === "bearer" ? (l(), S(d(f), { key: 0 }, {
|
|
114
|
+
default: n(() => [
|
|
78
115
|
u(w, V({ ref_for: !0 }, b, {
|
|
79
116
|
containerClass: t.layout === "reference" && "border-t",
|
|
80
117
|
modelValue: e.token,
|
|
@@ -82,16 +119,16 @@ const R = {
|
|
|
82
119
|
type: "password",
|
|
83
120
|
"onUpdate:modelValue": (o) => k(e.uid, "token", o)
|
|
84
121
|
}), {
|
|
85
|
-
default:
|
|
86
|
-
|
|
122
|
+
default: n(() => r[0] || (r[0] = [
|
|
123
|
+
m(" Bearer Token ")
|
|
87
124
|
])),
|
|
88
125
|
_: 2
|
|
89
126
|
}, 1040, ["containerClass", "modelValue", "onUpdate:modelValue"])
|
|
90
127
|
]),
|
|
91
128
|
_: 2
|
|
92
|
-
}, 1024)) : (e == null ? void 0 : e.scheme) === "basic" ? (
|
|
93
|
-
u(d(
|
|
94
|
-
default:
|
|
129
|
+
}, 1024)) : (e == null ? void 0 : e.scheme) === "basic" ? (l(), i(s, { key: 1 }, [
|
|
130
|
+
u(d(f), null, {
|
|
131
|
+
default: n(() => [
|
|
95
132
|
u(w, V({ ref_for: !0 }, b, {
|
|
96
133
|
class: "text-c-2",
|
|
97
134
|
containerClass: t.layout === "reference" && "auth-blend-required border-t",
|
|
@@ -100,24 +137,24 @@ const R = {
|
|
|
100
137
|
required: "",
|
|
101
138
|
"onUpdate:modelValue": (o) => k(e.uid, "username", o)
|
|
102
139
|
}), {
|
|
103
|
-
default:
|
|
104
|
-
|
|
140
|
+
default: n(() => r[1] || (r[1] = [
|
|
141
|
+
m(" Username ")
|
|
105
142
|
])),
|
|
106
143
|
_: 2
|
|
107
144
|
}, 1040, ["containerClass", "modelValue", "onUpdate:modelValue"])
|
|
108
145
|
]),
|
|
109
146
|
_: 2
|
|
110
147
|
}, 1024),
|
|
111
|
-
u(d(
|
|
112
|
-
default:
|
|
148
|
+
u(d(f), null, {
|
|
149
|
+
default: n(() => [
|
|
113
150
|
u(w, V({ ref_for: !0 }, b, {
|
|
114
151
|
modelValue: e.password,
|
|
115
152
|
placeholder: "********",
|
|
116
153
|
type: "password",
|
|
117
154
|
"onUpdate:modelValue": (o) => k(e.uid, "password", o)
|
|
118
155
|
}), {
|
|
119
|
-
default:
|
|
120
|
-
|
|
156
|
+
default: n(() => r[2] || (r[2] = [
|
|
157
|
+
m(" Password ")
|
|
121
158
|
])),
|
|
122
159
|
_: 2
|
|
123
160
|
}, 1040, ["modelValue", "onUpdate:modelValue"])
|
|
@@ -125,76 +162,80 @@ const R = {
|
|
|
125
162
|
_: 2
|
|
126
163
|
}, 1024)
|
|
127
164
|
], 64)) : v("", !0)
|
|
128
|
-
], 64)) : (e == null ? void 0 : e.type) === "apiKey" ? (
|
|
129
|
-
u(d(
|
|
130
|
-
default:
|
|
165
|
+
], 64)) : (e == null ? void 0 : e.type) === "apiKey" ? (l(), i(s, { key: 3 }, [
|
|
166
|
+
u(d(f), null, {
|
|
167
|
+
default: n(() => [
|
|
131
168
|
u(w, V({ ref_for: !0 }, b, {
|
|
132
169
|
containerClass: t.layout === "reference" && "border-t",
|
|
133
170
|
modelValue: e.name,
|
|
134
171
|
placeholder: "api-key",
|
|
135
172
|
"onUpdate:modelValue": (o) => k(e.uid, "name", o)
|
|
136
173
|
}), {
|
|
137
|
-
default:
|
|
138
|
-
|
|
174
|
+
default: n(() => r[3] || (r[3] = [
|
|
175
|
+
m(" Name ")
|
|
139
176
|
])),
|
|
140
177
|
_: 2
|
|
141
178
|
}, 1040, ["containerClass", "modelValue", "onUpdate:modelValue"])
|
|
142
179
|
]),
|
|
143
180
|
_: 2
|
|
144
181
|
}, 1024),
|
|
145
|
-
u(d(
|
|
146
|
-
default:
|
|
182
|
+
u(d(f), null, {
|
|
183
|
+
default: n(() => [
|
|
147
184
|
u(w, V({ ref_for: !0 }, b, {
|
|
148
185
|
modelValue: e.value,
|
|
149
186
|
placeholder: "QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT",
|
|
150
187
|
type: "password",
|
|
151
188
|
"onUpdate:modelValue": (o) => k(e.uid, "value", o)
|
|
152
189
|
}), {
|
|
153
|
-
default:
|
|
154
|
-
|
|
190
|
+
default: n(() => r[4] || (r[4] = [
|
|
191
|
+
m(" Value ")
|
|
155
192
|
])),
|
|
156
193
|
_: 2
|
|
157
194
|
}, 1040, ["modelValue", "onUpdate:modelValue"])
|
|
158
195
|
]),
|
|
159
196
|
_: 2
|
|
160
197
|
}, 1024)
|
|
161
|
-
], 64)) : (e == null ? void 0 : e.type) === "oauth2" ? (
|
|
162
|
-
u(d(
|
|
163
|
-
default:
|
|
164
|
-
Object.keys(e.flows).length > 1 ? (
|
|
165
|
-
|
|
166
|
-
(
|
|
167
|
-
key:
|
|
168
|
-
class:
|
|
169
|
-
"!text-c-1 !rounded-none border-b-[1px] !border-current": t.layout !== "reference" && (
|
|
170
|
-
"!text-c-1 !rounded-none border-b-[1px] !border-current opacity-100": t.layout === "reference" && (
|
|
198
|
+
], 64)) : (e == null ? void 0 : e.type) === "oauth2" ? (l(), i(s, { key: 4 }, [
|
|
199
|
+
u(d(f), null, {
|
|
200
|
+
default: n(() => [
|
|
201
|
+
Object.keys(e.flows).length > 1 ? (l(), i("div", Q, [
|
|
202
|
+
A("div", J, [
|
|
203
|
+
(l(!0), i(s, null, C(e == null ? void 0 : e.flows, (o, a, y) => (l(), i("button", {
|
|
204
|
+
key: a,
|
|
205
|
+
class: g(["floating-bg text-c-3 relative cursor-pointer border-b-[1px] border-transparent py-1 text-sm font-medium", {
|
|
206
|
+
"!text-c-1 !rounded-none border-b-[1px] !border-current": t.layout !== "reference" && (p.value === a || y === 0 && !p.value),
|
|
207
|
+
"!text-c-1 !rounded-none border-b-[1px] !border-current opacity-100": t.layout === "reference" && (p.value === a || y === 0 && !p.value)
|
|
171
208
|
}]),
|
|
172
209
|
type: "button",
|
|
173
|
-
onClick: (
|
|
210
|
+
onClick: (E) => p.value = a
|
|
174
211
|
}, [
|
|
175
|
-
|
|
176
|
-
], 10,
|
|
212
|
+
A("span", W, _(a), 1)
|
|
213
|
+
], 10, Y))), 128))
|
|
177
214
|
])
|
|
178
215
|
])) : v("", !0)
|
|
179
216
|
]),
|
|
180
217
|
_: 2
|
|
181
218
|
}, 1024),
|
|
182
|
-
(
|
|
183
|
-
|
|
219
|
+
(l(!0), i(s, null, C(e == null ? void 0 : e.flows, (o, a, y) => (l(), i(s, { key: a }, [
|
|
220
|
+
p.value === a || y === 0 && !p.value ? (l(), S(H, V({
|
|
184
221
|
key: 0,
|
|
185
222
|
ref_for: !0
|
|
186
223
|
}, b, {
|
|
187
224
|
collection: t.collection,
|
|
188
225
|
flow: o,
|
|
226
|
+
persistAuth: t.persistAuth,
|
|
189
227
|
scheme: e,
|
|
190
228
|
server: t.server,
|
|
191
229
|
workspace: t.workspace
|
|
192
|
-
}), null, 16, ["collection", "flow", "scheme", "server", "workspace"])) : v("", !0)
|
|
230
|
+
}), null, 16, ["collection", "flow", "persistAuth", "scheme", "server", "workspace"])) : v("", !0)
|
|
193
231
|
], 64))), 128))
|
|
194
|
-
], 64)) : (e == null ? void 0 : e.type) === "openIdConnect" ? (
|
|
232
|
+
], 64)) : (e == null ? void 0 : e.type) === "openIdConnect" ? (l(), i("div", {
|
|
233
|
+
key: 5,
|
|
234
|
+
class: g(["text-c-3 bg-b-1 flex min-h-[calc(4rem+1px)] items-center justify-center border-b-0 border-t px-4 text-sm", { "rounded-b-lg": t.layout === "reference" }])
|
|
235
|
+
}, " Coming soon ", 2)) : v("", !0)
|
|
195
236
|
], 64))), 128));
|
|
196
237
|
}
|
|
197
238
|
});
|
|
198
239
|
export {
|
|
199
|
-
|
|
240
|
+
ne as default
|
|
200
241
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestSection.vue"],"names":[],"mappings":"AAiUA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAA;AACnF,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,cAAc,EACd,MAAM,EACP,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AASrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAU1D,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,OAAO,EAAE,cAAc,CAAA;IACvB,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;IACpB,0BAA0B,EAAE,0BAA0B,CAAA;IACtD,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;;
|
|
1
|
+
{"version":3,"file":"RequestSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestSection.vue"],"names":[],"mappings":"AAiUA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAA;AACnF,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,cAAc,EACd,MAAM,EACP,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AASrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAU1D,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,OAAO,EAAE,cAAc,CAAA;IACvB,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;IACpB,0BAA0B,EAAE,0BAA0B,CAAA;IACtD,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;;AAmVF,wBAOG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./RequestSection.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-b2979639"]]);
|
|
5
5
|
export {
|
|
6
6
|
p as default
|
|
7
7
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as H, computed as p, useId as A, ref as N, watch as I, createBlock as v, openBlock as i, withCtx as d, createElementVNode as c, withDirectives as s, createCommentVNode as f, createVNode as t, unref as n, vShow as m, createElementBlock as
|
|
1
|
+
import { defineComponent as H, computed as p, useId as A, ref as N, watch as I, createBlock as v, openBlock as i, withCtx as d, createElementVNode as c, withDirectives as s, createCommentVNode as f, createVNode as t, unref as n, vShow as m, createElementBlock as h, toDisplayString as U } from "vue";
|
|
2
2
|
import { ScalarErrorBoundary as D } from "@scalar/components";
|
|
3
3
|
import { canMethodHaveBody as b, isDefined as K, REGEX as q } from "@scalar/oas-utils/helpers";
|
|
4
4
|
import Q from "../../../components/SectionFilter.vue.js";
|
|
5
5
|
import $ from "../../../components/ViewLayout/ViewLayoutSection.vue.js";
|
|
6
6
|
import { matchesDomain as L } from "../../../libs/send-request/set-request-cookies.js";
|
|
7
7
|
import j from "./RequestBody.vue.js";
|
|
8
|
-
import
|
|
8
|
+
import k from "./RequestParams.vue.js";
|
|
9
9
|
import F from "./RequestPathParams.vue.js";
|
|
10
10
|
import M from "./RequestAuth/RequestAuth.vue.js";
|
|
11
11
|
import T from "./RequestCodeExample.vue.js";
|
|
@@ -35,12 +35,12 @@ const G = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
35
35
|
"Headers",
|
|
36
36
|
"Query",
|
|
37
37
|
"Body"
|
|
38
|
-
], { requestMutators: S, cookies: g, securitySchemes: B } = W(), { layout: u } = z(),
|
|
38
|
+
], { requestMutators: S, cookies: g, securitySchemes: B } = W(), { layout: u } = z(), y = p(() => {
|
|
39
39
|
const e = /* @__PURE__ */ new Set(["All", ...P]);
|
|
40
40
|
return l.example.parameters.path.length || e.delete("Variables"), b(l.operation.method ?? "get") || e.delete("Body"), w.value && e.delete("Auth"), [...e];
|
|
41
41
|
}), r = p(
|
|
42
42
|
() => Object.fromEntries(
|
|
43
|
-
|
|
43
|
+
y.value.map((e) => [e, A()])
|
|
44
44
|
)
|
|
45
45
|
), w = p(
|
|
46
46
|
() => {
|
|
@@ -80,37 +80,37 @@ const G = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
80
80
|
}, {
|
|
81
81
|
title: d(() => [
|
|
82
82
|
c("div", G, [
|
|
83
|
-
n(u) !== "modal" ? (i(),
|
|
83
|
+
n(u) !== "modal" ? (i(), h("label", {
|
|
84
84
|
key: 0,
|
|
85
85
|
class: "pointer-events-auto absolute left-0 top-0 h-full w-full cursor-text opacity-0",
|
|
86
86
|
for: n(V)
|
|
87
87
|
}, null, 8, X)) : f("", !0),
|
|
88
|
-
n(u) !== "modal" ? (i(),
|
|
88
|
+
n(u) !== "modal" ? (i(), h("input", {
|
|
89
89
|
key: 1,
|
|
90
90
|
id: n(V),
|
|
91
91
|
class: "text-c-1 group-hover-input pl-1.25 md:-ml-1.25 pointer-events-auto relative z-10 -ml-0.5 h-8 w-full rounded has-[:focus-visible]:outline",
|
|
92
92
|
placeholder: E(),
|
|
93
93
|
value: e.operation.summary,
|
|
94
94
|
onInput: C
|
|
95
|
-
}, null, 40, J)) : (i(),
|
|
95
|
+
}, null, 40, J)) : (i(), h("span", Y, U(e.operation.summary), 1))
|
|
96
96
|
]),
|
|
97
97
|
t(Q, {
|
|
98
98
|
modelValue: a.value,
|
|
99
99
|
"onUpdate:modelValue": o[0] || (o[0] = (O) => a.value = O),
|
|
100
100
|
filterIds: r.value,
|
|
101
|
-
filters:
|
|
101
|
+
filters: y.value
|
|
102
102
|
}, null, 8, ["modelValue", "filterIds", "filters"])
|
|
103
103
|
]),
|
|
104
104
|
default: d(() => [
|
|
105
105
|
c("div", {
|
|
106
106
|
id: r.value.All,
|
|
107
|
-
class: "request-section-content custom-scroll relative flex flex-1 flex-col
|
|
107
|
+
class: "request-section-content custom-scroll relative flex flex-1 flex-col",
|
|
108
108
|
role: a.value === "All" ? "tabpanel" : "none"
|
|
109
109
|
}, [
|
|
110
110
|
e.collection && e.workspace && (n(u) !== "modal" || Object.keys(n(B) ?? {}).length) ? s((i(), v(M, {
|
|
111
111
|
key: 0,
|
|
112
112
|
id: r.value.Auth,
|
|
113
|
-
class: "request-section-content-auth
|
|
113
|
+
class: "request-section-content-auth",
|
|
114
114
|
collection: e.collection,
|
|
115
115
|
envVariables: e.envVariables,
|
|
116
116
|
environment: e.environment,
|
|
@@ -145,7 +145,7 @@ const G = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
145
145
|
(a.value === "All" || a.value === "Variables") && e.example.parameters.path.length
|
|
146
146
|
]
|
|
147
147
|
]),
|
|
148
|
-
s(t(
|
|
148
|
+
s(t(k, {
|
|
149
149
|
id: r.value.Cookies,
|
|
150
150
|
class: "request-section-content-cookies",
|
|
151
151
|
envVariables: e.envVariables,
|
|
@@ -162,7 +162,7 @@ const G = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
162
162
|
}, null, 8, ["id", "envVariables", "environment", "example", "invalidParams", "operation", "readOnlyEntries", "role", "workspace"]), [
|
|
163
163
|
[m, a.value === "All" || a.value === "Cookies"]
|
|
164
164
|
]),
|
|
165
|
-
s(t(
|
|
165
|
+
s(t(k, {
|
|
166
166
|
id: r.value.Headers,
|
|
167
167
|
class: "request-section-content-headers",
|
|
168
168
|
envVariables: e.envVariables,
|
|
@@ -178,7 +178,7 @@ const G = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
178
178
|
}, null, 8, ["id", "envVariables", "environment", "example", "invalidParams", "operation", "role", "workspace"]), [
|
|
179
179
|
[m, a.value === "All" || a.value === "Headers"]
|
|
180
180
|
]),
|
|
181
|
-
s(t(
|
|
181
|
+
s(t(k, {
|
|
182
182
|
id: r.value.Query,
|
|
183
183
|
class: "request-section-content-query",
|
|
184
184
|
envVariables: e.envVariables,
|
|
@@ -206,11 +206,11 @@ const G = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
206
206
|
title: "Body",
|
|
207
207
|
workspace: e.workspace
|
|
208
208
|
}, null, 8, ["id", "envVariables", "environment", "example", "operation", "role", "workspace"])) : f("", !0),
|
|
209
|
-
o[1] || (o[1] = c("div", { class: "
|
|
209
|
+
o[1] || (o[1] = c("div", { class: "flex flex-grow" }, null, -1)),
|
|
210
210
|
t(n(D), null, {
|
|
211
211
|
default: d(() => [
|
|
212
212
|
t(T, {
|
|
213
|
-
class: "request-section-content-code-example",
|
|
213
|
+
class: "request-section-content-code-example -mt-1/2 border-t",
|
|
214
214
|
collection: e.collection,
|
|
215
215
|
example: e.example,
|
|
216
216
|
operation: e.operation,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SecurityScheme } from '@scalar/oas-utils/entities/spec';
|
|
2
|
+
import type { Path, PathValue } from '@scalar/object-utils/nested';
|
|
3
|
+
import type { WorkspaceStore } from '../../../../store/store';
|
|
4
|
+
/** Shape of the local storage auth object */
|
|
5
|
+
export type Auth<P extends Path<SecurityScheme>> = Record<string, Record<P, NonNullable<PathValue<SecurityScheme, P>>>>;
|
|
6
|
+
/** Update the security scheme with side effects */
|
|
7
|
+
export declare const updateScheme: <U extends SecurityScheme["uid"], P extends Path<SecurityScheme>>(uid: U, path: P, value: NonNullable<PathValue<SecurityScheme, P>>, { securitySchemeMutators, securitySchemes }: WorkspaceStore, persistAuth?: boolean) => void;
|
|
8
|
+
//# sourceMappingURL=update-scheme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-scheme.d.ts","sourceRoot":"","sources":["../../../../../src/views/Request/RequestSection/helpers/update-scheme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AACrE,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAA;AAElE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAEnD,6CAA6C;AAC7C,MAAM,MAAM,IAAI,CAAC,CAAC,SAAS,IAAI,CAAC,cAAc,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAEvH,mDAAmD;AACnD,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC,SAAS,IAAI,CAAC,cAAc,CAAC,OACrF,CAAC,QACA,CAAC,SACA,WAAW,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,+CACH,cAAc,gCAsB5D,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CLIENT_LS_KEYS as a } from "../../../../libs/local-storage.js";
|
|
2
|
+
const l = (o, r, c, { securitySchemeMutators: m, securitySchemes: s }, S = !1) => {
|
|
3
|
+
var n;
|
|
4
|
+
if (m.edit(o, r, c), !!S)
|
|
5
|
+
try {
|
|
6
|
+
const e = JSON.parse(localStorage.getItem(a.AUTH) ?? "{}"), t = s[o];
|
|
7
|
+
if (e && (t != null && t.nameKey)) {
|
|
8
|
+
const f = e[n = t.nameKey] || (e[n] = {});
|
|
9
|
+
f[r] = c, localStorage.setItem(a.AUTH, JSON.stringify(e));
|
|
10
|
+
}
|
|
11
|
+
} catch (e) {
|
|
12
|
+
console.error(e);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
l as updateScheme
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-scheme.test.d.ts","sourceRoot":"","sources":["../../../../../src/views/Request/RequestSection/helpers/update-scheme.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestSidebar.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebar.vue"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"RequestSidebar.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebar.vue"],"names":[],"mappings":";;;cAokBuC,MAAM;aAAO,MAAM;;;;;cAAnB,MAAM;aAAO,MAAM;;;AAuzB1D,wBAMG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./RequestSidebar.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-8b424452"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|