@scalar/api-reference 1.25.79 → 1.25.81
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 +30 -0
- package/dist/browser/standalone.js +13239 -14204
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/Anchor/Anchor.vue.d.ts.map +1 -1
- package/dist/components/Anchor/Anchor.vue.js +1 -1
- package/dist/components/Anchor/Anchor.vue2.js +19 -21
- package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
- package/dist/components/ApiReferenceLayout.vue.js +2 -2
- package/dist/components/ApiReferenceLayout.vue2.js +97 -92
- package/dist/components/Content/ClientLibraries/ClientSelector.vue.d.ts.map +1 -1
- package/dist/components/Content/ClientLibraries/ClientSelector.vue.js +1 -1
- package/dist/components/Content/ClientLibraries/ClientSelector.vue2.js +22 -20
- package/dist/components/Content/Introduction/Description.vue.d.ts.map +1 -1
- package/dist/components/Content/Introduction/Description.vue.js +2 -2
- package/dist/components/Content/Introduction/Description.vue2.js +30 -33
- 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 +106 -102
- package/dist/components/Section/CompactSection.vue.js +2 -2
- package/dist/components/Section/CompactSection.vue2.js +14 -14
- package/dist/components/Section/Section.vue.d.ts.map +1 -1
- package/dist/components/Section/Section.vue.js +1 -1
- package/dist/components/Section/Section.vue2.js +16 -19
- package/dist/components/Sidebar/SidebarElement.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarElement.vue.js +2 -2
- package/dist/components/Sidebar/SidebarElement.vue2.js +42 -46
- package/dist/embeds/OpenApiDocument/OpenApiDocument.vue.d.ts +4 -4
- package/dist/features/ApiClientModal/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/features/ApiClientModal/ApiClientModal.vue.js +12 -12
- package/dist/features/ApiClientModal/useApiClient.d.ts +28 -28
- package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -1
- package/dist/features/ExampleRequest/ExampleRequest.vue.js +2 -2
- package/dist/features/ExampleRequest/ExampleRequest.vue2.js +1 -1
- package/dist/features/Operation/hooks/useRequestExample.js +22 -22
- package/dist/helpers/convertRequestToHarRequest.d.ts +1 -1
- package/dist/helpers/convertRequestToHarRequest.d.ts.map +1 -1
- package/dist/helpers/getExampleCode.d.ts +3 -4
- package/dist/helpers/getExampleCode.d.ts.map +1 -1
- package/dist/helpers/getExampleCode.js +12 -31
- package/dist/hooks/useNavState.d.ts +22 -0
- package/dist/hooks/useNavState.d.ts.map +1 -1
- package/dist/hooks/useNavState.js +57 -34
- package/dist/index.js +1 -1
- package/dist/stores/useHttpClientStore.d.ts +3 -4
- package/dist/stores/useHttpClientStore.d.ts.map +1 -1
- package/dist/stores/useHttpClientStore.js +45 -58
- package/dist/style.css +1 -1
- package/dist/types.d.ts +2 -5
- package/dist/types.d.ts.map +1 -1
- package/package.json +9 -10
|
@@ -1,7 +1,6 @@
|
|
|
1
|
+
import type { Target, TargetId } from '@scalar/snippetz/types';
|
|
1
2
|
import type { HiddenClients } from '@scalar/types/legacy';
|
|
2
|
-
import { type TargetId } from 'httpsnippet-lite';
|
|
3
3
|
import { type Ref } from 'vue';
|
|
4
|
-
import type { AvailableTarget } from '../types';
|
|
5
4
|
/**
|
|
6
5
|
* Gets the client title from the availableTargets
|
|
7
6
|
* { targetKey: 'shell', clientKey: 'curl' } -> 'Shell'
|
|
@@ -15,7 +14,7 @@ declare function getClientTitle(client: HttpClientState): string;
|
|
|
15
14
|
/**
|
|
16
15
|
* Filters out hidden clients from the available targets (based on the given configuration).
|
|
17
16
|
*/
|
|
18
|
-
export declare function filterHiddenClients(targets:
|
|
17
|
+
export declare function filterHiddenClients(targets: Target[], exclude: Ref<HiddenClients>): Target[];
|
|
19
18
|
/** The selected HTTP client */
|
|
20
19
|
export type HttpClientState = {
|
|
21
20
|
targetKey: TargetId;
|
|
@@ -34,7 +33,7 @@ export declare const useHttpClientStore: () => {
|
|
|
34
33
|
setDefaultHttpClient: typeof setDefaultHttpClient;
|
|
35
34
|
excludedClients: Ref<HiddenClients>;
|
|
36
35
|
setExcludedClients: (v: HiddenClients) => void;
|
|
37
|
-
availableTargets: import("vue").ComputedRef<
|
|
36
|
+
availableTargets: import("vue").ComputedRef<Target[]>;
|
|
38
37
|
getClientTitle: typeof getClientTitle;
|
|
39
38
|
getTargetTitle: typeof getTargetTitle;
|
|
40
39
|
httpTargetTitle: import("vue").ComputedRef<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHttpClientStore.d.ts","sourceRoot":"","sources":["../../src/stores/useHttpClientStore.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useHttpClientStore.d.ts","sourceRoot":"","sources":["../../src/stores/useHttpClientStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,EAAE,KAAK,GAAG,EAAqC,MAAM,KAAK,CAAA;AASjE;;;GAGG;AACH,iBAAS,cAAc,CAAC,MAAM,EAAE,eAAe,UAK9C;AAED;;;GAGG;AACH,iBAAS,cAAc,CAAC,MAAM,EAAE,eAAe,UAO9C;AAYD;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,EAAE,EACjB,OAAO,EAAE,GAAG,CAAC,aAAa,CAAC,GAC1B,MAAM,EAAE,CAkDV;AASD,+BAA+B;AAC/B,MAAM,MAAM,eAAe,GAAG;IAAE,SAAS,EAAE,QAAQ,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAA;AAMxE,iBAAS,oBAAoB,CAAC,UAAU,CAAC,EAAE,eAAe,QAQzD;AAmCD,iBAAS,UAAU,SAElB;AAYD,kEAAkE;AAClE,eAAO,MAAM,kBAAkB;;4BAhEY,QAAQ;4BAAa,MAAM;;;8BAwDrC,OAAO,CAAC,eAAe,CAAC;;qBAcP,GAAG,CAAC,aAAa,CAAC;4BACxC,aAAa;;;;;;CAaxC,CAAA"}
|
|
@@ -1,82 +1,69 @@
|
|
|
1
|
-
import { objectMerge as
|
|
2
|
-
import {
|
|
3
|
-
import { computed as
|
|
1
|
+
import { objectMerge as p } from "@scalar/oas-utils/helpers";
|
|
2
|
+
import { snippetz as k } from "@scalar/snippetz";
|
|
3
|
+
import { computed as o, ref as d, reactive as m, readonly as a } from "vue";
|
|
4
4
|
const y = {
|
|
5
5
|
targetKey: "shell",
|
|
6
6
|
clientKey: "curl"
|
|
7
|
-
};
|
|
8
|
-
function
|
|
7
|
+
}, { clients: A } = k();
|
|
8
|
+
function C(t) {
|
|
9
9
|
var n;
|
|
10
|
-
return ((n =
|
|
10
|
+
return ((n = r.value.find((e) => e.key === t.targetKey)) == null ? void 0 : n.title) ?? t.targetKey;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
var n,
|
|
14
|
-
return ((
|
|
12
|
+
function K(t) {
|
|
13
|
+
var n, e;
|
|
14
|
+
return ((e = (n = r.value.find((i) => i.key === t.targetKey)) == null ? void 0 : n.clients.find((i) => i.client === t.clientKey)) == null ? void 0 : e.title) ?? t.clientKey;
|
|
15
15
|
}
|
|
16
|
-
const
|
|
17
|
-
function
|
|
18
|
-
return n.value === !0 ? [] :
|
|
16
|
+
const H = o(() => C(l)), b = o(() => K(l));
|
|
17
|
+
function h(t, n) {
|
|
18
|
+
return n.value === !0 ? [] : t.flatMap((e) => {
|
|
19
19
|
var i;
|
|
20
|
-
return typeof n.value != "object" ? [] : Array.isArray(n.value) ? (
|
|
20
|
+
return typeof n.value != "object" ? [] : Array.isArray(n.value) ? (e.clients = e.clients.filter(
|
|
21
21
|
// @ts-expect-error Typescript, chill. It’s all good. It has to be an array.
|
|
22
|
-
(s) => !n.value.includes(s.
|
|
23
|
-
),
|
|
24
|
-
n.value[
|
|
22
|
+
(s) => !n.value.includes(s.client)
|
|
23
|
+
), e.clients.length ? [e] : []) : n.value[e.key] === !0 ? [] : (Array.isArray(n.value[e.key]) && (e.clients = e.clients.filter((s) => !// @ts-expect-error We checked whether it’s an Array already.
|
|
24
|
+
n.value[e.key].includes(s.client))), (i = e == null ? void 0 : e.clients) != null && i.length ? [e] : []);
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return (n = e.find((t) => t.key === "node")) == null || n.clients.unshift({
|
|
31
|
-
description: "An HTTP/1.1 client, written from scratch for Node.js.",
|
|
32
|
-
key: "undici",
|
|
33
|
-
link: "https://github.com/nodejs/undici",
|
|
34
|
-
title: "undici"
|
|
35
|
-
}), H(e, c);
|
|
36
|
-
}), d = {
|
|
37
|
-
node: ["unirest"]
|
|
38
|
-
}, c = k({
|
|
39
|
-
...d === !0 ? {} : d
|
|
40
|
-
}), o = k();
|
|
41
|
-
function E(e) {
|
|
42
|
-
e !== void 0 && (o.value = e, K(u()));
|
|
27
|
+
const r = o(() => h(A(), c)), c = d({}), f = d();
|
|
28
|
+
function j(t) {
|
|
29
|
+
t !== void 0 && (f.value = t, T(u()));
|
|
43
30
|
}
|
|
44
31
|
const u = () => {
|
|
45
|
-
var
|
|
46
|
-
return v(
|
|
47
|
-
targetKey: (
|
|
48
|
-
clientKey: (i = (
|
|
32
|
+
var t, n, e, i;
|
|
33
|
+
return v(f.value) ? f.value : v(y) ? y : {
|
|
34
|
+
targetKey: (t = r.value[0]) == null ? void 0 : t.key,
|
|
35
|
+
clientKey: (i = (e = (n = r.value[0]) == null ? void 0 : n.clients) == null ? void 0 : e[0]) == null ? void 0 : i.client
|
|
49
36
|
};
|
|
50
37
|
};
|
|
51
|
-
function v(
|
|
52
|
-
return
|
|
53
|
-
(n) => n.key ===
|
|
38
|
+
function v(t) {
|
|
39
|
+
return t === void 0 ? !1 : !!r.value.find(
|
|
40
|
+
(n) => n.key === t.targetKey && n.clients.find((e) => e.client === t.clientKey)
|
|
54
41
|
);
|
|
55
42
|
}
|
|
56
43
|
function L() {
|
|
57
|
-
|
|
44
|
+
p(l, u());
|
|
58
45
|
}
|
|
59
|
-
const
|
|
60
|
-
Object.assign(
|
|
61
|
-
...
|
|
62
|
-
...
|
|
46
|
+
const l = m(u()), T = (t) => {
|
|
47
|
+
Object.assign(l, {
|
|
48
|
+
...l,
|
|
49
|
+
...t
|
|
63
50
|
});
|
|
64
|
-
},
|
|
65
|
-
httpClient:
|
|
51
|
+
}, S = () => ({
|
|
52
|
+
httpClient: a(l),
|
|
66
53
|
resetState: L,
|
|
67
|
-
setHttpClient:
|
|
68
|
-
setDefaultHttpClient:
|
|
69
|
-
excludedClients:
|
|
70
|
-
setExcludedClients: (
|
|
71
|
-
c.value =
|
|
54
|
+
setHttpClient: T,
|
|
55
|
+
setDefaultHttpClient: j,
|
|
56
|
+
excludedClients: a(c),
|
|
57
|
+
setExcludedClients: (t) => {
|
|
58
|
+
c.value = t, p(l, u());
|
|
72
59
|
},
|
|
73
|
-
availableTargets:
|
|
74
|
-
getClientTitle:
|
|
75
|
-
getTargetTitle:
|
|
76
|
-
httpTargetTitle:
|
|
77
|
-
httpClientTitle:
|
|
60
|
+
availableTargets: r,
|
|
61
|
+
getClientTitle: K,
|
|
62
|
+
getTargetTitle: C,
|
|
63
|
+
httpTargetTitle: H,
|
|
64
|
+
httpClientTitle: b
|
|
78
65
|
});
|
|
79
66
|
export {
|
|
80
|
-
|
|
81
|
-
|
|
67
|
+
h as filterHiddenClients,
|
|
68
|
+
S as useHttpClientStore
|
|
82
69
|
};
|