@scalar/api-reference 1.25.93 → 1.25.95
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 +23 -0
- package/dist/browser/standalone.js +7356 -7289
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
- package/dist/components/ApiReferenceLayout.vue.js +2 -2
- package/dist/components/ApiReferenceLayout.vue2.js +3 -2
- package/dist/features/Operation/hooks/useRequestExample.d.ts +1 -1
- package/dist/features/Operation/hooks/useRequestExample.d.ts.map +1 -1
- package/dist/features/Operation/hooks/useRequestExample.js +46 -42
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiReferenceLayout.vue.d.ts","sourceRoot":"","sources":["../../src/components/ApiReferenceLayout.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ApiReferenceLayout.vue.d.ts","sourceRoot":"","sources":["../../src/components/ApiReferenceLayout.vue"],"names":[],"mappings":"AAmoBA,OAAO,EACL,KAAK,OAAO,EAGb,MAAM,gBAAgB,CAAA;AA4BvB,OAAO,KAAK,EACV,oBAAoB,EAEpB,kBAAkB,EACnB,MAAM,UAAU,CAAA;AAOjB,KAAK,WAAW,GAAG,IAAI,CAAC,oBAAoB,EAAE,QAAQ,CAAC,CAAC;AAyRxD,iBAAS,cAAc;WAoPT,OAAO,IAA6B;;wBAxfZ,kBAAkB,KAAK,GAAG;wBAA1B,kBAAkB,KAAK,GAAG;wBAA1B,kBAAkB,KAAK,GAAG;iCAA1B,kBAAkB,KAAK,GAAG;+BAA1B,kBAAkB,KAAK,GAAG;iCAA1B,kBAAkB,KAAK,GAAG;+BAA1B,kBAAkB,KAAK,GAAG;;wBAA1B,kBAAkB,KAAK,GAAG;wBAA1B,kBAAkB,KAAK,GAAG;wBAA1B,kBAAkB,KAAK,GAAG;iCAA1B,kBAAkB,KAAK,GAAG;+BAA1B,kBAAkB,KAAK,GAAG;iCAA1B,kBAAkB,KAAK,GAAG;+BAA1B,kBAAkB,KAAK,GAAG;;;;;;EA6f/D;AAuBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;YAtiBqB,OAAO;eAAS,MAAM;;;;;;;;YAAtB,OAAO;eAAS,MAAM;;;;;;kFA6iB9D,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -2,7 +2,7 @@ import o from "./ApiReferenceLayout.vue2.js";
|
|
|
2
2
|
/* empty css */
|
|
3
3
|
/* empty css */
|
|
4
4
|
import t from "../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
-
const
|
|
5
|
+
const c = /* @__PURE__ */ t(o, [["__scopeId", "data-v-2bc622ac"]]);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
c as default
|
|
8
8
|
};
|
|
@@ -125,13 +125,14 @@ const Ge = ["innerHTML"], Ke = { class: "references-header" }, Qe = {
|
|
|
125
125
|
() => o.rawSpec,
|
|
126
126
|
(e) => {
|
|
127
127
|
var t;
|
|
128
|
-
return T.importSpecFile(e, "default", {
|
|
128
|
+
return e && T.importSpecFile(e, "default", {
|
|
129
129
|
shouldLoad: !1,
|
|
130
130
|
documentUrl: (t = o.configuration.spec) == null ? void 0 : t.url,
|
|
131
131
|
setCollectionSecurity: !0,
|
|
132
132
|
...o.configuration
|
|
133
133
|
});
|
|
134
|
-
}
|
|
134
|
+
},
|
|
135
|
+
{ immediate: !0 }
|
|
135
136
|
), p(ye, T);
|
|
136
137
|
const oe = Te(T);
|
|
137
138
|
p(we, oe), p(
|
|
@@ -9,7 +9,7 @@ export declare const useRequestExample: ({ operation, collection, requests, requ
|
|
|
9
9
|
requests: WorkspaceStore["requests"];
|
|
10
10
|
requestExamples: WorkspaceStore["requestExamples"];
|
|
11
11
|
securitySchemes: WorkspaceStore["securitySchemes"];
|
|
12
|
-
server: ComputedRef<Server>;
|
|
12
|
+
server: ComputedRef<Server | undefined>;
|
|
13
13
|
}) => {
|
|
14
14
|
request: ComputedRef<Request | null>;
|
|
15
15
|
secretCredentials: ComputedRef<string[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRequestExample.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/hooks/useRequestExample.ts"],"names":[],"mappings":"AAGA,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;
|
|
1
|
+
{"version":3,"file":"useRequestExample.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/hooks/useRequestExample.ts"],"names":[],"mappings":"AAGA,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;AAMhD,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;;;CA4GA,CAAA"}
|
|
@@ -1,46 +1,50 @@
|
|
|
1
|
-
import { getRequest as
|
|
2
|
-
import { createRequestOperation as
|
|
3
|
-
import { computed as
|
|
4
|
-
import { getUrlFromServerState as
|
|
5
|
-
import { useServerStore as
|
|
6
|
-
const { server:
|
|
7
|
-
operation:
|
|
1
|
+
import { getRequest as k } from "../../../helpers/get-request.js";
|
|
2
|
+
import { createRequestOperation as x } from "@scalar/api-client/libs";
|
|
3
|
+
import { computed as u } from "vue";
|
|
4
|
+
import { getUrlFromServerState as R } from "../../../legacy/helpers/getUrlFromServerState.js";
|
|
5
|
+
import { useServerStore as w } from "../../../legacy/stores/useServerStore.js";
|
|
6
|
+
const { server: K } = w(), V = ({
|
|
7
|
+
operation: i,
|
|
8
8
|
collection: d,
|
|
9
9
|
requests: y,
|
|
10
10
|
requestExamples: q,
|
|
11
11
|
securitySchemes: m,
|
|
12
|
-
server:
|
|
12
|
+
server: S
|
|
13
13
|
}) => {
|
|
14
|
-
const
|
|
15
|
-
() =>
|
|
16
|
-
), v =
|
|
17
|
-
var
|
|
18
|
-
const t = ((
|
|
19
|
-
(
|
|
20
|
-
), e =
|
|
21
|
-
if (
|
|
22
|
-
return ((
|
|
14
|
+
const c = u(
|
|
15
|
+
() => k(y, i.path, i.httpVerb)
|
|
16
|
+
), v = u(() => {
|
|
17
|
+
var r, o, l, a;
|
|
18
|
+
const t = ((r = c.value) == null ? void 0 : r.security) ?? ((o = d.value) == null ? void 0 : o.security) ?? [], s = t.filter(
|
|
19
|
+
(n) => Object.keys(n).length
|
|
20
|
+
), e = s.map((n) => Object.keys(n)[0]);
|
|
21
|
+
if (s.length < t.length)
|
|
22
|
+
return ((l = d.value) == null ? void 0 : l.selectedSecuritySchemeUids) ?? [];
|
|
23
23
|
{
|
|
24
|
-
const
|
|
25
|
-
var
|
|
26
|
-
return (
|
|
24
|
+
const n = Object.values(m), O = e.map((f) => {
|
|
25
|
+
var p;
|
|
26
|
+
return (p = n.find((j) => j.nameKey === f)) == null ? void 0 : p.uid;
|
|
27
27
|
}).filter(Boolean);
|
|
28
|
-
return (
|
|
29
|
-
(f) => O.find((
|
|
28
|
+
return (a = d.value) == null ? void 0 : a.selectedSecuritySchemeUids.filter(
|
|
29
|
+
(f) => O.find((p) => p === f)
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
|
-
}),
|
|
33
|
-
|
|
32
|
+
}), b = u(() => {
|
|
33
|
+
var e, r;
|
|
34
|
+
const t = (r = (e = i.information) == null ? void 0 : e.servers) == null ? void 0 : r[0], { modifiedUrl: s } = R(K, t);
|
|
35
|
+
return s;
|
|
36
|
+
}), h = u(() => {
|
|
37
|
+
const t = S.value;
|
|
34
38
|
return {
|
|
35
39
|
uid: (t == null ? void 0 : t.uid) || "",
|
|
36
|
-
url:
|
|
40
|
+
url: b.value || ""
|
|
37
41
|
};
|
|
38
|
-
}),
|
|
39
|
-
var
|
|
40
|
-
const t = q[((
|
|
41
|
-
if (!
|
|
42
|
-
const [
|
|
43
|
-
request:
|
|
42
|
+
}), U = u(() => {
|
|
43
|
+
var o, l, a, n;
|
|
44
|
+
const t = q[((l = (o = c.value) == null ? void 0 : o.examples) == null ? void 0 : l[0]) ?? ""];
|
|
45
|
+
if (!c.value || !t) return null;
|
|
46
|
+
const [s, e] = x({
|
|
47
|
+
request: c.value,
|
|
44
48
|
example: t,
|
|
45
49
|
server: h.value,
|
|
46
50
|
securitySchemes: m,
|
|
@@ -50,27 +54,27 @@ const { server: w } = R(), T = ({
|
|
|
50
54
|
// TODO: cookies if we want em
|
|
51
55
|
globalCookies: []
|
|
52
56
|
});
|
|
53
|
-
if (
|
|
54
|
-
return console.error("[useRequestExample]",
|
|
55
|
-
const
|
|
56
|
-
((
|
|
57
|
+
if (s)
|
|
58
|
+
return console.error("[useRequestExample]", s), null;
|
|
59
|
+
const r = Object.keys(
|
|
60
|
+
((n = (a = i.information) == null ? void 0 : a.requestBody) == null ? void 0 : n.content) ?? {}
|
|
57
61
|
);
|
|
58
|
-
return e.request.headers.get("content-type") === "text/plain;charset=UTF-8" &&
|
|
59
|
-
}), g =
|
|
62
|
+
return e.request.headers.get("content-type") === "text/plain;charset=UTF-8" && r.length && e.request.headers.set("content-type", r[0]), e.request;
|
|
63
|
+
}), g = u(
|
|
60
64
|
() => {
|
|
61
65
|
var t;
|
|
62
|
-
return ((t = v.value) == null ? void 0 : t.flatMap((
|
|
63
|
-
const e = m[
|
|
66
|
+
return ((t = v.value) == null ? void 0 : t.flatMap((s) => {
|
|
67
|
+
const e = m[s];
|
|
64
68
|
return (e == null ? void 0 : e.type) === "apiKey" ? e.value : (e == null ? void 0 : e.type) === "http" ? [
|
|
65
69
|
e.token,
|
|
66
70
|
e.password,
|
|
67
71
|
btoa(`${e.username}:${e.password}`)
|
|
68
|
-
] : (e == null ? void 0 : e.type) === "oauth2" ? Object.values(e.flows).map((
|
|
72
|
+
] : (e == null ? void 0 : e.type) === "oauth2" ? Object.values(e.flows).map((r) => r.token) : [];
|
|
69
73
|
})) ?? [];
|
|
70
74
|
}
|
|
71
75
|
);
|
|
72
|
-
return { request:
|
|
76
|
+
return { request: U, secretCredentials: g };
|
|
73
77
|
};
|
|
74
78
|
export {
|
|
75
|
-
|
|
79
|
+
V as useRequestExample
|
|
76
80
|
};
|