@scalar/api-reference 1.25.116 → 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 +52 -0
- package/dist/browser/standalone.js +8700 -8579
- 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/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/features/ApiClientModal/useApiClient.d.ts +194 -114
- package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -1
- package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts.map +1 -1
- package/dist/features/ExampleRequest/ExampleRequest.vue.js +2 -2
- package/dist/features/ExampleRequest/ExampleRequest.vue2.js +96 -104
- 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/layouts/ClassicLayout.vue.js +4 -4
- package/dist/features/Operation/layouts/ClassicLayout.vue2.js +6 -4
- package/dist/features/Operation/layouts/ModernLayout.vue.js +2 -2
- package/dist/features/Operation/layouts/ModernLayout.vue2.js +7 -7
- package/dist/helpers/get-request.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/index.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +11 -11
- package/dist/features/ExampleRequest/helpers/filter-security-requirements.d.ts +0 -6
- package/dist/features/ExampleRequest/helpers/filter-security-requirements.d.ts.map +0 -1
- package/dist/features/ExampleRequest/helpers/filter-security-requirements.js +0 -17
- package/dist/helpers/convert-to-har-request.d.ts +0 -28
- package/dist/helpers/convert-to-har-request.d.ts.map +0 -1
- package/dist/helpers/convert-to-har-request.js +0 -64
- package/dist/helpers/get-example-code.d.ts +0 -9
- package/dist/helpers/get-example-code.d.ts.map +0 -1
- package/dist/helpers/get-example-code.js +0 -51
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/
|
|
58
|
-
"@scalar/openapi-parser": "0.10.5",
|
|
59
|
-
"@scalar/oas-utils": "0.2.103",
|
|
57
|
+
"@scalar/api-client": "2.2.47",
|
|
60
58
|
"@scalar/code-highlight": "0.0.20",
|
|
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/snippetz": "0.2.
|
|
63
|
-
"@scalar/themes": "0.9.
|
|
64
|
-
"@scalar/
|
|
65
|
-
"@scalar/
|
|
66
|
-
"@scalar/use-toasts": "0.7.8"
|
|
67
|
-
"@scalar/api-client": "2.2.45"
|
|
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",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"vite-plugin-css-injected-by-js": "^3.4.0",
|
|
80
80
|
"vitest": "^1.6.0",
|
|
81
81
|
"@scalar/build-tooling": "0.1.12",
|
|
82
|
-
"@scalar/galaxy": "0.2.
|
|
82
|
+
"@scalar/galaxy": "0.2.19"
|
|
83
83
|
},
|
|
84
84
|
"scripts": {
|
|
85
85
|
"analyze:default": "pnpm dlx vite-bundle-visualizer",
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { Collection, SecurityScheme } from '@scalar/oas-utils/entities/spec';
|
|
2
|
-
/**
|
|
3
|
-
* Takes in selected security and filters it with the requirements
|
|
4
|
-
*/
|
|
5
|
-
export declare const filterSecurityRequirements: (securityRequirements: Collection["security"], selectedSecuritySchemeUids?: Collection["selectedSecuritySchemeUids"], securitySchemes?: Record<string, SecurityScheme>) => SecurityScheme[];
|
|
6
|
-
//# sourceMappingURL=filter-security-requirements.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"filter-security-requirements.d.ts","sourceRoot":"","sources":["../../../../src/features/ExampleRequest/helpers/filter-security-requirements.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACf,MAAM,iCAAiC,CAAA;AAExC;;GAEG;AACH,eAAO,MAAM,0BAA0B,yBACf,UAAU,CAAC,UAAU,CAAC,+BAChB,UAAU,CAAC,4BAA4B,CAAC,oBACnD,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,KAC9C,cAAc,EAwBhB,CAAA"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
const y = (i, a = [], n = {}) => {
|
|
2
|
-
const m = new Set(
|
|
3
|
-
i.map(
|
|
4
|
-
(e) => Object.keys(e).sort().join(",")
|
|
5
|
-
)
|
|
6
|
-
);
|
|
7
|
-
return a.reduce((e, r) => {
|
|
8
|
-
const o = Array.isArray(r) ? r : [r], p = o.map((t) => {
|
|
9
|
-
var s;
|
|
10
|
-
return (s = n[t]) == null ? void 0 : s.nameKey;
|
|
11
|
-
}).sort().join(",");
|
|
12
|
-
return m.has(p) && e.push(...o.map((t) => n[t])), e;
|
|
13
|
-
}, []);
|
|
14
|
-
};
|
|
15
|
-
export {
|
|
16
|
-
y as filterSecurityRequirements
|
|
17
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { Operation, RequestExample } from '@scalar/oas-utils/entities/spec';
|
|
2
|
-
import type { HarRequest } from '@scalar/snippetz';
|
|
3
|
-
type Props = {
|
|
4
|
-
baseUrl: string | undefined;
|
|
5
|
-
body?: RequestExample['body'];
|
|
6
|
-
cookies: {
|
|
7
|
-
key: string;
|
|
8
|
-
value: string;
|
|
9
|
-
enabled: boolean;
|
|
10
|
-
}[];
|
|
11
|
-
headers: {
|
|
12
|
-
key: string;
|
|
13
|
-
value: string;
|
|
14
|
-
enabled: boolean;
|
|
15
|
-
}[];
|
|
16
|
-
query: {
|
|
17
|
-
key: string;
|
|
18
|
-
value: string;
|
|
19
|
-
enabled: boolean;
|
|
20
|
-
}[];
|
|
21
|
-
} & Pick<Operation, 'method' | 'path'>;
|
|
22
|
-
/**
|
|
23
|
-
* Takes in a regular request object and returns a HAR request
|
|
24
|
-
* We also Titlecase the headers and remove accept header if it's *
|
|
25
|
-
*/
|
|
26
|
-
export declare const convertToHarRequest: ({ baseUrl, method, body, path, cookies, headers, query, }: Props) => HarRequest;
|
|
27
|
-
export {};
|
|
28
|
-
//# sourceMappingURL=convert-to-har-request.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"convert-to-har-request.d.ts","sourceRoot":"","sources":["../../src/helpers/convert-to-har-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAEhF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,IAAI,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,CAAA;IAC7B,OAAO,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,EAAE,CAAA;IAC3D,OAAO,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,EAAE,CAAA;IAC3D,KAAK,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,EAAE,CAAA;CAC1D,GAAG,IAAI,CAAC,SAAS,EAAE,QAAQ,GAAG,MAAM,CAAC,CAAA;AAEtC;;;GAGG;AACH,eAAO,MAAM,mBAAmB,8DAQ7B,KAAK,KAAG,UA4GV,CAAA"}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { combineUrlAndPath as S } from "@scalar/oas-utils/helpers";
|
|
2
|
-
const w = ({
|
|
3
|
-
baseUrl: u = "",
|
|
4
|
-
method: g,
|
|
5
|
-
body: r,
|
|
6
|
-
path: h,
|
|
7
|
-
cookies: s,
|
|
8
|
-
headers: o,
|
|
9
|
-
query: m
|
|
10
|
-
}) => {
|
|
11
|
-
var p, c, l;
|
|
12
|
-
const D = S(u, h), i = {
|
|
13
|
-
method: g.toUpperCase(),
|
|
14
|
-
url: D.toString(),
|
|
15
|
-
httpVersion: "HTTP/1.1",
|
|
16
|
-
headers: [],
|
|
17
|
-
queryString: [],
|
|
18
|
-
cookies: [],
|
|
19
|
-
headersSize: -1,
|
|
20
|
-
bodySize: -1
|
|
21
|
-
};
|
|
22
|
-
if (s.length && (i.cookies = s.filter((e) => e.enabled).map(({ key: e, value: t }) => ({
|
|
23
|
-
name: e,
|
|
24
|
-
value: t
|
|
25
|
-
}))), o.length && (i.headers = o.filter(
|
|
26
|
-
(e) => e.enabled && !(e.key.toLowerCase() === "accept" && e.value === "*/*")
|
|
27
|
-
).map(({ key: e, value: t }) => ({
|
|
28
|
-
name: e.replace(/\b\w/g, (a) => a.toUpperCase()),
|
|
29
|
-
value: t
|
|
30
|
-
}))), m.length && (i.queryString = m.filter((e) => e.enabled).map(({ key: e, value: t }) => ({
|
|
31
|
-
name: e,
|
|
32
|
-
value: t
|
|
33
|
-
}))), r)
|
|
34
|
-
try {
|
|
35
|
-
const e = ((p = o.find((t) => t.key.toLowerCase() === "content-type")) == null ? void 0 : p.value) || "application/json";
|
|
36
|
-
if (r.activeBody === "formData" && r.formData) {
|
|
37
|
-
const t = {};
|
|
38
|
-
r.formData.value.forEach(({ key: a, value: f, file: n }) => {
|
|
39
|
-
n ? t[a] = {
|
|
40
|
-
type: "file",
|
|
41
|
-
text: "BINARY",
|
|
42
|
-
name: a || "blob",
|
|
43
|
-
size: n.size,
|
|
44
|
-
fileName: n.name,
|
|
45
|
-
mimeType: n.type || "application/octet-stream"
|
|
46
|
-
} : t[a] ? (Array.isArray(t[a]) || (t[a] = [t[a]]), t[a].push(f)) : t[a] = f;
|
|
47
|
-
}), ((c = r.formData) == null ? void 0 : c.encoding) === "urlencoded" ? i.postData = {
|
|
48
|
-
mimeType: e,
|
|
49
|
-
text: new URLSearchParams(t).toString()
|
|
50
|
-
} : i.postData = {
|
|
51
|
-
mimeType: e,
|
|
52
|
-
text: JSON.stringify(t)
|
|
53
|
-
};
|
|
54
|
-
} else r.activeBody === "raw" && r.raw && (i.postData = {
|
|
55
|
-
mimeType: e,
|
|
56
|
-
text: ((l = r.raw) == null ? void 0 : l.value) ?? ""
|
|
57
|
-
});
|
|
58
|
-
} catch {
|
|
59
|
-
}
|
|
60
|
-
return i;
|
|
61
|
-
};
|
|
62
|
-
export {
|
|
63
|
-
w as convertToHarRequest
|
|
64
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Operation, RequestExample, SecurityScheme, Server } from '@scalar/oas-utils/entities/spec';
|
|
2
|
-
import { type ClientId as SnippetzClientId, type TargetId as SnippetzTargetId } from '@scalar/snippetz';
|
|
3
|
-
export type TargetId = SnippetzTargetId;
|
|
4
|
-
export type ClientId<T extends SnippetzTargetId> = SnippetzClientId<T>;
|
|
5
|
-
/**
|
|
6
|
-
* Returns a code example for given operation
|
|
7
|
-
*/
|
|
8
|
-
export declare function getExampleCode<T extends SnippetzTargetId>(operation: Operation, example: RequestExample, target: TargetId | string, client: ClientId<T> | string, server: Server | undefined, securitySchemes?: SecurityScheme[]): Promise<string | undefined>;
|
|
9
|
-
//# sourceMappingURL=get-example-code.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-example-code.d.ts","sourceRoot":"","sources":["../../src/helpers/get-example-code.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,SAAS,EACT,cAAc,EACd,cAAc,EACd,MAAM,EACP,MAAM,iCAAiC,CAAA;AACxC,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;AAItE;;GAEG;AACH,wBAAsB,cAAc,CAAC,CAAC,SAAS,gBAAgB,EAC7D,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,cAAc,EACvB,MAAM,EAAE,QAAQ,GAAG,MAAM,EACzB,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,MAAM,EAC5B,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,eAAe,GAAE,cAAc,EAAO,+BAoEvC"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { buildRequestSecurity as b } from "@scalar/api-client/libs/send-request";
|
|
2
|
-
import { snippetz as i } from "@scalar/snippetz";
|
|
3
|
-
import { convertToHarRequest as l } from "./convert-to-har-request.js";
|
|
4
|
-
const E = "YOUR_SECRET_TOKEN";
|
|
5
|
-
async function q(n, r, t, u, a, p = []) {
|
|
6
|
-
const s = b(
|
|
7
|
-
p,
|
|
8
|
-
{},
|
|
9
|
-
E
|
|
10
|
-
), m = [
|
|
11
|
-
...r.parameters.headers,
|
|
12
|
-
...Object.entries(s.headers).map(([e, o]) => ({
|
|
13
|
-
key: e,
|
|
14
|
-
value: o,
|
|
15
|
-
enabled: !0
|
|
16
|
-
}))
|
|
17
|
-
], d = [
|
|
18
|
-
...r.parameters.cookies,
|
|
19
|
-
...s.cookies.map((e) => ({
|
|
20
|
-
key: e.name,
|
|
21
|
-
value: e.value,
|
|
22
|
-
enabled: !0
|
|
23
|
-
}))
|
|
24
|
-
], y = [
|
|
25
|
-
...r.parameters.query,
|
|
26
|
-
...Array.from(s.urlParams.entries()).map(([e, o]) => ({
|
|
27
|
-
key: e,
|
|
28
|
-
value: o,
|
|
29
|
-
enabled: !0
|
|
30
|
-
}))
|
|
31
|
-
], h = await l({
|
|
32
|
-
baseUrl: a == null ? void 0 : a.url,
|
|
33
|
-
method: n.method,
|
|
34
|
-
path: n.path,
|
|
35
|
-
body: r.body,
|
|
36
|
-
cookies: d,
|
|
37
|
-
headers: m,
|
|
38
|
-
query: y
|
|
39
|
-
}), c = t == null ? void 0 : t.replace(
|
|
40
|
-
"javascript",
|
|
41
|
-
"js"
|
|
42
|
-
);
|
|
43
|
-
return i().hasPlugin(c, u) ? i().print(
|
|
44
|
-
c,
|
|
45
|
-
u,
|
|
46
|
-
h
|
|
47
|
-
) : "";
|
|
48
|
-
}
|
|
49
|
-
export {
|
|
50
|
-
q as getExampleCode
|
|
51
|
-
};
|