@scalar/api-reference 1.41.1 → 1.42.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 +41 -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 +15 -15
- 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,55 +0,0 @@
|
|
|
1
|
-
import { defineComponent, useId, createBlock, openBlock, unref, mergeProps, withCtx, renderSlot, createElementVNode } from "vue";
|
|
2
|
-
import { DataTableInput } from "@scalar/api-client/components/DataTable";
|
|
3
|
-
const _hoisted_1 = ["for"];
|
|
4
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
|
-
__name: "RequestAuthDataTableInput",
|
|
6
|
-
props: {
|
|
7
|
-
type: {},
|
|
8
|
-
containerClass: {},
|
|
9
|
-
required: { type: Boolean, default: false },
|
|
10
|
-
modelValue: {},
|
|
11
|
-
readOnly: { type: Boolean, default: false },
|
|
12
|
-
environment: {},
|
|
13
|
-
envVariables: {},
|
|
14
|
-
workspace: {}
|
|
15
|
-
},
|
|
16
|
-
emits: ["update:modelValue", "inputFocus", "inputBlur", "selectVariable"],
|
|
17
|
-
setup(__props, { emit: __emit }) {
|
|
18
|
-
const props = __props;
|
|
19
|
-
const emit = __emit;
|
|
20
|
-
const id = useId();
|
|
21
|
-
return (_ctx, _cache) => {
|
|
22
|
-
return openBlock(), createBlock(unref(DataTableInput), mergeProps({
|
|
23
|
-
id: unref(id),
|
|
24
|
-
canAddCustomEnumValue: !props.readOnly,
|
|
25
|
-
containerClass: props.containerClass
|
|
26
|
-
}, _ctx.$attrs, {
|
|
27
|
-
envVariables: props.envVariables,
|
|
28
|
-
environment: props.environment,
|
|
29
|
-
lineWrapping: "",
|
|
30
|
-
modelValue: props.modelValue,
|
|
31
|
-
readOnly: props.readOnly,
|
|
32
|
-
required: props.required,
|
|
33
|
-
type: props.type,
|
|
34
|
-
workspace: props.workspace,
|
|
35
|
-
onInputBlur: _cache[0] || (_cache[0] = ($event) => emit("inputBlur")),
|
|
36
|
-
onInputFocus: _cache[1] || (_cache[1] = ($event) => emit("inputFocus")),
|
|
37
|
-
onSelectVariable: _cache[2] || (_cache[2] = ($event) => emit("selectVariable", $event)),
|
|
38
|
-
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => emit("update:modelValue", $event))
|
|
39
|
-
}), {
|
|
40
|
-
default: withCtx(() => [
|
|
41
|
-
createElementVNode("label", { for: unref(id) }, [
|
|
42
|
-
renderSlot(_ctx.$slots, "default")
|
|
43
|
-
], 8, _hoisted_1)
|
|
44
|
-
]),
|
|
45
|
-
icon: withCtx(() => [
|
|
46
|
-
renderSlot(_ctx.$slots, "icon")
|
|
47
|
-
]),
|
|
48
|
-
_: 3
|
|
49
|
-
}, 16, ["id", "canAddCustomEnumValue", "containerClass", "envVariables", "environment", "modelValue", "readOnly", "required", "type", "workspace"]);
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
export {
|
|
54
|
-
_sfc_main as default
|
|
55
|
-
};
|
|
@@ -1,17 +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
|
-
securitySchemeUids: string[];
|
|
12
|
-
server: Server | undefined;
|
|
13
|
-
workspace: Workspace;
|
|
14
|
-
};
|
|
15
|
-
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>;
|
|
16
|
-
export default _default;
|
|
17
|
-
//# sourceMappingURL=RequestAuthTab.vue.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RequestAuthTab.vue.d.ts","sourceRoot":"","sources":["../../../../src/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue"],"names":[],"mappings":"AAqUA,OAAO,EAAgB,KAAK,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAMzE,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;AAcrE,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,kBAAkB,EAAE,MAAM,EAAE,CAAA;IAC5B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;;AAqjBF,wBAMG"}
|
|
@@ -1,288 +0,0 @@
|
|
|
1
|
-
import { defineComponent, computed, ref, onMounted, useTemplateRef, createElementBlock, openBlock, Fragment, createElementVNode, renderList, createBlock, createCommentVNode, unref, withCtx, createVNode, toDisplayString, mergeProps, createTextVNode, normalizeClass, capitalize } from "vue";
|
|
2
|
-
import { DataTableRow, DataTableCell } from "@scalar/api-client/components/DataTable";
|
|
3
|
-
import { useWorkspace } from "@scalar/api-client/store";
|
|
4
|
-
import { ScalarMarkdownSummary } from "@scalar/components";
|
|
5
|
-
import { safeLocalStorage, CLIENT_LS_KEYS } from "@scalar/helpers/object/local-storage";
|
|
6
|
-
import { isDefined } from "@scalar/oas-utils/helpers";
|
|
7
|
-
import { emitCustomEvent } from "@scalar/workspace-store/events";
|
|
8
|
-
import { updateScheme } from "../helpers/update-scheme.js";
|
|
9
|
-
import _sfc_main$2 from "./OAuth2.vue.js";
|
|
10
|
-
import _sfc_main$1 from "./RequestAuthDataTableInput.vue.js";
|
|
11
|
-
const _hoisted_1 = { class: "bg-b-1 text-c-2 outline-b-3 top-0 z-1 h-full w-full overflow-hidden px-3 py-1.25 text-ellipsis group-hover/auth:absolute group-hover/auth:h-auto group-hover/auth:border-b *:first:line-clamp-1 *:first:text-ellipsis group-hover/auth:*:first:line-clamp-none" };
|
|
12
|
-
const _hoisted_2 = {
|
|
13
|
-
key: 0,
|
|
14
|
-
class: "flex min-h-8 border-t text-base"
|
|
15
|
-
};
|
|
16
|
-
const _hoisted_3 = { class: "flex h-8 max-w-full gap-2.5 overflow-x-auto px-3" };
|
|
17
|
-
const _hoisted_4 = ["onClick"];
|
|
18
|
-
const _hoisted_5 = { class: "relative z-10" };
|
|
19
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
20
|
-
__name: "RequestAuthTab",
|
|
21
|
-
props: {
|
|
22
|
-
collection: {},
|
|
23
|
-
environment: {},
|
|
24
|
-
envVariables: {},
|
|
25
|
-
layout: {},
|
|
26
|
-
persistAuth: { type: Boolean, default: false },
|
|
27
|
-
securitySchemeUids: {},
|
|
28
|
-
server: {},
|
|
29
|
-
workspace: {}
|
|
30
|
-
},
|
|
31
|
-
setup(__props) {
|
|
32
|
-
const storeContext = useWorkspace();
|
|
33
|
-
const { securitySchemes } = storeContext;
|
|
34
|
-
const security = computed(
|
|
35
|
-
() => __props.securitySchemeUids.map((uid) => ({
|
|
36
|
-
scheme: securitySchemes[uid]
|
|
37
|
-
}))
|
|
38
|
-
);
|
|
39
|
-
const activeFlow = ref("");
|
|
40
|
-
const generateLabel = (scheme) => {
|
|
41
|
-
const description = scheme.description ? `: ${scheme.description}` : "";
|
|
42
|
-
const baseLabel = `${capitalize(scheme.nameKey)}${description || `: ${scheme.type}`}`;
|
|
43
|
-
if (scheme.type === "apiKey") {
|
|
44
|
-
return `${capitalize(scheme.nameKey)}${description || `: ${scheme.in}`}`;
|
|
45
|
-
}
|
|
46
|
-
if (scheme.type === "oauth2") {
|
|
47
|
-
const firstFlow = Object.values(scheme.flows ?? {})[0];
|
|
48
|
-
return `${capitalize(scheme.nameKey)}: ${activeFlow.value ? activeFlow.value : firstFlow?.type ?? ""}${description}`;
|
|
49
|
-
}
|
|
50
|
-
if (scheme.type === "http") {
|
|
51
|
-
return `${capitalize(scheme.nameKey)}: ${scheme.scheme}${description}`;
|
|
52
|
-
}
|
|
53
|
-
return `${baseLabel}${description}`;
|
|
54
|
-
};
|
|
55
|
-
const updateScheme$1 = (uid, path, value) => {
|
|
56
|
-
updateScheme(uid, path, value, storeContext, wrapperRef.value, __props.persistAuth);
|
|
57
|
-
};
|
|
58
|
-
onMounted(() => {
|
|
59
|
-
if (!__props.persistAuth) {
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
const auth = JSON.parse(
|
|
63
|
-
safeLocalStorage().getItem(CLIENT_LS_KEYS.AUTH) ?? "{}"
|
|
64
|
-
);
|
|
65
|
-
const dict = Object.keys(securitySchemes).reduce(
|
|
66
|
-
(acc, key) => {
|
|
67
|
-
const scheme = securitySchemes[key];
|
|
68
|
-
if (scheme) {
|
|
69
|
-
acc[scheme.nameKey] = scheme.uid;
|
|
70
|
-
}
|
|
71
|
-
return acc;
|
|
72
|
-
},
|
|
73
|
-
{}
|
|
74
|
-
);
|
|
75
|
-
Object.entries(auth).forEach(([key, entry]) => {
|
|
76
|
-
const uid = dict[key];
|
|
77
|
-
if (uid) {
|
|
78
|
-
const entries = Object.entries(entry);
|
|
79
|
-
entries.forEach(([path, value]) => {
|
|
80
|
-
emitCustomEvent(wrapperRef.value, "scalar-edit-security-scheme", {
|
|
81
|
-
uid,
|
|
82
|
-
path,
|
|
83
|
-
value
|
|
84
|
-
});
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
try {
|
|
89
|
-
const selectedSchemeUids = JSON.parse(
|
|
90
|
-
safeLocalStorage().getItem(CLIENT_LS_KEYS.SELECTED_SECURITY_SCHEMES) ?? "null"
|
|
91
|
-
);
|
|
92
|
-
const uids = selectedSchemeUids?.map((nameKeys) => {
|
|
93
|
-
if (Array.isArray(nameKeys)) {
|
|
94
|
-
return nameKeys.map((key) => dict[key]).filter(isDefined);
|
|
95
|
-
}
|
|
96
|
-
return dict[nameKeys];
|
|
97
|
-
}).filter(isDefined);
|
|
98
|
-
if (uids) {
|
|
99
|
-
emitCustomEvent(wrapperRef.value, "scalar-select-security-schemes", {
|
|
100
|
-
uids
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
} catch {
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
const dataTableInputProps = {
|
|
107
|
-
environment: __props.environment,
|
|
108
|
-
envVariables: __props.envVariables,
|
|
109
|
-
workspace: __props.workspace
|
|
110
|
-
};
|
|
111
|
-
const wrapperRef = useTemplateRef("wrapperRef");
|
|
112
|
-
return (_ctx, _cache) => {
|
|
113
|
-
return openBlock(), createElementBlock(Fragment, null, [
|
|
114
|
-
createElementVNode("div", {
|
|
115
|
-
ref_key: "wrapperRef",
|
|
116
|
-
ref: wrapperRef
|
|
117
|
-
}, null, 512),
|
|
118
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(security.value, ({ scheme }) => {
|
|
119
|
-
return openBlock(), createElementBlock(Fragment, {
|
|
120
|
-
key: scheme?.uid
|
|
121
|
-
}, [
|
|
122
|
-
security.value.length > 1 && scheme ? (openBlock(), createBlock(unref(DataTableRow), { key: 0 }, {
|
|
123
|
-
default: withCtx(() => [
|
|
124
|
-
createVNode(unref(DataTableCell), {
|
|
125
|
-
"aria-label": generateLabel(scheme),
|
|
126
|
-
class: "text-c-2 group/auth flex items-center leading-[22px] whitespace-nowrap outline-none hover:whitespace-normal"
|
|
127
|
-
}, {
|
|
128
|
-
default: withCtx(() => [
|
|
129
|
-
createElementVNode("p", _hoisted_1, toDisplayString(generateLabel(scheme)), 1)
|
|
130
|
-
]),
|
|
131
|
-
_: 2
|
|
132
|
-
}, 1032, ["aria-label"])
|
|
133
|
-
]),
|
|
134
|
-
_: 2
|
|
135
|
-
}, 1024)) : createCommentVNode("", true),
|
|
136
|
-
scheme?.description && security.value.length <= 1 ? (openBlock(), createBlock(unref(DataTableRow), { key: 1 }, {
|
|
137
|
-
default: withCtx(() => [
|
|
138
|
-
createVNode(unref(DataTableCell), {
|
|
139
|
-
"aria-label": scheme.description,
|
|
140
|
-
class: "max-h-[auto]"
|
|
141
|
-
}, {
|
|
142
|
-
default: withCtx(() => [
|
|
143
|
-
createVNode(unref(ScalarMarkdownSummary), {
|
|
144
|
-
class: "auth-description bg-b-1 text-c-2 min-w-0 flex-1 px-3 py-1.25",
|
|
145
|
-
value: scheme.description
|
|
146
|
-
}, null, 8, ["value"])
|
|
147
|
-
]),
|
|
148
|
-
_: 2
|
|
149
|
-
}, 1032, ["aria-label"])
|
|
150
|
-
]),
|
|
151
|
-
_: 2
|
|
152
|
-
}, 1024)) : createCommentVNode("", true),
|
|
153
|
-
scheme?.type === "http" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
154
|
-
scheme.scheme === "bearer" ? (openBlock(), createBlock(unref(DataTableRow), { key: 0 }, {
|
|
155
|
-
default: withCtx(() => [
|
|
156
|
-
createVNode(_sfc_main$1, mergeProps({ ref_for: true }, dataTableInputProps, {
|
|
157
|
-
containerClass: _ctx.layout === "reference" && "border-t",
|
|
158
|
-
modelValue: scheme.token,
|
|
159
|
-
placeholder: "Token",
|
|
160
|
-
type: "password",
|
|
161
|
-
"onUpdate:modelValue": (v) => updateScheme$1(scheme.uid, "token", v)
|
|
162
|
-
}), {
|
|
163
|
-
default: withCtx(() => [..._cache[0] || (_cache[0] = [
|
|
164
|
-
createTextVNode(" Bearer Token ", -1)
|
|
165
|
-
])]),
|
|
166
|
-
_: 1
|
|
167
|
-
}, 16, ["containerClass", "modelValue", "onUpdate:modelValue"])
|
|
168
|
-
]),
|
|
169
|
-
_: 2
|
|
170
|
-
}, 1024)) : scheme?.scheme === "basic" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
171
|
-
createVNode(unref(DataTableRow), null, {
|
|
172
|
-
default: withCtx(() => [
|
|
173
|
-
createVNode(_sfc_main$1, mergeProps({ ref_for: true }, dataTableInputProps, {
|
|
174
|
-
class: "text-c-2",
|
|
175
|
-
modelValue: scheme.username,
|
|
176
|
-
placeholder: "janedoe",
|
|
177
|
-
required: "",
|
|
178
|
-
"onUpdate:modelValue": (v) => updateScheme$1(scheme.uid, "username", v)
|
|
179
|
-
}), {
|
|
180
|
-
default: withCtx(() => [..._cache[1] || (_cache[1] = [
|
|
181
|
-
createTextVNode(" Username ", -1)
|
|
182
|
-
])]),
|
|
183
|
-
_: 1
|
|
184
|
-
}, 16, ["modelValue", "onUpdate:modelValue"])
|
|
185
|
-
]),
|
|
186
|
-
_: 2
|
|
187
|
-
}, 1024),
|
|
188
|
-
createVNode(unref(DataTableRow), null, {
|
|
189
|
-
default: withCtx(() => [
|
|
190
|
-
createVNode(_sfc_main$1, mergeProps({ ref_for: true }, dataTableInputProps, {
|
|
191
|
-
modelValue: scheme.password,
|
|
192
|
-
placeholder: "********",
|
|
193
|
-
type: "password",
|
|
194
|
-
"onUpdate:modelValue": (v) => updateScheme$1(scheme.uid, "password", v)
|
|
195
|
-
}), {
|
|
196
|
-
default: withCtx(() => [..._cache[2] || (_cache[2] = [
|
|
197
|
-
createTextVNode(" Password ", -1)
|
|
198
|
-
])]),
|
|
199
|
-
_: 1
|
|
200
|
-
}, 16, ["modelValue", "onUpdate:modelValue"])
|
|
201
|
-
]),
|
|
202
|
-
_: 2
|
|
203
|
-
}, 1024)
|
|
204
|
-
], 64)) : createCommentVNode("", true)
|
|
205
|
-
], 64)) : scheme?.type === "apiKey" ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
|
|
206
|
-
createVNode(unref(DataTableRow), null, {
|
|
207
|
-
default: withCtx(() => [
|
|
208
|
-
createVNode(_sfc_main$1, mergeProps({ ref_for: true }, dataTableInputProps, {
|
|
209
|
-
containerClass: _ctx.layout === "reference" && "border-t",
|
|
210
|
-
modelValue: scheme.name,
|
|
211
|
-
placeholder: "api-key",
|
|
212
|
-
"onUpdate:modelValue": (v) => updateScheme$1(scheme.uid, "name", v)
|
|
213
|
-
}), {
|
|
214
|
-
default: withCtx(() => [..._cache[3] || (_cache[3] = [
|
|
215
|
-
createTextVNode(" Name ", -1)
|
|
216
|
-
])]),
|
|
217
|
-
_: 1
|
|
218
|
-
}, 16, ["containerClass", "modelValue", "onUpdate:modelValue"])
|
|
219
|
-
]),
|
|
220
|
-
_: 2
|
|
221
|
-
}, 1024),
|
|
222
|
-
createVNode(unref(DataTableRow), null, {
|
|
223
|
-
default: withCtx(() => [
|
|
224
|
-
createVNode(_sfc_main$1, mergeProps({ ref_for: true }, dataTableInputProps, {
|
|
225
|
-
modelValue: scheme.value,
|
|
226
|
-
placeholder: "QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT",
|
|
227
|
-
type: "password",
|
|
228
|
-
"onUpdate:modelValue": (v) => updateScheme$1(scheme.uid, "value", v)
|
|
229
|
-
}), {
|
|
230
|
-
default: withCtx(() => [..._cache[4] || (_cache[4] = [
|
|
231
|
-
createTextVNode(" Value ", -1)
|
|
232
|
-
])]),
|
|
233
|
-
_: 1
|
|
234
|
-
}, 16, ["modelValue", "onUpdate:modelValue"])
|
|
235
|
-
]),
|
|
236
|
-
_: 2
|
|
237
|
-
}, 1024)
|
|
238
|
-
], 64)) : scheme?.type === "oauth2" ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
|
|
239
|
-
createVNode(unref(DataTableRow), null, {
|
|
240
|
-
default: withCtx(() => [
|
|
241
|
-
Object.keys(scheme.flows).length > 1 ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
242
|
-
createElementVNode("div", _hoisted_3, [
|
|
243
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(scheme?.flows, (_, key, ind) => {
|
|
244
|
-
return openBlock(), createElementBlock("button", {
|
|
245
|
-
key,
|
|
246
|
-
class: normalizeClass(["floating-bg text-c-3 relative cursor-pointer border-b-[1px] border-transparent py-1 text-base font-medium", {
|
|
247
|
-
"!text-c-1 !rounded-none border-b-[1px] !border-current": _ctx.layout !== "reference" && (activeFlow.value === key || ind === 0 && !activeFlow.value),
|
|
248
|
-
"!text-c-1 !rounded-none border-b-[1px] !border-current opacity-100": _ctx.layout === "reference" && (activeFlow.value === key || ind === 0 && !activeFlow.value)
|
|
249
|
-
}]),
|
|
250
|
-
type: "button",
|
|
251
|
-
onClick: ($event) => activeFlow.value = key
|
|
252
|
-
}, [
|
|
253
|
-
createElementVNode("span", _hoisted_5, toDisplayString(key), 1)
|
|
254
|
-
], 10, _hoisted_4);
|
|
255
|
-
}), 128))
|
|
256
|
-
])
|
|
257
|
-
])) : createCommentVNode("", true)
|
|
258
|
-
]),
|
|
259
|
-
_: 2
|
|
260
|
-
}, 1024),
|
|
261
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(scheme?.flows, (flow, key, ind) => {
|
|
262
|
-
return openBlock(), createElementBlock(Fragment, { key }, [
|
|
263
|
-
activeFlow.value === key || ind === 0 && !activeFlow.value ? (openBlock(), createBlock(_sfc_main$2, mergeProps({
|
|
264
|
-
key: 0,
|
|
265
|
-
ref_for: true
|
|
266
|
-
}, dataTableInputProps, {
|
|
267
|
-
collection: _ctx.collection,
|
|
268
|
-
flow,
|
|
269
|
-
persistAuth: _ctx.persistAuth,
|
|
270
|
-
scheme,
|
|
271
|
-
server: _ctx.server,
|
|
272
|
-
workspace: _ctx.workspace
|
|
273
|
-
}), null, 16, ["collection", "flow", "persistAuth", "scheme", "server", "workspace"])) : createCommentVNode("", true)
|
|
274
|
-
], 64);
|
|
275
|
-
}), 128))
|
|
276
|
-
], 64)) : scheme?.type === "openIdConnect" ? (openBlock(), createElementBlock("div", {
|
|
277
|
-
key: 5,
|
|
278
|
-
class: normalizeClass(["text-c-3 bg-b-1 flex min-h-[calc(4rem+1px)] items-center justify-center border-t border-b-0 px-4 text-base", { "rounded-b-lg": _ctx.layout === "reference" }])
|
|
279
|
-
}, " Coming soon ", 2)) : createCommentVNode("", true)
|
|
280
|
-
], 64);
|
|
281
|
-
}), 128))
|
|
282
|
-
], 64);
|
|
283
|
-
};
|
|
284
|
-
}
|
|
285
|
-
});
|
|
286
|
-
export {
|
|
287
|
-
_sfc_main as default
|
|
288
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { Collection, SecurityScheme } from '@scalar/oas-utils/entities/spec';
|
|
2
|
-
/**
|
|
3
|
-
* Takes in selected security and filters it with the requirements
|
|
4
|
-
*/
|
|
5
|
-
export declare const filterSecurityRequirements: (securityRequirements: Collection["security"], selectedSecuritySchemeUids?: Collection["selectedSecuritySchemeUids"], securitySchemes?: Record<string, SecurityScheme>) => SecurityScheme[];
|
|
6
|
-
//# sourceMappingURL=filter-security-requirements.d.ts.map
|
package/dist/blocks/scalar-auth-selector-block/helpers/filter-security-requirements.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"filter-security-requirements.d.ts","sourceRoot":"","sources":["../../../../src/blocks/scalar-auth-selector-block/helpers/filter-security-requirements.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAEjF;;GAEG;AACH,eAAO,MAAM,0BAA0B,GACrC,sBAAsB,UAAU,CAAC,UAAU,CAAC,EAC5C,6BAA4B,UAAU,CAAC,4BAA4B,CAAM,EACzE,kBAAiB,MAAM,CAAC,MAAM,EAAE,cAAc,CAAM,KACnD,cAAc,EA0DhB,CAAA"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { SecurityScheme } from '@scalar/oas-utils/entities/spec';
|
|
2
|
-
import type { Path, PathValue } from '@scalar/object-utils/nested';
|
|
3
|
-
import type { WorkspaceStore } from '@scalar/api-client/store';
|
|
4
|
-
/** Shape of the local storage auth object */
|
|
5
|
-
export type Auth<P extends Path<SecurityScheme>> = Record<string, Record<P, NonNullable<PathValue<SecurityScheme, P>>>>;
|
|
6
|
-
/** Update the security scheme with side effects */
|
|
7
|
-
export declare const updateScheme: <U extends SecurityScheme["uid"], P extends Path<SecurityScheme>>(uid: U, path: P, value: NonNullable<PathValue<SecurityScheme, P>>, { securitySchemes }: WorkspaceStore, el?: HTMLElement | null, persistAuth?: boolean) => void;
|
|
8
|
-
//# sourceMappingURL=update-scheme.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-scheme.d.ts","sourceRoot":"","sources":["../../../../src/blocks/scalar-auth-selector-block/helpers/update-scheme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AACrE,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAA;AAElE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAG9D,6CAA6C;AAC7C,MAAM,MAAM,IAAI,CAAC,CAAC,SAAS,IAAI,CAAC,cAAc,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAEvH,mDAAmD;AACnD,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC,SAAS,IAAI,CAAC,cAAc,CAAC,EAC1F,KAAK,CAAC,EACN,MAAM,CAAC,EACP,OAAO,WAAW,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,EAChD,qBAAqB,cAAc,EACnC,KAAK,WAAW,GAAG,IAAI,EACvB,qBAAmB,SAyBpB,CAAA"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { safeLocalStorage, CLIENT_LS_KEYS } from "@scalar/helpers/object/local-storage";
|
|
2
|
-
import { emitCustomEvent } from "@scalar/workspace-store/events";
|
|
3
|
-
const updateScheme = (uid, path, value, { securitySchemes }, el, persistAuth = false) => {
|
|
4
|
-
emitCustomEvent(el, "scalar-edit-security-scheme", {
|
|
5
|
-
uid,
|
|
6
|
-
path,
|
|
7
|
-
value
|
|
8
|
-
});
|
|
9
|
-
if (!persistAuth) {
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
try {
|
|
13
|
-
const auth = JSON.parse(safeLocalStorage().getItem(CLIENT_LS_KEYS.AUTH) ?? "{}");
|
|
14
|
-
const scheme = securitySchemes[uid];
|
|
15
|
-
if (auth && scheme?.nameKey) {
|
|
16
|
-
const nameScheme = auth[scheme.nameKey] ||= {};
|
|
17
|
-
nameScheme[path] = value;
|
|
18
|
-
safeLocalStorage().setItem(CLIENT_LS_KEYS.AUTH, JSON.stringify(auth));
|
|
19
|
-
}
|
|
20
|
-
} catch (e) {
|
|
21
|
-
console.error(e);
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
export {
|
|
25
|
-
updateScheme
|
|
26
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/blocks/scalar-auth-selector-block/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,+BAA+B,CAAA"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { type ClientOptionGroup } from '@scalar/api-client/v2/blocks/operation-code-sample';
|
|
2
|
-
import type { AvailableClients } from '@scalar/snippetz';
|
|
3
|
-
import type { WorkspaceDocument } from '@scalar/workspace-store/schemas/workspace';
|
|
4
|
-
type __VLS_Props = {
|
|
5
|
-
/** Current document from the store */
|
|
6
|
-
document: WorkspaceDocument;
|
|
7
|
-
/** Computed list of all available Http Client options */
|
|
8
|
-
clientOptions: ClientOptionGroup[];
|
|
9
|
-
/** The currently selected Http Client */
|
|
10
|
-
selectedClient?: AvailableClients[number];
|
|
11
|
-
};
|
|
12
|
-
declare const _default: import("vue").DefineComponent<__VLS_Props, {
|
|
13
|
-
selectedClientOption: import("vue").ComputedRef<import("@scalar/api-client/v2/blocks/operation-code-sample").ClientOption | undefined>;
|
|
14
|
-
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
-
export default _default;
|
|
16
|
-
//# sourceMappingURL=ClientLibraries.vue.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ClientLibraries.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/ClientLibraries/ClientLibraries.vue"],"names":[],"mappings":"AA0MA,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,oDAAoD,CAAA;AAE3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAExD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAA;AAMlF,KAAK,WAAW,GAAG;IACjB,sCAAsC;IACtC,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,yDAAyD;IACzD,aAAa,EAAE,iBAAiB,EAAE,CAAA;IAClC,yCAAyC;IACzC,cAAc,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;CAC1C,CAAC;;;;AA0RF,wBAOG"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import _sfc_main from "./ClientLibraries.vue2.js";
|
|
2
|
-
/* empty css */
|
|
3
|
-
import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const ClientLibraries = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-33fea7c3"]]);
|
|
5
|
-
export {
|
|
6
|
-
ClientLibraries as default
|
|
7
|
-
};
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
import { defineComponent, useId, computed, useTemplateRef, createElementBlock, createCommentVNode, openBlock, createVNode, unref, withCtx, createElementVNode, Fragment, normalizeClass, renderList, createBlock, createTextVNode, toDisplayString } from "vue";
|
|
2
|
-
import { TabGroup, TabList, TabPanels, TabPanel } from "@headlessui/vue";
|
|
3
|
-
import { DEFAULT_CLIENT } from "@scalar/api-client/v2/blocks/operation-code-sample";
|
|
4
|
-
import { ScalarMarkdown, ScalarCodeBlock } from "@scalar/components";
|
|
5
|
-
import { emitCustomEvent } from "@scalar/workspace-store/events";
|
|
6
|
-
import ClientSelector from "./ClientSelector.vue.js";
|
|
7
|
-
import { getFeaturedClients, isFeaturedClient } from "./featured-clients.js";
|
|
8
|
-
const _hoisted_1 = {
|
|
9
|
-
key: 0,
|
|
10
|
-
ref: "wrapper-ref"
|
|
11
|
-
};
|
|
12
|
-
const _hoisted_2 = ["id"];
|
|
13
|
-
const _hoisted_3 = {
|
|
14
|
-
key: 1,
|
|
15
|
-
class: "selected-client card-footer border-t-0 p-0",
|
|
16
|
-
role: "tabpanel",
|
|
17
|
-
tabindex: "1"
|
|
18
|
-
};
|
|
19
|
-
const _hoisted_4 = ["id"];
|
|
20
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
21
|
-
__name: "ClientLibraries",
|
|
22
|
-
props: {
|
|
23
|
-
document: {},
|
|
24
|
-
clientOptions: {},
|
|
25
|
-
selectedClient: { default: () => DEFAULT_CLIENT }
|
|
26
|
-
},
|
|
27
|
-
setup(__props, { expose: __expose }) {
|
|
28
|
-
const headingId = useId();
|
|
29
|
-
const morePanel = useId();
|
|
30
|
-
const selectedClientOption = computed(
|
|
31
|
-
() => __props.clientOptions.flatMap(
|
|
32
|
-
(option) => option.options.find((option2) => option2.id === __props.selectedClient) ?? []
|
|
33
|
-
)[0]
|
|
34
|
-
);
|
|
35
|
-
const featuredClients = computed(() => getFeaturedClients(__props.clientOptions));
|
|
36
|
-
const tabIndex = computed(
|
|
37
|
-
() => featuredClients.value.findIndex(
|
|
38
|
-
(featuredClient) => __props.selectedClient === featuredClient.id
|
|
39
|
-
)
|
|
40
|
-
);
|
|
41
|
-
const wrapper = useTemplateRef("wrapper-ref");
|
|
42
|
-
const onTabSelect = (i) => {
|
|
43
|
-
const client = featuredClients.value[i];
|
|
44
|
-
if (!client || !wrapper.value) {
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
emitCustomEvent(wrapper.value, "scalar-update-selected-client", client.id);
|
|
48
|
-
};
|
|
49
|
-
const installationInstructions = computed(() => {
|
|
50
|
-
const XScalarSdkInstallation = __props.document.info["x-scalar-sdk-installation"];
|
|
51
|
-
if (!Array.isArray(XScalarSdkInstallation) || !XScalarSdkInstallation?.length) {
|
|
52
|
-
return void 0;
|
|
53
|
-
}
|
|
54
|
-
const instruction = XScalarSdkInstallation.find((instruction2) => {
|
|
55
|
-
const targetKey = __props.selectedClient?.split("/")[0]?.toLowerCase();
|
|
56
|
-
return instruction2.lang.toLowerCase() === targetKey;
|
|
57
|
-
});
|
|
58
|
-
if (!instruction) {
|
|
59
|
-
return void 0;
|
|
60
|
-
}
|
|
61
|
-
return instruction;
|
|
62
|
-
});
|
|
63
|
-
__expose({
|
|
64
|
-
selectedClientOption
|
|
65
|
-
});
|
|
66
|
-
return (_ctx, _cache) => {
|
|
67
|
-
return _ctx.clientOptions.length ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
68
|
-
createVNode(unref(TabGroup), {
|
|
69
|
-
manual: "",
|
|
70
|
-
selectedIndex: tabIndex.value,
|
|
71
|
-
onChange: onTabSelect
|
|
72
|
-
}, {
|
|
73
|
-
default: withCtx(() => [
|
|
74
|
-
createElementVNode("div", {
|
|
75
|
-
id: unref(headingId),
|
|
76
|
-
class: "client-libraries-heading"
|
|
77
|
-
}, " Client Libraries ", 8, _hoisted_2),
|
|
78
|
-
createVNode(unref(TabList), {
|
|
79
|
-
"aria-labelledby": unref(headingId),
|
|
80
|
-
class: "client-libraries-list"
|
|
81
|
-
}, {
|
|
82
|
-
default: withCtx(() => [
|
|
83
|
-
createVNode(ClientSelector, {
|
|
84
|
-
clientOptions: _ctx.clientOptions,
|
|
85
|
-
featuredClients: featuredClients.value,
|
|
86
|
-
morePanel: unref(morePanel),
|
|
87
|
-
selectedClient: _ctx.selectedClient
|
|
88
|
-
}, null, 8, ["clientOptions", "featuredClients", "morePanel", "selectedClient"])
|
|
89
|
-
]),
|
|
90
|
-
_: 1
|
|
91
|
-
}, 8, ["aria-labelledby"]),
|
|
92
|
-
createVNode(unref(TabPanels), null, {
|
|
93
|
-
default: withCtx(() => [
|
|
94
|
-
installationInstructions.value?.source || installationInstructions.value?.description ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
95
|
-
installationInstructions.value.description ? (openBlock(), createElementBlock("div", {
|
|
96
|
-
key: 0,
|
|
97
|
-
class: normalizeClass(["selected-client card-footer -outline-offset-2", installationInstructions.value.source && "rounded-b-none"]),
|
|
98
|
-
role: "tabpanel",
|
|
99
|
-
tabindex: "0"
|
|
100
|
-
}, [
|
|
101
|
-
createVNode(unref(ScalarMarkdown), {
|
|
102
|
-
value: installationInstructions.value.description
|
|
103
|
-
}, null, 8, ["value"])
|
|
104
|
-
], 2)) : createCommentVNode("", true),
|
|
105
|
-
installationInstructions.value.source ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
106
|
-
createVNode(unref(ScalarCodeBlock), {
|
|
107
|
-
class: "rounded-t-none rounded-b-lg px-3 py-2 -outline-offset-1 has-focus:outline",
|
|
108
|
-
content: installationInstructions.value.source,
|
|
109
|
-
copy: true,
|
|
110
|
-
lang: "shell"
|
|
111
|
-
}, null, 8, ["content"])
|
|
112
|
-
])) : createCommentVNode("", true)
|
|
113
|
-
], 64)) : unref(isFeaturedClient)(_ctx.selectedClient) ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(featuredClients.value, (client) => {
|
|
114
|
-
return openBlock(), createBlock(unref(TabPanel), {
|
|
115
|
-
key: client.id,
|
|
116
|
-
class: "selected-client card-footer -outline-offset-2"
|
|
117
|
-
}, {
|
|
118
|
-
default: withCtx(() => [
|
|
119
|
-
createTextVNode(toDisplayString(client.title), 1)
|
|
120
|
-
]),
|
|
121
|
-
_: 2
|
|
122
|
-
}, 1024);
|
|
123
|
-
}), 128)) : (openBlock(), createElementBlock("div", {
|
|
124
|
-
key: 2,
|
|
125
|
-
id: unref(morePanel),
|
|
126
|
-
class: "selected-client card-footer -outline-offset-2",
|
|
127
|
-
role: "tabpanel",
|
|
128
|
-
tabindex: "0"
|
|
129
|
-
}, toDisplayString(selectedClientOption.value?.title), 9, _hoisted_4))
|
|
130
|
-
]),
|
|
131
|
-
_: 1
|
|
132
|
-
})
|
|
133
|
-
]),
|
|
134
|
-
_: 1
|
|
135
|
-
}, 8, ["selectedIndex"])
|
|
136
|
-
], 512)) : createCommentVNode("", true);
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
export {
|
|
141
|
-
_sfc_main as default
|
|
142
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { type ClientOption, type ClientOptionGroup } from '@scalar/api-client/v2/blocks/operation-code-sample';
|
|
2
|
-
import type { AvailableClients } from '@scalar/types/snippetz';
|
|
3
|
-
type __VLS_Props = {
|
|
4
|
-
/** Client options */
|
|
5
|
-
clientOptions: ClientOptionGroup[];
|
|
6
|
-
/** The currently selected Http Client */
|
|
7
|
-
selectedClient?: AvailableClients[number];
|
|
8
|
-
/** List of featured clients */
|
|
9
|
-
featuredClients: ClientOption[];
|
|
10
|
-
};
|
|
11
|
-
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>;
|
|
12
|
-
export default _default;
|
|
13
|
-
//# sourceMappingURL=ClientSelector.vue.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ClientSelector.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/ClientLibraries/ClientSelector.vue"],"names":[],"mappings":"AAsPA,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACvB,MAAM,oDAAoD,CAAA;AAG3D,OAAO,KAAK,EAAE,gBAAgB,EAAY,MAAM,wBAAwB,CAAA;AAMxE,KAAK,WAAW,GAAG;IACjB,qBAAqB;IACrB,aAAa,EAAE,iBAAiB,EAAE,CAAA;IAClC,yCAAyC;IACzC,cAAc,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;IACzC,+BAA+B;IAC/B,eAAe,EAAE,YAAY,EAAE,CAAA;CAChC,CAAC;;AAgPF,wBAMG"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import _sfc_main from "./ClientSelector.vue2.js";
|
|
2
|
-
/* empty css */
|
|
3
|
-
import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const ClientSelector = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-f0cbe3aa"]]);
|
|
5
|
-
export {
|
|
6
|
-
ClientSelector as default
|
|
7
|
-
};
|