@scalar/api-reference 1.25.115 → 1.25.118
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 +76 -0
- package/dist/browser/standalone.js +15973 -15829
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiReferenceLayout.vue.js +2 -2
- package/dist/components/ApiReferenceLayout.vue2.js +1 -1
- package/dist/components/Content/Introduction/Introduction.vue.d.ts.map +1 -1
- package/dist/components/Content/Introduction/Introduction.vue.js +1 -1
- package/dist/components/Content/Introduction/Introduction.vue2.js +39 -38
- package/dist/components/Content/Lazy/Loading.vue.d.ts.map +1 -1
- package/dist/components/Content/Lazy/Loading.vue.js +58 -60
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +6 -0
- 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 +124 -120
- package/dist/components/Content/Schema/helpers/optimizeValueForDisplay.d.ts +1 -3
- package/dist/components/Content/Schema/helpers/optimizeValueForDisplay.d.ts.map +1 -1
- package/dist/components/Content/Tag/TagList.vue.d.ts.map +1 -1
- package/dist/components/Content/Tag/TagList.vue.js +36 -38
- 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 +59 -55
- package/dist/features/ApiClientModal/useApiClient.d.ts +208 -128
- package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -1
- package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts +6 -4
- package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts.map +1 -1
- package/dist/features/ExampleRequest/ExampleRequest.vue.js +1 -1
- package/dist/features/ExampleRequest/ExampleRequest.vue2.js +130 -119
- package/dist/features/ExampleResponses/ExampleResponses.vue.d.ts +2 -2
- package/dist/features/ExampleResponses/ExampleResponses.vue.d.ts.map +1 -1
- package/dist/features/ExampleResponses/ExampleResponses.vue.js +3 -3
- package/dist/features/ExampleResponses/ExampleResponses.vue2.js +86 -91
- package/dist/features/Operation/Operation.vue.d.ts +4 -5
- package/dist/features/Operation/Operation.vue.d.ts.map +1 -1
- package/dist/features/Operation/Operation.vue.js +34 -41
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +6 -6
- 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 +54 -51
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts +6 -6
- 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 +71 -71
- package/dist/helpers/get-request.d.ts.map +1 -1
- package/dist/helpers/index.d.ts +0 -3
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/hooks/useConfig.d.ts +1 -1
- package/dist/hooks/useConfig.d.ts.map +1 -1
- package/dist/hooks/useConfig.js +1 -1
- package/dist/hooks/useNavState.d.ts.map +1 -1
- package/dist/hooks/useNavState.js +26 -24
- package/dist/hooks/useReactiveSpec.d.ts +1 -1
- package/dist/index.js +66 -72
- package/dist/style.css +1 -1
- package/package.json +12 -12
- package/dist/features/Operation/hooks/useRequestExample.d.ts +0 -17
- package/dist/features/Operation/hooks/useRequestExample.d.ts.map +0 -1
- package/dist/features/Operation/hooks/useRequestExample.js +0 -68
- package/dist/helpers/convertRequestToHarRequest.d.ts +0 -7
- package/dist/helpers/convertRequestToHarRequest.d.ts.map +0 -1
- package/dist/helpers/convertRequestToHarRequest.js +0 -64
- package/dist/helpers/get-request.js +0 -6
- package/dist/helpers/getExampleCode.d.ts +0 -8
- package/dist/helpers/getExampleCode.d.ts.map +0 -1
- package/dist/helpers/getExampleCode.js +0 -16
- package/dist/helpers/joinWithSlash.d.ts +0 -5
- package/dist/helpers/joinWithSlash.d.ts.map +0 -1
- package/dist/helpers/joinWithSlash.js +0 -4
package/package.json
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"vue",
|
|
21
21
|
"vue3"
|
|
22
22
|
],
|
|
23
|
-
"version": "1.25.
|
|
23
|
+
"version": "1.25.118",
|
|
24
24
|
"engines": {
|
|
25
25
|
"node": ">=18"
|
|
26
26
|
},
|
|
@@ -54,17 +54,17 @@
|
|
|
54
54
|
"github-slugger": "^2.0.0",
|
|
55
55
|
"nanoid": "^5.0.7",
|
|
56
56
|
"vue": "^3.5.12",
|
|
57
|
-
"@scalar/api-client": "2.2.
|
|
58
|
-
"@scalar/oas-utils": "0.2.102",
|
|
57
|
+
"@scalar/api-client": "2.2.47",
|
|
59
58
|
"@scalar/code-highlight": "0.0.20",
|
|
60
|
-
"@scalar/
|
|
59
|
+
"@scalar/oas-utils": "0.2.104",
|
|
60
|
+
"@scalar/openapi-parser": "0.10.6",
|
|
61
|
+
"@scalar/components": "0.13.23",
|
|
61
62
|
"@scalar/openapi-types": "0.1.7",
|
|
62
|
-
"@scalar/
|
|
63
|
-
"@scalar/
|
|
64
|
-
"@scalar/types": "0.0.
|
|
65
|
-
"@scalar/
|
|
66
|
-
"@scalar/use-toasts": "0.7.8"
|
|
67
|
-
"@scalar/use-hooks": "0.1.18"
|
|
63
|
+
"@scalar/snippetz": "0.2.12",
|
|
64
|
+
"@scalar/themes": "0.9.66",
|
|
65
|
+
"@scalar/types": "0.0.32",
|
|
66
|
+
"@scalar/use-hooks": "0.1.20",
|
|
67
|
+
"@scalar/use-toasts": "0.7.8"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@vitejs/plugin-vue": "^5.0.4",
|
|
@@ -78,8 +78,8 @@
|
|
|
78
78
|
"vite-plugin-banner": "^0.7.1",
|
|
79
79
|
"vite-plugin-css-injected-by-js": "^3.4.0",
|
|
80
80
|
"vitest": "^1.6.0",
|
|
81
|
-
"@scalar/
|
|
82
|
-
"@scalar/
|
|
81
|
+
"@scalar/build-tooling": "0.1.12",
|
|
82
|
+
"@scalar/galaxy": "0.2.19"
|
|
83
83
|
},
|
|
84
84
|
"scripts": {
|
|
85
85
|
"analyze:default": "pnpm dlx vite-bundle-visualizer",
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { WorkspaceStore } from '@scalar/api-client/store';
|
|
2
|
-
import type { Collection, Server } from '@scalar/oas-utils/entities/spec';
|
|
3
|
-
import type { TransformedOperation } from '@scalar/types/legacy';
|
|
4
|
-
import { type ComputedRef } from 'vue';
|
|
5
|
-
/** Builds a request object for the code sniipet, as well as the security credentials to obfuscate */
|
|
6
|
-
export declare const useRequestExample: ({ operation, collection, requests, requestExamples, securitySchemes, server, }: {
|
|
7
|
-
operation: TransformedOperation;
|
|
8
|
-
collection: ComputedRef<Collection | undefined>;
|
|
9
|
-
requests: WorkspaceStore["requests"];
|
|
10
|
-
requestExamples: WorkspaceStore["requestExamples"];
|
|
11
|
-
securitySchemes: WorkspaceStore["securitySchemes"];
|
|
12
|
-
server: ComputedRef<Server | undefined>;
|
|
13
|
-
}) => {
|
|
14
|
-
request: ComputedRef<Request | null>;
|
|
15
|
-
secretCredentials: ComputedRef<string[]>;
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=useRequestExample.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useRequestExample.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/hooks/useRequestExample.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AACzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAChE,OAAO,EAAE,KAAK,WAAW,EAAY,MAAM,KAAK,CAAA;AAEhD,qGAAqG;AACrG,eAAO,MAAM,iBAAiB,mFAO3B;IACD,SAAS,EAAE,oBAAoB,CAAA;IAC/B,UAAU,EAAE,WAAW,CAAC,UAAU,GAAG,SAAS,CAAC,CAAA;IAC/C,QAAQ,EAAE,cAAc,CAAC,UAAU,CAAC,CAAA;IACpC,eAAe,EAAE,cAAc,CAAC,iBAAiB,CAAC,CAAA;IAClD,eAAe,EAAE,cAAc,CAAC,iBAAiB,CAAC,CAAA;IAClD,MAAM,EAAE,WAAW,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;CACxC;;;CA6FA,CAAA"}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { getRequest as S } from "../../../helpers/get-request.js";
|
|
2
|
-
import { createRequestOperation as k } from "@scalar/api-client/libs";
|
|
3
|
-
import { computed as c } from "vue";
|
|
4
|
-
const w = ({
|
|
5
|
-
operation: p,
|
|
6
|
-
collection: d,
|
|
7
|
-
requests: v,
|
|
8
|
-
requestExamples: q,
|
|
9
|
-
securitySchemes: f,
|
|
10
|
-
server: b
|
|
11
|
-
}) => {
|
|
12
|
-
const o = c(
|
|
13
|
-
() => S(v, p.path, p.httpVerb)
|
|
14
|
-
), y = c(() => {
|
|
15
|
-
var n, u, a, l;
|
|
16
|
-
const t = ((n = o.value) == null ? void 0 : n.security) ?? ((u = d.value) == null ? void 0 : u.security) ?? [], s = t.filter(
|
|
17
|
-
(r) => Object.keys(r).length
|
|
18
|
-
), e = s.map((r) => Object.keys(r)[0]);
|
|
19
|
-
if (s.length < t.length)
|
|
20
|
-
return ((a = d.value) == null ? void 0 : a.selectedSecuritySchemeUids) ?? [];
|
|
21
|
-
{
|
|
22
|
-
const r = Object.values(f), g = e.map((m) => {
|
|
23
|
-
var i;
|
|
24
|
-
return (i = r.find((j) => j.nameKey === m)) == null ? void 0 : i.uid;
|
|
25
|
-
}).filter(Boolean);
|
|
26
|
-
return (l = d.value) == null ? void 0 : l.selectedSecuritySchemeUids.filter(
|
|
27
|
-
(m) => g.find((i) => i === m)
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
}), h = c(() => {
|
|
31
|
-
var u, a, l, r;
|
|
32
|
-
const t = q[((a = (u = o.value) == null ? void 0 : u.examples) == null ? void 0 : a[0]) ?? ""];
|
|
33
|
-
if (!o.value || !t) return null;
|
|
34
|
-
const [s, e] = k({
|
|
35
|
-
request: o.value,
|
|
36
|
-
example: t,
|
|
37
|
-
server: b.value,
|
|
38
|
-
securitySchemes: f,
|
|
39
|
-
selectedSecuritySchemeUids: y.value,
|
|
40
|
-
// TODO: env vars if we want em
|
|
41
|
-
environment: {},
|
|
42
|
-
// TODO: cookies if we want em
|
|
43
|
-
globalCookies: []
|
|
44
|
-
});
|
|
45
|
-
if (s)
|
|
46
|
-
return console.error("[useRequestExample]", s), null;
|
|
47
|
-
const n = Object.keys(
|
|
48
|
-
((r = (l = p.information) == null ? void 0 : l.requestBody) == null ? void 0 : r.content) ?? {}
|
|
49
|
-
);
|
|
50
|
-
return e.request.headers.get("content-type") === "text/plain;charset=UTF-8" && n.length && e.request.headers.set("content-type", n[0]), e.request;
|
|
51
|
-
}), O = c(
|
|
52
|
-
() => {
|
|
53
|
-
var t;
|
|
54
|
-
return ((t = y.value) == null ? void 0 : t.flat().flatMap((s) => {
|
|
55
|
-
const e = f[s];
|
|
56
|
-
return (e == null ? void 0 : e.type) === "apiKey" ? e.value : (e == null ? void 0 : e.type) === "http" ? [
|
|
57
|
-
e.token,
|
|
58
|
-
e.password,
|
|
59
|
-
btoa(`${e.username}:${e.password}`)
|
|
60
|
-
] : (e == null ? void 0 : e.type) === "oauth2" ? Object.values(e.flows).map((n) => n.token) : [];
|
|
61
|
-
})) ?? [];
|
|
62
|
-
}
|
|
63
|
-
);
|
|
64
|
-
return { request: h, secretCredentials: O };
|
|
65
|
-
};
|
|
66
|
-
export {
|
|
67
|
-
w as useRequestExample
|
|
68
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { HarRequest } from '@scalar/snippetz';
|
|
2
|
-
/**
|
|
3
|
-
* Takes in a regular request object and returns a HAR request
|
|
4
|
-
* We also Titlecase the headers
|
|
5
|
-
*/
|
|
6
|
-
export declare const convertRequestToHarRequest: (request: Request) => Promise<HarRequest>;
|
|
7
|
-
//# sourceMappingURL=convertRequestToHarRequest.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"convertRequestToHarRequest.d.ts","sourceRoot":"","sources":["../../src/helpers/convertRequestToHarRequest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD;;;GAGG;AACH,eAAO,MAAM,0BAA0B,YAC5B,OAAO,KACf,OAAO,CAAC,UAAU,CAuGpB,CAAA"}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
const f = async (t) => {
|
|
2
|
-
const r = new URL(t.url), p = Array.from(r.searchParams.entries());
|
|
3
|
-
r.search = "";
|
|
4
|
-
const i = {
|
|
5
|
-
method: t.method.toUpperCase(),
|
|
6
|
-
url: r.toString(),
|
|
7
|
-
httpVersion: "HTTP/1.1",
|
|
8
|
-
headers: [],
|
|
9
|
-
queryString: [],
|
|
10
|
-
cookies: [],
|
|
11
|
-
headersSize: -1,
|
|
12
|
-
bodySize: -1
|
|
13
|
-
}, m = t.headers.get("cookie");
|
|
14
|
-
m && (i.cookies = m.split(";").map((e) => {
|
|
15
|
-
const [a, o] = e.trim().split("=");
|
|
16
|
-
return { name: a, value: o };
|
|
17
|
-
})), t.headers && (i.headers = Array.from(t.headers.entries()).map(
|
|
18
|
-
([e, a]) => ({
|
|
19
|
-
name: e.replace(/\b\w/g, (o) => o.toUpperCase()),
|
|
20
|
-
value: a
|
|
21
|
-
})
|
|
22
|
-
));
|
|
23
|
-
try {
|
|
24
|
-
i.queryString = p.map(([e, a]) => ({
|
|
25
|
-
name: e,
|
|
26
|
-
value: a
|
|
27
|
-
})), r.search = "";
|
|
28
|
-
} catch {
|
|
29
|
-
}
|
|
30
|
-
if (t.body)
|
|
31
|
-
try {
|
|
32
|
-
const e = t.headers.get("content-type") || "application/json";
|
|
33
|
-
if (e.includes("multipart/form-data")) {
|
|
34
|
-
const a = await t.formData(), o = {};
|
|
35
|
-
a.forEach((s, n) => {
|
|
36
|
-
const l = s instanceof Blob;
|
|
37
|
-
if (s instanceof File || l)
|
|
38
|
-
o[n] = {
|
|
39
|
-
type: "file",
|
|
40
|
-
text: "BINARY",
|
|
41
|
-
name: "name" in s ? s.name : "blob",
|
|
42
|
-
size: s.size,
|
|
43
|
-
mimeType: s.type || "application/octet-stream"
|
|
44
|
-
};
|
|
45
|
-
else {
|
|
46
|
-
const c = a.getAll(n);
|
|
47
|
-
c.length > 1 ? o[n] = c : o[n] = c[0];
|
|
48
|
-
}
|
|
49
|
-
}), i.postData = {
|
|
50
|
-
mimeType: e,
|
|
51
|
-
text: JSON.stringify(o)
|
|
52
|
-
};
|
|
53
|
-
} else
|
|
54
|
-
i.postData = {
|
|
55
|
-
mimeType: e,
|
|
56
|
-
text: await t.text()
|
|
57
|
-
};
|
|
58
|
-
} catch {
|
|
59
|
-
}
|
|
60
|
-
return i;
|
|
61
|
-
};
|
|
62
|
-
export {
|
|
63
|
-
f as convertRequestToHarRequest
|
|
64
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type ClientId as SnippetzClientId, type TargetId as SnippetzTargetId } from '@scalar/snippetz';
|
|
2
|
-
export type TargetId = SnippetzTargetId;
|
|
3
|
-
export type ClientId<T extends SnippetzTargetId> = SnippetzClientId<T>;
|
|
4
|
-
/**
|
|
5
|
-
* Returns a code example for given Request
|
|
6
|
-
*/
|
|
7
|
-
export declare function getExampleCode<T extends SnippetzTargetId>(request: Request, target: TargetId | string, client: ClientId<T> | string): Promise<string | undefined>;
|
|
8
|
-
//# sourceMappingURL=getExampleCode.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getExampleCode.d.ts","sourceRoot":"","sources":["../../src/helpers/getExampleCode.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,QAAQ,IAAI,gBAAgB,EACjC,KAAK,QAAQ,IAAI,gBAAgB,EAElC,MAAM,kBAAkB,CAAA;AAIzB,MAAM,MAAM,QAAQ,GAAG,gBAAgB,CAAA;AACvC,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,gBAAgB,IAAI,gBAAgB,CAAC,CAAC,CAAC,CAAA;AAEtE;;GAEG;AACH,wBAAsB,cAAc,CAAC,CAAC,SAAS,gBAAgB,EAC7D,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,QAAQ,GAAG,MAAM,EACzB,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,MAAM,+BAyB7B"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { snippetz as i } from "@scalar/snippetz";
|
|
2
|
-
import { convertRequestToHarRequest as p } from "./convertRequestToHarRequest.js";
|
|
3
|
-
async function u(r, n, t) {
|
|
4
|
-
const o = await p(r), e = n == null ? void 0 : n.replace(
|
|
5
|
-
"javascript",
|
|
6
|
-
"js"
|
|
7
|
-
);
|
|
8
|
-
return i().hasPlugin(e, t) ? i().print(
|
|
9
|
-
e,
|
|
10
|
-
t,
|
|
11
|
-
o
|
|
12
|
-
) : r.url.startsWith("__") ? r.url : "";
|
|
13
|
-
}
|
|
14
|
-
export {
|
|
15
|
-
u as getExampleCode
|
|
16
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"joinWithSlash.d.ts","sourceRoot":"","sources":["../../src/helpers/joinWithSlash.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,aAAa,SAAU,MAAM,SAAS,MAAM,WACC,CAAA"}
|