@scalar/api-reference 1.25.111 → 1.25.113

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.
Files changed (63) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/browser/standalone.js +5991 -6107
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
  5. package/dist/components/ApiReferenceLayout.vue.js +2 -2
  6. package/dist/components/ApiReferenceLayout.vue2.js +103 -104
  7. package/dist/components/Content/Content.vue.d.ts +1 -3
  8. package/dist/components/Content/Content.vue.d.ts.map +1 -1
  9. package/dist/components/Content/Content.vue.js +1 -1
  10. package/dist/components/Content/Content.vue2.js +53 -55
  11. package/dist/features/ApiClientModal/ApiClientModal.vue.d.ts.map +1 -1
  12. package/dist/features/ApiClientModal/ApiClientModal.vue.js +24 -34
  13. package/dist/features/ApiClientModal/useApiClient.d.ts +60 -80
  14. package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -1
  15. package/dist/features/BaseUrl/BaseUrl.vue.d.ts +1 -16
  16. package/dist/features/BaseUrl/BaseUrl.vue.d.ts.map +1 -1
  17. package/dist/features/BaseUrl/BaseUrl.vue.js +36 -29
  18. package/dist/features/BaseUrl/index.d.ts +0 -1
  19. package/dist/features/BaseUrl/index.d.ts.map +1 -1
  20. package/dist/features/Operation/hooks/useRequestExample.d.ts.map +1 -1
  21. package/dist/features/Operation/hooks/useRequestExample.js +39 -51
  22. package/dist/index.js +1 -1
  23. package/dist/legacy/helpers/index.d.ts +0 -1
  24. package/dist/legacy/helpers/index.d.ts.map +1 -1
  25. package/dist/legacy/stores/index.d.ts +1 -2
  26. package/dist/legacy/stores/index.d.ts.map +1 -1
  27. package/dist/style.css +1 -1
  28. package/package.json +8 -8
  29. package/dist/features/BaseUrl/ServerForm.vue.d.ts +0 -18
  30. package/dist/features/BaseUrl/ServerForm.vue.d.ts.map +0 -1
  31. package/dist/features/BaseUrl/ServerForm.vue.js +0 -7
  32. package/dist/features/BaseUrl/ServerForm.vue2.js +0 -76
  33. package/dist/features/BaseUrl/ServerUrl.vue.d.ts +0 -9
  34. package/dist/features/BaseUrl/ServerUrl.vue.d.ts.map +0 -1
  35. package/dist/features/BaseUrl/ServerUrl.vue.js +0 -7
  36. package/dist/features/BaseUrl/ServerUrl.vue2.js +0 -27
  37. package/dist/features/BaseUrl/ServerUrlSelect.vue.d.ts +0 -28
  38. package/dist/features/BaseUrl/ServerUrlSelect.vue.d.ts.map +0 -1
  39. package/dist/features/BaseUrl/ServerUrlSelect.vue.js +0 -7
  40. package/dist/features/BaseUrl/ServerUrlSelect.vue2.js +0 -61
  41. package/dist/features/BaseUrl/ServerVariablesForm.vue.d.ts +0 -14
  42. package/dist/features/BaseUrl/ServerVariablesForm.vue.d.ts.map +0 -1
  43. package/dist/features/BaseUrl/ServerVariablesForm.vue.js +0 -7
  44. package/dist/features/BaseUrl/ServerVariablesForm.vue2.js +0 -59
  45. package/dist/features/BaseUrl/ServerVariablesSelect.vue.d.ts +0 -12
  46. package/dist/features/BaseUrl/ServerVariablesSelect.vue.d.ts.map +0 -1
  47. package/dist/features/BaseUrl/ServerVariablesSelect.vue.js +0 -7
  48. package/dist/features/BaseUrl/ServerVariablesSelect.vue2.js +0 -54
  49. package/dist/features/BaseUrl/ServerVariablesTextbox.vue.d.ts +0 -11
  50. package/dist/features/BaseUrl/ServerVariablesTextbox.vue.d.ts.map +0 -1
  51. package/dist/features/BaseUrl/ServerVariablesTextbox.vue.js +0 -7
  52. package/dist/features/BaseUrl/ServerVariablesTextbox.vue2.js +0 -29
  53. package/dist/features/BaseUrl/types.d.ts +0 -9
  54. package/dist/features/BaseUrl/types.d.ts.map +0 -1
  55. package/dist/features/BaseUrl/utils/getServers.d.ts +0 -15
  56. package/dist/features/BaseUrl/utils/getServers.d.ts.map +0 -1
  57. package/dist/features/BaseUrl/utils/getServers.js +0 -31
  58. package/dist/legacy/helpers/getUrlFromServerState.d.ts +0 -10
  59. package/dist/legacy/helpers/getUrlFromServerState.d.ts.map +0 -1
  60. package/dist/legacy/helpers/getUrlFromServerState.js +0 -18
  61. package/dist/legacy/stores/useServerStore.d.ts +0 -44
  62. package/dist/legacy/stores/useServerStore.d.ts.map +0 -1
  63. package/dist/legacy/stores/useServerStore.js +0 -88
@@ -1,34 +1,41 @@
1
- import { defineComponent as f, toRef as a, computed as c, openBlock as m, createBlock as S, unref as b } from "vue";
2
- import U from "./ServerForm.vue.js";
3
- import { useServerStore as B } from "../../legacy/stores/useServerStore.js";
4
- const _ = /* @__PURE__ */ f({
1
+ import { defineComponent as b, useId as _, openBlock as l, createElementBlock as x, Fragment as k, createElementVNode as v, unref as e, createBlock as d, createCommentVNode as m, createVNode as S } from "vue";
2
+ import { ServerDropdown as g, ServerVariablesForm as V } from "@scalar/api-client/components/Server";
3
+ import { useActiveEntities as y, useWorkspace as B } from "@scalar/api-client/store";
4
+ import { ScalarMarkdown as C } from "@scalar/components";
5
+ const E = ["id"], U = /* @__PURE__ */ b({
5
6
  __name: "BaseUrl",
6
- props: {
7
- specification: {},
8
- defaultServerUrl: {},
9
- servers: {}
10
- },
11
- setup(i) {
12
- const s = i, p = a(s.specification), u = a(s.defaultServerUrl), d = a(s.servers), { server: t, setServer: l } = B({
13
- specification: p,
14
- defaultServerUrl: u,
15
- servers: d
16
- }), v = c({
17
- get: () => t.selectedServer || 0,
18
- set: (e) => l({ selectedServer: e })
19
- }), n = c({
20
- get: () => t.variables,
21
- set: (e) => l({ variables: e })
22
- });
23
- return (e, r) => (m(), S(U, {
24
- selected: v.value,
25
- "onUpdate:selected": r[0] || (r[0] = (o) => v.value = o),
26
- variables: n.value,
27
- "onUpdate:variables": r[1] || (r[1] = (o) => n.value = o),
28
- servers: b(t).servers
29
- }, null, 8, ["selected", "variables", "servers"]));
7
+ setup(N) {
8
+ const { activeCollection: s, activeServer: r } = y(), { serverMutators: p } = B(), n = _(), f = (o, a) => {
9
+ if (!r.value) return;
10
+ const t = r.value.variables || {};
11
+ t[o] = { ...t[o], default: a }, p.edit(r.value.uid, "variables", t);
12
+ };
13
+ return (o, a) => {
14
+ var t, i, c, u;
15
+ return l(), x(k, null, [
16
+ a[0] || (a[0] = v("label", { class: "bg-b-2 flex font-medium items-center h-8 px-3 py-2.5 text-sm" }, " Server ", -1)),
17
+ v("div", { id: e(n) }, [
18
+ (i = (t = e(s)) == null ? void 0 : t.servers) != null && i.length ? (l(), d(e(g), {
19
+ key: 0,
20
+ collection: e(s),
21
+ layout: "reference",
22
+ server: e(r),
23
+ target: e(n)
24
+ }, null, 8, ["collection", "server", "target"])) : m("", !0)
25
+ ], 8, E),
26
+ S(e(V), {
27
+ variables: (c = e(r)) == null ? void 0 : c.variables,
28
+ "onUpdate:variable": f
29
+ }, null, 8, ["variables"]),
30
+ (u = e(r)) != null && u.description ? (l(), d(e(C), {
31
+ key: 0,
32
+ class: "px-3 py-1.5 text-c-3",
33
+ value: e(r).description
34
+ }, null, 8, ["value"])) : m("", !0)
35
+ ], 64);
36
+ };
30
37
  }
31
38
  });
32
39
  export {
33
- _ as default
40
+ U as default
34
41
  };
@@ -1,3 +1,2 @@
1
1
  export { default as BaseUrl } from './BaseUrl.vue.js';
2
- export * from './types';
3
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/features/BaseUrl/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,eAAe,CAAA;AAElD,cAAc,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/features/BaseUrl/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,eAAe,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"useRequestExample.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/hooks/useRequestExample.ts"],"names":[],"mappings":"AAGA,OA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AAA;IAClD,MAAM,EAAE,WAAW,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;CACxC;;;CA6FA,CAAA"}
@@ -1,54 +1,42 @@
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,
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,
8
6
  collection: d,
9
- requests: y,
7
+ requests: v,
10
8
  requestExamples: q,
11
- securitySchemes: m,
12
- server: S
9
+ securitySchemes: f,
10
+ server: b
13
11
  }) => {
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]);
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]);
21
19
  if (s.length < t.length)
22
- return ((l = d.value) == null ? void 0 : l.selectedSecuritySchemeUids) ?? [];
20
+ return ((a = d.value) == null ? void 0 : a.selectedSecuritySchemeUids) ?? [];
23
21
  {
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;
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;
27
25
  }).filter(Boolean);
28
- return (a = d.value) == null ? void 0 : a.selectedSecuritySchemeUids.filter(
29
- (f) => O.find((p) => p === f)
26
+ return (l = d.value) == null ? void 0 : l.selectedSecuritySchemeUids.filter(
27
+ (m) => g.find((i) => i === m)
30
28
  );
31
29
  }
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;
38
- return {
39
- uid: (t == null ? void 0 : t.uid) || "",
40
- url: b.value || ""
41
- };
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,
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,
48
36
  example: t,
49
- server: h.value,
50
- securitySchemes: m,
51
- selectedSecuritySchemeUids: v.value,
37
+ server: b.value,
38
+ securitySchemes: f,
39
+ selectedSecuritySchemeUids: y.value,
52
40
  // TODO: env vars if we want em
53
41
  environment: {},
54
42
  // TODO: cookies if we want em
@@ -56,25 +44,25 @@ const { server: K } = w(), V = ({
56
44
  });
57
45
  if (s)
58
46
  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) ?? {}
47
+ const n = Object.keys(
48
+ ((r = (l = p.information) == null ? void 0 : l.requestBody) == null ? void 0 : r.content) ?? {}
61
49
  );
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(
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(
64
52
  () => {
65
53
  var t;
66
- return ((t = v.value) == null ? void 0 : t.flatMap((s) => {
67
- const e = m[s];
54
+ return ((t = y.value) == null ? void 0 : t.flatMap((s) => {
55
+ const e = f[s];
68
56
  return (e == null ? void 0 : e.type) === "apiKey" ? e.value : (e == null ? void 0 : e.type) === "http" ? [
69
57
  e.token,
70
58
  e.password,
71
59
  btoa(`${e.username}:${e.password}`)
72
- ] : (e == null ? void 0 : e.type) === "oauth2" ? Object.values(e.flows).map((r) => r.token) : [];
60
+ ] : (e == null ? void 0 : e.type) === "oauth2" ? Object.values(e.flows).map((n) => n.token) : [];
73
61
  })) ?? [];
74
62
  }
75
63
  );
76
- return { request: U, secretCredentials: g };
64
+ return { request: h, secretCredentials: O };
77
65
  };
78
66
  export {
79
- V as useRequestExample
67
+ w as useRequestExample
80
68
  };