@scalar/api-reference 1.25.48 → 1.25.49
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 +22 -0
- package/dist/browser/standalone.js +13698 -13755
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
- package/dist/components/ApiReferenceLayout.vue.js +1 -1
- package/dist/components/ApiReferenceLayout.vue2.js +136 -137
- package/dist/components/Content/Operation/TestRequestButton.vue.d.ts.map +1 -1
- package/dist/components/Content/Operation/TestRequestButton.vue.js +2 -2
- package/dist/components/Content/Operation/TestRequestButton.vue2.js +18 -17
- package/dist/components/DarkModeToggle/DarkModeToggle.vue.d.ts.map +1 -1
- package/dist/components/DarkModeToggle/DarkModeToggle.vue.js +1 -1
- package/dist/components/DarkModeToggle/DarkModeToggle.vue2.js +12 -11
- package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/Sidebar.vue.js +2 -2
- package/dist/components/Sidebar/Sidebar.vue2.js +146 -142
- package/dist/components/Sidebar/SidebarElement.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarElement.vue.js +1 -1
- package/dist/components/Sidebar/SidebarElement.vue2.js +37 -35
- package/dist/embeds/OpenApiDocument/OpenApiDocument.vue.d.ts.map +1 -1
- package/dist/{components → features/ApiClientModal}/ApiClientModal.vue.d.ts +3 -3
- package/dist/features/ApiClientModal/ApiClientModal.vue.d.ts.map +1 -0
- package/dist/features/ApiClientModal/ApiClientModal.vue.js +49 -0
- package/dist/features/ApiClientModal/index.d.ts +3 -0
- package/dist/features/ApiClientModal/index.d.ts.map +1 -0
- package/dist/features/ApiClientModal/useApiClient.d.ts +7734 -0
- package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -0
- package/dist/features/ApiClientModal/useApiClient.js +23 -0
- package/dist/features/BaseUrl/ServerUrlSelect.vue.d.ts.map +1 -1
- package/dist/features/BaseUrl/ServerUrlSelect.vue.js +2 -2
- package/dist/features/BaseUrl/ServerUrlSelect.vue2.js +10 -7
- package/dist/features/Search/SearchButton.vue.d.ts.map +1 -1
- package/dist/features/Search/SearchButton.vue.js +2 -2
- package/dist/features/Search/SearchButton.vue2.js +16 -20
- package/dist/helpers/index.d.ts +0 -1
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/hooks/useSidebar.d.ts.map +1 -1
- package/dist/hooks/useSidebar.js +148 -155
- package/dist/index.js +43 -45
- package/dist/legacy/components/SecurityScheme.vue.d.ts.map +1 -1
- package/dist/legacy/components/SecurityScheme.vue.js +2 -2
- package/dist/legacy/components/SecurityScheme.vue2.js +111 -115
- package/dist/legacy/components/SecuritySchemeSelector.vue.d.ts.map +1 -1
- package/dist/legacy/components/SecuritySchemeSelector.vue.js +1 -1
- package/dist/legacy/components/SecuritySchemeSelector.vue2.js +46 -36
- package/dist/legacy/helpers/index.d.ts +1 -1
- package/dist/legacy/stores/index.d.ts +1 -2
- package/dist/legacy/stores/index.d.ts.map +1 -1
- package/dist/legacy/stores/useOpenApiStore.js +4 -18
- package/dist/style.css +1 -1
- package/package.json +11 -11
- package/dist/components/ApiClientModal.vue.d.ts.map +0 -1
- package/dist/components/ApiClientModal.vue.js +0 -64
- package/dist/components/api-client-bus.d.ts +0 -22
- package/dist/components/api-client-bus.d.ts.map +0 -1
- package/dist/components/api-client-bus.js +0 -6
- package/dist/helpers/openClientFor.d.ts +0 -7
- package/dist/helpers/openClientFor.d.ts.map +0 -1
- package/dist/helpers/openClientFor.js +0 -19
- package/dist/legacy/helpers/createPlaceholderRequest.js +0 -14
- package/dist/legacy/stores/useApiClientStore.d.ts +0 -18
- package/dist/legacy/stores/useApiClientStore.d.ts.map +0 -1
- package/dist/legacy/stores/useApiClientStore.js +0 -32
- package/dist/legacy/stores/useRequestStore.js +0 -33
- /package/dist/{components → features/ApiClientModal}/ApiClientModal.vue2.js +0 -0
package/package.json
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"vue",
|
|
21
21
|
"vue3"
|
|
22
22
|
],
|
|
23
|
-
"version": "1.25.
|
|
23
|
+
"version": "1.25.49",
|
|
24
24
|
"engines": {
|
|
25
25
|
"node": ">=18"
|
|
26
26
|
},
|
|
@@ -52,16 +52,16 @@
|
|
|
52
52
|
"httpsnippet-lite": "^3.0.5",
|
|
53
53
|
"nanoid": "^5.0.7",
|
|
54
54
|
"vue": "^3.5.12",
|
|
55
|
-
"@scalar/api-client": "2.1.
|
|
56
|
-
"@scalar/oas-utils": "0.2.60",
|
|
55
|
+
"@scalar/api-client": "2.1.34",
|
|
57
56
|
"@scalar/code-highlight": "0.0.14",
|
|
58
|
-
"@scalar/components": "0.12.
|
|
59
|
-
"@scalar/openapi-parser": "0.8.
|
|
60
|
-
"@scalar/themes": "0.9.41",
|
|
61
|
-
"@scalar/snippetz": "0.2.4",
|
|
62
|
-
"@scalar/types": "0.0.17",
|
|
57
|
+
"@scalar/components": "0.12.60",
|
|
58
|
+
"@scalar/openapi-parser": "0.8.8",
|
|
63
59
|
"@scalar/openapi-types": "0.1.4",
|
|
60
|
+
"@scalar/oas-utils": "0.2.61",
|
|
61
|
+
"@scalar/snippetz": "0.2.4",
|
|
62
|
+
"@scalar/themes": "0.9.42",
|
|
64
63
|
"@scalar/use-toasts": "0.7.7",
|
|
64
|
+
"@scalar/types": "0.0.17",
|
|
65
65
|
"@scalar/use-tooltip": "1.0.3"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
@@ -83,13 +83,13 @@
|
|
|
83
83
|
"storybook-dark-mode": "^4.0.1",
|
|
84
84
|
"tailwindcss": "^3.4.4",
|
|
85
85
|
"type-fest": "^4.20.0",
|
|
86
|
-
"vite": "^5.
|
|
86
|
+
"vite": "^5.4.9",
|
|
87
87
|
"vite-plugin-banner": "^0.7.1",
|
|
88
88
|
"vite-plugin-css-injected-by-js": "^3.4.0",
|
|
89
89
|
"vitest": "^1.6.0",
|
|
90
90
|
"vitest-matchmedia-mock": "^1.0.5",
|
|
91
|
-
"@scalar/
|
|
92
|
-
"@scalar/
|
|
91
|
+
"@scalar/galaxy": "0.2.13",
|
|
92
|
+
"@scalar/build-tooling": "0.1.11"
|
|
93
93
|
},
|
|
94
94
|
"scripts": {
|
|
95
95
|
"analyze:default": "pnpm dlx vite-bundle-visualizer",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ApiClientModal.vue.d.ts","sourceRoot":"","sources":["../../src/components/ApiClientModal.vue"],"names":[],"mappings":"AAuFA,OAAO,KAAK,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;;eAQtD,MAAM;8BACS,MAAM,GAAG,IAAI;WAChC,iBAAiB;cACd,IAAI,CAAC,SAAS,CAAC;;eAHd,MAAM;8BACS,MAAM,GAAG,IAAI;WAChC,iBAAiB;cACd,IAAI,CAAC,SAAS,CAAC;;AA2G3B,wBAMG"}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { defineComponent as x, ref as c, onMounted as U, watch as l, onBeforeUnmount as _, openBlock as A, createElementBlock as B } from "vue";
|
|
2
|
-
import { modalStateBus as C, apiClientBus as k } from "./api-client-bus.js";
|
|
3
|
-
import { useServerStore as M } from "../legacy/stores/useServerStore.js";
|
|
4
|
-
import { getUrlFromServerState as w } from "../legacy/helpers/getUrlFromServerState.js";
|
|
5
|
-
const b = /* @__PURE__ */ x({
|
|
6
|
-
__name: "ApiClientModal",
|
|
7
|
-
props: {
|
|
8
|
-
proxyUrl: {},
|
|
9
|
-
preferredSecurityScheme: {},
|
|
10
|
-
spec: {},
|
|
11
|
-
servers: {}
|
|
12
|
-
},
|
|
13
|
-
setup(i) {
|
|
14
|
-
const p = i, a = c(null), o = c(null), { server: u, setServer: d } = M();
|
|
15
|
-
return U(async () => {
|
|
16
|
-
if (!a.value) return;
|
|
17
|
-
const { createApiClientModal: e } = await import("@scalar/api-client"), {
|
|
18
|
-
app: r,
|
|
19
|
-
open: f,
|
|
20
|
-
updateAuth: m,
|
|
21
|
-
modalState: S,
|
|
22
|
-
updateSpec: n,
|
|
23
|
-
updateServer: v,
|
|
24
|
-
onUpdateServer: h
|
|
25
|
-
} = await e(a.value, {
|
|
26
|
-
spec: p.spec ?? {},
|
|
27
|
-
preferredSecurityScheme: p.preferredSecurityScheme,
|
|
28
|
-
proxyUrl: p.proxyUrl,
|
|
29
|
-
servers: p.servers
|
|
30
|
-
});
|
|
31
|
-
o.value = {
|
|
32
|
-
// @ts-expect-error not sure what the beef with app is, possible router related
|
|
33
|
-
app: r,
|
|
34
|
-
updateSpec: n,
|
|
35
|
-
updateServer: v
|
|
36
|
-
}, C.emit(S), h((t) => {
|
|
37
|
-
if (!u.servers) return;
|
|
38
|
-
const s = u.servers.findIndex((y) => y.url === t);
|
|
39
|
-
s >= 0 && d({ selectedServer: s });
|
|
40
|
-
}), k.on((t) => {
|
|
41
|
-
t.open && f(t.open), t.updateSpec && n(t.updateSpec), t.updateAuth && m(t.updateAuth);
|
|
42
|
-
});
|
|
43
|
-
}), l(u, (e) => {
|
|
44
|
-
const r = w(e);
|
|
45
|
-
r && o.value && o.value.updateServer(r);
|
|
46
|
-
}), l(
|
|
47
|
-
() => p.spec,
|
|
48
|
-
(e) => {
|
|
49
|
-
var r;
|
|
50
|
-
return e && ((r = o.value) == null ? void 0 : r.updateSpec(e));
|
|
51
|
-
},
|
|
52
|
-
{ deep: !0 }
|
|
53
|
-
), _(() => {
|
|
54
|
-
var e;
|
|
55
|
-
return (e = o.value) == null ? void 0 : e.app.unmount();
|
|
56
|
-
}), (e, r) => (A(), B("div", {
|
|
57
|
-
ref_key: "el",
|
|
58
|
-
ref: a
|
|
59
|
-
}, null, 512));
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
export {
|
|
63
|
-
b as default
|
|
64
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { ApiClient, OpenClientPayload } from '@scalar/api-client/libs';
|
|
2
|
-
import type { SpecConfiguration } from '@scalar/types/legacy';
|
|
3
|
-
import type { RequireAtLeastOne } from 'type-fest';
|
|
4
|
-
type ApiClientEvents = RequireAtLeastOne<{
|
|
5
|
-
open?: OpenClientPayload;
|
|
6
|
-
updateAuth?: Parameters<ApiClient['updateAuth']>[0];
|
|
7
|
-
updateSpec?: SpecConfiguration;
|
|
8
|
-
}>;
|
|
9
|
-
/**
|
|
10
|
-
* Event bus for controlling the Api Client
|
|
11
|
-
*
|
|
12
|
-
* There is a limitation in useEventBus with mapping the event with the payload type. This is a workaround, however
|
|
13
|
-
* doing it this way allows us to "fire" multiple events at the same time which is actually kind of nice
|
|
14
|
-
*/
|
|
15
|
-
export declare const apiClientBus: import("@vueuse/core").UseEventBusReturn<ApiClientEvents, any>;
|
|
16
|
-
export declare const modalStateBus: import("@vueuse/core").UseEventBusReturn<{
|
|
17
|
-
open: boolean;
|
|
18
|
-
show: () => void;
|
|
19
|
-
hide: () => void;
|
|
20
|
-
}, any>;
|
|
21
|
-
export {};
|
|
22
|
-
//# sourceMappingURL=api-client-bus.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api-client-bus.d.ts","sourceRoot":"","sources":["../../src/components/api-client-bus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAE3E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAE7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAElD,KAAK,eAAe,GAAG,iBAAiB,CAAC;IACvC,IAAI,CAAC,EAAE,iBAAiB,CAAA;IACxB,UAAU,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IACnD,UAAU,CAAC,EAAE,iBAAiB,CAAA;CAC/B,CAAC,CAAA;AAIF;;;;;GAKG;AACH,eAAO,MAAM,YAAY,gEAA+B,CAAA;AACxD,eAAO,MAAM,aAAa;;;;OAAyC,CAAA"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { OpenAPIV3 } from '@scalar/openapi-types';
|
|
2
|
-
import type { TransformedOperation } from '@scalar/types/legacy';
|
|
3
|
-
/**
|
|
4
|
-
* Prepares all the data to open the API client for a specific operation.
|
|
5
|
-
*/
|
|
6
|
-
export declare function openClientFor(operation: TransformedOperation, globalSecurity?: OpenAPIV3.SecurityRequirementObject[]): void;
|
|
7
|
-
//# sourceMappingURL=openClientFor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"openClientFor.d.ts","sourceRoot":"","sources":["../../src/helpers/openClientFor.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAWhE;;GAEG;AACH,wBAAgB,aAAa,CAC3B,SAAS,EAAE,oBAAoB,EAC/B,cAAc,CAAC,EAAE,SAAS,CAAC,yBAAyB,EAAE,QAuBvD"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { useServerStore as r } from "../legacy/stores/useServerStore.js";
|
|
2
|
-
import { useApiClientStore as s } from "../legacy/stores/useApiClientStore.js";
|
|
3
|
-
import { getApiClientRequest as i } from "./getApiClientRequest.js";
|
|
4
|
-
import { useRequestStore as n } from "../legacy/stores/useRequestStore.js";
|
|
5
|
-
import { useOpenApiStore as u } from "../legacy/stores/useOpenApiStore.js";
|
|
6
|
-
const { server: l } = r(), { setOperation: p, setGlobalSecurity: c } = u(), { toggleApiClient: m } = s(), { setActiveRequest: S, resetActiveResponse: a } = n();
|
|
7
|
-
function C(e, o) {
|
|
8
|
-
const t = i({
|
|
9
|
-
serverState: l,
|
|
10
|
-
operation: e,
|
|
11
|
-
// Let the API client handle the authentication.
|
|
12
|
-
authenticationState: null,
|
|
13
|
-
globalSecurity: null
|
|
14
|
-
});
|
|
15
|
-
a(), S(t), p(e), c(o), m(t, !0);
|
|
16
|
-
}
|
|
17
|
-
export {
|
|
18
|
-
C as openClientFor
|
|
19
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
declare function toggleApiClient(item?: any, forceShow?: boolean): void;
|
|
2
|
-
declare function hideApiClient(): void;
|
|
3
|
-
declare function setActiveApiClientEndpointId(id: string): void;
|
|
4
|
-
declare function setSnippetType(type: string): void;
|
|
5
|
-
export declare const useApiClientStore: () => {
|
|
6
|
-
state: {
|
|
7
|
-
readonly showApiClient: boolean;
|
|
8
|
-
readonly activeApiClientEndpointId: string;
|
|
9
|
-
readonly activeItem: any;
|
|
10
|
-
readonly snippetType: string;
|
|
11
|
-
};
|
|
12
|
-
toggleApiClient: typeof toggleApiClient;
|
|
13
|
-
setActiveApiClientEndpointId: typeof setActiveApiClientEndpointId;
|
|
14
|
-
setSnippetType: typeof setSnippetType;
|
|
15
|
-
hideApiClient: typeof hideApiClient;
|
|
16
|
-
};
|
|
17
|
-
export {};
|
|
18
|
-
//# sourceMappingURL=useApiClientStore.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useApiClientStore.d.ts","sourceRoot":"","sources":["../../../src/legacy/stores/useApiClientStore.ts"],"names":[],"mappings":"AAoBA,iBAAS,eAAe,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,SAAS,UAAQ,QASrD;AAED,iBAAS,aAAa,SAErB;AAED,iBAAS,4BAA4B,CAAC,EAAE,EAAE,MAAM,QAE/C;AAED,iBAAS,cAAc,CAAC,IAAI,EAAE,MAAM,QAEnC;AAED,eAAO,MAAM,iBAAiB;;gCAxCb,OAAO;4CACK,MAAM;6BACrB,GAAG;8BACF,MAAM;;;;;;CA2CnB,CAAA"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { reactive as n, readonly as p } from "vue";
|
|
2
|
-
function o() {
|
|
3
|
-
return {
|
|
4
|
-
showApiClient: !1,
|
|
5
|
-
activeApiClientEndpointId: "",
|
|
6
|
-
activeItem: {},
|
|
7
|
-
snippetType: "javascript"
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
const t = n(o());
|
|
11
|
-
function s(e, i = !1) {
|
|
12
|
-
i ? t.showApiClient = !0 : t.showApiClient = !t.showApiClient, e && (t.activeItem = e);
|
|
13
|
-
}
|
|
14
|
-
function l() {
|
|
15
|
-
t.showApiClient = !1;
|
|
16
|
-
}
|
|
17
|
-
function a(e) {
|
|
18
|
-
t.activeApiClientEndpointId = e;
|
|
19
|
-
}
|
|
20
|
-
function c(e) {
|
|
21
|
-
t.snippetType = e;
|
|
22
|
-
}
|
|
23
|
-
const A = () => ({
|
|
24
|
-
state: p(t),
|
|
25
|
-
toggleApiClient: s,
|
|
26
|
-
setActiveApiClientEndpointId: a,
|
|
27
|
-
setSnippetType: c,
|
|
28
|
-
hideApiClient: l
|
|
29
|
-
});
|
|
30
|
-
export {
|
|
31
|
-
A as useApiClientStore
|
|
32
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { reactive as u, ref as n, computed as d } from "vue";
|
|
2
|
-
import { createPlaceholderRequest as p } from "../helpers/createPlaceholderRequest.js";
|
|
3
|
-
const o = u({}), a = n([]), s = n(""), r = u(p()), l = (e) => {
|
|
4
|
-
o[e.responseId] = e, s.value = e.responseId, a.value.unshift(e.responseId);
|
|
5
|
-
}, v = (e) => {
|
|
6
|
-
var i;
|
|
7
|
-
s.value = e;
|
|
8
|
-
const t = (i = o[e]) == null ? void 0 : i.request, c = JSON.parse(JSON.stringify(t));
|
|
9
|
-
c.body = JSON.stringify((t == null ? void 0 : t.body) ?? "", null, 2), Object.assign(r, c);
|
|
10
|
-
}, q = d(
|
|
11
|
-
() => {
|
|
12
|
-
var e;
|
|
13
|
-
return s.value ? (e = o[s.value ?? ""]) == null ? void 0 : e.response : null;
|
|
14
|
-
}
|
|
15
|
-
), R = (e) => {
|
|
16
|
-
Object.assign(r, e);
|
|
17
|
-
}, y = () => {
|
|
18
|
-
s.value = "";
|
|
19
|
-
}, O = n(!0), b = () => ({
|
|
20
|
-
readOnly: O,
|
|
21
|
-
activeRequest: r,
|
|
22
|
-
activeResponse: q,
|
|
23
|
-
requestHistory: o,
|
|
24
|
-
requestHistoryOrder: a,
|
|
25
|
-
activeRequestId: s,
|
|
26
|
-
setActiveResponse: v,
|
|
27
|
-
resetActiveResponse: y,
|
|
28
|
-
addRequestToHistory: l,
|
|
29
|
-
setActiveRequest: R
|
|
30
|
-
});
|
|
31
|
-
export {
|
|
32
|
-
b as useRequestStore
|
|
33
|
-
};
|
|
File without changes
|