@scalar/api-client 2.5.34 → 2.6.0
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 +38 -0
- package/dist/components/CodeInput/CodeInput.vue.d.ts +0 -3
- package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
- package/dist/components/CodeInput/CodeInput.vue.js +2 -2
- package/dist/components/CodeInput/CodeInput.vue2.js +60 -62
- package/dist/components/CodeInput/codeVariableWidget.d.ts +1 -3
- package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -1
- package/dist/components/CodeInput/codeVariableWidget.js +25 -32
- package/dist/components/DataTable/DataTableInput.vue.d.ts +0 -2
- package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableInput.vue.js +2 -2
- package/dist/components/DataTable/DataTableInput.vue2.js +17 -19
- package/dist/layouts/App/create-api-client-app.d.ts +20 -20
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/create-api-client-modal.d.ts +40 -40
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Web/create-api-client-web.d.ts +20 -20
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +20 -20
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/send-request/create-request-operation.test.d.ts +1 -1
- package/dist/libs/send-request/create-request-operation.test.d.ts.map +1 -1
- package/dist/store/active-entities.d.ts +1 -1
- package/dist/store/request-example.d.ts +10 -10
- package/dist/store/security-schemes.d.ts +10 -10
- package/dist/store/security-schemes.d.ts.map +1 -1
- package/dist/store/store.d.ts +20 -20
- package/dist/store/store.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/v2/blocks/operation-code-sample/components/ExamplePicker.test.d.ts +2 -0
- package/dist/v2/blocks/operation-code-sample/components/ExamplePicker.test.d.ts.map +1 -0
- package/dist/v2/blocks/operation-code-sample/components/ExamplePicker.vue.d.ts +14 -0
- package/dist/v2/blocks/operation-code-sample/components/ExamplePicker.vue.d.ts.map +1 -0
- package/dist/v2/blocks/operation-code-sample/components/ExamplePicker.vue.js +55 -0
- package/dist/v2/blocks/operation-code-sample/components/ExamplePicker.vue2.js +4 -0
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.test.d.ts +2 -0
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.test.d.ts.map +1 -0
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts +104 -0
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts.map +1 -0
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js +7 -0
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue2.js +237 -0
- package/dist/v2/blocks/operation-code-sample/helpers/find-client.d.ts +41 -0
- package/dist/v2/blocks/operation-code-sample/helpers/find-client.d.ts.map +1 -0
- package/dist/v2/blocks/operation-code-sample/helpers/find-client.js +20 -0
- package/dist/v2/blocks/operation-code-sample/helpers/find-client.test.d.ts +2 -0
- package/dist/v2/blocks/operation-code-sample/helpers/find-client.test.d.ts.map +1 -0
- package/dist/v2/blocks/operation-code-sample/helpers/generate-client-options.d.ts +20 -0
- package/dist/v2/blocks/operation-code-sample/helpers/generate-client-options.d.ts.map +1 -0
- package/dist/v2/blocks/operation-code-sample/helpers/generate-client-options.js +4 -0
- package/dist/v2/blocks/operation-code-sample/helpers/generate-client-options.test.d.ts +2 -0
- package/dist/v2/blocks/operation-code-sample/helpers/generate-client-options.test.d.ts.map +1 -0
- package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts +17 -0
- package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts.map +1 -0
- package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.js +30 -0
- package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.test.d.ts +2 -0
- package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.test.d.ts.map +1 -0
- package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.d.ts +29 -0
- package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.d.ts.map +1 -0
- package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.js +209 -0
- package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.test.d.ts +2 -0
- package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.test.d.ts.map +1 -0
- package/dist/v2/blocks/operation-code-sample/helpers/get-resolved-ref-deep.d.ts +26 -0
- package/dist/v2/blocks/operation-code-sample/helpers/get-resolved-ref-deep.d.ts.map +1 -0
- package/dist/v2/blocks/operation-code-sample/helpers/get-resolved-ref-deep.js +29 -0
- package/dist/v2/blocks/operation-code-sample/helpers/get-resolved-ref-deep.test.d.ts +2 -0
- package/dist/v2/blocks/operation-code-sample/helpers/get-resolved-ref-deep.test.d.ts.map +1 -0
- package/dist/v2/blocks/operation-code-sample/helpers/get-secrets.d.ts +4 -0
- package/dist/v2/blocks/operation-code-sample/helpers/get-secrets.d.ts.map +1 -0
- package/dist/v2/blocks/operation-code-sample/helpers/get-secrets.js +10 -0
- package/dist/v2/blocks/operation-code-sample/helpers/get-secrets.test.d.ts +2 -0
- package/dist/v2/blocks/operation-code-sample/helpers/get-secrets.test.d.ts.map +1 -0
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/get-example-value.d.ts +7 -0
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/get-example-value.d.ts.map +1 -0
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/get-example-value.js +28 -0
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/get-example-value.test.d.ts +2 -0
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/get-example-value.test.d.ts.map +1 -0
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.d.ts +52 -0
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.d.ts.map +1 -0
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.js +59 -0
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.test.d.ts +2 -0
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.test.d.ts.map +1 -0
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.d.ts +12 -0
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.d.ts.map +1 -0
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.js +57 -0
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.test.d.ts +2 -0
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.test.d.ts.map +1 -0
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.d.ts +25 -0
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.d.ts.map +1 -0
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.js +212 -0
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.test.d.ts +2 -0
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.test.d.ts.map +1 -0
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-security-schemes.d.ts +15 -0
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-security-schemes.d.ts.map +1 -0
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-security-schemes.js +55 -0
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-security-schemes.test.d.ts +2 -0
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-security-schemes.test.d.ts.map +1 -0
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-server-url.d.ts +6 -0
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-server-url.d.ts.map +1 -0
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-server-url.js +18 -0
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-server-url.test.d.ts +2 -0
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-server-url.test.d.ts.map +1 -0
- package/dist/v2/blocks/operation-code-sample/index.d.ts +3 -0
- package/dist/v2/blocks/operation-code-sample/index.d.ts.map +1 -0
- package/dist/v2/blocks/operation-code-sample/index.js +6 -0
- package/dist/v2/blocks/operation-code-sample/types.d.ts +29 -0
- package/dist/v2/blocks/operation-code-sample/types.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.test.d.ts +2 -0
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.test.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts +65 -0
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +7 -0
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +122 -0
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.test.d.ts +2 -0
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.test.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.d.ts +25 -0
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.js +7 -0
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue2.js +90 -0
- package/dist/v2/blocks/scalar-address-bar-block/components/httpStatusCodeColors.d.ts +55 -0
- package/dist/v2/blocks/scalar-address-bar-block/components/httpStatusCodeColors.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-address-bar-block/components/httpStatusCodeColors.js +39 -0
- package/dist/v2/blocks/scalar-address-bar-block/index.d.ts +2 -0
- package/dist/v2/blocks/scalar-address-bar-block/index.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-address-bar-block/index.js +4 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.test.d.ts +2 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.test.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts +49 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js +7 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue2.js +172 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.test.d.ts +2 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.test.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.d.ts +17 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.js +52 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue2.js +4 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.test.d.ts +2 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.test.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +45 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +254 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue2.js +4 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.test.d.ts +2 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.test.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.d.ts +16 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.js +134 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue2.js +4 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.test.d.ts +2 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.test.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts +33 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.js +7 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue2.js +82 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.d.ts +48 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.js +48 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue2.js +4 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.test.d.ts +2 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.test.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts +29 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js +232 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue2.js +4 -0
- package/dist/v2/blocks/scalar-auth-selector-block/event-types.d.ts +29 -0
- package/dist/v2/blocks/scalar-auth-selector-block/event-types.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/auth-options.d.ts +9 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/auth-options.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/auth-options.js +121 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts +34 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js +111 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.test.d.ts +2 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.test.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts +39 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js +52 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.test.d.ts +2 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.test.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/index.d.ts +2 -0
- package/dist/v2/blocks/scalar-auth-selector-block/index.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/index.js +4 -0
- package/dist/v2/components/server/ServerDropdown.test.d.ts +2 -0
- package/dist/v2/components/server/ServerDropdown.test.d.ts.map +1 -0
- package/dist/v2/components/server/ServerDropdown.vue.d.ts +33 -0
- package/dist/v2/components/server/ServerDropdown.vue.d.ts.map +1 -0
- package/dist/v2/components/server/ServerDropdown.vue.js +87 -0
- package/dist/v2/components/server/ServerDropdown.vue2.js +4 -0
- package/dist/v2/components/server/ServerDropdownItem.test.d.ts +2 -0
- package/dist/v2/components/server/ServerDropdownItem.test.d.ts.map +1 -0
- package/dist/v2/components/server/ServerDropdownItem.vue.d.ts +21 -0
- package/dist/v2/components/server/ServerDropdownItem.vue.d.ts.map +1 -0
- package/dist/v2/components/server/ServerDropdownItem.vue.js +7 -0
- package/dist/v2/components/server/ServerDropdownItem.vue2.js +51 -0
- package/dist/v2/components/server/index.d.ts +2 -0
- package/dist/v2/components/server/index.d.ts.map +1 -0
- package/dist/v2/components/server/index.js +4 -0
- package/dist/views/Request/Request.vue.js +1 -1
- package/dist/views/Request/Request.vue2.js +4 -4
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts +2 -2
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts +2 -2
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/dist/vitest.setup.d.ts.map +1 -1
- package/package.json +16 -12
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import { defineComponent as C, computed as T, createElementBlock as v, openBlock as u, Fragment as x, createBlock as y, createCommentVNode as f, createVNode as r, unref as o, withCtx as l, mergeProps as p, createTextVNode as d, createElementVNode as S } from "vue";
|
|
2
|
+
import { useLoadingState as z, ScalarButton as g } from "@scalar/components";
|
|
3
|
+
import { pkceOptions as P } from "@scalar/oas-utils/entities/spec";
|
|
4
|
+
import { useToasts as I } from "@scalar/use-toasts";
|
|
5
|
+
import L from "./OAuthScopesInput.vue.js";
|
|
6
|
+
import { authorizeOauth2 as R } from "../helpers/oauth.js";
|
|
7
|
+
import c from "./RequestAuthDataTableInput.vue.js";
|
|
8
|
+
import n from "../../../../components/DataTable/DataTableRow.vue.js";
|
|
9
|
+
const B = { class: "flex h-8 items-center justify-end gap-2 border-t" }, F = { class: "flex h-8 w-full items-center justify-end border-t" }, M = /* @__PURE__ */ C({
|
|
10
|
+
__name: "OAuth2",
|
|
11
|
+
props: {
|
|
12
|
+
environment: {},
|
|
13
|
+
envVariables: {},
|
|
14
|
+
flows: {},
|
|
15
|
+
type: {},
|
|
16
|
+
selectedScopes: {},
|
|
17
|
+
server: {},
|
|
18
|
+
proxyUrl: {}
|
|
19
|
+
},
|
|
20
|
+
emits: ["update:selectedScopes", "update:securityScheme"],
|
|
21
|
+
setup(i, { emit: w }) {
|
|
22
|
+
const s = w, V = z(), { toast: U } = I(), b = async () => {
|
|
23
|
+
if (V.isLoading)
|
|
24
|
+
return;
|
|
25
|
+
if (!i.server) {
|
|
26
|
+
U("No server selected", "error");
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
V.startLoading();
|
|
30
|
+
const [k, e] = await R(
|
|
31
|
+
i.flows,
|
|
32
|
+
i.type,
|
|
33
|
+
i.selectedScopes,
|
|
34
|
+
i.server,
|
|
35
|
+
i.proxyUrl
|
|
36
|
+
).finally(() => V.stopLoading());
|
|
37
|
+
e ? s("update:securityScheme", { token: e }) : (console.error(k), U(k?.message ?? "Failed to authorize", "error"));
|
|
38
|
+
}, m = {
|
|
39
|
+
environment: i.environment,
|
|
40
|
+
envVariables: i.envVariables
|
|
41
|
+
}, t = T(() => i.flows[i.type]);
|
|
42
|
+
return (k, e) => (u(), v(x, null, [
|
|
43
|
+
t.value["x-scalar-secret-token"] ? (u(), v(x, { key: 0 }, [
|
|
44
|
+
r(o(n), null, {
|
|
45
|
+
default: l(() => [
|
|
46
|
+
r(c, p(m, {
|
|
47
|
+
class: "border-r-transparent",
|
|
48
|
+
modelValue: t.value["x-scalar-secret-token"],
|
|
49
|
+
placeholder: "QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT",
|
|
50
|
+
type: "password",
|
|
51
|
+
"onUpdate:modelValue": e[0] || (e[0] = (a) => s("update:securityScheme", { token: a }))
|
|
52
|
+
}), {
|
|
53
|
+
default: l(() => e[11] || (e[11] = [
|
|
54
|
+
d(" Access Token ")
|
|
55
|
+
])),
|
|
56
|
+
_: 1,
|
|
57
|
+
__: [11]
|
|
58
|
+
}, 16, ["modelValue"])
|
|
59
|
+
]),
|
|
60
|
+
_: 1
|
|
61
|
+
}),
|
|
62
|
+
r(o(n), { class: "min-w-full" }, {
|
|
63
|
+
default: l(() => [
|
|
64
|
+
S("div", B, [
|
|
65
|
+
r(o(g), {
|
|
66
|
+
class: "mr-1 p-0 px-2 py-0.5",
|
|
67
|
+
loading: o(V),
|
|
68
|
+
size: "sm",
|
|
69
|
+
variant: "outlined",
|
|
70
|
+
onClick: e[1] || (e[1] = (a) => s("update:securityScheme", { token: "" }))
|
|
71
|
+
}, {
|
|
72
|
+
default: l(() => e[12] || (e[12] = [
|
|
73
|
+
d(" Clear ")
|
|
74
|
+
])),
|
|
75
|
+
_: 1,
|
|
76
|
+
__: [12]
|
|
77
|
+
}, 8, ["loading"])
|
|
78
|
+
])
|
|
79
|
+
]),
|
|
80
|
+
_: 1
|
|
81
|
+
})
|
|
82
|
+
], 64)) : (u(), v(x, { key: 1 }, [
|
|
83
|
+
r(o(n), null, {
|
|
84
|
+
default: l(() => [
|
|
85
|
+
"authorizationUrl" in t.value ? (u(), y(c, p({ key: 0 }, m, {
|
|
86
|
+
containerClass: "border-r-0",
|
|
87
|
+
modelValue: t.value.authorizationUrl,
|
|
88
|
+
placeholder: "https://galaxy.scalar.com/authorize",
|
|
89
|
+
"onUpdate:modelValue": e[2] || (e[2] = (a) => s("update:securityScheme", { authUrl: a }))
|
|
90
|
+
}), {
|
|
91
|
+
default: l(() => e[13] || (e[13] = [
|
|
92
|
+
d(" Auth URL ")
|
|
93
|
+
])),
|
|
94
|
+
_: 1,
|
|
95
|
+
__: [13]
|
|
96
|
+
}, 16, ["modelValue"])) : f("", !0),
|
|
97
|
+
"tokenUrl" in t.value ? (u(), y(c, p({ key: 1 }, m, {
|
|
98
|
+
modelValue: t.value.tokenUrl,
|
|
99
|
+
placeholder: "https://galaxy.scalar.com/token",
|
|
100
|
+
"onUpdate:modelValue": e[3] || (e[3] = (a) => s("update:securityScheme", { tokenUrl: a }))
|
|
101
|
+
}), {
|
|
102
|
+
default: l(() => e[14] || (e[14] = [
|
|
103
|
+
d(" Token URL ")
|
|
104
|
+
])),
|
|
105
|
+
_: 1,
|
|
106
|
+
__: [14]
|
|
107
|
+
}, 16, ["modelValue"])) : f("", !0)
|
|
108
|
+
]),
|
|
109
|
+
_: 1
|
|
110
|
+
}),
|
|
111
|
+
"x-scalar-secret-redirect-uri" in t.value ? (u(), y(o(n), { key: 0 }, {
|
|
112
|
+
default: l(() => [
|
|
113
|
+
r(c, p(m, {
|
|
114
|
+
modelValue: t.value["x-scalar-secret-redirect-uri"],
|
|
115
|
+
placeholder: "https://galaxy.scalar.com/callback",
|
|
116
|
+
"onUpdate:modelValue": e[4] || (e[4] = (a) => s("update:securityScheme", { redirectUrl: a }))
|
|
117
|
+
}), {
|
|
118
|
+
default: l(() => e[15] || (e[15] = [
|
|
119
|
+
d(" Redirect URL ")
|
|
120
|
+
])),
|
|
121
|
+
_: 1,
|
|
122
|
+
__: [15]
|
|
123
|
+
}, 16, ["modelValue"])
|
|
124
|
+
]),
|
|
125
|
+
_: 1
|
|
126
|
+
})) : f("", !0),
|
|
127
|
+
"x-scalar-secret-username" in t.value && "x-scalar-secret-password" in t.value ? (u(), v(x, { key: 1 }, [
|
|
128
|
+
r(o(n), null, {
|
|
129
|
+
default: l(() => [
|
|
130
|
+
r(c, p(m, {
|
|
131
|
+
class: "text-c-2",
|
|
132
|
+
modelValue: t.value["x-scalar-secret-username"],
|
|
133
|
+
placeholder: "janedoe",
|
|
134
|
+
"onUpdate:modelValue": e[5] || (e[5] = (a) => s("update:securityScheme", { username: a }))
|
|
135
|
+
}), {
|
|
136
|
+
default: l(() => e[16] || (e[16] = [
|
|
137
|
+
d(" Username ")
|
|
138
|
+
])),
|
|
139
|
+
_: 1,
|
|
140
|
+
__: [16]
|
|
141
|
+
}, 16, ["modelValue"])
|
|
142
|
+
]),
|
|
143
|
+
_: 1
|
|
144
|
+
}),
|
|
145
|
+
r(o(n), null, {
|
|
146
|
+
default: l(() => [
|
|
147
|
+
r(c, p(m, {
|
|
148
|
+
modelValue: t.value["x-scalar-secret-password"],
|
|
149
|
+
placeholder: "********",
|
|
150
|
+
type: "password",
|
|
151
|
+
"onUpdate:modelValue": e[6] || (e[6] = (a) => s("update:securityScheme", { password: a }))
|
|
152
|
+
}), {
|
|
153
|
+
default: l(() => e[17] || (e[17] = [
|
|
154
|
+
d(" Password ")
|
|
155
|
+
])),
|
|
156
|
+
_: 1,
|
|
157
|
+
__: [17]
|
|
158
|
+
}, 16, ["modelValue"])
|
|
159
|
+
]),
|
|
160
|
+
_: 1
|
|
161
|
+
})
|
|
162
|
+
], 64)) : f("", !0),
|
|
163
|
+
r(o(n), null, {
|
|
164
|
+
default: l(() => [
|
|
165
|
+
r(c, p(m, {
|
|
166
|
+
modelValue: t.value["x-scalar-secret-client-id"],
|
|
167
|
+
placeholder: "12345",
|
|
168
|
+
"onUpdate:modelValue": e[7] || (e[7] = (a) => s("update:securityScheme", { clientId: a }))
|
|
169
|
+
}), {
|
|
170
|
+
default: l(() => e[18] || (e[18] = [
|
|
171
|
+
d(" Client ID ")
|
|
172
|
+
])),
|
|
173
|
+
_: 1,
|
|
174
|
+
__: [18]
|
|
175
|
+
}, 16, ["modelValue"])
|
|
176
|
+
]),
|
|
177
|
+
_: 1
|
|
178
|
+
}),
|
|
179
|
+
"x-scalar-secret-client-secret" in t.value ? (u(), y(o(n), { key: 2 }, {
|
|
180
|
+
default: l(() => [
|
|
181
|
+
r(c, p(m, {
|
|
182
|
+
modelValue: t.value["x-scalar-secret-client-secret"],
|
|
183
|
+
placeholder: "XYZ123",
|
|
184
|
+
type: "password",
|
|
185
|
+
"onUpdate:modelValue": e[8] || (e[8] = (a) => s("update:securityScheme", { clientSecret: a }))
|
|
186
|
+
}), {
|
|
187
|
+
default: l(() => e[19] || (e[19] = [
|
|
188
|
+
d(" Client Secret ")
|
|
189
|
+
])),
|
|
190
|
+
_: 1,
|
|
191
|
+
__: [19]
|
|
192
|
+
}, 16, ["modelValue"])
|
|
193
|
+
]),
|
|
194
|
+
_: 1
|
|
195
|
+
})) : f("", !0),
|
|
196
|
+
"x-usePkce" in t.value ? (u(), y(o(n), { key: 3 }, {
|
|
197
|
+
default: l(() => [
|
|
198
|
+
r(c, p(m, {
|
|
199
|
+
enum: o(P),
|
|
200
|
+
modelValue: t.value["x-usePkce"],
|
|
201
|
+
readOnly: "",
|
|
202
|
+
"onUpdate:modelValue": e[9] || (e[9] = (a) => s("update:securityScheme", {
|
|
203
|
+
usePkce: a
|
|
204
|
+
}))
|
|
205
|
+
}), {
|
|
206
|
+
default: l(() => e[20] || (e[20] = [
|
|
207
|
+
d(" Use PKCE ")
|
|
208
|
+
])),
|
|
209
|
+
_: 1,
|
|
210
|
+
__: [20]
|
|
211
|
+
}, 16, ["enum", "modelValue"])
|
|
212
|
+
]),
|
|
213
|
+
_: 1
|
|
214
|
+
})) : f("", !0),
|
|
215
|
+
Object.keys(t.value.scopes ?? {}).length ? (u(), y(o(n), { key: 4 }, {
|
|
216
|
+
default: l(() => [
|
|
217
|
+
r(L, {
|
|
218
|
+
flow: t.value,
|
|
219
|
+
selectedScopes: k.selectedScopes,
|
|
220
|
+
"onUpdate:selectedScopes": e[10] || (e[10] = (a) => s("update:selectedScopes", a))
|
|
221
|
+
}, null, 8, ["flow", "selectedScopes"])
|
|
222
|
+
]),
|
|
223
|
+
_: 1
|
|
224
|
+
})) : f("", !0)
|
|
225
|
+
], 64)),
|
|
226
|
+
t.value["x-scalar-secret-token"] ? f("", !0) : (u(), y(o(n), {
|
|
227
|
+
key: 2,
|
|
228
|
+
class: "min-w-full"
|
|
229
|
+
}, {
|
|
230
|
+
default: l(() => [
|
|
231
|
+
S("div", F, [
|
|
232
|
+
r(o(g), {
|
|
233
|
+
class: "mr-0.75 p-0 px-2 py-0.5",
|
|
234
|
+
loading: o(V),
|
|
235
|
+
size: "sm",
|
|
236
|
+
variant: "outlined",
|
|
237
|
+
onClick: b
|
|
238
|
+
}, {
|
|
239
|
+
default: l(() => e[21] || (e[21] = [
|
|
240
|
+
d(" Authorize ")
|
|
241
|
+
])),
|
|
242
|
+
_: 1,
|
|
243
|
+
__: [21]
|
|
244
|
+
}, 8, ["loading"])
|
|
245
|
+
])
|
|
246
|
+
]),
|
|
247
|
+
_: 1
|
|
248
|
+
}))
|
|
249
|
+
], 64));
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
export {
|
|
253
|
+
M as default
|
|
254
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OAuthScopesInput.test.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { OAuthFlow } from '@scalar/workspace-store/schemas/v3.1/strict/oauth-flow';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
flow: OAuthFlow;
|
|
4
|
+
selectedScopes: string[];
|
|
5
|
+
};
|
|
6
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
7
|
+
"update:selectedScopes": (payload: {
|
|
8
|
+
scopes: string[];
|
|
9
|
+
}) => any;
|
|
10
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
11
|
+
"onUpdate:selectedScopes"?: ((payload: {
|
|
12
|
+
scopes: string[];
|
|
13
|
+
}) => any) | undefined;
|
|
14
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
export default _default;
|
|
16
|
+
//# sourceMappingURL=OAuthScopesInput.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OAuthScopesInput.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue"],"names":[],"mappings":"AAuIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wDAAwD,CAAA;AASvF,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,SAAS,CAAA;IACf,cAAc,EAAE,MAAM,EAAE,CAAA;CACzB,CAAC;;;gBAIgD,MAAM,EAAE;;;;gBAAR,MAAM,EAAE;;;AA0U1D,wBAOG"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { defineComponent as A, computed as v, createBlock as d, openBlock as n, unref as s, withCtx as o, createElementVNode as a, createVNode as r, normalizeClass as B, toDisplayString as p, createCommentVNode as u, withModifiers as g, createTextVNode as m, createElementBlock as w, Fragment as O, renderList as j } from "vue";
|
|
2
|
+
import { Disclosure as z, DisclosureButton as N, DisclosurePanel as T } from "@headlessui/vue";
|
|
3
|
+
import { ScalarButton as k, ScalarIcon as $ } from "@scalar/components";
|
|
4
|
+
import _ from "../../../../components/DataTable/DataTableCell.vue.js";
|
|
5
|
+
import E from "../../../../components/DataTable/DataTableRow.vue.js";
|
|
6
|
+
import I from "../../../../components/DataTable/DataTableCheckbox.vue.js";
|
|
7
|
+
const R = { class: "flex h-fit w-full" }, U = { class: "flex-1" }, F = { class: "flex items-center gap-1.75" }, L = {
|
|
8
|
+
class: "grid auto-rows-auto",
|
|
9
|
+
style: { gridTemplateColumns: "1fr auto" }
|
|
10
|
+
}, M = { key: 0 }, P = { class: "font-code text-xs" }, X = /* @__PURE__ */ A({
|
|
11
|
+
__name: "OAuthScopesInput",
|
|
12
|
+
props: {
|
|
13
|
+
flow: {},
|
|
14
|
+
selectedScopes: {}
|
|
15
|
+
},
|
|
16
|
+
emits: ["update:selectedScopes"],
|
|
17
|
+
setup(c, { emit: C }) {
|
|
18
|
+
const i = C, b = v(
|
|
19
|
+
() => Object.entries(c.flow?.scopes ?? {}).map(([e, t]) => ({
|
|
20
|
+
id: e,
|
|
21
|
+
label: e,
|
|
22
|
+
description: t
|
|
23
|
+
}))
|
|
24
|
+
), f = v(
|
|
25
|
+
() => c.selectedScopes.length === Object.keys(c.flow?.scopes ?? {}).length
|
|
26
|
+
);
|
|
27
|
+
function S(e, t) {
|
|
28
|
+
if (t)
|
|
29
|
+
return i("update:selectedScopes", {
|
|
30
|
+
scopes: Array.from(/* @__PURE__ */ new Set([...c.selectedScopes, e]))
|
|
31
|
+
});
|
|
32
|
+
i("update:selectedScopes", {
|
|
33
|
+
scopes: c.selectedScopes.filter((l) => l !== e)
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
const y = () => {
|
|
37
|
+
i("update:selectedScopes", { scopes: Object.keys(c.flow?.scopes ?? {}) });
|
|
38
|
+
}, V = () => {
|
|
39
|
+
i("update:selectedScopes", { scopes: [] });
|
|
40
|
+
};
|
|
41
|
+
return (e, t) => (n(), d(s(_), { class: "h-auto !max-h-[initial] min-h-8 items-center" }, {
|
|
42
|
+
default: o(() => [
|
|
43
|
+
a("div", R, [
|
|
44
|
+
t[2] || (t[2] = a("div", { class: "text-c-1 h-full items-center" }, null, -1)),
|
|
45
|
+
r(s(z), {
|
|
46
|
+
as: "div",
|
|
47
|
+
class: "bl flex w-full flex-col"
|
|
48
|
+
}, {
|
|
49
|
+
default: o(() => [
|
|
50
|
+
r(s(N), {
|
|
51
|
+
class: B([
|
|
52
|
+
"group/scopes-accordion hover:text-c-1 flex h-auto min-h-8 cursor-pointer items-center gap-1.5 pr-2.25 pl-3 text-left",
|
|
53
|
+
(e.selectedScopes.length || 0) > 0 ? "text-c-1" : "text-c-3"
|
|
54
|
+
])
|
|
55
|
+
}, {
|
|
56
|
+
default: o(({ open: l }) => [
|
|
57
|
+
a("div", U, " Scopes Selected " + p(e.selectedScopes.length || 0) + " / " + p(Object.keys(e.flow?.scopes ?? {}).length || 0), 1),
|
|
58
|
+
a("div", F, [
|
|
59
|
+
f.value ? (n(), d(s(k), {
|
|
60
|
+
key: 0,
|
|
61
|
+
class: "pr-0.75 pl-1 transition-none",
|
|
62
|
+
size: "sm",
|
|
63
|
+
variant: "ghost",
|
|
64
|
+
onClick: g(V, ["stop"])
|
|
65
|
+
}, {
|
|
66
|
+
default: o(() => t[0] || (t[0] = [
|
|
67
|
+
m(" Deselect All ")
|
|
68
|
+
])),
|
|
69
|
+
_: 1,
|
|
70
|
+
__: [0]
|
|
71
|
+
})) : u("", !0),
|
|
72
|
+
f.value ? u("", !0) : (n(), d(s(k), {
|
|
73
|
+
key: 1,
|
|
74
|
+
class: "pr-0.75 pl-1 transition-none",
|
|
75
|
+
size: "sm",
|
|
76
|
+
variant: "ghost",
|
|
77
|
+
onClick: g(y, ["stop"])
|
|
78
|
+
}, {
|
|
79
|
+
default: o(() => t[1] || (t[1] = [
|
|
80
|
+
m(" Select All ")
|
|
81
|
+
])),
|
|
82
|
+
_: 1,
|
|
83
|
+
__: [1]
|
|
84
|
+
})),
|
|
85
|
+
r(s($), {
|
|
86
|
+
class: "text-c-3 group-hover/scopes-accordion:text-c-2",
|
|
87
|
+
icon: l ? "ChevronDown" : "ChevronRight",
|
|
88
|
+
size: "md"
|
|
89
|
+
}, null, 8, ["icon"])
|
|
90
|
+
])
|
|
91
|
+
]),
|
|
92
|
+
_: 1
|
|
93
|
+
}, 8, ["class"]),
|
|
94
|
+
r(s(T), { as: "template" }, {
|
|
95
|
+
default: o(() => [
|
|
96
|
+
a("table", L, [
|
|
97
|
+
(n(!0), w(O, null, j(b.value, ({ id: l, label: D, description: h }) => (n(), d(s(E), {
|
|
98
|
+
key: l,
|
|
99
|
+
class: "text-c-2",
|
|
100
|
+
onClick: (x) => S(l, !e.selectedScopes.includes(l))
|
|
101
|
+
}, {
|
|
102
|
+
default: o(() => [
|
|
103
|
+
r(s(_), { class: "hover:text-c-1 box-border !max-h-[initial] w-full cursor-pointer px-3 py-1.5" }, {
|
|
104
|
+
default: o(() => [
|
|
105
|
+
h ? (n(), w("div", M, [
|
|
106
|
+
a("span", P, p(D), 1),
|
|
107
|
+
m(" – " + p(h), 1)
|
|
108
|
+
])) : u("", !0)
|
|
109
|
+
]),
|
|
110
|
+
_: 2
|
|
111
|
+
}, 1024),
|
|
112
|
+
r(s(I), {
|
|
113
|
+
modelValue: e.selectedScopes.includes(l),
|
|
114
|
+
"onUpdate:modelValue": (x) => S(l, x)
|
|
115
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
116
|
+
]),
|
|
117
|
+
_: 2
|
|
118
|
+
}, 1032, ["onClick"]))), 128))
|
|
119
|
+
])
|
|
120
|
+
]),
|
|
121
|
+
_: 1
|
|
122
|
+
})
|
|
123
|
+
]),
|
|
124
|
+
_: 1
|
|
125
|
+
})
|
|
126
|
+
])
|
|
127
|
+
]),
|
|
128
|
+
_: 1
|
|
129
|
+
}));
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
export {
|
|
133
|
+
X as default
|
|
134
|
+
};
|
package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.test.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RequestAuthDataTable.test.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Environment } from '@scalar/oas-utils/entities/environment';
|
|
2
|
+
import type { ComponentsObject, ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
3
|
+
import type { EnvVariable } from '../../../../store/index.js';
|
|
4
|
+
import type { UpdateSecuritySchemeEvent } from '../../../../v2/blocks/scalar-auth-selector-block/event-types';
|
|
5
|
+
import type { SecuritySchemeOption } from '../../../../v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js';
|
|
6
|
+
type __VLS_Props = {
|
|
7
|
+
environment: Environment;
|
|
8
|
+
envVariables: EnvVariable[];
|
|
9
|
+
layout: 'client' | 'reference';
|
|
10
|
+
selectedSchemeOptions: SecuritySchemeOption[];
|
|
11
|
+
securitySchemes: ComponentsObject['securitySchemes'];
|
|
12
|
+
server: ServerObject | undefined;
|
|
13
|
+
};
|
|
14
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {
|
|
15
|
+
activeAuthIndex: import("vue").Ref<number, number>;
|
|
16
|
+
activeScheme: import("vue").ComputedRef<SecuritySchemeOption | undefined>;
|
|
17
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
18
|
+
"update:selectedScopes": (payload: {
|
|
19
|
+
id: string[];
|
|
20
|
+
name: string;
|
|
21
|
+
scopes: string[];
|
|
22
|
+
}) => any;
|
|
23
|
+
"update:securityScheme": (payload: UpdateSecuritySchemeEvent) => any;
|
|
24
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
25
|
+
"onUpdate:selectedScopes"?: ((payload: {
|
|
26
|
+
id: string[];
|
|
27
|
+
name: string;
|
|
28
|
+
scopes: string[];
|
|
29
|
+
}) => any) | undefined;
|
|
30
|
+
"onUpdate:securityScheme"?: ((payload: UpdateSecuritySchemeEvent) => any) | undefined;
|
|
31
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
32
|
+
export default _default;
|
|
33
|
+
//# sourceMappingURL=RequestAuthDataTable.vue.d.ts.map
|
package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RequestAuthDataTable.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue"],"names":[],"mappings":"AA4KA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAIrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAC1C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,oDAAoD,CAAA;AACnG,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gEAAgE,CAAA;AAI1G,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,MAAM,EAAE,QAAQ,GAAG,WAAW,CAAA;IAC9B,qBAAqB,EAAE,oBAAoB,EAAE,CAAA;IAC7C,eAAe,EAAE,gBAAgB,CAAC,iBAAiB,CAAC,CAAA;IACpD,MAAM,EAAE,YAAY,GAAG,SAAS,CAAA;CACjC,CAAC;;;;;;YAaiB,MAAM,EAAE;cAAQ,MAAM;gBAAU,MAAM,EAAE;;;;;YAAxC,MAAM,EAAE;cAAQ,MAAM;gBAAU,MAAM,EAAE;;;;AAsN3D,wBAQG"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { defineComponent as v, ref as f, computed as h, watch as y, createElementBlock as o, openBlock as r, withModifiers as S, createCommentVNode as d, createBlock as x, normalizeClass as n, Fragment as g, renderList as k, createElementVNode as m, toDisplayString as w, unref as V, withCtx as C, createVNode as O } from "vue";
|
|
2
|
+
import z from "./RequestAuthTab.vue.js";
|
|
3
|
+
import N from "../../../../components/DataTable/DataTable.vue.js";
|
|
4
|
+
const j = ["onClick"], B = { class: "relative z-10 font-medium whitespace-nowrap" }, $ = {
|
|
5
|
+
key: 0,
|
|
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
|
+
}, U = /* @__PURE__ */ v({
|
|
8
|
+
__name: "RequestAuthDataTable",
|
|
9
|
+
props: {
|
|
10
|
+
environment: {},
|
|
11
|
+
envVariables: {},
|
|
12
|
+
layout: { default: "client" },
|
|
13
|
+
selectedSchemeOptions: { default: () => [] },
|
|
14
|
+
securitySchemes: {},
|
|
15
|
+
server: {}
|
|
16
|
+
},
|
|
17
|
+
emits: ["update:securityScheme", "update:selectedScopes"],
|
|
18
|
+
setup(c, { expose: p, emit: b }) {
|
|
19
|
+
const u = b, t = f(0), l = h(() => c.selectedSchemeOptions[t.value]);
|
|
20
|
+
return y(
|
|
21
|
+
() => c.selectedSchemeOptions,
|
|
22
|
+
(e) => {
|
|
23
|
+
(!e || !e[t.value]) && (t.value = Math.max(0, t.value - 1));
|
|
24
|
+
}
|
|
25
|
+
), p({
|
|
26
|
+
activeAuthIndex: t,
|
|
27
|
+
activeScheme: l
|
|
28
|
+
}), (e, s) => (r(), o("form", {
|
|
29
|
+
onSubmit: s[2] || (s[2] = S(() => {
|
|
30
|
+
}, ["prevent"]))
|
|
31
|
+
}, [
|
|
32
|
+
e.selectedSchemeOptions.length > 1 ? (r(), o("div", {
|
|
33
|
+
key: 0,
|
|
34
|
+
class: n(["box-content flex flex-wrap gap-x-2.5 overflow-hidden border border-b-0 px-3", e.layout === "client" && "border-x-0"]),
|
|
35
|
+
"data-testid": "auth-tabs"
|
|
36
|
+
}, [
|
|
37
|
+
(r(!0), o(g, null, k(e.selectedSchemeOptions, (a, i) => (r(), o("div", {
|
|
38
|
+
key: Object.keys(a).join(" & "),
|
|
39
|
+
class: n(["relative z-1 -mb-[var(--scalar-border-width)] flex h-8 cursor-pointer", [t.value === i ? "text-c-1" : "text-c-3"]])
|
|
40
|
+
}, [
|
|
41
|
+
m("button", {
|
|
42
|
+
class: "floating-bg relative cursor-pointer border-b-[1px] border-transparent py-1 text-sm font-medium",
|
|
43
|
+
type: "button",
|
|
44
|
+
onClick: (A) => t.value = i
|
|
45
|
+
}, [
|
|
46
|
+
m("span", B, w(a.label), 1)
|
|
47
|
+
], 8, j),
|
|
48
|
+
t.value === i ? (r(), o("div", $)) : d("", !0)
|
|
49
|
+
], 2))), 128))
|
|
50
|
+
], 2)) : d("", !0),
|
|
51
|
+
l.value ? (r(), x(V(N), {
|
|
52
|
+
key: 1,
|
|
53
|
+
class: n(["flex-1", e.layout === "reference" && "bg-b-1 rounded-b-lg border border-t-0"]),
|
|
54
|
+
columns: [""],
|
|
55
|
+
presentational: ""
|
|
56
|
+
}, {
|
|
57
|
+
default: C(() => [
|
|
58
|
+
O(z, {
|
|
59
|
+
envVariables: e.envVariables,
|
|
60
|
+
environment: e.environment,
|
|
61
|
+
layout: e.layout,
|
|
62
|
+
securitySchemes: e.securitySchemes ?? {},
|
|
63
|
+
selectedSecuritySchema: l.value.value,
|
|
64
|
+
server: e.server,
|
|
65
|
+
"onUpdate:securityScheme": s[0] || (s[0] = (a) => u("update:securityScheme", a)),
|
|
66
|
+
"onUpdate:selectedScopes": s[1] || (s[1] = (a) => u("update:selectedScopes", a))
|
|
67
|
+
}, null, 8, ["envVariables", "environment", "layout", "securitySchemes", "selectedSecuritySchema", "server"])
|
|
68
|
+
]),
|
|
69
|
+
_: 1
|
|
70
|
+
}, 8, ["class"])) : (r(), o("div", {
|
|
71
|
+
key: 2,
|
|
72
|
+
class: n([
|
|
73
|
+
"text-c-3 bg-b-1 flex min-h-16 items-center justify-center border-t px-4 text-sm",
|
|
74
|
+
e.layout === "reference" && "min-h-[calc(4rem+0.5px)] rounded-b-lg border"
|
|
75
|
+
])
|
|
76
|
+
}, " No authentication selected ", 2))
|
|
77
|
+
], 32));
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
export {
|
|
81
|
+
U as default
|
|
82
|
+
};
|
package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.d.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { Environment } from '@scalar/oas-utils/entities/environment';
|
|
2
|
+
import { type MaybeRefOrGetter } from 'vue';
|
|
3
|
+
import type { EnvVariable } from '../../../../store/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* Vue class prop type
|
|
6
|
+
*
|
|
7
|
+
* Vue seems to just use any behind the scenes
|
|
8
|
+
*
|
|
9
|
+
* @see https://vuejs.org/guide/essentials/class-and-style.html#class-and-style-bindings
|
|
10
|
+
*/
|
|
11
|
+
export type VueClassProp = MaybeRefOrGetter<string | Record<string, boolean> | (string | Record<string, boolean>)[] | false>;
|
|
12
|
+
type __VLS_Props = {
|
|
13
|
+
containerClass?: VueClassProp;
|
|
14
|
+
environment: Environment;
|
|
15
|
+
envVariables: EnvVariable[];
|
|
16
|
+
readOnly?: boolean;
|
|
17
|
+
required?: boolean;
|
|
18
|
+
type?: string;
|
|
19
|
+
};
|
|
20
|
+
type __VLS_PublicProps = __VLS_Props & {
|
|
21
|
+
modelValue: string;
|
|
22
|
+
};
|
|
23
|
+
declare var __VLS_12: {}, __VLS_14: {};
|
|
24
|
+
type __VLS_Slots = {} & {
|
|
25
|
+
default?: (props: typeof __VLS_12) => any;
|
|
26
|
+
} & {
|
|
27
|
+
icon?: (props: typeof __VLS_14) => any;
|
|
28
|
+
};
|
|
29
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
30
|
+
"update:modelValue": (value: string) => any;
|
|
31
|
+
} & {
|
|
32
|
+
selectVariable: (value: string) => any;
|
|
33
|
+
inputFocus: () => any;
|
|
34
|
+
inputBlur: () => any;
|
|
35
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
36
|
+
onSelectVariable?: ((value: string) => any) | undefined;
|
|
37
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
38
|
+
onInputFocus?: (() => any) | undefined;
|
|
39
|
+
onInputBlur?: (() => any) | undefined;
|
|
40
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
41
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
42
|
+
export default _default;
|
|
43
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
44
|
+
new (): {
|
|
45
|
+
$slots: S;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=RequestAuthDataTableInput.vue.d.ts.map
|
package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RequestAuthDataTableInput.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue"],"names":[],"mappings":"AA0EA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,EAAS,KAAK,gBAAgB,EAAE,MAAM,KAAK,CAAA;AAGlD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG,gBAAgB,CACvC,MAAM,GACN,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACvB,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,GACpC,KAAK,CACR,CAAA;AAED,KAAK,WAAW,GAAG;IACjB,cAAc,CAAC,EAAE,YAAY,CAAA;IAC7B,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAC;AAyBF,KAAK,iBAAiB,GAAG,WAAW,GAAG;IACvC,UAAU,EAAE,MAAM,CAAC;CAClB,CAAC;AA2EF,QAAA,IAAI,QAAQ,IAAW,EAAE,QAAQ,IAAY,CAAE;AAC/C,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,GAC7C;IAAE,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAyB7C,QAAA,MAAM,eAAe;;;;;;;;;;;kFAOnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAQ1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { defineComponent as p, mergeModels as u, useModel as V, useId as f, createBlock as v, openBlock as y, unref as t, mergeProps as b, withCtx as s, renderSlot as i, createElementVNode as C } from "vue";
|
|
2
|
+
import B from "../../../../components/DataTable/DataTableInput.vue.js";
|
|
3
|
+
const q = ["for"], $ = /* @__PURE__ */ p({
|
|
4
|
+
__name: "RequestAuthDataTableInput",
|
|
5
|
+
props: /* @__PURE__ */ u({
|
|
6
|
+
containerClass: {},
|
|
7
|
+
environment: {},
|
|
8
|
+
envVariables: {},
|
|
9
|
+
readOnly: { type: Boolean, default: !1 },
|
|
10
|
+
required: { type: Boolean, default: !1 },
|
|
11
|
+
type: {}
|
|
12
|
+
}, {
|
|
13
|
+
modelValue: { default: "", required: !0 },
|
|
14
|
+
modelModifiers: {}
|
|
15
|
+
}),
|
|
16
|
+
emits: /* @__PURE__ */ u(["inputFocus", "inputBlur", "selectVariable"], ["update:modelValue"]),
|
|
17
|
+
setup(d, { emit: m }) {
|
|
18
|
+
const a = m, o = V(d, "modelValue"), r = f();
|
|
19
|
+
return (e, n) => (y(), v(t(B), b({ id: t(r) }, e.$attrs, {
|
|
20
|
+
modelValue: o.value,
|
|
21
|
+
"onUpdate:modelValue": n[0] || (n[0] = (l) => o.value = l),
|
|
22
|
+
canAddCustomEnumValue: !e.readOnly,
|
|
23
|
+
containerClass: e.containerClass,
|
|
24
|
+
envVariables: e.envVariables,
|
|
25
|
+
environment: e.environment,
|
|
26
|
+
lineWrapping: "",
|
|
27
|
+
readOnly: e.readOnly,
|
|
28
|
+
required: e.required,
|
|
29
|
+
type: e.type,
|
|
30
|
+
onInputBlur: n[1] || (n[1] = (l) => a("inputBlur")),
|
|
31
|
+
onInputFocus: n[2] || (n[2] = (l) => a("inputFocus")),
|
|
32
|
+
onSelectVariable: n[3] || (n[3] = (l) => a("selectVariable", l))
|
|
33
|
+
}), {
|
|
34
|
+
default: s(() => [
|
|
35
|
+
C("label", { for: t(r) }, [
|
|
36
|
+
i(e.$slots, "default")
|
|
37
|
+
], 8, q)
|
|
38
|
+
]),
|
|
39
|
+
icon: s(() => [
|
|
40
|
+
i(e.$slots, "icon")
|
|
41
|
+
]),
|
|
42
|
+
_: 3
|
|
43
|
+
}, 16, ["id", "modelValue", "canAddCustomEnumValue", "containerClass", "envVariables", "environment", "readOnly", "required", "type"]));
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
export {
|
|
47
|
+
$ as default
|
|
48
|
+
};
|