@scalar/api-reference 1.41.1 → 1.43.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 +82 -0
- package/dist/blocks/index.d.ts +0 -1
- package/dist/blocks/index.d.ts.map +1 -1
- package/dist/blocks/index.js +4 -6
- package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.d.ts +4 -1
- package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.d.ts.map +1 -1
- package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.js +1 -1
- package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue2.js +9 -13
- package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.d.ts +4 -1
- package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.d.ts.map +1 -1
- package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.js +1 -1
- package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue2.js +10 -9
- package/dist/blocks/scalar-info-block/components/DownloadLink.vue.d.ts +4 -0
- package/dist/blocks/scalar-info-block/components/DownloadLink.vue.d.ts.map +1 -1
- package/dist/blocks/scalar-info-block/components/DownloadLink.vue.js +1 -1
- package/dist/blocks/scalar-info-block/components/DownloadLink.vue2.js +4 -7
- package/dist/blocks/scalar-info-block/components/InfoBlock.vue.d.ts +7 -9
- package/dist/blocks/scalar-info-block/components/InfoBlock.vue.d.ts.map +1 -1
- package/dist/blocks/scalar-info-block/components/InfoBlock.vue.js +9 -6
- package/dist/blocks/scalar-server-selector-block/components/Selector.vue.d.ts +2 -9
- package/dist/blocks/scalar-server-selector-block/components/Selector.vue.d.ts.map +1 -1
- package/dist/blocks/scalar-server-selector-block/components/Selector.vue.js +13 -25
- package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue.d.ts +8 -4
- package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue.d.ts.map +1 -1
- package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue.js +18 -41
- package/dist/browser/standalone.js +20335 -23246
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiReference.vue.d.ts +2 -254
- package/dist/components/ApiReference.vue.d.ts.map +1 -1
- package/dist/components/ApiReference.vue.js +1 -1
- package/dist/components/ApiReference.vue2.js +71 -83
- package/dist/components/Content/Auth/Auth.vue.d.ts +17 -0
- package/dist/components/Content/Auth/Auth.vue.d.ts.map +1 -0
- package/dist/components/Content/Auth/Auth.vue.js +70 -0
- package/dist/components/Content/Auth/Auth.vue2.js +4 -0
- package/dist/components/Content/Auth/helpers/get-default-security.d.ts +18 -0
- package/dist/components/Content/Auth/helpers/get-default-security.d.ts.map +1 -0
- package/dist/components/Content/Auth/helpers/get-default-security.js +43 -0
- package/dist/components/Content/Auth/index.d.ts +2 -0
- package/dist/components/Content/Auth/index.d.ts.map +1 -0
- package/dist/components/Content/Content.vue.d.ts +9 -19
- package/dist/components/Content/Content.vue.d.ts.map +1 -1
- package/dist/components/Content/Content.vue.js +46 -47
- package/dist/components/Content/Models/Model.vue.d.ts +3 -6
- package/dist/components/Content/Models/Model.vue.d.ts.map +1 -1
- package/dist/components/Content/Models/Model.vue.js +2 -2
- package/dist/components/Content/Models/ModelTag.vue.d.ts +2 -7
- package/dist/components/Content/Models/ModelTag.vue.d.ts.map +1 -1
- package/dist/components/Content/Models/ModelTag.vue.js +3 -3
- package/dist/components/Content/Models/components/ClassicLayout.vue.d.ts +3 -5
- package/dist/components/Content/Models/components/ClassicLayout.vue.d.ts.map +1 -1
- package/dist/components/Content/Models/components/ClassicLayout.vue.js +1 -1
- package/dist/components/Content/Models/components/ClassicLayout.vue2.js +2 -8
- package/dist/components/Content/Models/components/ModernLayout.vue.d.ts +1 -1
- package/dist/components/Content/Models/components/ModernLayout.vue.d.ts.map +1 -1
- package/dist/components/Content/Operations/TraversedEntry.vue.d.ts +20 -25
- package/dist/components/Content/Operations/TraversedEntry.vue.d.ts.map +1 -1
- package/dist/components/Content/Operations/TraversedEntry.vue.js +38 -56
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
- package/dist/components/Content/index.d.ts +0 -1
- package/dist/components/Content/index.d.ts.map +1 -1
- package/dist/components/ShowMoreButton.vue.d.ts +1 -4
- package/dist/components/ShowMoreButton.vue.d.ts.map +1 -1
- package/dist/components/ShowMoreButton.vue.js +1 -1
- package/dist/components/ShowMoreButton.vue2.js +7 -17
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +12 -14
- package/dist/features/Operation/Operation.vue.d.ts +23 -25
- package/dist/features/Operation/Operation.vue.d.ts.map +1 -1
- package/dist/features/Operation/Operation.vue.js +28 -19
- package/dist/features/Operation/components/OperationParameters.vue.d.ts +2 -4
- package/dist/features/Operation/components/OperationParameters.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/OperationParameters.vue.js +17 -6
- package/dist/features/Operation/components/OperationResponses.vue.d.ts +3 -5
- package/dist/features/Operation/components/OperationResponses.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/OperationResponses.vue.js +3 -1
- package/dist/features/Operation/components/ParameterList.vue.d.ts +3 -6
- package/dist/features/Operation/components/ParameterList.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ParameterList.vue.js +6 -8
- package/dist/features/Operation/components/ParameterListItem.vue.d.ts +3 -6
- package/dist/features/Operation/components/ParameterListItem.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ParameterListItem.vue.js +1 -1
- package/dist/features/Operation/components/ParameterListItem.vue2.js +6 -8
- package/dist/features/Operation/components/callbacks/Callback.vue.d.ts +2 -4
- package/dist/features/Operation/components/callbacks/Callback.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/callbacks/Callback.vue.js +1 -1
- package/dist/features/Operation/components/callbacks/Callback.vue2.js +1 -5
- package/dist/features/Operation/components/callbacks/Callbacks.vue.d.ts +2 -8
- package/dist/features/Operation/components/callbacks/Callbacks.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/callbacks/Callbacks.vue.js +35 -24
- package/dist/features/Operation/helpers/filter-selected-security.d.ts +9 -0
- package/dist/features/Operation/helpers/filter-selected-security.d.ts.map +1 -0
- package/dist/features/Operation/helpers/filter-selected-security.js +27 -0
- package/dist/features/Operation/helpers/get-first-server.d.ts +1 -1
- package/dist/features/Operation/helpers/get-first-server.d.ts.map +1 -1
- package/dist/features/Operation/helpers/get-first-server.js +3 -3
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +7 -23
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.js +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue2.js +24 -23
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts +7 -23
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue.js +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue2.js +25 -27
- package/dist/features/example-responses/ExampleResponse.vue.d.ts.map +1 -1
- package/dist/features/example-responses/ExampleResponse.vue.js +1 -1
- package/dist/features/example-responses/ExampleResponse.vue2.js +1 -2
- package/dist/features/example-responses/ExampleResponses.vue.d.ts.map +1 -1
- package/dist/features/example-responses/ExampleResponses.vue.js +1 -1
- package/dist/features/example-responses/ExampleResponses.vue2.js +1 -2
- package/dist/features/test-request-button/TestRequestButton.vue.d.ts +3 -0
- package/dist/features/test-request-button/TestRequestButton.vue.d.ts.map +1 -1
- package/dist/features/test-request-button/TestRequestButton.vue.js +1 -1
- package/dist/features/test-request-button/TestRequestButton.vue2.js +5 -9
- package/dist/helpers/index.d.ts +0 -4
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/index.js +1 -9
- package/dist/helpers/map-config-plugins.d.ts +5 -0
- package/dist/helpers/map-config-plugins.d.ts.map +1 -0
- package/dist/helpers/map-config-plugins.js +29 -0
- package/dist/helpers/map-config-to-workspace-store.d.ts.map +1 -1
- package/dist/helpers/map-config-to-workspace-store.js +5 -0
- package/dist/helpers/map-configuration.d.ts +2 -2
- package/dist/helpers/storage.d.ts +347 -0
- package/dist/helpers/storage.d.ts.map +1 -0
- package/dist/helpers/storage.js +61 -0
- package/dist/hooks/index.d.ts +0 -2
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -5
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -3
- package/dist/plugins/persistance-plugin.d.ts +16 -0
- package/dist/plugins/persistance-plugin.d.ts.map +1 -0
- package/dist/plugins/persistance-plugin.js +54 -0
- package/dist/style.css +220 -542
- package/package.json +17 -17
- package/dist/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts +0 -11
- package/dist/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +0 -1
- package/dist/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js +0 -7
- package/dist/blocks/scalar-auth-selector-block/components/AuthSelector.vue2.js +0 -259
- package/dist/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.d.ts +0 -21
- package/dist/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.d.ts.map +0 -1
- package/dist/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.js +0 -66
- package/dist/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue2.js +0 -4
- package/dist/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +0 -17
- package/dist/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +0 -1
- package/dist/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +0 -273
- package/dist/blocks/scalar-auth-selector-block/components/OAuth2.vue2.js +0 -4
- package/dist/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.d.ts +0 -9
- package/dist/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.d.ts.map +0 -1
- package/dist/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.js +0 -150
- package/dist/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue2.js +0 -4
- package/dist/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts +0 -20
- package/dist/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts.map +0 -1
- package/dist/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.js +0 -7
- package/dist/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue2.js +0 -116
- package/dist/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.d.ts +0 -50
- package/dist/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.d.ts.map +0 -1
- package/dist/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.js +0 -55
- package/dist/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue2.js +0 -4
- package/dist/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts +0 -17
- package/dist/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +0 -1
- package/dist/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js +0 -288
- package/dist/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue2.js +0 -4
- package/dist/blocks/scalar-auth-selector-block/helpers/filter-security-requirements.d.ts +0 -6
- package/dist/blocks/scalar-auth-selector-block/helpers/filter-security-requirements.d.ts.map +0 -1
- package/dist/blocks/scalar-auth-selector-block/helpers/update-scheme.d.ts +0 -8
- package/dist/blocks/scalar-auth-selector-block/helpers/update-scheme.d.ts.map +0 -1
- package/dist/blocks/scalar-auth-selector-block/helpers/update-scheme.js +0 -26
- package/dist/blocks/scalar-auth-selector-block/index.d.ts +0 -2
- package/dist/blocks/scalar-auth-selector-block/index.d.ts.map +0 -1
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue.d.ts +0 -16
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue.d.ts.map +0 -1
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue.js +0 -7
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue2.js +0 -142
- package/dist/components/Content/ClientLibraries/ClientSelector.vue.d.ts +0 -13
- package/dist/components/Content/ClientLibraries/ClientSelector.vue.d.ts.map +0 -1
- package/dist/components/Content/ClientLibraries/ClientSelector.vue.js +0 -7
- package/dist/components/Content/ClientLibraries/ClientSelector.vue2.js +0 -125
- package/dist/components/Content/ClientLibraries/featured-clients.d.ts +0 -11
- package/dist/components/Content/ClientLibraries/featured-clients.d.ts.map +0 -1
- package/dist/components/Content/ClientLibraries/featured-clients.js +0 -24
- package/dist/components/Content/ClientLibraries/index.d.ts +0 -2
- package/dist/components/Content/ClientLibraries/index.d.ts.map +0 -1
- package/dist/features/example-responses/helpers/get-resolved-ref-deep.d.ts +0 -26
- package/dist/features/example-responses/helpers/get-resolved-ref-deep.d.ts.map +0 -1
- package/dist/features/example-responses/helpers/get-resolved-ref-deep.js +0 -39
- package/dist/helpers/convert-security-scheme.d.ts +0 -9
- package/dist/helpers/convert-security-scheme.d.ts.map +0 -1
- package/dist/helpers/convert-security-scheme.js +0 -34
- package/dist/helpers/map-config-to-client-store.d.ts +0 -72
- package/dist/helpers/map-config-to-client-store.d.ts.map +0 -1
- package/dist/helpers/map-config-to-client-store.js +0 -146
- package/dist/hooks/use-legacy-store-events.d.ts +0 -14
- package/dist/hooks/use-legacy-store-events.d.ts.map +0 -1
- package/dist/hooks/use-legacy-store-events.js +0 -91
- package/dist/hooks/use-workspace-store-events.d.ts +0 -4
- package/dist/hooks/use-workspace-store-events.d.ts.map +0 -1
- package/dist/hooks/use-workspace-store-events.js +0 -68
|
@@ -1,273 +0,0 @@
|
|
|
1
|
-
import { defineComponent, useTemplateRef, createElementBlock, openBlock, Fragment, createElementVNode, createBlock, createCommentVNode, createVNode, unref, withCtx, mergeProps, createTextVNode } from "vue";
|
|
2
|
-
import { DataTableRow } from "@scalar/api-client/components/DataTable";
|
|
3
|
-
import { useWorkspace } from "@scalar/api-client/store";
|
|
4
|
-
import { authorizeOauth2 } from "@scalar/api-client/views/Request/libs";
|
|
5
|
-
import { useLoadingState, ScalarButton } from "@scalar/components";
|
|
6
|
-
import { pkceOptions } from "@scalar/oas-utils/entities/spec";
|
|
7
|
-
import { useToasts } from "@scalar/use-toasts";
|
|
8
|
-
import { updateScheme } from "../helpers/update-scheme.js";
|
|
9
|
-
import _sfc_main$2 from "./OAuthScopesInput.vue.js";
|
|
10
|
-
import _sfc_main$1 from "./RequestAuthDataTableInput.vue.js";
|
|
11
|
-
const _hoisted_1 = { class: "flex h-8 items-center justify-end gap-2 border-t" };
|
|
12
|
-
const _hoisted_2 = { class: "flex h-8 w-full items-center justify-end border-t" };
|
|
13
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
14
|
-
__name: "OAuth2",
|
|
15
|
-
props: {
|
|
16
|
-
collection: {},
|
|
17
|
-
environment: {},
|
|
18
|
-
envVariables: {},
|
|
19
|
-
flow: {},
|
|
20
|
-
persistAuth: { type: Boolean, default: false },
|
|
21
|
-
scheme: {},
|
|
22
|
-
server: {},
|
|
23
|
-
workspace: {}
|
|
24
|
-
},
|
|
25
|
-
setup(__props) {
|
|
26
|
-
const loader = useLoadingState();
|
|
27
|
-
const { toast } = useToasts();
|
|
28
|
-
const storeContext = useWorkspace();
|
|
29
|
-
const updateScheme$1 = (path, value) => updateScheme(
|
|
30
|
-
__props.scheme.uid,
|
|
31
|
-
path,
|
|
32
|
-
value,
|
|
33
|
-
storeContext,
|
|
34
|
-
wrapperRef.value,
|
|
35
|
-
__props.persistAuth
|
|
36
|
-
);
|
|
37
|
-
const handleAuthorize = async () => {
|
|
38
|
-
if (loader.isLoading || !__props.collection?.uid) {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
if (!__props.server) {
|
|
42
|
-
toast("No server selected", "error");
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
loader.start();
|
|
46
|
-
const [error, accessToken] = await authorizeOauth2(
|
|
47
|
-
__props.flow,
|
|
48
|
-
__props.server,
|
|
49
|
-
__props.workspace?.proxyUrl
|
|
50
|
-
).finally(async () => {
|
|
51
|
-
await loader.clear();
|
|
52
|
-
});
|
|
53
|
-
if (accessToken) {
|
|
54
|
-
updateScheme$1(`flows.${__props.flow.type}.token`, accessToken);
|
|
55
|
-
} else {
|
|
56
|
-
console.error(error);
|
|
57
|
-
toast(error?.message ?? "Failed to authorize", "error");
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
const dataTableInputProps = {
|
|
61
|
-
environment: __props.environment,
|
|
62
|
-
envVariables: __props.envVariables,
|
|
63
|
-
workspace: __props.workspace
|
|
64
|
-
};
|
|
65
|
-
const wrapperRef = useTemplateRef("wrapperRef");
|
|
66
|
-
return (_ctx, _cache) => {
|
|
67
|
-
return openBlock(), createElementBlock(Fragment, null, [
|
|
68
|
-
createElementVNode("div", {
|
|
69
|
-
ref_key: "wrapperRef",
|
|
70
|
-
ref: wrapperRef
|
|
71
|
-
}, null, 512),
|
|
72
|
-
_ctx.flow.token ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
73
|
-
createVNode(unref(DataTableRow), null, {
|
|
74
|
-
default: withCtx(() => [
|
|
75
|
-
createVNode(_sfc_main$1, mergeProps(dataTableInputProps, {
|
|
76
|
-
class: "border-r-transparent",
|
|
77
|
-
modelValue: _ctx.flow.token,
|
|
78
|
-
placeholder: "QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT",
|
|
79
|
-
type: "password",
|
|
80
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = (v) => updateScheme$1(`flows.${_ctx.flow.type}.token`, v))
|
|
81
|
-
}), {
|
|
82
|
-
default: withCtx(() => [..._cache[10] || (_cache[10] = [
|
|
83
|
-
createTextVNode(" Access Token ", -1)
|
|
84
|
-
])]),
|
|
85
|
-
_: 1
|
|
86
|
-
}, 16, ["modelValue"])
|
|
87
|
-
]),
|
|
88
|
-
_: 1
|
|
89
|
-
}),
|
|
90
|
-
createVNode(unref(DataTableRow), { class: "min-w-full" }, {
|
|
91
|
-
default: withCtx(() => [
|
|
92
|
-
createElementVNode("div", _hoisted_1, [
|
|
93
|
-
createVNode(unref(ScalarButton), {
|
|
94
|
-
class: "mr-1 p-0 px-2 py-0.5",
|
|
95
|
-
loader: unref(loader),
|
|
96
|
-
size: "sm",
|
|
97
|
-
variant: "outlined",
|
|
98
|
-
onClick: _cache[1] || (_cache[1] = ($event) => updateScheme$1(`flows.${_ctx.flow.type}.token`, ""))
|
|
99
|
-
}, {
|
|
100
|
-
default: withCtx(() => [..._cache[11] || (_cache[11] = [
|
|
101
|
-
createTextVNode(" Clear ", -1)
|
|
102
|
-
])]),
|
|
103
|
-
_: 1
|
|
104
|
-
}, 8, ["loader"])
|
|
105
|
-
])
|
|
106
|
-
]),
|
|
107
|
-
_: 1
|
|
108
|
-
})
|
|
109
|
-
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
110
|
-
createVNode(unref(DataTableRow), null, {
|
|
111
|
-
default: withCtx(() => [
|
|
112
|
-
"authorizationUrl" in _ctx.flow ? (openBlock(), createBlock(_sfc_main$1, mergeProps({ key: 0 }, dataTableInputProps, {
|
|
113
|
-
containerClass: "border-r-0",
|
|
114
|
-
modelValue: _ctx.flow.authorizationUrl,
|
|
115
|
-
placeholder: "https://galaxy.scalar.com/authorize",
|
|
116
|
-
"onUpdate:modelValue": _cache[2] || (_cache[2] = (v) => updateScheme$1(`flows.${_ctx.flow.type}.authorizationUrl`, v))
|
|
117
|
-
}), {
|
|
118
|
-
default: withCtx(() => [..._cache[12] || (_cache[12] = [
|
|
119
|
-
createTextVNode(" Auth URL ", -1)
|
|
120
|
-
])]),
|
|
121
|
-
_: 1
|
|
122
|
-
}, 16, ["modelValue"])) : createCommentVNode("", true),
|
|
123
|
-
"tokenUrl" in _ctx.flow ? (openBlock(), createBlock(_sfc_main$1, mergeProps({ key: 1 }, dataTableInputProps, {
|
|
124
|
-
modelValue: _ctx.flow.tokenUrl,
|
|
125
|
-
placeholder: "https://galaxy.scalar.com/token",
|
|
126
|
-
"onUpdate:modelValue": _cache[3] || (_cache[3] = (v) => updateScheme$1(`flows.${_ctx.flow.type}.tokenUrl`, v))
|
|
127
|
-
}), {
|
|
128
|
-
default: withCtx(() => [..._cache[13] || (_cache[13] = [
|
|
129
|
-
createTextVNode(" Token URL ", -1)
|
|
130
|
-
])]),
|
|
131
|
-
_: 1
|
|
132
|
-
}, 16, ["modelValue"])) : createCommentVNode("", true)
|
|
133
|
-
]),
|
|
134
|
-
_: 1
|
|
135
|
-
}),
|
|
136
|
-
"x-scalar-redirect-uri" in _ctx.flow ? (openBlock(), createBlock(unref(DataTableRow), { key: 0 }, {
|
|
137
|
-
default: withCtx(() => [
|
|
138
|
-
createVNode(_sfc_main$1, mergeProps(dataTableInputProps, {
|
|
139
|
-
modelValue: _ctx.flow["x-scalar-redirect-uri"],
|
|
140
|
-
placeholder: "https://galaxy.scalar.com/callback",
|
|
141
|
-
"onUpdate:modelValue": _cache[4] || (_cache[4] = (v) => updateScheme$1(`flows.${_ctx.flow.type}.x-scalar-redirect-uri`, v))
|
|
142
|
-
}), {
|
|
143
|
-
default: withCtx(() => [..._cache[14] || (_cache[14] = [
|
|
144
|
-
createTextVNode(" Redirect URL ", -1)
|
|
145
|
-
])]),
|
|
146
|
-
_: 1
|
|
147
|
-
}, 16, ["modelValue"])
|
|
148
|
-
]),
|
|
149
|
-
_: 1
|
|
150
|
-
})) : createCommentVNode("", true),
|
|
151
|
-
_ctx.flow.type === "password" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
152
|
-
createVNode(unref(DataTableRow), null, {
|
|
153
|
-
default: withCtx(() => [
|
|
154
|
-
createVNode(_sfc_main$1, mergeProps(dataTableInputProps, {
|
|
155
|
-
class: "text-c-2",
|
|
156
|
-
modelValue: _ctx.flow.username,
|
|
157
|
-
placeholder: "janedoe",
|
|
158
|
-
"onUpdate:modelValue": _cache[5] || (_cache[5] = (v) => updateScheme$1(`flows.${_ctx.flow.type}.username`, v))
|
|
159
|
-
}), {
|
|
160
|
-
default: withCtx(() => [..._cache[15] || (_cache[15] = [
|
|
161
|
-
createTextVNode(" Username ", -1)
|
|
162
|
-
])]),
|
|
163
|
-
_: 1
|
|
164
|
-
}, 16, ["modelValue"])
|
|
165
|
-
]),
|
|
166
|
-
_: 1
|
|
167
|
-
}),
|
|
168
|
-
createVNode(unref(DataTableRow), null, {
|
|
169
|
-
default: withCtx(() => [
|
|
170
|
-
createVNode(_sfc_main$1, mergeProps(dataTableInputProps, {
|
|
171
|
-
modelValue: _ctx.flow.password,
|
|
172
|
-
placeholder: "********",
|
|
173
|
-
type: "password",
|
|
174
|
-
"onUpdate:modelValue": _cache[6] || (_cache[6] = (v) => updateScheme$1(`flows.${_ctx.flow.type}.password`, v))
|
|
175
|
-
}), {
|
|
176
|
-
default: withCtx(() => [..._cache[16] || (_cache[16] = [
|
|
177
|
-
createTextVNode(" Password ", -1)
|
|
178
|
-
])]),
|
|
179
|
-
_: 1
|
|
180
|
-
}, 16, ["modelValue"])
|
|
181
|
-
]),
|
|
182
|
-
_: 1
|
|
183
|
-
})
|
|
184
|
-
], 64)) : createCommentVNode("", true),
|
|
185
|
-
createVNode(unref(DataTableRow), null, {
|
|
186
|
-
default: withCtx(() => [
|
|
187
|
-
createVNode(_sfc_main$1, mergeProps(dataTableInputProps, {
|
|
188
|
-
modelValue: _ctx.flow["x-scalar-client-id"],
|
|
189
|
-
placeholder: "12345",
|
|
190
|
-
"onUpdate:modelValue": _cache[7] || (_cache[7] = (v) => updateScheme$1(`flows.${_ctx.flow.type}.x-scalar-client-id`, v))
|
|
191
|
-
}), {
|
|
192
|
-
default: withCtx(() => [..._cache[17] || (_cache[17] = [
|
|
193
|
-
createTextVNode(" Client ID ", -1)
|
|
194
|
-
])]),
|
|
195
|
-
_: 1
|
|
196
|
-
}, 16, ["modelValue"])
|
|
197
|
-
]),
|
|
198
|
-
_: 1
|
|
199
|
-
}),
|
|
200
|
-
"clientSecret" in _ctx.flow ? (openBlock(), createBlock(unref(DataTableRow), { key: 2 }, {
|
|
201
|
-
default: withCtx(() => [
|
|
202
|
-
createVNode(_sfc_main$1, mergeProps(dataTableInputProps, {
|
|
203
|
-
modelValue: _ctx.flow.clientSecret,
|
|
204
|
-
placeholder: "XYZ123",
|
|
205
|
-
type: "password",
|
|
206
|
-
"onUpdate:modelValue": _cache[8] || (_cache[8] = (v) => updateScheme$1(`flows.${_ctx.flow.type}.clientSecret`, v))
|
|
207
|
-
}), {
|
|
208
|
-
default: withCtx(() => [..._cache[18] || (_cache[18] = [
|
|
209
|
-
createTextVNode(" Client Secret ", -1)
|
|
210
|
-
])]),
|
|
211
|
-
_: 1
|
|
212
|
-
}, 16, ["modelValue"])
|
|
213
|
-
]),
|
|
214
|
-
_: 1
|
|
215
|
-
})) : createCommentVNode("", true),
|
|
216
|
-
"x-usePkce" in _ctx.flow ? (openBlock(), createBlock(unref(DataTableRow), { key: 3 }, {
|
|
217
|
-
default: withCtx(() => [
|
|
218
|
-
createVNode(_sfc_main$1, mergeProps(dataTableInputProps, {
|
|
219
|
-
enum: unref(pkceOptions),
|
|
220
|
-
modelValue: _ctx.flow["x-usePkce"],
|
|
221
|
-
readOnly: "",
|
|
222
|
-
"onUpdate:modelValue": _cache[9] || (_cache[9] = (v) => updateScheme$1(
|
|
223
|
-
`flows.${_ctx.flow.type}.x-usePkce`,
|
|
224
|
-
v
|
|
225
|
-
))
|
|
226
|
-
}), {
|
|
227
|
-
default: withCtx(() => [..._cache[19] || (_cache[19] = [
|
|
228
|
-
createTextVNode(" Use PKCE ", -1)
|
|
229
|
-
])]),
|
|
230
|
-
_: 1
|
|
231
|
-
}, 16, ["enum", "modelValue"])
|
|
232
|
-
]),
|
|
233
|
-
_: 1
|
|
234
|
-
})) : createCommentVNode("", true),
|
|
235
|
-
Object.keys(_ctx.flow.scopes ?? {}).length ? (openBlock(), createBlock(unref(DataTableRow), { key: 4 }, {
|
|
236
|
-
default: withCtx(() => [
|
|
237
|
-
createVNode(_sfc_main$2, {
|
|
238
|
-
flow: _ctx.flow,
|
|
239
|
-
updateScheme: updateScheme$1
|
|
240
|
-
}, null, 8, ["flow"])
|
|
241
|
-
]),
|
|
242
|
-
_: 1
|
|
243
|
-
})) : createCommentVNode("", true)
|
|
244
|
-
], 64)),
|
|
245
|
-
!_ctx.flow.token ? (openBlock(), createBlock(unref(DataTableRow), {
|
|
246
|
-
key: 2,
|
|
247
|
-
class: "min-w-full"
|
|
248
|
-
}, {
|
|
249
|
-
default: withCtx(() => [
|
|
250
|
-
createElementVNode("div", _hoisted_2, [
|
|
251
|
-
createVNode(unref(ScalarButton), {
|
|
252
|
-
class: "mr-0.75 p-0 px-2 py-0.5",
|
|
253
|
-
loader: unref(loader),
|
|
254
|
-
size: "sm",
|
|
255
|
-
variant: "outlined",
|
|
256
|
-
onClick: handleAuthorize
|
|
257
|
-
}, {
|
|
258
|
-
default: withCtx(() => [..._cache[20] || (_cache[20] = [
|
|
259
|
-
createTextVNode(" Authorize ", -1)
|
|
260
|
-
])]),
|
|
261
|
-
_: 1
|
|
262
|
-
}, 8, ["loader"])
|
|
263
|
-
])
|
|
264
|
-
]),
|
|
265
|
-
_: 1
|
|
266
|
-
})) : createCommentVNode("", true)
|
|
267
|
-
], 64);
|
|
268
|
-
};
|
|
269
|
-
}
|
|
270
|
-
});
|
|
271
|
-
export {
|
|
272
|
-
_sfc_main as default
|
|
273
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { UpdateScheme } from '@scalar/api-client/store';
|
|
2
|
-
import type { Oauth2Flow } from '@scalar/oas-utils/entities/spec';
|
|
3
|
-
type __VLS_Props = {
|
|
4
|
-
flow: Oauth2Flow;
|
|
5
|
-
updateScheme: UpdateScheme;
|
|
6
|
-
};
|
|
7
|
-
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
8
|
-
export default _default;
|
|
9
|
-
//# sourceMappingURL=OAuthScopesInput.vue.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OAuthScopesInput.vue.d.ts","sourceRoot":"","sources":["../../../../src/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue"],"names":[],"mappings":"AA6IA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAE5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AAGjE,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,UAAU,CAAA;IAChB,YAAY,EAAE,YAAY,CAAA;CAC3B,CAAC;;AA6UF,wBAMG"}
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import { defineComponent, computed, createBlock, openBlock, unref, withCtx, createElementVNode, createVNode, normalizeClass, toDisplayString, createCommentVNode, withModifiers, createTextVNode, createElementBlock, Fragment, renderList } from "vue";
|
|
2
|
-
import { Disclosure, DisclosureButton, DisclosurePanel } from "@headlessui/vue";
|
|
3
|
-
import { DataTableCell, DataTableRow, DataTableCheckbox } from "@scalar/api-client/components/DataTable";
|
|
4
|
-
import { ScalarButton, ScalarIcon } from "@scalar/components";
|
|
5
|
-
const _hoisted_1 = { class: "flex h-fit w-full" };
|
|
6
|
-
const _hoisted_2 = { class: "flex-1" };
|
|
7
|
-
const _hoisted_3 = { class: "flex items-center gap-1.75" };
|
|
8
|
-
const _hoisted_4 = {
|
|
9
|
-
class: "grid auto-rows-auto",
|
|
10
|
-
style: { gridTemplateColumns: "1fr auto" }
|
|
11
|
-
};
|
|
12
|
-
const _hoisted_5 = { key: 0 };
|
|
13
|
-
const _hoisted_6 = { class: "font-code text-xs" };
|
|
14
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
15
|
-
__name: "OAuthScopesInput",
|
|
16
|
-
props: {
|
|
17
|
-
flow: {},
|
|
18
|
-
updateScheme: { type: Function }
|
|
19
|
-
},
|
|
20
|
-
setup(__props) {
|
|
21
|
-
const scopes = computed(
|
|
22
|
-
() => Object.entries(__props.flow?.scopes ?? {}).map(([key, val]) => ({
|
|
23
|
-
id: key,
|
|
24
|
-
label: key,
|
|
25
|
-
description: val
|
|
26
|
-
}))
|
|
27
|
-
);
|
|
28
|
-
const selectedScopes = computed(() => __props.flow?.selectedScopes || []);
|
|
29
|
-
function setScope(id, checked) {
|
|
30
|
-
if (checked) {
|
|
31
|
-
__props.updateScheme(`flows.${__props.flow.type}.selectedScopes`, [
|
|
32
|
-
...selectedScopes.value,
|
|
33
|
-
id
|
|
34
|
-
]);
|
|
35
|
-
} else {
|
|
36
|
-
__props.updateScheme(
|
|
37
|
-
`flows.${__props.flow.type}.selectedScopes`,
|
|
38
|
-
selectedScopes.value.filter((scope) => scope !== id)
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
const allScopesSelected = computed(
|
|
43
|
-
() => __props.flow?.selectedScopes?.length === Object.keys(__props.flow?.scopes ?? {}).length
|
|
44
|
-
);
|
|
45
|
-
const selectAllScopes = () => {
|
|
46
|
-
__props.updateScheme(
|
|
47
|
-
`flows.${__props.flow.type}.selectedScopes`,
|
|
48
|
-
Object.keys(__props.flow?.scopes ?? {})
|
|
49
|
-
);
|
|
50
|
-
};
|
|
51
|
-
const deselectAllScopes = () => {
|
|
52
|
-
__props.updateScheme(`flows.${__props.flow.type}.selectedScopes`, []);
|
|
53
|
-
};
|
|
54
|
-
return (_ctx, _cache) => {
|
|
55
|
-
return openBlock(), createBlock(unref(DataTableCell), { class: "h-auto !max-h-[initial] min-h-8 items-center" }, {
|
|
56
|
-
default: withCtx(() => [
|
|
57
|
-
createElementVNode("div", _hoisted_1, [
|
|
58
|
-
_cache[2] || (_cache[2] = createElementVNode("div", { class: "text-c-1 h-full items-center" }, null, -1)),
|
|
59
|
-
createVNode(unref(Disclosure), {
|
|
60
|
-
as: "div",
|
|
61
|
-
class: "bl flex w-full flex-col"
|
|
62
|
-
}, {
|
|
63
|
-
default: withCtx(() => [
|
|
64
|
-
createVNode(unref(DisclosureButton), {
|
|
65
|
-
class: normalizeClass([
|
|
66
|
-
"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",
|
|
67
|
-
(_ctx.flow?.selectedScopes?.length || 0) > 0 ? "text-c-1" : "text-c-3"
|
|
68
|
-
])
|
|
69
|
-
}, {
|
|
70
|
-
default: withCtx(({ open }) => [
|
|
71
|
-
createElementVNode("div", _hoisted_2, " Scopes Selected " + toDisplayString(_ctx.flow?.selectedScopes?.length || 0) + " / " + toDisplayString(Object.keys(_ctx.flow?.scopes ?? {}).length || 0), 1),
|
|
72
|
-
createElementVNode("div", _hoisted_3, [
|
|
73
|
-
allScopesSelected.value ? (openBlock(), createBlock(unref(ScalarButton), {
|
|
74
|
-
key: 0,
|
|
75
|
-
class: "pr-0.75 pl-1 transition-none",
|
|
76
|
-
size: "sm",
|
|
77
|
-
variant: "ghost",
|
|
78
|
-
onClick: withModifiers(deselectAllScopes, ["stop"])
|
|
79
|
-
}, {
|
|
80
|
-
default: withCtx(() => [..._cache[0] || (_cache[0] = [
|
|
81
|
-
createTextVNode(" Deselect All ", -1)
|
|
82
|
-
])]),
|
|
83
|
-
_: 1
|
|
84
|
-
})) : createCommentVNode("", true),
|
|
85
|
-
!allScopesSelected.value ? (openBlock(), createBlock(unref(ScalarButton), {
|
|
86
|
-
key: 1,
|
|
87
|
-
class: "pr-0.75 pl-1 transition-none",
|
|
88
|
-
size: "sm",
|
|
89
|
-
variant: "ghost",
|
|
90
|
-
onClick: withModifiers(selectAllScopes, ["stop"])
|
|
91
|
-
}, {
|
|
92
|
-
default: withCtx(() => [..._cache[1] || (_cache[1] = [
|
|
93
|
-
createTextVNode(" Select All ", -1)
|
|
94
|
-
])]),
|
|
95
|
-
_: 1
|
|
96
|
-
})) : createCommentVNode("", true),
|
|
97
|
-
createVNode(unref(ScalarIcon), {
|
|
98
|
-
class: "text-c-3 group-hover/scopes-accordion:text-c-2",
|
|
99
|
-
icon: open ? "ChevronDown" : "ChevronRight",
|
|
100
|
-
size: "md"
|
|
101
|
-
}, null, 8, ["icon"])
|
|
102
|
-
])
|
|
103
|
-
]),
|
|
104
|
-
_: 1
|
|
105
|
-
}, 8, ["class"]),
|
|
106
|
-
createVNode(unref(DisclosurePanel), { as: "template" }, {
|
|
107
|
-
default: withCtx(() => [
|
|
108
|
-
createElementVNode("table", _hoisted_4, [
|
|
109
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(scopes.value, ({ id, label, description }) => {
|
|
110
|
-
return openBlock(), createBlock(unref(DataTableRow), {
|
|
111
|
-
key: id,
|
|
112
|
-
class: "text-c-2",
|
|
113
|
-
onClick: ($event) => setScope(id, !selectedScopes.value.includes(id))
|
|
114
|
-
}, {
|
|
115
|
-
default: withCtx(() => [
|
|
116
|
-
createVNode(unref(DataTableCell), { class: "hover:text-c-1 box-border !max-h-[initial] w-full cursor-pointer px-3 py-1.5" }, {
|
|
117
|
-
default: withCtx(() => [
|
|
118
|
-
description ? (openBlock(), createElementBlock("div", _hoisted_5, [
|
|
119
|
-
createElementVNode("span", _hoisted_6, toDisplayString(label), 1),
|
|
120
|
-
createTextVNode(" – " + toDisplayString(description), 1)
|
|
121
|
-
])) : createCommentVNode("", true)
|
|
122
|
-
]),
|
|
123
|
-
_: 2
|
|
124
|
-
}, 1024),
|
|
125
|
-
createVNode(unref(DataTableCheckbox), {
|
|
126
|
-
modelValue: selectedScopes.value.includes(id),
|
|
127
|
-
"onUpdate:modelValue": () => {
|
|
128
|
-
}
|
|
129
|
-
}, null, 8, ["modelValue"])
|
|
130
|
-
]),
|
|
131
|
-
_: 2
|
|
132
|
-
}, 1032, ["onClick"]);
|
|
133
|
-
}), 128))
|
|
134
|
-
])
|
|
135
|
-
]),
|
|
136
|
-
_: 1
|
|
137
|
-
})
|
|
138
|
-
]),
|
|
139
|
-
_: 1
|
|
140
|
-
})
|
|
141
|
-
])
|
|
142
|
-
]),
|
|
143
|
-
_: 1
|
|
144
|
-
});
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
|
-
export {
|
|
149
|
-
_sfc_main as default
|
|
150
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { EnvVariable } from '@scalar/api-client/store';
|
|
2
|
-
import type { Environment } from '@scalar/oas-utils/entities/environment';
|
|
3
|
-
import type { Collection, Server } from '@scalar/oas-utils/entities/spec';
|
|
4
|
-
import type { Workspace } from '@scalar/oas-utils/entities/workspace';
|
|
5
|
-
type __VLS_Props = {
|
|
6
|
-
collection: Collection;
|
|
7
|
-
environment: Environment;
|
|
8
|
-
envVariables: EnvVariable[];
|
|
9
|
-
layout: 'client' | 'reference';
|
|
10
|
-
persistAuth: boolean;
|
|
11
|
-
selectedSchemeOptions: {
|
|
12
|
-
id: string;
|
|
13
|
-
label: string;
|
|
14
|
-
}[];
|
|
15
|
-
server: Server | undefined;
|
|
16
|
-
workspace: Workspace;
|
|
17
|
-
};
|
|
18
|
-
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
-
export default _default;
|
|
20
|
-
//# sourceMappingURL=RequestAuthDataTable.vue.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RequestAuthDataTable.vue.d.ts","sourceRoot":"","sources":["../../../../src/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue"],"names":[],"mappings":"AAgOA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAE3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EACV,UAAU,EAEV,MAAM,EACP,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAMrE,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,MAAM,EAAE,QAAQ,GAAG,WAAW,CAAA;IAC9B,WAAW,EAAE,OAAO,CAAA;IACpB,qBAAqB,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IACtD,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;;AAiPF,wBAMG"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import _sfc_main from "./RequestAuthDataTable.vue2.js";
|
|
2
|
-
/* empty css */
|
|
3
|
-
import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const RequestAuthDataTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-a85af23e"]]);
|
|
5
|
-
export {
|
|
6
|
-
RequestAuthDataTable as default
|
|
7
|
-
};
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { defineComponent, ref, computed, watch, createElementBlock, openBlock, withModifiers, createCommentVNode, withDirectives, createVNode, normalizeClass, Fragment, renderList, createElementVNode, toDisplayString, unref, withCtx, vShow } from "vue";
|
|
2
|
-
import { DataTable } from "@scalar/api-client/components/DataTable";
|
|
3
|
-
import { useModal } from "@scalar/components";
|
|
4
|
-
import _sfc_main$2 from "./DeleteRequestAuthModal.vue.js";
|
|
5
|
-
import _sfc_main$1 from "./RequestAuthTab.vue.js";
|
|
6
|
-
const _hoisted_1 = ["onClick"];
|
|
7
|
-
const _hoisted_2 = { class: "relative z-10 font-medium whitespace-nowrap" };
|
|
8
|
-
const _hoisted_3 = {
|
|
9
|
-
key: 0,
|
|
10
|
-
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"
|
|
11
|
-
};
|
|
12
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
13
|
-
__name: "RequestAuthDataTable",
|
|
14
|
-
props: {
|
|
15
|
-
collection: {},
|
|
16
|
-
environment: {},
|
|
17
|
-
envVariables: {},
|
|
18
|
-
layout: { default: "client" },
|
|
19
|
-
persistAuth: { type: Boolean, default: false },
|
|
20
|
-
selectedSchemeOptions: { default: () => [] },
|
|
21
|
-
server: {},
|
|
22
|
-
workspace: {}
|
|
23
|
-
},
|
|
24
|
-
setup(__props) {
|
|
25
|
-
const deleteSchemeModal = useModal();
|
|
26
|
-
const selectedScheme = ref(
|
|
27
|
-
null
|
|
28
|
-
);
|
|
29
|
-
const activeAuthIndex = ref(0);
|
|
30
|
-
const activeScheme = computed(() => {
|
|
31
|
-
if (!__props.selectedSchemeOptions || __props.selectedSchemeOptions.length === 0) {
|
|
32
|
-
return [];
|
|
33
|
-
}
|
|
34
|
-
const option = __props.selectedSchemeOptions[activeAuthIndex.value];
|
|
35
|
-
if (!option) {
|
|
36
|
-
return [];
|
|
37
|
-
}
|
|
38
|
-
const keys = option.id.split(",").filter(Boolean);
|
|
39
|
-
return keys.length > 1 ? keys : [option.id];
|
|
40
|
-
});
|
|
41
|
-
const hasActiveSchemes = computed(() => {
|
|
42
|
-
return activeScheme.value.length > 0;
|
|
43
|
-
});
|
|
44
|
-
watch(
|
|
45
|
-
() => __props.selectedSchemeOptions,
|
|
46
|
-
(newOptions) => {
|
|
47
|
-
if (!newOptions || !newOptions[activeAuthIndex.value]) {
|
|
48
|
-
activeAuthIndex.value = Math.max(0, activeAuthIndex.value - 1);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
);
|
|
52
|
-
return (_ctx, _cache) => {
|
|
53
|
-
return openBlock(), createElementBlock("form", {
|
|
54
|
-
onSubmit: _cache[1] || (_cache[1] = withModifiers(() => {
|
|
55
|
-
}, ["prevent"]))
|
|
56
|
-
}, [
|
|
57
|
-
_ctx.selectedSchemeOptions.length > 1 ? (openBlock(), createElementBlock("div", {
|
|
58
|
-
key: 0,
|
|
59
|
-
class: normalizeClass(["box-content flex flex-wrap gap-x-2.5 overflow-hidden border border-b-0 px-3", _ctx.layout === "client" && "border-x-0"])
|
|
60
|
-
}, [
|
|
61
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.selectedSchemeOptions, (option, index) => {
|
|
62
|
-
return openBlock(), createElementBlock("div", {
|
|
63
|
-
key: option.id,
|
|
64
|
-
class: normalizeClass(["relative z-1 -mb-[var(--scalar-border-width)] flex h-8 cursor-pointer", [activeAuthIndex.value === index ? "text-c-1" : "text-c-3"]])
|
|
65
|
-
}, [
|
|
66
|
-
createElementVNode("button", {
|
|
67
|
-
class: "floating-bg relative cursor-pointer border-b-[1px] border-transparent py-1 text-sm font-medium",
|
|
68
|
-
type: "button",
|
|
69
|
-
onClick: ($event) => activeAuthIndex.value = index
|
|
70
|
-
}, [
|
|
71
|
-
createElementVNode("span", _hoisted_2, toDisplayString(option.label), 1)
|
|
72
|
-
], 8, _hoisted_1),
|
|
73
|
-
activeAuthIndex.value === index ? (openBlock(), createElementBlock("div", _hoisted_3)) : createCommentVNode("", true)
|
|
74
|
-
], 2);
|
|
75
|
-
}), 128))
|
|
76
|
-
], 2)) : createCommentVNode("", true),
|
|
77
|
-
withDirectives(createVNode(unref(DataTable), {
|
|
78
|
-
class: normalizeClass(["flex-1", _ctx.layout === "reference" && "bg-b-1 rounded-b-lg border border-t-0"]),
|
|
79
|
-
columns: [""],
|
|
80
|
-
presentational: ""
|
|
81
|
-
}, {
|
|
82
|
-
default: withCtx(() => [
|
|
83
|
-
createVNode(_sfc_main$1, {
|
|
84
|
-
collection: _ctx.collection,
|
|
85
|
-
envVariables: _ctx.envVariables,
|
|
86
|
-
environment: _ctx.environment,
|
|
87
|
-
layout: _ctx.layout,
|
|
88
|
-
persistAuth: _ctx.persistAuth,
|
|
89
|
-
securitySchemeUids: activeScheme.value,
|
|
90
|
-
server: _ctx.server,
|
|
91
|
-
workspace: _ctx.workspace
|
|
92
|
-
}, null, 8, ["collection", "envVariables", "environment", "layout", "persistAuth", "securitySchemeUids", "server", "workspace"])
|
|
93
|
-
]),
|
|
94
|
-
_: 1
|
|
95
|
-
}, 8, ["class"]), [
|
|
96
|
-
[vShow, hasActiveSchemes.value]
|
|
97
|
-
]),
|
|
98
|
-
!hasActiveSchemes.value ? (openBlock(), createElementBlock("div", {
|
|
99
|
-
key: 1,
|
|
100
|
-
class: normalizeClass([
|
|
101
|
-
"text-c-3 bg-b-1 flex min-h-16 items-center justify-center border-t px-4 text-sm",
|
|
102
|
-
_ctx.layout === "reference" && "min-h-[calc(4rem+0.5px)] rounded-b-lg border"
|
|
103
|
-
])
|
|
104
|
-
}, " No authentication selected ", 2)) : createCommentVNode("", true),
|
|
105
|
-
createVNode(_sfc_main$2, {
|
|
106
|
-
scheme: selectedScheme.value,
|
|
107
|
-
state: unref(deleteSchemeModal),
|
|
108
|
-
onClose: _cache[0] || (_cache[0] = ($event) => unref(deleteSchemeModal).hide())
|
|
109
|
-
}, null, 8, ["scheme", "state"])
|
|
110
|
-
], 32);
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
export {
|
|
115
|
-
_sfc_main as default
|
|
116
|
-
};
|
package/dist/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.d.ts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import type { EnvVariable } from '@scalar/api-client/store';
|
|
2
|
-
import type { Environment } from '@scalar/oas-utils/entities/environment';
|
|
3
|
-
import type { Workspace } from '@scalar/oas-utils/entities/workspace';
|
|
4
|
-
import { type MaybeRefOrGetter } from 'vue';
|
|
5
|
-
/**
|
|
6
|
-
* Vue class prop type
|
|
7
|
-
*
|
|
8
|
-
* Vue seems to just use any behind the scenes
|
|
9
|
-
*
|
|
10
|
-
* @see https://vuejs.org/guide/essentials/class-and-style.html#class-and-style-bindings
|
|
11
|
-
*/
|
|
12
|
-
export type VueClassProp = MaybeRefOrGetter<string | Record<string, boolean> | (string | Record<string, boolean>)[] | false>;
|
|
13
|
-
type __VLS_Props = {
|
|
14
|
-
type?: string;
|
|
15
|
-
containerClass?: VueClassProp;
|
|
16
|
-
required?: boolean;
|
|
17
|
-
modelValue: string | number;
|
|
18
|
-
readOnly?: boolean;
|
|
19
|
-
environment: Environment;
|
|
20
|
-
envVariables: EnvVariable[];
|
|
21
|
-
workspace: Workspace;
|
|
22
|
-
};
|
|
23
|
-
declare var __VLS_13: {}, __VLS_15: {};
|
|
24
|
-
type __VLS_Slots = {} & {
|
|
25
|
-
default?: (props: typeof __VLS_13) => any;
|
|
26
|
-
} & {
|
|
27
|
-
icon?: (props: typeof __VLS_15) => any;
|
|
28
|
-
};
|
|
29
|
-
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
30
|
-
"update:modelValue": (v: string) => any;
|
|
31
|
-
inputFocus: () => any;
|
|
32
|
-
inputBlur: () => any;
|
|
33
|
-
selectVariable: (value: string) => any;
|
|
34
|
-
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
35
|
-
"onUpdate:modelValue"?: ((v: string) => any) | undefined;
|
|
36
|
-
onInputFocus?: (() => any) | undefined;
|
|
37
|
-
onInputBlur?: (() => any) | undefined;
|
|
38
|
-
onSelectVariable?: ((value: string) => any) | undefined;
|
|
39
|
-
}>, {
|
|
40
|
-
required: boolean;
|
|
41
|
-
readOnly: boolean;
|
|
42
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
43
|
-
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
44
|
-
export default _default;
|
|
45
|
-
type __VLS_WithSlots<T, S> = T & {
|
|
46
|
-
new (): {
|
|
47
|
-
$slots: S;
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
//# sourceMappingURL=RequestAuthDataTableInput.vue.d.ts.map
|
package/dist/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RequestAuthDataTableInput.vue.d.ts","sourceRoot":"","sources":["../../../../src/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue"],"names":[],"mappings":"AA2EA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AACrE,OAAO,EAAS,KAAK,gBAAgB,EAAE,MAAM,KAAK,CAAA;AAElD;;;;;;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;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,cAAc,CAAC,EAAE,YAAY,CAAA;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,EAAE,MAAM,GAAG,MAAM,CAAA;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;AAkGJ,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;;;;;;;;;;;cApIN,OAAO;cAEP,OAAO;6EA0IpB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAa1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|