@scalar/api-reference 1.31.18 → 1.32.1
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 +43 -0
- package/dist/blocks/helpers/getPointer.d.ts +1 -1
- package/dist/blocks/helpers/getPointer.d.ts.map +1 -1
- package/dist/blocks/hooks/useBlockProps.js +10 -10
- package/dist/browser/standalone.js +14230 -14155
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
- package/dist/components/ApiReferenceLayout.vue.js +2 -2
- package/dist/components/ApiReferenceLayout.vue2.js +122 -124
- package/dist/components/Content/Content.vue.d.ts.map +1 -1
- package/dist/components/Content/Content.vue.js +2 -2
- package/dist/components/Content/Content.vue2.js +93 -92
- package/dist/components/Content/Introduction/Introduction.vue.js +1 -1
- package/dist/components/Content/Introduction/Introduction.vue2.js +3 -3
- package/dist/components/Content/Lazy/Loading.vue.d.ts +3 -0
- package/dist/components/Content/Lazy/Loading.vue.d.ts.map +1 -1
- package/dist/components/Content/Lazy/Loading.vue.js +94 -93
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.js +2 -2
- package/dist/components/Content/Schema/SchemaProperty.vue2.js +1 -1
- package/dist/components/Content/Tag/Tag.vue.js +1 -1
- package/dist/components/Content/Tag/TagList.vue.d.ts +7 -1
- package/dist/components/Content/Tag/TagList.vue.d.ts.map +1 -1
- package/dist/components/Content/Tag/TagList.vue.js +41 -38
- package/dist/features/Operation/Operation.vue.d.ts +8 -3
- package/dist/features/Operation/Operation.vue.d.ts.map +1 -1
- package/dist/features/Operation/Operation.vue.js +67 -51
- package/dist/features/Operation/components/OperationParameters.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/OperationResponses.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/callbacks/Callback.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/callbacks/Callback.vue.js +2 -2
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +9 -2
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.js +2 -2
- package/dist/features/Operation/layouts/ClassicLayout.vue2.js +92 -84
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts +10 -3
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue.js +2 -2
- package/dist/features/Operation/layouts/ModernLayout.vue2.js +132 -117
- package/dist/features/Search/SearchButton.vue.d.ts +1 -3
- package/dist/features/Search/SearchButton.vue.d.ts.map +1 -1
- package/dist/features/Search/SearchButton.vue.js +19 -19
- package/dist/features/Search/SearchModal.vue.js +2 -2
- package/dist/features/Search/SearchModal.vue2.js +4 -4
- package/dist/features/Search/useSearchIndex.d.ts.map +1 -1
- package/dist/features/Search/useSearchIndex.js +15 -15
- package/dist/features/api-client-modal/ApiClientModal.vue.d.ts.map +1 -0
- package/dist/features/api-client-modal/index.d.ts.map +1 -0
- package/dist/features/{ApiClientModal → api-client-modal}/useApiClient.d.ts +118 -118
- package/dist/features/api-client-modal/useApiClient.d.ts.map +1 -0
- package/dist/features/base-url/BaseUrl.vue.d.ts.map +1 -0
- package/dist/features/base-url/index.d.ts.map +1 -0
- package/dist/features/document-source/hooks/useDocumentFetcher.d.ts.map +1 -0
- package/dist/features/document-source/hooks/useDocumentSource.d.ts.map +1 -0
- package/dist/features/document-source/index.d.ts.map +1 -0
- package/dist/features/download-link/DownloadLink.vue.d.ts.map +1 -0
- package/dist/features/download-link/DownloadLink.vue.js +7 -0
- package/dist/features/download-link/index.d.ts.map +1 -0
- package/dist/features/download-link/openapi-version-symbol.d.ts.map +1 -0
- package/dist/features/example-request/ExamplePicker.vue.d.ts +13 -0
- package/dist/features/example-request/ExamplePicker.vue.d.ts.map +1 -0
- package/dist/features/example-request/ExamplePicker.vue.js +7 -0
- package/dist/features/example-request/ExamplePicker.vue2.js +56 -0
- package/dist/features/example-request/ExampleRequest.vue.d.ts.map +1 -0
- package/dist/features/{ExampleRequest → example-request}/ExampleRequest.vue.js +2 -2
- package/dist/features/{ExampleRequest → example-request}/ExampleRequest.vue2.js +93 -93
- package/dist/features/example-request/TextSelect.vue.d.ts.map +1 -0
- package/dist/features/example-request/index.d.ts.map +1 -0
- package/dist/features/example-responses/ExampleResponse.vue.d.ts.map +1 -0
- package/dist/features/example-responses/ExampleResponse.vue.js +7 -0
- package/dist/features/example-responses/ExampleResponses.vue.d.ts.map +1 -0
- package/dist/features/example-responses/ExampleResponses.vue.js +7 -0
- package/dist/features/{ExampleResponses → example-responses}/ExampleResponses.vue2.js +1 -1
- package/dist/features/example-responses/index.d.ts.map +1 -0
- package/dist/{components/DocumentSelector → features/multiple-documents}/DocumentSelector.vue.d.ts.map +1 -1
- package/dist/features/multiple-documents/index.d.ts +3 -0
- package/dist/features/multiple-documents/index.d.ts.map +1 -0
- package/dist/{hooks → features/multiple-documents}/useMultipleDocuments.d.ts +1 -1
- package/dist/features/multiple-documents/useMultipleDocuments.d.ts.map +1 -0
- package/dist/features/sidebar/components/Sidebar.vue.d.ts.map +1 -0
- package/dist/features/sidebar/components/Sidebar.vue.js +7 -0
- package/dist/{components/Sidebar → features/sidebar/components}/Sidebar.vue2.js +2 -2
- package/dist/{components/Sidebar → features/sidebar/components}/SidebarElement.vue.d.ts +1 -1
- package/dist/features/sidebar/components/SidebarElement.vue.d.ts.map +1 -0
- package/dist/features/sidebar/components/SidebarElement.vue.js +7 -0
- package/dist/{components/Sidebar → features/sidebar/components}/SidebarElement.vue2.js +2 -2
- package/dist/features/sidebar/components/SidebarGroup.vue.d.ts.map +1 -0
- package/dist/features/sidebar/components/SidebarGroup.vue.js +7 -0
- package/dist/features/sidebar/components/SidebarHttpBadge.vue.d.ts.map +1 -0
- package/dist/features/sidebar/components/SidebarHttpBadge.vue.js +7 -0
- package/dist/{components/Sidebar → features/sidebar/components}/SidebarHttpBadge.vue2.js +1 -1
- package/dist/features/sidebar/helpers/create-sidebar.d.ts.map +1 -1
- package/dist/features/sidebar/helpers/create-sidebar.js +8 -8
- package/dist/features/sidebar/index.d.ts +1 -0
- package/dist/features/sidebar/index.d.ts.map +1 -1
- package/dist/features/specification-extension/SpecificationExtension.vue.d.ts.map +1 -0
- package/dist/features/specification-extension/index.d.ts.map +1 -0
- package/dist/features/test-request-button/TestRequestButton.vue.d.ts.map +1 -0
- package/dist/features/{TestRequestButton → test-request-button}/TestRequestButton.vue.js +2 -2
- package/dist/features/{TestRequestButton → test-request-button}/TestRequestButton.vue2.js +1 -1
- package/dist/features/test-request-button/index.d.ts.map +1 -0
- package/dist/features/traverse-schema/helpers/traverse-paths.d.ts.map +1 -1
- package/dist/features/traverse-schema/helpers/traverse-paths.js +21 -20
- package/dist/features/traverse-schema/helpers/traverse-schemas.d.ts.map +1 -1
- package/dist/features/traverse-schema/helpers/traverse-schemas.js +14 -14
- package/dist/hooks/useOperationDiscriminator.d.ts +2 -2
- package/dist/hooks/useOperationDiscriminator.d.ts.map +1 -1
- package/dist/hooks/useOperationDiscriminator.js +28 -28
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -5
- package/dist/libs/openapi.d.ts +5 -6
- package/dist/libs/openapi.d.ts.map +1 -1
- package/dist/libs/openapi.js +41 -43
- package/dist/style.css +1 -1
- package/dist/v2/ApiReferenceWorkspace.vue.d.ts.map +1 -1
- package/dist/v2/ApiReferenceWorkspace.vue.js +110 -65
- package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue.d.ts +141 -0
- package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-request-example-block/helpers/find-client.d.ts +38 -0
- package/dist/v2/blocks/scalar-request-example-block/helpers/find-client.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-request-example-block/helpers/generate-client-options.d.ts +21 -0
- package/dist/v2/blocks/scalar-request-example-block/helpers/generate-client-options.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-request-example-block/helpers/generate-code-snippet.d.ts +20 -0
- package/dist/v2/blocks/scalar-request-example-block/helpers/generate-code-snippet.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-request-example-block/helpers/get-secrets.d.ts +4 -0
- package/dist/v2/blocks/scalar-request-example-block/helpers/get-secrets.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-request-example-block/index.d.ts +2 -0
- package/dist/v2/blocks/scalar-request-example-block/index.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-request-example-block/types.d.ts +21 -0
- package/dist/v2/blocks/scalar-request-example-block/types.d.ts.map +1 -0
- package/package.json +11 -11
- package/dist/components/DocumentSelector/index.d.ts +0 -2
- package/dist/components/DocumentSelector/index.d.ts.map +0 -1
- package/dist/components/Sidebar/Sidebar.vue.d.ts.map +0 -1
- package/dist/components/Sidebar/Sidebar.vue.js +0 -7
- package/dist/components/Sidebar/SidebarElement.vue.d.ts.map +0 -1
- package/dist/components/Sidebar/SidebarElement.vue.js +0 -7
- package/dist/components/Sidebar/SidebarGroup.vue.d.ts.map +0 -1
- package/dist/components/Sidebar/SidebarGroup.vue.js +0 -7
- package/dist/components/Sidebar/SidebarHttpBadge.vue.d.ts.map +0 -1
- package/dist/components/Sidebar/SidebarHttpBadge.vue.js +0 -7
- package/dist/components/Sidebar/index.d.ts +0 -2
- package/dist/components/Sidebar/index.d.ts.map +0 -1
- package/dist/components/SpecificationExtension/SpecificationExtension.vue.d.ts.map +0 -1
- package/dist/components/SpecificationExtension/index.d.ts.map +0 -1
- package/dist/features/ApiClientModal/ApiClientModal.vue.d.ts.map +0 -1
- package/dist/features/ApiClientModal/index.d.ts.map +0 -1
- package/dist/features/ApiClientModal/useApiClient.d.ts.map +0 -1
- package/dist/features/BaseUrl/BaseUrl.vue.d.ts.map +0 -1
- package/dist/features/BaseUrl/index.d.ts.map +0 -1
- package/dist/features/DocumentSource/hooks/useDocumentFetcher.d.ts.map +0 -1
- package/dist/features/DocumentSource/hooks/useDocumentSource.d.ts.map +0 -1
- package/dist/features/DocumentSource/index.d.ts.map +0 -1
- package/dist/features/DownloadLink/DownloadLink.vue.d.ts.map +0 -1
- package/dist/features/DownloadLink/DownloadLink.vue.js +0 -7
- package/dist/features/DownloadLink/index.d.ts.map +0 -1
- package/dist/features/DownloadLink/openapi-version-symbol.d.ts.map +0 -1
- package/dist/features/ExampleRequest/ExamplePicker.vue.d.ts +0 -10
- package/dist/features/ExampleRequest/ExamplePicker.vue.d.ts.map +0 -1
- package/dist/features/ExampleRequest/ExamplePicker.vue.js +0 -7
- package/dist/features/ExampleRequest/ExamplePicker.vue2.js +0 -59
- package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts.map +0 -1
- package/dist/features/ExampleRequest/TextSelect.vue.d.ts.map +0 -1
- package/dist/features/ExampleRequest/index.d.ts.map +0 -1
- package/dist/features/ExampleResponses/ExampleResponse.vue.d.ts.map +0 -1
- package/dist/features/ExampleResponses/ExampleResponse.vue.js +0 -7
- package/dist/features/ExampleResponses/ExampleResponses.vue.d.ts.map +0 -1
- package/dist/features/ExampleResponses/ExampleResponses.vue.js +0 -7
- package/dist/features/ExampleResponses/index.d.ts.map +0 -1
- package/dist/features/TestRequestButton/TestRequestButton.vue.d.ts.map +0 -1
- package/dist/features/TestRequestButton/index.d.ts.map +0 -1
- package/dist/hooks/useMultipleDocuments.d.ts.map +0 -1
- /package/dist/features/{ApiClientModal → api-client-modal}/ApiClientModal.vue.d.ts +0 -0
- /package/dist/features/{ApiClientModal → api-client-modal}/ApiClientModal.vue.js +0 -0
- /package/dist/features/{ApiClientModal → api-client-modal}/ApiClientModal.vue2.js +0 -0
- /package/dist/features/{ApiClientModal → api-client-modal}/index.d.ts +0 -0
- /package/dist/features/{ApiClientModal → api-client-modal}/useApiClient.js +0 -0
- /package/dist/features/{BaseUrl → base-url}/BaseUrl.vue.d.ts +0 -0
- /package/dist/features/{BaseUrl → base-url}/BaseUrl.vue.js +0 -0
- /package/dist/features/{BaseUrl → base-url}/BaseUrl.vue2.js +0 -0
- /package/dist/features/{BaseUrl → base-url}/index.d.ts +0 -0
- /package/dist/features/{DocumentSource → document-source}/hooks/useDocumentFetcher.d.ts +0 -0
- /package/dist/features/{DocumentSource → document-source}/hooks/useDocumentFetcher.js +0 -0
- /package/dist/features/{DocumentSource → document-source}/hooks/useDocumentSource.d.ts +0 -0
- /package/dist/features/{DocumentSource → document-source}/hooks/useDocumentSource.js +0 -0
- /package/dist/features/{DocumentSource → document-source}/index.d.ts +0 -0
- /package/dist/features/{DownloadLink → download-link}/DownloadLink.vue.d.ts +0 -0
- /package/dist/features/{DownloadLink → download-link}/DownloadLink.vue2.js +0 -0
- /package/dist/features/{DownloadLink → download-link}/index.d.ts +0 -0
- /package/dist/features/{DownloadLink → download-link}/openapi-version-symbol.d.ts +0 -0
- /package/dist/features/{DownloadLink → download-link}/openapi-version-symbol.js +0 -0
- /package/dist/features/{ExampleRequest → example-request}/ExampleRequest.vue.d.ts +0 -0
- /package/dist/features/{ExampleRequest → example-request}/TextSelect.vue.d.ts +0 -0
- /package/dist/features/{ExampleRequest → example-request}/TextSelect.vue.js +0 -0
- /package/dist/features/{ExampleRequest → example-request}/TextSelect.vue3.js +0 -0
- /package/dist/features/{ExampleRequest → example-request}/index.d.ts +0 -0
- /package/dist/features/{ExampleResponses → example-responses}/ExampleResponse.vue.d.ts +0 -0
- /package/dist/features/{ExampleResponses → example-responses}/ExampleResponse.vue2.js +0 -0
- /package/dist/features/{ExampleResponses → example-responses}/ExampleResponses.vue.d.ts +0 -0
- /package/dist/features/{ExampleResponses → example-responses}/index.d.ts +0 -0
- /package/dist/{components/DocumentSelector → features/multiple-documents}/DocumentSelector.vue.d.ts +0 -0
- /package/dist/{components/DocumentSelector → features/multiple-documents}/DocumentSelector.vue.js +0 -0
- /package/dist/{components/DocumentSelector → features/multiple-documents}/DocumentSelector.vue2.js +0 -0
- /package/dist/{hooks → features/multiple-documents}/useMultipleDocuments.js +0 -0
- /package/dist/{components/Sidebar → features/sidebar/components}/Sidebar.vue.d.ts +0 -0
- /package/dist/{components/Sidebar → features/sidebar/components}/SidebarGroup.vue.d.ts +0 -0
- /package/dist/{components/Sidebar → features/sidebar/components}/SidebarGroup.vue2.js +0 -0
- /package/dist/{components/Sidebar → features/sidebar/components}/SidebarHttpBadge.vue.d.ts +0 -0
- /package/dist/{components/SpecificationExtension → features/specification-extension}/SpecificationExtension.vue.d.ts +0 -0
- /package/dist/{components/SpecificationExtension → features/specification-extension}/SpecificationExtension.vue.js +0 -0
- /package/dist/{components/SpecificationExtension → features/specification-extension}/SpecificationExtension.vue2.js +0 -0
- /package/dist/{components/SpecificationExtension → features/specification-extension}/index.d.ts +0 -0
- /package/dist/features/{TestRequestButton → test-request-button}/TestRequestButton.vue.d.ts +0 -0
- /package/dist/features/{TestRequestButton → test-request-button}/index.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiReferenceWorkspace.vue.d.ts","sourceRoot":"","sources":["../../src/v2/ApiReferenceWorkspace.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ApiReferenceWorkspace.vue.d.ts","sourceRoot":"","sources":["../../src/v2/ApiReferenceWorkspace.vue"],"names":[],"mappings":"AA8SA,OAAO,KAAK,EACV,4BAA4B,EAE7B,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAyBpE,KAAK,WAAW,GAAG;IACjB,aAAa,CAAC,EAAE,4BAA4B,CAAA;IAC5C,iBAAiB,EAAE,MAAM,cAAc,CAAA;CACxC,CAAC;AAyMF,iBAAS,cAAc;WA0GT,OAAO,IAA6B;;wBAVrB,GAAG;wBACH,GAAG;iCACM,GAAG;;;;EAaxC;AAeD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,kSAMnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,82 +1,127 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { NAV_STATE_SYMBOL as
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
|
|
1
|
+
import { defineComponent as w, ref as m, toRef as R, provide as T, shallowRef as $, onServerPrefetch as A, onMounted as B, watch as d, computed as N, createElementBlock as P, openBlock as D, Fragment as F, createBlock as I, createCommentVNode as U, createVNode as C, unref as r, resolveDynamicComponent as W, withCtx as n, createTextVNode as L, toDisplayString as O, renderSlot as p, isRef as Y } from "vue";
|
|
2
|
+
import { parseJsonOrYaml as _, redirectToProxy as j } from "@scalar/oas-utils/helpers";
|
|
3
|
+
import { useColorMode as J } from "@scalar/use-hooks/useColorMode";
|
|
4
|
+
import { useSeoMeta as q } from "@unhead/vue";
|
|
5
|
+
import { useFavicon as z } from "@vueuse/core";
|
|
6
|
+
import G from "../components/ApiReferenceLayout.vue.js";
|
|
7
|
+
import { NAV_STATE_SYMBOL as H } from "../hooks/useNavState.js";
|
|
8
|
+
import { useMultipleDocuments as K } from "../features/multiple-documents/useMultipleDocuments.js";
|
|
9
|
+
import { onCustomEvent as h } from "./events/listeners.js";
|
|
10
|
+
import Q from "../features/multiple-documents/DocumentSelector.vue.js";
|
|
11
|
+
const se = /* @__PURE__ */ w({
|
|
11
12
|
__name: "ApiReferenceWorkspace",
|
|
12
13
|
props: {
|
|
13
14
|
configuration: {},
|
|
14
15
|
getWorkspaceStore: { type: Function }
|
|
15
16
|
},
|
|
16
|
-
setup(
|
|
17
|
-
const
|
|
18
|
-
availableDocuments:
|
|
19
|
-
selectedConfiguration:
|
|
20
|
-
selectedDocumentIndex:
|
|
21
|
-
isIntersectionEnabled:
|
|
22
|
-
hash:
|
|
23
|
-
hashPrefix:
|
|
24
|
-
} =
|
|
25
|
-
configuration:
|
|
26
|
-
isIntersectionEnabled:
|
|
27
|
-
hash:
|
|
28
|
-
hashPrefix:
|
|
29
|
-
})
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
17
|
+
setup(M) {
|
|
18
|
+
const f = M, {
|
|
19
|
+
availableDocuments: u,
|
|
20
|
+
selectedConfiguration: t,
|
|
21
|
+
selectedDocumentIndex: l,
|
|
22
|
+
isIntersectionEnabled: x,
|
|
23
|
+
hash: y,
|
|
24
|
+
hashPrefix: S
|
|
25
|
+
} = K({
|
|
26
|
+
configuration: R(f, "configuration"),
|
|
27
|
+
isIntersectionEnabled: m(!1),
|
|
28
|
+
hash: m(""),
|
|
29
|
+
hashPrefix: m("")
|
|
30
|
+
}), g = (e, o) => fetch(
|
|
31
|
+
j(t.value.proxyUrl, e.toString()),
|
|
32
|
+
o
|
|
33
|
+
);
|
|
34
|
+
T(H, { isIntersectionEnabled: x, hash: y, hashPrefix: S });
|
|
35
|
+
const v = $(null), a = f.getWorkspaceStore(), i = u, s = (e) => {
|
|
36
|
+
if (a.workspace.documents[e.slug ?? "default"] === void 0) {
|
|
37
|
+
if (e.content) {
|
|
38
|
+
const o = typeof e.content == "string" ? _(e.content) : e.content;
|
|
39
|
+
return a.addDocumentSync({
|
|
40
|
+
name: e.slug ?? "default",
|
|
41
|
+
document: typeof o == "function" ? o() : o
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
if (e.url)
|
|
45
|
+
return a.addDocument({
|
|
46
|
+
name: e.slug ?? "default",
|
|
47
|
+
url: e.url,
|
|
48
|
+
fetch: g
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
i.value.forEach((e) => {
|
|
53
|
+
e.content && s(e);
|
|
54
|
+
}), A(() => {
|
|
55
|
+
i.value.forEach((e) => {
|
|
56
|
+
e.url && s(e);
|
|
57
|
+
});
|
|
58
|
+
}), B(() => {
|
|
59
|
+
i.value.forEach((e) => {
|
|
60
|
+
e.url && s(e);
|
|
61
|
+
});
|
|
62
|
+
}), h(v, "scalar-update-dark-mode", (e) => {
|
|
63
|
+
a.update("x-scalar-dark-mode", e.data.value);
|
|
64
|
+
}), h(v, "scalar-update-active-document", (e) => {
|
|
65
|
+
a.update("x-scalar-active-document", e.data.value);
|
|
36
66
|
});
|
|
37
|
-
const { toggleColorMode:
|
|
38
|
-
initialColorMode:
|
|
39
|
-
overrideColorMode:
|
|
67
|
+
const { toggleColorMode: E, isDarkMode: V } = J({
|
|
68
|
+
initialColorMode: t.value.darkMode ? "dark" : void 0,
|
|
69
|
+
overrideColorMode: t.value.forceDarkModeState
|
|
40
70
|
});
|
|
41
|
-
|
|
42
|
-
() =>
|
|
43
|
-
(e) =>
|
|
44
|
-
),
|
|
45
|
-
() =>
|
|
46
|
-
(e) =>
|
|
71
|
+
d(
|
|
72
|
+
() => t.value.darkMode,
|
|
73
|
+
(e) => a.update("x-scalar-dark-mode", !!e)
|
|
74
|
+
), d(
|
|
75
|
+
() => V.value,
|
|
76
|
+
(e) => a.update("x-scalar-dark-mode", e),
|
|
77
|
+
{ immediate: !0 }
|
|
78
|
+
), d(
|
|
79
|
+
() => l.value,
|
|
80
|
+
(e) => {
|
|
81
|
+
var o;
|
|
82
|
+
return a.update(
|
|
83
|
+
"x-scalar-active-document",
|
|
84
|
+
(o = u.value[e]) == null ? void 0 : o.slug
|
|
85
|
+
);
|
|
86
|
+
},
|
|
47
87
|
{ immediate: !0 }
|
|
48
|
-
),
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
88
|
+
), d(
|
|
89
|
+
() => u.value,
|
|
90
|
+
(e) => {
|
|
91
|
+
e.forEach(s);
|
|
92
|
+
}
|
|
93
|
+
), t.value.metaData && q(t.value.metaData);
|
|
94
|
+
const b = N(() => t.value.favicon);
|
|
95
|
+
return z(b), (e, o) => {
|
|
96
|
+
var k;
|
|
97
|
+
return D(), P(F, null, [
|
|
98
|
+
(k = r(t)) != null && k.customCss ? (D(), I(W("style"), { key: 0 }, {
|
|
99
|
+
default: n(() => [
|
|
100
|
+
L(O(r(t).customCss), 1)
|
|
56
101
|
]),
|
|
57
102
|
_: 1
|
|
58
|
-
})) :
|
|
59
|
-
|
|
60
|
-
configuration: t
|
|
61
|
-
isDark: !!
|
|
62
|
-
onToggleDarkMode:
|
|
63
|
-
onUpdateContent:
|
|
103
|
+
})) : U("", !0),
|
|
104
|
+
C(G, {
|
|
105
|
+
configuration: r(t),
|
|
106
|
+
isDark: !!r(a).workspace["x-scalar-dark-mode"],
|
|
107
|
+
onToggleDarkMode: o[1] || (o[1] = () => r(E)()),
|
|
108
|
+
onUpdateContent: o[2] || (o[2] = (c) => e.$emit("updateContent", c))
|
|
64
109
|
}, {
|
|
65
|
-
footer:
|
|
66
|
-
|
|
110
|
+
footer: n(() => [
|
|
111
|
+
p(e.$slots, "footer")
|
|
67
112
|
]),
|
|
68
|
-
"content-end":
|
|
69
|
-
|
|
113
|
+
"content-end": n(() => [
|
|
114
|
+
p(e.$slots, "footer")
|
|
70
115
|
]),
|
|
71
|
-
"document-selector":
|
|
72
|
-
|
|
73
|
-
modelValue:
|
|
74
|
-
"onUpdate:modelValue":
|
|
75
|
-
options:
|
|
116
|
+
"document-selector": n(() => [
|
|
117
|
+
C(r(Q), {
|
|
118
|
+
modelValue: r(l),
|
|
119
|
+
"onUpdate:modelValue": o[0] || (o[0] = (c) => Y(l) ? l.value = c : null),
|
|
120
|
+
options: r(u)
|
|
76
121
|
}, null, 8, ["modelValue", "options"])
|
|
77
122
|
]),
|
|
78
|
-
"sidebar-start":
|
|
79
|
-
|
|
123
|
+
"sidebar-start": n(() => [
|
|
124
|
+
p(e.$slots, "sidebar-start")
|
|
80
125
|
]),
|
|
81
126
|
_: 3
|
|
82
127
|
}, 8, ["configuration", "isDark"])
|
|
@@ -85,5 +130,5 @@ const te = /* @__PURE__ */ V({
|
|
|
85
130
|
}
|
|
86
131
|
});
|
|
87
132
|
export {
|
|
88
|
-
|
|
133
|
+
se as default
|
|
89
134
|
};
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import type { HttpMethod as HttpMethodType } from '@scalar/helpers/http/http-methods';
|
|
2
|
+
import { type AvailableClients } from '@scalar/snippetz';
|
|
3
|
+
import type { OperationObject } from '@scalar/workspace-store/schemas/v3.1/strict/path-operations';
|
|
4
|
+
import type { SecuritySchemeObject } from '@scalar/workspace-store/schemas/v3.1/strict/security-scheme';
|
|
5
|
+
import type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/server';
|
|
6
|
+
import { type Dereference } from '@scalar/workspace-store/schemas/v3.1/type-guard';
|
|
7
|
+
import { type ComponentPublicInstance } from 'vue';
|
|
8
|
+
type Props = {
|
|
9
|
+
/**
|
|
10
|
+
* List of all allowed clients, this will determine which clients are available in the dropdown
|
|
11
|
+
*
|
|
12
|
+
* For the complete list:
|
|
13
|
+
* @see https://github.com/scalar/scalar/blob/main/packages/types/src/snippetz/snippetz.ts#L8
|
|
14
|
+
*
|
|
15
|
+
* @defaults to all available clients + any included custom code examples
|
|
16
|
+
*/
|
|
17
|
+
allowedClients?: AvailableClients[number][];
|
|
18
|
+
/**
|
|
19
|
+
* Pre-selected client, this will determine which client is initially selected in the dropdown
|
|
20
|
+
*
|
|
21
|
+
* @defaults to js/fetch or a custom sample if one is available
|
|
22
|
+
*/
|
|
23
|
+
selectedClient?: AvailableClients[number];
|
|
24
|
+
/**
|
|
25
|
+
* Which server from the spec to use for the code example
|
|
26
|
+
*/
|
|
27
|
+
selectedServer?: ServerObject;
|
|
28
|
+
/**
|
|
29
|
+
* The selected content type from the requestBody.content, this will determine which examples are available
|
|
30
|
+
* as well as the content type of the code example
|
|
31
|
+
*
|
|
32
|
+
* @defaults to the first content type
|
|
33
|
+
*/
|
|
34
|
+
selectedContentType?: string;
|
|
35
|
+
/**
|
|
36
|
+
* In case you wish to pre-select an example from the requestBody.content.examples
|
|
37
|
+
*/
|
|
38
|
+
selectedExample?: string;
|
|
39
|
+
/**
|
|
40
|
+
* The security schemes which are applicable to this operation
|
|
41
|
+
*/
|
|
42
|
+
securitySchemes?: SecuritySchemeObject[];
|
|
43
|
+
/**
|
|
44
|
+
* HTTP method of the operation
|
|
45
|
+
*/
|
|
46
|
+
method: HttpMethodType;
|
|
47
|
+
/**
|
|
48
|
+
* Path of the operation
|
|
49
|
+
*/
|
|
50
|
+
path: string;
|
|
51
|
+
/**
|
|
52
|
+
* De-referenced OpenAPI Operation object
|
|
53
|
+
*/
|
|
54
|
+
operation: Dereference<OperationObject>;
|
|
55
|
+
/**
|
|
56
|
+
* If true and there's no example, we will display a small card with the method and path only
|
|
57
|
+
*/
|
|
58
|
+
fallback?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* A method to generate the label of the block, should return an html string
|
|
61
|
+
*/
|
|
62
|
+
generateLabel?: () => string;
|
|
63
|
+
/**
|
|
64
|
+
* Config options for the block
|
|
65
|
+
*/
|
|
66
|
+
config?: {
|
|
67
|
+
hideClientSelector?: boolean;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
declare function __VLS_template(): {
|
|
71
|
+
attrs: Partial<{}>;
|
|
72
|
+
slots: Readonly<{
|
|
73
|
+
header: () => unknown;
|
|
74
|
+
footer: () => unknown;
|
|
75
|
+
}> & {
|
|
76
|
+
header: () => unknown;
|
|
77
|
+
footer: () => unknown;
|
|
78
|
+
};
|
|
79
|
+
refs: {
|
|
80
|
+
elem: ({
|
|
81
|
+
$: import("vue").ComponentInternalInstance;
|
|
82
|
+
$data: {};
|
|
83
|
+
$props: Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>;
|
|
84
|
+
$attrs: {
|
|
85
|
+
[x: string]: unknown;
|
|
86
|
+
};
|
|
87
|
+
$refs: {
|
|
88
|
+
[x: string]: unknown;
|
|
89
|
+
};
|
|
90
|
+
$slots: Readonly<{
|
|
91
|
+
[name: string]: import("vue").Slot<any> | undefined;
|
|
92
|
+
}>;
|
|
93
|
+
$root: ComponentPublicInstance | null;
|
|
94
|
+
$parent: ComponentPublicInstance | null;
|
|
95
|
+
$host: Element | null;
|
|
96
|
+
$emit: (event: string, ...args: any[]) => void;
|
|
97
|
+
$el: HTMLDivElement;
|
|
98
|
+
$options: import("vue").ComponentOptionsBase<Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
|
|
99
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
100
|
+
created?: (() => void) | (() => void)[];
|
|
101
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
102
|
+
mounted?: (() => void) | (() => void)[];
|
|
103
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
104
|
+
updated?: (() => void) | (() => void)[];
|
|
105
|
+
activated?: (() => void) | (() => void)[];
|
|
106
|
+
deactivated?: (() => void) | (() => void)[];
|
|
107
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
108
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
109
|
+
destroyed?: (() => void) | (() => void)[];
|
|
110
|
+
unmounted?: (() => void) | (() => void)[];
|
|
111
|
+
renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
|
112
|
+
renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
|
113
|
+
errorCaptured?: ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
114
|
+
};
|
|
115
|
+
$forceUpdate: () => void;
|
|
116
|
+
$nextTick: typeof import("vue").nextTick;
|
|
117
|
+
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import("@vue/reactivity").OnCleanup]) => any : (...args: [any, any, import("@vue/reactivity").OnCleanup]) => any, options?: import("vue").WatchOptions): import("vue").WatchStopHandle;
|
|
118
|
+
} & Readonly<{}> & Omit<Readonly<{}> & Readonly<{}>, never> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
|
|
119
|
+
$slots: {
|
|
120
|
+
default?(_: {}): any;
|
|
121
|
+
};
|
|
122
|
+
}) | null;
|
|
123
|
+
};
|
|
124
|
+
rootEl: any;
|
|
125
|
+
};
|
|
126
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
127
|
+
declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
128
|
+
"update:selectedClient": (id: "c/libcurl" | "clojure/clj_http" | "csharp/httpclient" | "csharp/restsharp" | "go/native" | "http/http1.1" | "java/asynchttp" | "java/nethttp" | "java/okhttp" | "java/unirest" | "js/axios" | "js/fetch" | "js/jquery" | "js/ofetch" | "js/xhr" | "kotlin/okhttp" | "node/axios" | "node/fetch" | "node/ofetch" | "node/undici" | "objc/nsurlsession" | "ocaml/cohttp" | "php/curl" | "php/guzzle" | "powershell/restmethod" | "powershell/webrequest" | "python/python3" | "python/requests" | "python/httpx_sync" | "python/httpx_async" | "r/httr" | "ruby/native" | "shell/curl" | "shell/httpie" | "shell/wget" | "swift/nsurlsession" | "dart/http") => any;
|
|
129
|
+
"update:selectedExample": (name: string) => any;
|
|
130
|
+
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
131
|
+
"onUpdate:selectedClient"?: ((id: "c/libcurl" | "clojure/clj_http" | "csharp/httpclient" | "csharp/restsharp" | "go/native" | "http/http1.1" | "java/asynchttp" | "java/nethttp" | "java/okhttp" | "java/unirest" | "js/axios" | "js/fetch" | "js/jquery" | "js/ofetch" | "js/xhr" | "kotlin/okhttp" | "node/axios" | "node/fetch" | "node/ofetch" | "node/undici" | "objc/nsurlsession" | "ocaml/cohttp" | "php/curl" | "php/guzzle" | "powershell/restmethod" | "powershell/webrequest" | "python/python3" | "python/requests" | "python/httpx_sync" | "python/httpx_async" | "r/httr" | "ruby/native" | "shell/curl" | "shell/httpie" | "shell/wget" | "swift/nsurlsession" | "dart/http") => any) | undefined;
|
|
132
|
+
"onUpdate:selectedExample"?: ((name: string) => any) | undefined;
|
|
133
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
134
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
135
|
+
export default _default;
|
|
136
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
137
|
+
new (): {
|
|
138
|
+
$slots: S;
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
//# sourceMappingURL=RequestExample.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RequestExample.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-request-example-block/components/RequestExample.vue"],"names":[],"mappings":"AA4XA,OAAO,KAAK,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,mCAAmC,CAAA;AAGrF,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6DAA6D,CAAA;AAClG,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6DAA6D,CAAA;AACvG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oDAAoD,CAAA;AACtF,OAAO,EAEL,KAAK,WAAW,EACjB,MAAM,iDAAiD,CAAA;AACxD,OAAO,EAA+B,KAAK,uBAAuB,EAAE,MAAM,KAAK,CAAA;AAiB/E,KAAK,KAAK,GAAG;IACX;;;;;;;OAOG;IACH,cAAc,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,EAAE,CAAA;IAC3C;;;;OAIG;IACH,cAAc,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;IACzC;;OAEG;IACH,cAAc,CAAC,EAAE,YAAY,CAAA;IAC7B;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB;;OAEG;IACH,eAAe,CAAC,EAAE,oBAAoB,EAAE,CAAA;IACxC;;OAEG;IACH,MAAM,EAAE,cAAc,CAAA;IACtB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,SAAS,EAAE,WAAW,CAAC,eAAe,CAAC,CAAA;IACvC;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,MAAM,CAAA;IAC5B;;OAEG;IACH,MAAM,CAAC,EAAE;QACP,kBAAkB,CAAC,EAAE,OAAO,CAAA;KAC7B,CAAA;CACF,CAAA;AA+ID,iBAAS,cAAc;WAuNT,OAAO,IAA6B;;gBA3UxC,MAAM,OAAO;gBACb,MAAM,OAAO;;gBADb,MAAM,OAAO;gBACb,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAmPM,GAAG,8CAE7B,GAAG,yBAAyB,GAAG,6DAAmC,GAAG;;;;;;;;EA0FvE;AA6BD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;kFAOnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ClientOption, ClientOptionGroup } from '../../../../v2/blocks/scalar-request-example-block/types';
|
|
2
|
+
import type { AvailableClients } from '@scalar/snippetz';
|
|
3
|
+
/**
|
|
4
|
+
* Finds and returns the appropriate client option from a list of client option groups.
|
|
5
|
+
*
|
|
6
|
+
* This function is used to determine which client should be initially selected in the
|
|
7
|
+
* request example block. It prioritizes a specific client ID if provided, otherwise
|
|
8
|
+
* falls back to the first available option.
|
|
9
|
+
*
|
|
10
|
+
* @param options - Array of client option groups, each containing a label and array of client options
|
|
11
|
+
* @param id - Optional client identifier to search for (e.g., 'js/fetch', 'python/requests')
|
|
12
|
+
*
|
|
13
|
+
* @returns The selected client option. If a specific ID is provided and found, returns that client.
|
|
14
|
+
* If the ID is not found or not provided, returns the first available client option.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* const clientGroups = [
|
|
19
|
+
* {
|
|
20
|
+
* label: 'JavaScript',
|
|
21
|
+
* options: [
|
|
22
|
+
* { id: 'js/fetch', label: 'Fetch API', lang: 'js' },
|
|
23
|
+
* { id: 'js/axios', label: 'Axios', lang: 'js' }
|
|
24
|
+
* ]
|
|
25
|
+
* }
|
|
26
|
+
* ]
|
|
27
|
+
*
|
|
28
|
+
* // Find specific client
|
|
29
|
+
* const client = findClient(clientGroups, 'js/fetch')
|
|
30
|
+
* // Returns: { id: 'js/fetch', label: 'Fetch API', lang: 'js' }
|
|
31
|
+
*
|
|
32
|
+
* // Find first available client
|
|
33
|
+
* const firstClient = findClient(clientGroups)
|
|
34
|
+
* // Returns: { id: 'js/fetch', label: 'Fetch API', lang: 'js' }
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export declare const findClient: (clientGroups: ClientOptionGroup[], clientId?: AvailableClients[number] | undefined) => ClientOption;
|
|
38
|
+
//# sourceMappingURL=find-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-client.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-request-example-block/helpers/find-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAA;AACrG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAExD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,UAAU,iBACP,iBAAiB,EAAE,aACtB,gBAAgB,CAAC,MAAM,CAAC,GAAG,SAAS,KAC9C,YAcF,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ClientOptionGroup } from '../../../../v2/blocks/scalar-request-example-block/types';
|
|
2
|
+
import type { XCodeSample } from '@scalar/openapi-types/schemas/extensions';
|
|
3
|
+
import { type AvailableClients } from '@scalar/snippetz';
|
|
4
|
+
/** Helper to generate an ID for custom code samples */
|
|
5
|
+
export declare const generateCustomId: (example: XCodeSample) => string;
|
|
6
|
+
/**
|
|
7
|
+
* Generates client options for the request example block by combining built-in snippets
|
|
8
|
+
* with custom code samples. This function creates a structured list of available
|
|
9
|
+
* client options that can be used to generate code examples for different programming
|
|
10
|
+
* languages and frameworks.
|
|
11
|
+
*
|
|
12
|
+
* The function filters built-in clients based on the allowedClients parameter and
|
|
13
|
+
* groups them by their category (e.g., JavaScript, Python, etc.). Custom code samples
|
|
14
|
+
* are added as a separate "Code Examples" group at the top of the list.
|
|
15
|
+
*
|
|
16
|
+
* @param customRequestExamples - Array of custom code samples to include in the options
|
|
17
|
+
* @param allowedClients - Optional array of allowed client IDs to filter built-in clients
|
|
18
|
+
* @returns Array of client option groups, each containing a label and array of client options
|
|
19
|
+
*/
|
|
20
|
+
export declare const generateClientOptions: (customRequestExamples: XCodeSample[], allowedClients?: AvailableClients[number][]) => ClientOptionGroup[];
|
|
21
|
+
//# sourceMappingURL=generate-client-options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-client-options.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-request-example-block/helpers/generate-client-options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAA;AACvF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAA;AAC3E,OAAO,EAAY,KAAK,gBAAgB,EAAiB,MAAM,kBAAkB,CAAA;AAGjF,uDAAuD;AACvD,eAAO,MAAM,gBAAgB,YAAa,WAAW,WAA6B,CAAA;AAElF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,qBAAqB,0BACT,WAAW,EAAE,mBACnB,gBAAgB,CAAC,MAAM,CAAC,EAAE,KAC1C,iBAAiB,EAqDnB,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { AvailableClients } from '@scalar/snippetz';
|
|
2
|
+
import type { OperationObject } from '@scalar/workspace-store/schemas/v3.1/strict/path-operations';
|
|
3
|
+
import { type Dereference } from '@scalar/workspace-store/schemas/v3.1/type-guard';
|
|
4
|
+
import type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/server';
|
|
5
|
+
import type { SecuritySchemeObject } from '@scalar/workspace-store/schemas/v3.1/strict/security-scheme';
|
|
6
|
+
import type { HttpMethod } from '@scalar/helpers/http/http-methods';
|
|
7
|
+
type Props = {
|
|
8
|
+
clientId: AvailableClients[number];
|
|
9
|
+
operation: Dereference<OperationObject>;
|
|
10
|
+
example: unknown;
|
|
11
|
+
method: HttpMethod;
|
|
12
|
+
path: string;
|
|
13
|
+
contentType?: string | undefined;
|
|
14
|
+
server?: ServerObject | undefined;
|
|
15
|
+
securitySchemes?: SecuritySchemeObject[] | undefined;
|
|
16
|
+
};
|
|
17
|
+
/** Generate the code snippet for the selected example OR operation */
|
|
18
|
+
export declare const generateCodeSnippet: ({ clientId, operation, method, path, example, contentType, server, securitySchemes, }: Props) => string;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=generate-code-snippet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-code-snippet.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-request-example-block/helpers/generate-code-snippet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAsB,MAAM,kBAAkB,CAAA;AAE5E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6DAA6D,CAAA;AAClG,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,iDAAiD,CAAA;AAC/F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oDAAoD,CAAA;AAEtF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6DAA6D,CAAA;AACvG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAEnE,KAAK,KAAK,GAAG;IACX,QAAQ,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;IAClC,SAAS,EAAE,WAAW,CAAC,eAAe,CAAC,CAAA;IACvC,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,EAAE,UAAU,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAChC,MAAM,CAAC,EAAE,YAAY,GAAG,SAAS,CAAA;IACjC,eAAe,CAAC,EAAE,oBAAoB,EAAE,GAAG,SAAS,CAAA;CACrD,CAAA;AAED,sEAAsE;AACtE,eAAO,MAAM,mBAAmB,0FAS7B,KAAK,KAAG,MAuBV,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { SecuritySchemeObject } from '@scalar/workspace-store/schemas/v3.1/strict/security-scheme';
|
|
2
|
+
/** Extract secrets from security schemes */
|
|
3
|
+
export declare const getSecrets: (securitySchemes: SecuritySchemeObject[]) => string[];
|
|
4
|
+
//# sourceMappingURL=get-secrets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-secrets.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-request-example-block/helpers/get-secrets.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6DAA6D,CAAA;AAEvG,4CAA4C;AAC5C,eAAO,MAAM,UAAU,oBAAqB,oBAAoB,EAAE,KAqBxC,MAAM,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/blocks/scalar-request-example-block/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,iCAAiC,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ScalarComboboxOption, ScalarComboboxOptionGroup } from '@scalar/components';
|
|
2
|
+
import type { TargetId } from '@scalar/snippetz';
|
|
3
|
+
/**
|
|
4
|
+
* Represents a client option in the request example block.
|
|
5
|
+
* Extends the base combobox option with language-specific information
|
|
6
|
+
* for generating code examples in different programming languages.
|
|
7
|
+
*/
|
|
8
|
+
export type ClientOption = ScalarComboboxOption & {
|
|
9
|
+
/** The programming language or tool for code generation (e.g., 'javascript', 'python', 'curl') */
|
|
10
|
+
lang: TargetId | 'curl' | 'plaintext';
|
|
11
|
+
/** The title shows when the client is selected in the dropdown */
|
|
12
|
+
title: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Augments the base combobox option group with ClientOptions
|
|
16
|
+
*/
|
|
17
|
+
export type ClientOptionGroup = Omit<ScalarComboboxOptionGroup, 'options'> & {
|
|
18
|
+
/** Array of client options that belong to this group */
|
|
19
|
+
options: ClientOption[];
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/v2/blocks/scalar-request-example-block/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAA;AACzF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAEhD;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,oBAAoB,GAAG;IAChD,kGAAkG;IAClG,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAA;IACrC,kEAAkE;IAClE,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,yBAAyB,EAAE,SAAS,CAAC,GAAG;IAC3E,wDAAwD;IACxD,OAAO,EAAE,YAAY,EAAE,CAAA;CACxB,CAAA"}
|
package/package.json
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"vue",
|
|
21
21
|
"vue3"
|
|
22
22
|
],
|
|
23
|
-
"version": "1.
|
|
23
|
+
"version": "1.32.1",
|
|
24
24
|
"engines": {
|
|
25
25
|
"node": ">=20"
|
|
26
26
|
},
|
|
@@ -51,23 +51,23 @@
|
|
|
51
51
|
"fuse.js": "^7.0.0",
|
|
52
52
|
"github-slugger": "^2.0.0",
|
|
53
53
|
"microdiff": "^1.4.0",
|
|
54
|
-
"nanoid": "
|
|
54
|
+
"nanoid": "5.1.5",
|
|
55
55
|
"vue": "^3.5.12",
|
|
56
56
|
"zod": "3.24.1",
|
|
57
|
-
"@scalar/api-client": "2.5.
|
|
57
|
+
"@scalar/api-client": "2.5.13",
|
|
58
58
|
"@scalar/code-highlight": "0.1.4",
|
|
59
|
-
"@scalar/
|
|
60
|
-
"@scalar/
|
|
61
|
-
"@scalar/
|
|
62
|
-
"@scalar/oas-utils": "0.4.8",
|
|
59
|
+
"@scalar/helpers": "0.0.5",
|
|
60
|
+
"@scalar/components": "0.14.14",
|
|
61
|
+
"@scalar/icons": "0.4.5",
|
|
63
62
|
"@scalar/openapi-parser": "0.18.0",
|
|
64
|
-
"@scalar/openapi-types": "0.3.
|
|
65
|
-
"@scalar/themes": "0.13.5",
|
|
63
|
+
"@scalar/openapi-types": "0.3.4",
|
|
66
64
|
"@scalar/snippetz": "0.3.1",
|
|
67
|
-
"@scalar/
|
|
65
|
+
"@scalar/oas-utils": "0.4.9",
|
|
66
|
+
"@scalar/types": "0.2.5",
|
|
68
67
|
"@scalar/use-hooks": "0.2.3",
|
|
68
|
+
"@scalar/themes": "0.13.6",
|
|
69
69
|
"@scalar/use-toasts": "0.8.0",
|
|
70
|
-
"@scalar/workspace-store": "0.
|
|
70
|
+
"@scalar/workspace-store": "0.7.0"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@tailwindcss/vite": "^4.1.7",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DocumentSelector/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Sidebar.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/Sidebar.vue"],"names":[],"mappings":"AA+QA,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;CACd,CAAC;AAmHF,iBAAS,cAAc;WAoKT,OAAO,IAA6B;;iCAVb,GAAG;+BACJ,GAAG;;;;;;EActC;AAkBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,6SAOnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarElement.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/SidebarElement.vue"],"names":[],"mappings":"AAiWA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAQhE,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,cAAc,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,IAAI,CAAC,EAAE,OAAO,CAAA;CACf,CAAC;AAuEF,iBAAS,cAAc;WA+KT,OAAO,IAA6B;;yBATpB,GAAG;+BACG,GAAG;;;;EAatC;AAiBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;4FAQnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarGroup.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/SidebarGroup.vue"],"names":[],"mappings":"AA8CA,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;CACd,CAAC;AAQF,iBAAS,cAAc;WAiDT,OAAO,IAA6B;;yBARrB,GAAG;;;;EAa/B;AAQD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,+SAOnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarHttpBadge.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/SidebarHttpBadge.vue"],"names":[],"mappings":"AAmDA,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAC;AAQF,iBAAS,cAAc;WA6DT,OAAO,IAA6B;;yBARrB,GAAG;;;;EAa/B;AASD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,kSAOnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,eAAe,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SpecificationExtension.vue.d.ts","sourceRoot":"","sources":["../../../src/components/SpecificationExtension/SpecificationExtension.vue"],"names":[],"mappings":"AAkFA,KAAK,WAAW,GAAG;IACjB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAA;CAC3C,CAAC;;AAyHF,wBAMG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/SpecificationExtension/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,8BAA8B,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ApiClientModal.vue.d.ts","sourceRoot":"","sources":["../../../src/features/ApiClientModal/ApiClientModal.vue"],"names":[],"mappings":"AAiKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAYzE,KAAK,WAAW,GAAG;IAEjB,aAAa,EAAE,OAAO,CAAC,IAAI,CAAC,sBAAsB,EAAE,SAAS,CAAC,CAAC,CAAA;IAC/D,oBAAoB,EAAE,WAAW,CAAC,QAAQ,CAAA;CAC3C,CAAC;;AAuLF,wBAOG"}
|