@scalar/api-client 2.3.16 → 2.3.18
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 +33 -0
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +9 -9
- package/dist/components/SideNav/SideHelp.vue.js +1 -1
- package/dist/hooks/useClientConfig.d.ts +69 -0
- package/dist/hooks/useClientConfig.d.ts.map +1 -0
- package/dist/hooks/useClientConfig.js +7 -0
- package/dist/hooks/useResponseBody.d.ts +4 -3
- package/dist/hooks/useResponseBody.d.ts.map +1 -1
- package/dist/hooks/useResponseBody.js +15 -15
- package/dist/layouts/App/create-api-client-app.d.ts +34 -34
- package/dist/layouts/Modal/create-api-client-modal.d.ts +68 -68
- package/dist/layouts/Web/create-api-client-web.d.ts +34 -34
- package/dist/libs/create-client.d.ts +34 -34
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/create-client.js +63 -62
- package/dist/libs/hot-keys.d.ts +1 -1
- package/dist/store/collections.d.ts +4 -4
- package/dist/store/request-example.d.ts +2 -2
- package/dist/store/requests.d.ts +4 -4
- package/dist/store/security-schemes.d.ts +10 -10
- package/dist/store/servers.d.ts +4 -4
- package/dist/store/store.d.ts +34 -34
- package/dist/store/tags.d.ts +2 -2
- package/dist/store/workspace.d.ts +4 -4
- package/dist/style.css +1 -1
- package/dist/views/Request/RequestRoot.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestRoot.vue.js +1 -1
- package/dist/views/Request/RequestRoot.vue2.js +67 -66
- package/dist/views/Request/RequestSection/RequestBody.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestBody.vue2.js +1 -1
- package/dist/views/Request/RequestSection/RequestTable.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestTable.vue2.js +5 -5
- package/dist/views/Request/ResponseSection/ResponseBody.vue.js +2 -2
- package/dist/views/Request/ResponseSection/ResponseBody.vue2.js +31 -31
- package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue.js +20 -20
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +116 -116
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# @scalar/api-client
|
|
2
2
|
|
|
3
|
+
## 2.3.18
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 5b19c90: refactor(components): cleanup old icons in Scalar components
|
|
8
|
+
- Updated dependencies [5b19c90]
|
|
9
|
+
- Updated dependencies [9def02e]
|
|
10
|
+
- Updated dependencies [f705230]
|
|
11
|
+
- Updated dependencies [3745d77]
|
|
12
|
+
- @scalar/components@0.13.47
|
|
13
|
+
- @scalar/types@0.1.7
|
|
14
|
+
- @scalar/use-codemirror@0.11.92
|
|
15
|
+
- @scalar/oas-utils@0.2.130
|
|
16
|
+
- @scalar/openapi-parser@0.10.14
|
|
17
|
+
- @scalar/snippetz@0.2.19
|
|
18
|
+
- @scalar/themes@0.9.86
|
|
19
|
+
- @scalar/import@0.3.13
|
|
20
|
+
- @scalar/postman-to-openapi@0.2.3
|
|
21
|
+
- @scalar/use-hooks@0.1.40
|
|
22
|
+
|
|
23
|
+
## 2.3.17
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- Updated dependencies [8720ae7]
|
|
28
|
+
- @scalar/themes@0.9.85
|
|
29
|
+
- @scalar/components@0.13.46
|
|
30
|
+
- @scalar/oas-utils@0.2.129
|
|
31
|
+
- @scalar/use-codemirror@0.11.91
|
|
32
|
+
- @scalar/use-hooks@0.1.39
|
|
33
|
+
- @scalar/import@0.3.12
|
|
34
|
+
- @scalar/postman-to-openapi@0.2.2
|
|
35
|
+
|
|
3
36
|
## 2.3.16
|
|
4
37
|
|
|
5
38
|
### Patch Changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as G, ref as R, computed as k, watch as D, openBlock as n, createBlock as
|
|
1
|
+
import { defineComponent as G, ref as R, computed as k, watch as D, openBlock as n, createBlock as _, unref as s, withCtx as v, createElementVNode as w, createVNode as C, createTextVNode as f, createElementBlock as u, Fragment as g, toDisplayString as V, createCommentVNode as H } from "vue";
|
|
2
2
|
import { useLoadingState as K, ScalarButton as T, ScalarIcon as Q, ScalarTooltip as X, ScalarCodeBlock as Z } from "@scalar/components";
|
|
3
3
|
import { useToasts as ee } from "@scalar/use-toasts";
|
|
4
4
|
import { useRouter as te } from "vue-router";
|
|
@@ -7,7 +7,7 @@ import { useActiveEntities as ae } from "../../store/active-entities.js";
|
|
|
7
7
|
import le from "./CommandActionForm.vue.js";
|
|
8
8
|
import ne from "./CommandActionInput.vue.js";
|
|
9
9
|
import re from "./WatchModeToggle.vue.js";
|
|
10
|
-
import { isPostmanCollection as
|
|
10
|
+
import { isPostmanCollection as S, getPostmanDocumentDetails as ie, convertPostmanToOpenApi as F } from "../../libs/postman.js";
|
|
11
11
|
import { getOpenApiDocumentDetails as se } from "../../libs/getOpenApiDocumentDetails.js";
|
|
12
12
|
import { isUrl as U } from "../../libs/isUrl.js";
|
|
13
13
|
import { useFileDialog as ce } from "../../hooks/useFileDialog.js";
|
|
@@ -23,7 +23,7 @@ const me = { class: "flex justify-between" }, de = { class: "flex w-full flex-ro
|
|
|
23
23
|
__name: "CommandPaletteImport",
|
|
24
24
|
emits: ["close", "back"],
|
|
25
25
|
setup(ye, { emit: N }) {
|
|
26
|
-
const P = N, $ = te(), { activeWorkspace: m, activeCollection: B } = ae(), { importSpecFile: b, importSpecFromUrl: W, events: j } = ue(), { toast: d } = ee(), p = K(), a = R(""), y = R(!0), i = k(() =>
|
|
26
|
+
const P = N, $ = te(), { activeWorkspace: m, activeCollection: B } = ae(), { importSpecFile: b, importSpecFromUrl: W, events: j } = ue(), { toast: d } = ee(), p = K(), a = R(""), y = R(!0), i = k(() => S(a.value) ? ie(a.value) : se(a.value)), A = k(
|
|
27
27
|
() => i.value ? i.value.type : "json"
|
|
28
28
|
);
|
|
29
29
|
function x(t) {
|
|
@@ -45,7 +45,7 @@ const me = { class: "flex justify-between" }, de = { class: "flex w-full flex-ro
|
|
|
45
45
|
var c, L, O;
|
|
46
46
|
const o = (c = I.target) == null ? void 0 : c.result;
|
|
47
47
|
try {
|
|
48
|
-
if (
|
|
48
|
+
if (S(o)) {
|
|
49
49
|
const l = await b(
|
|
50
50
|
await F(o),
|
|
51
51
|
((L = m.value) == null ? void 0 : L.uid) ?? ""
|
|
@@ -98,7 +98,7 @@ const me = { class: "flex justify-between" }, de = { class: "flex w-full flex-ro
|
|
|
98
98
|
return;
|
|
99
99
|
}
|
|
100
100
|
} else if (z.value)
|
|
101
|
-
if (
|
|
101
|
+
if (S(a.value)) {
|
|
102
102
|
const o = await b(
|
|
103
103
|
await F(a.value),
|
|
104
104
|
((r = m.value) == null ? void 0 : r.uid) ?? ""
|
|
@@ -137,7 +137,7 @@ const me = { class: "flex justify-between" }, de = { class: "flex w-full flex-ro
|
|
|
137
137
|
}
|
|
138
138
|
a.value = t;
|
|
139
139
|
};
|
|
140
|
-
return (t, e) => (n(),
|
|
140
|
+
return (t, e) => (n(), _(le, {
|
|
141
141
|
disabled: !a.value.trim(),
|
|
142
142
|
loading: s(p),
|
|
143
143
|
onSubmit: J
|
|
@@ -153,7 +153,7 @@ const me = { class: "flex justify-between" }, de = { class: "flex w-full flex-ro
|
|
|
153
153
|
e[5] || (e[5] = f(" JSON, or YAML File ")),
|
|
154
154
|
C(s(Q), {
|
|
155
155
|
class: "text-c-3",
|
|
156
|
-
icon: "
|
|
156
|
+
icon: "Upload",
|
|
157
157
|
size: "md"
|
|
158
158
|
})
|
|
159
159
|
]),
|
|
@@ -198,7 +198,7 @@ const me = { class: "flex justify-between" }, de = { class: "flex w-full flex-ro
|
|
|
198
198
|
], 64))
|
|
199
199
|
]),
|
|
200
200
|
default: v(() => [
|
|
201
|
-
!i.value || s(U)(a.value) ? (n(),
|
|
201
|
+
!i.value || s(U)(a.value) ? (n(), _(ne, {
|
|
202
202
|
key: 0,
|
|
203
203
|
modelValue: a.value,
|
|
204
204
|
placeholder: "OpenAPI/Swagger/Postman URL or cURL",
|
|
@@ -218,7 +218,7 @@ const me = { class: "flex justify-between" }, de = { class: "flex w-full flex-ro
|
|
|
218
218
|
_: 1
|
|
219
219
|
})
|
|
220
220
|
]),
|
|
221
|
-
i.value && !s(U)(a.value) ? (n(),
|
|
221
|
+
i.value && !s(U)(a.value) ? (n(), _(s(Z), {
|
|
222
222
|
key: 0,
|
|
223
223
|
class: "bg-b-2 mt-1 max-h-[40dvh] rounded border [--scalar-small:--scalar-font-size-4]",
|
|
224
224
|
content: a.value,
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { type ApiClientConfiguration } from '@scalar/types/api-reference';
|
|
2
|
+
import { type InjectionKey, type Ref } from 'vue';
|
|
3
|
+
export declare const CLIENT_CONFIGURATION_SYMBOL: InjectionKey<Ref<ApiClientConfiguration>>;
|
|
4
|
+
/** Hook for easy access to the reference configuration */
|
|
5
|
+
export declare const useClientConfig: () => Ref<{
|
|
6
|
+
hideClientButton: boolean;
|
|
7
|
+
showSidebar: boolean;
|
|
8
|
+
theme: "alternate" | "default" | "moon" | "purple" | "solarized" | "bluePlanet" | "deepSpace" | "saturn" | "kepler" | "elysiajs" | "fastify" | "mars" | "none";
|
|
9
|
+
url?: string | undefined;
|
|
10
|
+
content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
|
|
11
|
+
title?: string | undefined;
|
|
12
|
+
slug?: string | undefined;
|
|
13
|
+
spec?: {
|
|
14
|
+
url?: string | undefined;
|
|
15
|
+
content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
|
|
16
|
+
title?: string | undefined;
|
|
17
|
+
slug?: string | undefined;
|
|
18
|
+
} | undefined;
|
|
19
|
+
authentication?: any;
|
|
20
|
+
baseServerURL?: string | undefined;
|
|
21
|
+
proxyUrl?: string | undefined;
|
|
22
|
+
searchHotKey?: "c" | "r" | "o" | "n" | "a" | "b" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "p" | "q" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | undefined;
|
|
23
|
+
servers?: any[] | undefined;
|
|
24
|
+
_integration?: "go" | "elysiajs" | "fastify" | "adonisjs" | "docusaurus" | "dotnet" | "express" | "fastapi" | "hono" | "html" | "laravel" | "litestar" | "nestjs" | "nextjs" | "nitro" | "nuxt" | "platformatic" | "react" | "rust" | "vue" | null | undefined;
|
|
25
|
+
onRequestSent?: ((args_0: string, ...args: unknown[]) => void) | undefined;
|
|
26
|
+
}, {
|
|
27
|
+
hideClientButton: boolean;
|
|
28
|
+
showSidebar: boolean;
|
|
29
|
+
theme: "alternate" | "default" | "moon" | "purple" | "solarized" | "bluePlanet" | "deepSpace" | "saturn" | "kepler" | "elysiajs" | "fastify" | "mars" | "none";
|
|
30
|
+
url?: string | undefined;
|
|
31
|
+
content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
|
|
32
|
+
title?: string | undefined;
|
|
33
|
+
slug?: string | undefined;
|
|
34
|
+
spec?: {
|
|
35
|
+
url?: string | undefined;
|
|
36
|
+
content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
|
|
37
|
+
title?: string | undefined;
|
|
38
|
+
slug?: string | undefined;
|
|
39
|
+
} | undefined;
|
|
40
|
+
authentication?: any;
|
|
41
|
+
baseServerURL?: string | undefined;
|
|
42
|
+
proxyUrl?: string | undefined;
|
|
43
|
+
searchHotKey?: "c" | "r" | "o" | "n" | "a" | "b" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "p" | "q" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | undefined;
|
|
44
|
+
servers?: any[] | undefined;
|
|
45
|
+
_integration?: "go" | "elysiajs" | "fastify" | "adonisjs" | "docusaurus" | "dotnet" | "express" | "fastapi" | "hono" | "html" | "laravel" | "litestar" | "nestjs" | "nextjs" | "nitro" | "nuxt" | "platformatic" | "react" | "rust" | "vue" | null | undefined;
|
|
46
|
+
onRequestSent?: ((args_0: string, ...args: unknown[]) => void) | undefined;
|
|
47
|
+
} | {
|
|
48
|
+
hideClientButton: boolean;
|
|
49
|
+
showSidebar: boolean;
|
|
50
|
+
theme: "alternate" | "default" | "moon" | "purple" | "solarized" | "bluePlanet" | "deepSpace" | "saturn" | "kepler" | "elysiajs" | "fastify" | "mars" | "none";
|
|
51
|
+
url?: string | undefined;
|
|
52
|
+
content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
|
|
53
|
+
title?: string | undefined;
|
|
54
|
+
slug?: string | undefined;
|
|
55
|
+
spec?: {
|
|
56
|
+
url?: string | undefined;
|
|
57
|
+
content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
|
|
58
|
+
title?: string | undefined;
|
|
59
|
+
slug?: string | undefined;
|
|
60
|
+
} | undefined;
|
|
61
|
+
authentication?: any;
|
|
62
|
+
baseServerURL?: string | undefined;
|
|
63
|
+
proxyUrl?: string | undefined;
|
|
64
|
+
searchHotKey?: "c" | "r" | "o" | "n" | "a" | "b" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "p" | "q" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | undefined;
|
|
65
|
+
servers?: any[] | undefined;
|
|
66
|
+
_integration?: "go" | "elysiajs" | "fastify" | "adonisjs" | "docusaurus" | "dotnet" | "express" | "fastapi" | "hono" | "html" | "laravel" | "litestar" | "nestjs" | "nextjs" | "nitro" | "nuxt" | "platformatic" | "react" | "rust" | "vue" | null | undefined;
|
|
67
|
+
onRequestSent?: ((args_0: string, ...args: unknown[]) => void) | undefined;
|
|
68
|
+
}>;
|
|
69
|
+
//# sourceMappingURL=useClientConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useClientConfig.d.ts","sourceRoot":"","sources":["../../src/hooks/useClientConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,KAAK,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AACvG,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,GAAG,EAAe,MAAM,KAAK,CAAA;AAE9D,eAAO,MAAM,2BAA2B,EAAe,YAAY,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC,CAAA;AAEhG,0DAA0D;AAC1D,eAAO,MAAM,eAAe;;;;;+CAC+9O,GAAG;;;;;mDAA8N,GAAG;;;;;;;;;;sCAAgwB,GAAI;;;;;;+CAAx+B,GAAG;;;;WAAoJ,CAAC;eAAqC,CAAC,mCAAmC,GAAG;aAA0E,CAAC;YAAkC,CAAC;;;;;;;;sCAAkpB,GAAI;;;;;;+CAAx+B,GAAG;;;;;mDAA8N,GAAG;;;;;;;;;;sCAAgwB,GAAI;EAD92Q,CAAA"}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import MimeType from 'whatwg-mimetype';
|
|
2
|
+
import type { Ref } from 'vue';
|
|
2
3
|
/**
|
|
3
4
|
* Processes the response body of an HTTP request.
|
|
4
5
|
* Extracts MIME type, attachment filename, and generates a data URL.
|
|
5
6
|
*/
|
|
6
7
|
export declare function useResponseBody(props: {
|
|
7
|
-
data: unknown
|
|
8
|
-
headers: {
|
|
8
|
+
data: Ref<unknown>;
|
|
9
|
+
headers: Ref<{
|
|
9
10
|
name: string;
|
|
10
11
|
value: string;
|
|
11
12
|
required: boolean;
|
|
12
|
-
}[]
|
|
13
|
+
}[]>;
|
|
13
14
|
}): {
|
|
14
15
|
mimeType: import("vue").ComputedRef<MimeType>;
|
|
15
16
|
attachmentFilename: import("vue").ComputedRef<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useResponseBody.d.ts","sourceRoot":"","sources":["../../src/hooks/useResponseBody.ts"],"names":[],"mappings":"AAEA,OAAO,QAAQ,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"useResponseBody.d.ts","sourceRoot":"","sources":["../../src/hooks/useResponseBody.ts"],"names":[],"mappings":"AAEA,OAAO,QAAQ,MAAM,iBAAiB,CAAA;AACtC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAE9B;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE;IACrC,IAAI,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;IAClB,OAAO,EAAE,GAAG,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,EAAE,CAAC,CAAA;CACnE;;;;EAmCA"}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { extractFilename as
|
|
2
|
-
import { computed as
|
|
3
|
-
import
|
|
4
|
-
function
|
|
5
|
-
const
|
|
1
|
+
import { extractFilename as v } from "../libs/extractAttachmentFilename.js";
|
|
2
|
+
import { computed as r, isRef as i } from "vue";
|
|
3
|
+
import m from "whatwg-mimetype";
|
|
4
|
+
function b(t) {
|
|
5
|
+
const l = (a) => a instanceof Blob, e = r(() => i(t.data) ? t.data.value : t.data), c = r(() => i(t.headers) ? t.headers.value : t.headers), o = r(() => {
|
|
6
6
|
var n;
|
|
7
|
-
const
|
|
8
|
-
return new
|
|
9
|
-
}),
|
|
7
|
+
const a = ((n = c.value.find((u) => u.name.toLowerCase() === "content-type")) == null ? void 0 : n.value) ?? "";
|
|
8
|
+
return new m(a);
|
|
9
|
+
}), s = r(() => {
|
|
10
10
|
var n;
|
|
11
|
-
const
|
|
12
|
-
return
|
|
13
|
-
}),
|
|
14
|
-
new Blob([JSON.stringify(e.
|
|
15
|
-
type:
|
|
11
|
+
const a = ((n = c.value.find((u) => u.name.toLowerCase() === "content-disposition")) == null ? void 0 : n.value) ?? "";
|
|
12
|
+
return v(a);
|
|
13
|
+
}), f = r(() => l(e.value) ? URL.createObjectURL(e.value) : typeof e.value == "string" ? URL.createObjectURL(new Blob([e.value], { type: o.value.toString() })) : e.value instanceof Object && Object.keys(e.value).length ? URL.createObjectURL(
|
|
14
|
+
new Blob([JSON.stringify(e.value)], {
|
|
15
|
+
type: o.value.toString()
|
|
16
16
|
})
|
|
17
17
|
) : "");
|
|
18
|
-
return { mimeType:
|
|
18
|
+
return { mimeType: o, attachmentFilename: s, dataUrl: f };
|
|
19
19
|
}
|
|
20
20
|
export {
|
|
21
|
-
|
|
21
|
+
b as useResponseBody
|
|
22
22
|
};
|