@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,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as b, computed as w, watch as
|
|
2
|
-
import { useLoadingState as
|
|
1
|
+
import { defineComponent as b, computed as w, watch as L, createElementBlock as x, openBlock as c, Fragment as V, createVNode as r, unref as o, withCtx as l, createTextVNode as s, createElementVNode as U, createBlock as f, createCommentVNode as v } from "vue";
|
|
2
|
+
import { useLoadingState as O, ScalarButton as S } from "@scalar/components";
|
|
3
3
|
import { pkceOptions as P } from "@scalar/oas-utils/entities/spec";
|
|
4
4
|
import { useToasts as R } from "@scalar/use-toasts";
|
|
5
5
|
import F from "./OAuthScopesInput.vue.js";
|
|
6
6
|
/* empty css */
|
|
7
|
-
import { authorizeOauth2 as
|
|
8
|
-
import
|
|
7
|
+
import { authorizeOauth2 as A } from "../helpers/oauth.js";
|
|
8
|
+
import i from "./RequestAuthDataTableInput.vue.js";
|
|
9
9
|
import u from "../../../../components/DataTable/DataTableRow.vue.js";
|
|
10
|
-
const
|
|
10
|
+
const I = { class: "flex h-8 items-center justify-end gap-2 border-t" }, N = { class: "flex h-8 w-full items-center justify-end border-t" }, Y = /* @__PURE__ */ b({
|
|
11
11
|
__name: "OAuth2",
|
|
12
12
|
props: {
|
|
13
13
|
environment: {},
|
|
@@ -15,54 +15,65 @@ const A = { class: "flex h-8 items-center justify-end gap-2 border-t" }, I = { c
|
|
|
15
15
|
type: {},
|
|
16
16
|
selectedScopes: {},
|
|
17
17
|
server: {},
|
|
18
|
-
proxyUrl: {}
|
|
18
|
+
proxyUrl: {},
|
|
19
|
+
name: {},
|
|
20
|
+
eventBus: {}
|
|
19
21
|
},
|
|
20
|
-
emits: ["update:
|
|
21
|
-
setup(
|
|
22
|
-
const
|
|
23
|
-
() =>
|
|
24
|
-
),
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
emits: ["update:selectedScopes"],
|
|
23
|
+
setup(t, { emit: g }) {
|
|
24
|
+
const C = g, p = O(), { toast: T } = R(), a = w(() => t.flows[t.type]), k = w(
|
|
25
|
+
() => t.selectedScopes.filter((d) => d in (a.value.scopes ?? {}))
|
|
26
|
+
), y = (d) => t.eventBus.emit("auth:update:security-scheme", {
|
|
27
|
+
payload: {
|
|
28
|
+
type: "oauth2",
|
|
29
|
+
flows: {
|
|
30
|
+
[t.type]: d
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
name: t.name
|
|
34
|
+
}), m = (d) => t.eventBus.emit("auth:update:security-scheme-secrets", {
|
|
35
|
+
payload: {
|
|
36
|
+
type: "oauth2",
|
|
37
|
+
[t.type]: d
|
|
38
|
+
},
|
|
39
|
+
name: t.name
|
|
29
40
|
});
|
|
30
|
-
|
|
31
|
-
() =>
|
|
32
|
-
(
|
|
33
|
-
|
|
41
|
+
L(
|
|
42
|
+
() => a.value["x-scalar-secret-redirect-uri"],
|
|
43
|
+
(d) => {
|
|
44
|
+
d || typeof window > "u" || !("x-scalar-secret-redirect-uri" in a.value) || m({
|
|
34
45
|
"x-scalar-secret-redirect-uri": window.location.origin + window.location.pathname
|
|
35
46
|
});
|
|
36
47
|
},
|
|
37
48
|
{ immediate: !0 }
|
|
38
49
|
);
|
|
39
|
-
const
|
|
50
|
+
const z = async () => {
|
|
40
51
|
if (p.isLoading)
|
|
41
52
|
return;
|
|
42
53
|
p.start();
|
|
43
|
-
const [
|
|
44
|
-
|
|
45
|
-
|
|
54
|
+
const [d, e] = await A(
|
|
55
|
+
t.flows,
|
|
56
|
+
t.type,
|
|
46
57
|
k.value,
|
|
47
|
-
|
|
48
|
-
|
|
58
|
+
t.server,
|
|
59
|
+
t.proxyUrl
|
|
49
60
|
);
|
|
50
|
-
await p.clear(), e ?
|
|
51
|
-
},
|
|
52
|
-
"x-scalar-credentials-location":
|
|
61
|
+
await p.clear(), e ? m({ "x-scalar-secret-token": e }) : (console.error(d), T(d?.message ?? "Failed to authorize", "error"));
|
|
62
|
+
}, B = (d) => y({
|
|
63
|
+
"x-scalar-credentials-location": d === "body" ? "body" : "header"
|
|
53
64
|
});
|
|
54
|
-
return (
|
|
65
|
+
return (d, e) => a.value["x-scalar-secret-token"] ? (c(), x(V, { key: 0 }, [
|
|
55
66
|
r(o(u), null, {
|
|
56
|
-
default:
|
|
57
|
-
r(
|
|
67
|
+
default: l(() => [
|
|
68
|
+
r(i, {
|
|
58
69
|
class: "border-r-transparent",
|
|
59
|
-
environment:
|
|
60
|
-
modelValue:
|
|
70
|
+
environment: t.environment,
|
|
71
|
+
modelValue: a.value["x-scalar-secret-token"],
|
|
61
72
|
placeholder: "QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT",
|
|
62
73
|
type: "password",
|
|
63
|
-
"onUpdate:modelValue": e[0] || (e[0] = (n) =>
|
|
74
|
+
"onUpdate:modelValue": e[0] || (e[0] = (n) => m({ "x-scalar-secret-token": n }))
|
|
64
75
|
}, {
|
|
65
|
-
default:
|
|
76
|
+
default: l(() => [...e[12] || (e[12] = [
|
|
66
77
|
s(" Access Token ", -1)
|
|
67
78
|
])]),
|
|
68
79
|
_: 1
|
|
@@ -71,16 +82,16 @@ const A = { class: "flex h-8 items-center justify-end gap-2 border-t" }, I = { c
|
|
|
71
82
|
_: 1
|
|
72
83
|
}),
|
|
73
84
|
r(o(u), { class: "min-w-full" }, {
|
|
74
|
-
default:
|
|
75
|
-
U("div",
|
|
85
|
+
default: l(() => [
|
|
86
|
+
U("div", I, [
|
|
76
87
|
r(o(S), {
|
|
77
88
|
class: "mr-1 p-0 px-2 py-0.5",
|
|
78
89
|
loader: o(p),
|
|
79
90
|
size: "sm",
|
|
80
91
|
variant: "outlined",
|
|
81
|
-
onClick: e[1] || (e[1] = () =>
|
|
92
|
+
onClick: e[1] || (e[1] = () => m({ "x-scalar-secret-token": "" }))
|
|
82
93
|
}, {
|
|
83
|
-
default:
|
|
94
|
+
default: l(() => [...e[13] || (e[13] = [
|
|
84
95
|
s(" Clear ", -1)
|
|
85
96
|
])]),
|
|
86
97
|
_: 1
|
|
@@ -89,30 +100,30 @@ const A = { class: "flex h-8 items-center justify-end gap-2 border-t" }, I = { c
|
|
|
89
100
|
]),
|
|
90
101
|
_: 1
|
|
91
102
|
})
|
|
92
|
-
], 64)) : (c(), x(
|
|
103
|
+
], 64)) : (c(), x(V, { key: 1 }, [
|
|
93
104
|
r(o(u), null, {
|
|
94
|
-
default:
|
|
95
|
-
"authorizationUrl" in
|
|
105
|
+
default: l(() => [
|
|
106
|
+
"authorizationUrl" in a.value ? (c(), f(i, {
|
|
96
107
|
key: 0,
|
|
97
108
|
containerClass: "border-r-0",
|
|
98
|
-
environment:
|
|
99
|
-
modelValue:
|
|
109
|
+
environment: t.environment,
|
|
110
|
+
modelValue: a.value.authorizationUrl,
|
|
100
111
|
placeholder: "https://galaxy.scalar.com/authorize",
|
|
101
|
-
"onUpdate:modelValue": e[2] || (e[2] = (n) =>
|
|
112
|
+
"onUpdate:modelValue": e[2] || (e[2] = (n) => y({ authorizationUrl: n }))
|
|
102
113
|
}, {
|
|
103
|
-
default:
|
|
114
|
+
default: l(() => [...e[14] || (e[14] = [
|
|
104
115
|
s(" Auth URL ", -1)
|
|
105
116
|
])]),
|
|
106
117
|
_: 1
|
|
107
118
|
}, 8, ["environment", "modelValue"])) : v("", !0),
|
|
108
|
-
"tokenUrl" in
|
|
119
|
+
"tokenUrl" in a.value ? (c(), f(i, {
|
|
109
120
|
key: 1,
|
|
110
|
-
environment:
|
|
111
|
-
modelValue:
|
|
121
|
+
environment: t.environment,
|
|
122
|
+
modelValue: a.value.tokenUrl,
|
|
112
123
|
placeholder: "https://galaxy.scalar.com/token",
|
|
113
|
-
"onUpdate:modelValue": e[3] || (e[3] = (n) =>
|
|
124
|
+
"onUpdate:modelValue": e[3] || (e[3] = (n) => y({ tokenUrl: n }))
|
|
114
125
|
}, {
|
|
115
|
-
default:
|
|
126
|
+
default: l(() => [...e[15] || (e[15] = [
|
|
116
127
|
s(" Token URL ", -1)
|
|
117
128
|
])]),
|
|
118
129
|
_: 1
|
|
@@ -120,15 +131,15 @@ const A = { class: "flex h-8 items-center justify-end gap-2 border-t" }, I = { c
|
|
|
120
131
|
]),
|
|
121
132
|
_: 1
|
|
122
133
|
}),
|
|
123
|
-
"x-scalar-secret-redirect-uri" in
|
|
124
|
-
default:
|
|
125
|
-
r(
|
|
126
|
-
environment:
|
|
127
|
-
modelValue:
|
|
134
|
+
"x-scalar-secret-redirect-uri" in a.value ? (c(), f(o(u), { key: 0 }, {
|
|
135
|
+
default: l(() => [
|
|
136
|
+
r(i, {
|
|
137
|
+
environment: t.environment,
|
|
138
|
+
modelValue: a.value["x-scalar-secret-redirect-uri"],
|
|
128
139
|
placeholder: "https://galaxy.scalar.com/callback",
|
|
129
|
-
"onUpdate:modelValue": e[4] || (e[4] = (n) =>
|
|
140
|
+
"onUpdate:modelValue": e[4] || (e[4] = (n) => m({ "x-scalar-secret-redirect-uri": n }))
|
|
130
141
|
}, {
|
|
131
|
-
default:
|
|
142
|
+
default: l(() => [...e[16] || (e[16] = [
|
|
132
143
|
s(" Redirect URL ", -1)
|
|
133
144
|
])]),
|
|
134
145
|
_: 1
|
|
@@ -136,17 +147,17 @@ const A = { class: "flex h-8 items-center justify-end gap-2 border-t" }, I = { c
|
|
|
136
147
|
]),
|
|
137
148
|
_: 1
|
|
138
149
|
})) : v("", !0),
|
|
139
|
-
"x-scalar-secret-username" in
|
|
150
|
+
"x-scalar-secret-username" in a.value && "x-scalar-secret-password" in a.value ? (c(), x(V, { key: 1 }, [
|
|
140
151
|
r(o(u), null, {
|
|
141
|
-
default:
|
|
142
|
-
r(
|
|
152
|
+
default: l(() => [
|
|
153
|
+
r(i, {
|
|
143
154
|
class: "text-c-2",
|
|
144
|
-
environment:
|
|
145
|
-
modelValue:
|
|
155
|
+
environment: t.environment,
|
|
156
|
+
modelValue: a.value["x-scalar-secret-username"],
|
|
146
157
|
placeholder: "janedoe",
|
|
147
|
-
"onUpdate:modelValue": e[5] || (e[5] = (n) =>
|
|
158
|
+
"onUpdate:modelValue": e[5] || (e[5] = (n) => m({ "x-scalar-secret-username": n }))
|
|
148
159
|
}, {
|
|
149
|
-
default:
|
|
160
|
+
default: l(() => [...e[17] || (e[17] = [
|
|
150
161
|
s(" Username ", -1)
|
|
151
162
|
])]),
|
|
152
163
|
_: 1
|
|
@@ -155,15 +166,15 @@ const A = { class: "flex h-8 items-center justify-end gap-2 border-t" }, I = { c
|
|
|
155
166
|
_: 1
|
|
156
167
|
}),
|
|
157
168
|
r(o(u), null, {
|
|
158
|
-
default:
|
|
159
|
-
r(
|
|
160
|
-
environment:
|
|
161
|
-
modelValue:
|
|
169
|
+
default: l(() => [
|
|
170
|
+
r(i, {
|
|
171
|
+
environment: t.environment,
|
|
172
|
+
modelValue: a.value["x-scalar-secret-password"],
|
|
162
173
|
placeholder: "********",
|
|
163
174
|
type: "password",
|
|
164
|
-
"onUpdate:modelValue": e[6] || (e[6] = (n) =>
|
|
175
|
+
"onUpdate:modelValue": e[6] || (e[6] = (n) => m({ "x-scalar-secret-password": n }))
|
|
165
176
|
}, {
|
|
166
|
-
default:
|
|
177
|
+
default: l(() => [...e[18] || (e[18] = [
|
|
167
178
|
s(" Password ", -1)
|
|
168
179
|
])]),
|
|
169
180
|
_: 1
|
|
@@ -173,14 +184,14 @@ const A = { class: "flex h-8 items-center justify-end gap-2 border-t" }, I = { c
|
|
|
173
184
|
})
|
|
174
185
|
], 64)) : v("", !0),
|
|
175
186
|
r(o(u), null, {
|
|
176
|
-
default:
|
|
177
|
-
r(
|
|
178
|
-
environment:
|
|
179
|
-
modelValue:
|
|
187
|
+
default: l(() => [
|
|
188
|
+
r(i, {
|
|
189
|
+
environment: t.environment,
|
|
190
|
+
modelValue: a.value["x-scalar-secret-client-id"],
|
|
180
191
|
placeholder: "12345",
|
|
181
|
-
"onUpdate:modelValue": e[7] || (e[7] = (n) =>
|
|
192
|
+
"onUpdate:modelValue": e[7] || (e[7] = (n) => m({ "x-scalar-secret-client-id": n }))
|
|
182
193
|
}, {
|
|
183
|
-
default:
|
|
194
|
+
default: l(() => [...e[19] || (e[19] = [
|
|
184
195
|
s(" Client ID ", -1)
|
|
185
196
|
])]),
|
|
186
197
|
_: 1
|
|
@@ -188,16 +199,16 @@ const A = { class: "flex h-8 items-center justify-end gap-2 border-t" }, I = { c
|
|
|
188
199
|
]),
|
|
189
200
|
_: 1
|
|
190
201
|
}),
|
|
191
|
-
"x-scalar-secret-client-secret" in
|
|
192
|
-
default:
|
|
193
|
-
r(
|
|
194
|
-
environment:
|
|
195
|
-
modelValue:
|
|
202
|
+
"x-scalar-secret-client-secret" in a.value ? (c(), f(o(u), { key: 2 }, {
|
|
203
|
+
default: l(() => [
|
|
204
|
+
r(i, {
|
|
205
|
+
environment: t.environment,
|
|
206
|
+
modelValue: a.value["x-scalar-secret-client-secret"],
|
|
196
207
|
placeholder: "XYZ123",
|
|
197
208
|
type: "password",
|
|
198
|
-
"onUpdate:modelValue": e[8] || (e[8] = (n) =>
|
|
209
|
+
"onUpdate:modelValue": e[8] || (e[8] = (n) => m({ "x-scalar-secret-client-secret": n }))
|
|
199
210
|
}, {
|
|
200
|
-
default:
|
|
211
|
+
default: l(() => [...e[20] || (e[20] = [
|
|
201
212
|
s(" Client Secret ", -1)
|
|
202
213
|
])]),
|
|
203
214
|
_: 1
|
|
@@ -205,18 +216,18 @@ const A = { class: "flex h-8 items-center justify-end gap-2 border-t" }, I = { c
|
|
|
205
216
|
]),
|
|
206
217
|
_: 1
|
|
207
218
|
})) : v("", !0),
|
|
208
|
-
"x-usePkce" in
|
|
209
|
-
default:
|
|
210
|
-
r(
|
|
219
|
+
"x-usePkce" in a.value ? (c(), f(o(u), { key: 3 }, {
|
|
220
|
+
default: l(() => [
|
|
221
|
+
r(i, {
|
|
211
222
|
enum: o(P),
|
|
212
|
-
environment:
|
|
213
|
-
modelValue:
|
|
223
|
+
environment: t.environment,
|
|
224
|
+
modelValue: a.value["x-usePkce"],
|
|
214
225
|
readOnly: "",
|
|
215
|
-
"onUpdate:modelValue": e[9] || (e[9] = (n) =>
|
|
226
|
+
"onUpdate:modelValue": e[9] || (e[9] = (n) => y({
|
|
216
227
|
"x-usePkce": n
|
|
217
228
|
}))
|
|
218
229
|
}, {
|
|
219
|
-
default:
|
|
230
|
+
default: l(() => [...e[21] || (e[21] = [
|
|
220
231
|
s(" Use PKCE ", -1)
|
|
221
232
|
])]),
|
|
222
233
|
_: 1
|
|
@@ -224,17 +235,17 @@ const A = { class: "flex h-8 items-center justify-end gap-2 border-t" }, I = { c
|
|
|
224
235
|
]),
|
|
225
236
|
_: 1
|
|
226
237
|
})) : v("", !0),
|
|
227
|
-
|
|
228
|
-
default:
|
|
229
|
-
r(
|
|
238
|
+
t.type !== "implicit" ? (c(), f(o(u), { key: 4 }, {
|
|
239
|
+
default: l(() => [
|
|
240
|
+
r(i, {
|
|
230
241
|
enum: ["header", "body"],
|
|
231
|
-
environment:
|
|
232
|
-
modelValue:
|
|
242
|
+
environment: t.environment,
|
|
243
|
+
modelValue: a.value["x-scalar-credentials-location"] || "header",
|
|
233
244
|
placeholder: "header",
|
|
234
245
|
readOnly: "",
|
|
235
|
-
"onUpdate:modelValue": e[10] || (e[10] = (n) =>
|
|
246
|
+
"onUpdate:modelValue": e[10] || (e[10] = (n) => B(n))
|
|
236
247
|
}, {
|
|
237
|
-
default:
|
|
248
|
+
default: l(() => [...e[22] || (e[22] = [
|
|
238
249
|
s(" Credentials Location ", -1)
|
|
239
250
|
])]),
|
|
240
251
|
_: 1
|
|
@@ -243,27 +254,27 @@ const A = { class: "flex h-8 items-center justify-end gap-2 border-t" }, I = { c
|
|
|
243
254
|
_: 1
|
|
244
255
|
})) : v("", !0),
|
|
245
256
|
r(o(u), null, {
|
|
246
|
-
default:
|
|
257
|
+
default: l(() => [
|
|
247
258
|
r(F, {
|
|
248
|
-
flow:
|
|
249
|
-
flowType:
|
|
259
|
+
flow: a.value,
|
|
260
|
+
flowType: t.type,
|
|
250
261
|
selectedScopes: k.value,
|
|
251
|
-
"onUpdate:selectedScopes": e[11] || (e[11] = (n) =>
|
|
262
|
+
"onUpdate:selectedScopes": e[11] || (e[11] = (n) => C("update:selectedScopes", n))
|
|
252
263
|
}, null, 8, ["flow", "flowType", "selectedScopes"])
|
|
253
264
|
]),
|
|
254
265
|
_: 1
|
|
255
266
|
}),
|
|
256
267
|
r(o(u), { class: "min-w-full" }, {
|
|
257
|
-
default:
|
|
258
|
-
U("div",
|
|
268
|
+
default: l(() => [
|
|
269
|
+
U("div", N, [
|
|
259
270
|
r(o(S), {
|
|
260
271
|
class: "mr-0.75 p-0 px-2 py-0.5",
|
|
261
272
|
loader: o(p),
|
|
262
273
|
size: "sm",
|
|
263
274
|
variant: "outlined",
|
|
264
|
-
onClick:
|
|
275
|
+
onClick: z
|
|
265
276
|
}, {
|
|
266
|
-
default:
|
|
277
|
+
default: l(() => [...e[23] || (e[23] = [
|
|
267
278
|
s(" Authorize ", -1)
|
|
268
279
|
])]),
|
|
269
280
|
_: 1
|
|
@@ -276,5 +287,5 @@ const A = { class: "flex h-8 items-center justify-end gap-2 border-t" }, I = { c
|
|
|
276
287
|
}
|
|
277
288
|
});
|
|
278
289
|
export {
|
|
279
|
-
|
|
290
|
+
Y as default
|
|
280
291
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { AuthMeta, WorkspaceEventBus } from '@scalar/workspace-store/events';
|
|
2
2
|
import type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments';
|
|
3
|
-
import type {
|
|
3
|
+
import type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
4
|
+
import type { MergedSecuritySchemes } from '../../../../v2/blocks/scalar-auth-selector-block/index.js';
|
|
4
5
|
import type { SecuritySchemeOption } from '../../../../v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js';
|
|
5
6
|
type __VLS_Props = {
|
|
6
7
|
/** The current environment configuration */
|
|
@@ -14,7 +15,7 @@ type __VLS_Props = {
|
|
|
14
15
|
/** Proxy URL */
|
|
15
16
|
proxyUrl: string;
|
|
16
17
|
/** OpenAPI security scheme definitions */
|
|
17
|
-
securitySchemes:
|
|
18
|
+
securitySchemes: MergedSecuritySchemes;
|
|
18
19
|
/** Current server configuration */
|
|
19
20
|
server: ServerObject | null;
|
|
20
21
|
/** Event bus for authentication updates */
|
package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestAuthDataTable.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestAuthDataTable.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue"],"names":[],"mappings":"AA4IA,OAAO,KAAK,EAEV,QAAQ,EACR,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAGhG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAA;AACnF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gEAAgE,CAAA;AAK1G,KAAK,WAAW,GAAG;IACjB,4CAA4C;IAC5C,WAAW,EAAE,kBAAkB,CAAA;IAC/B,mEAAmE;IACnE,QAAQ,EAAE,OAAO,CAAA;IACjB,8CAA8C;IAC9C,qBAAqB,EAAE,oBAAoB,EAAE,CAAA;IAC7C,uDAAuD;IACvD,eAAe,EAAE,MAAM,CAAA;IACvB,gBAAgB;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,0CAA0C;IAC1C,eAAe,EAAE,qBAAqB,CAAA;IACtC,mCAAmC;IACnC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,2CAA2C;IAC3C,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,0CAA0C;IAC1C,IAAI,EAAE,QAAQ,CAAA;CACf,CAAC;;;;AAsNF,wBAOG"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as f, computed as d, createElementBlock as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as f, computed as d, createElementBlock as n, openBlock as t, withModifiers as S, createCommentVNode as m, createBlock as y, normalizeClass as s, Fragment as g, renderList as k, createElementVNode as u, toDisplayString as w, unref as B, withCtx as p, createVNode as C } from "vue";
|
|
2
|
+
import U from "./RequestAuthTab.vue.js";
|
|
3
|
+
import A from "../../../components/data-table/DataTable.vue.js";
|
|
4
|
+
const z = ["onClick"], N = { class: "relative z-10 font-medium whitespace-nowrap" }, O = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "absolute inset-x-1 bottom-[var(--scalar-border-width)] left-1/2 z-1 h-px w-full -translate-x-1/2 bg-current"
|
|
7
|
-
},
|
|
7
|
+
}, D = /* @__PURE__ */ f({
|
|
8
8
|
__name: "RequestAuthDataTable",
|
|
9
9
|
props: {
|
|
10
10
|
environment: {},
|
|
@@ -18,63 +18,60 @@ const N = ["onClick"], O = { class: "relative z-10 font-medium whitespace-nowrap
|
|
|
18
18
|
meta: {}
|
|
19
19
|
},
|
|
20
20
|
setup(e, { expose: h }) {
|
|
21
|
-
const
|
|
21
|
+
const c = d(
|
|
22
22
|
() => e.selectedSchemeOptions[e.activeAuthIndex]
|
|
23
|
-
),
|
|
24
|
-
index:
|
|
23
|
+
), v = d(() => e.selectedSchemeOptions.length > 1), b = (a) => e.eventBus.emit("auth:update:active-index", {
|
|
24
|
+
index: a,
|
|
25
25
|
meta: e.meta
|
|
26
|
-
}), x = (
|
|
27
|
-
|
|
28
|
-
name: n
|
|
29
|
-
}), S = (t) => e.eventBus.emit("auth:update:selected-scopes", {
|
|
30
|
-
...t,
|
|
26
|
+
}), x = (a) => e.eventBus.emit("auth:update:selected-scopes", {
|
|
27
|
+
...a,
|
|
31
28
|
meta: e.meta
|
|
32
|
-
}),
|
|
29
|
+
}), i = (a) => e.activeAuthIndex === a;
|
|
33
30
|
return h({
|
|
34
|
-
activeScheme:
|
|
35
|
-
}), (
|
|
36
|
-
onSubmit:
|
|
31
|
+
activeScheme: c
|
|
32
|
+
}), (a, o) => (t(), n("form", {
|
|
33
|
+
onSubmit: o[0] || (o[0] = S(() => {
|
|
37
34
|
}, ["prevent"]))
|
|
38
35
|
}, [
|
|
39
|
-
|
|
36
|
+
v.value ? (t(), n("div", {
|
|
40
37
|
key: 0,
|
|
41
38
|
class: s(["box-content flex flex-wrap gap-x-2.5 overflow-hidden border border-b-0 px-3", { "border-x-0": !e.isStatic }]),
|
|
42
39
|
"data-testid": "auth-tabs"
|
|
43
40
|
}, [
|
|
44
|
-
(
|
|
41
|
+
(t(!0), n(g, null, k(e.selectedSchemeOptions, (l, r) => (t(), n("div", {
|
|
45
42
|
key: l.id,
|
|
46
43
|
class: "relative z-1 -mb-[var(--scalar-border-width)] flex h-8"
|
|
47
44
|
}, [
|
|
48
45
|
u("button", {
|
|
49
|
-
class: s(["floating-bg relative cursor-pointer border-b border-transparent py-1 text-sm font-medium transition-colors",
|
|
46
|
+
class: s(["floating-bg relative cursor-pointer border-b border-transparent py-1 text-sm font-medium transition-colors", i(r) ? "text-c-1" : "text-c-3"]),
|
|
50
47
|
type: "button",
|
|
51
|
-
onClick: (
|
|
48
|
+
onClick: (T) => b(r)
|
|
52
49
|
}, [
|
|
53
|
-
u("span",
|
|
54
|
-
], 10,
|
|
55
|
-
|
|
50
|
+
u("span", N, w(l.label), 1)
|
|
51
|
+
], 10, z),
|
|
52
|
+
i(r) ? (t(), n("div", O)) : m("", !0)
|
|
56
53
|
]))), 128))
|
|
57
54
|
], 2)) : m("", !0),
|
|
58
|
-
|
|
55
|
+
c.value ? (t(), y(B(A), {
|
|
59
56
|
key: 1,
|
|
60
57
|
class: s(["flex-1", { "bg-b-1 rounded-b-lg border border-t-0": e.isStatic }]),
|
|
61
58
|
columns: [""],
|
|
62
59
|
presentational: ""
|
|
63
60
|
}, {
|
|
64
|
-
default:
|
|
65
|
-
C(
|
|
61
|
+
default: p(() => [
|
|
62
|
+
C(U, {
|
|
66
63
|
environment: e.environment,
|
|
64
|
+
eventBus: e.eventBus,
|
|
67
65
|
isStatic: e.isStatic,
|
|
68
66
|
proxyUrl: e.proxyUrl,
|
|
69
67
|
securitySchemes: e.securitySchemes,
|
|
70
|
-
selectedSecuritySchemas:
|
|
68
|
+
selectedSecuritySchemas: c.value.value,
|
|
71
69
|
server: e.server,
|
|
72
|
-
"onUpdate:
|
|
73
|
-
|
|
74
|
-
}, null, 8, ["environment", "isStatic", "proxyUrl", "securitySchemes", "selectedSecuritySchemas", "server"])
|
|
70
|
+
"onUpdate:selectedScopes": x
|
|
71
|
+
}, null, 8, ["environment", "eventBus", "isStatic", "proxyUrl", "securitySchemes", "selectedSecuritySchemas", "server"])
|
|
75
72
|
]),
|
|
76
73
|
_: 1
|
|
77
|
-
}, 8, ["class"])) : (
|
|
74
|
+
}, 8, ["class"])) : (t(), n("div", {
|
|
78
75
|
key: 2,
|
|
79
76
|
class: s(["bg-b-1 text-c-3 flex min-h-16 items-center justify-center border-t px-4 text-sm", { "min-h-[calc(4rem+0.5px)] rounded-b-lg border": e.isStatic }])
|
|
80
77
|
}, " No authentication selected ", 2))
|
|
@@ -82,5 +79,5 @@ const N = ["onClick"], O = { class: "relative z-10 font-medium whitespace-nowrap
|
|
|
82
79
|
}
|
|
83
80
|
});
|
|
84
81
|
export {
|
|
85
|
-
|
|
82
|
+
D as default
|
|
86
83
|
};
|