@scalar/api-reference 1.25.80 → 1.25.82

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 (49) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/browser/standalone.js +13239 -14204
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/Anchor/Anchor.vue.d.ts.map +1 -1
  5. package/dist/components/Anchor/Anchor.vue.js +1 -1
  6. package/dist/components/Anchor/Anchor.vue2.js +19 -21
  7. package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
  8. package/dist/components/ApiReferenceLayout.vue.js +1 -1
  9. package/dist/components/ApiReferenceLayout.vue2.js +94 -90
  10. package/dist/components/Content/ClientLibraries/ClientSelector.vue.d.ts.map +1 -1
  11. package/dist/components/Content/ClientLibraries/ClientSelector.vue.js +1 -1
  12. package/dist/components/Content/ClientLibraries/ClientSelector.vue2.js +22 -20
  13. package/dist/components/Content/Introduction/Description.vue.d.ts.map +1 -1
  14. package/dist/components/Content/Introduction/Description.vue.js +2 -2
  15. package/dist/components/Content/Introduction/Description.vue2.js +30 -33
  16. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
  17. package/dist/components/Content/Schema/SchemaProperty.vue.js +2 -2
  18. package/dist/components/Content/Schema/SchemaProperty.vue2.js +106 -102
  19. package/dist/components/Section/CompactSection.vue.js +2 -2
  20. package/dist/components/Section/CompactSection.vue2.js +14 -14
  21. package/dist/components/Section/Section.vue.d.ts.map +1 -1
  22. package/dist/components/Section/Section.vue.js +1 -1
  23. package/dist/components/Section/Section.vue2.js +16 -19
  24. package/dist/components/Sidebar/SidebarElement.vue.d.ts.map +1 -1
  25. package/dist/components/Sidebar/SidebarElement.vue.js +2 -2
  26. package/dist/components/Sidebar/SidebarElement.vue2.js +42 -46
  27. package/dist/embeds/OpenApiDocument/OpenApiDocument.vue.d.ts +4 -4
  28. package/dist/features/ApiClientModal/ApiClientModal.vue.d.ts.map +1 -1
  29. package/dist/features/ApiClientModal/ApiClientModal.vue.js +12 -12
  30. package/dist/features/ApiClientModal/useApiClient.d.ts +28 -28
  31. package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -1
  32. package/dist/features/ExampleRequest/ExampleRequest.vue.js +2 -2
  33. package/dist/features/ExampleRequest/ExampleRequest.vue2.js +1 -1
  34. package/dist/helpers/convertRequestToHarRequest.d.ts +1 -1
  35. package/dist/helpers/convertRequestToHarRequest.d.ts.map +1 -1
  36. package/dist/helpers/getExampleCode.d.ts +3 -4
  37. package/dist/helpers/getExampleCode.d.ts.map +1 -1
  38. package/dist/helpers/getExampleCode.js +12 -31
  39. package/dist/hooks/useNavState.d.ts +22 -0
  40. package/dist/hooks/useNavState.d.ts.map +1 -1
  41. package/dist/hooks/useNavState.js +57 -34
  42. package/dist/index.js +1 -1
  43. package/dist/stores/useHttpClientStore.d.ts +3 -4
  44. package/dist/stores/useHttpClientStore.d.ts.map +1 -1
  45. package/dist/stores/useHttpClientStore.js +45 -58
  46. package/dist/style.css +1 -1
  47. package/dist/types.d.ts +2 -5
  48. package/dist/types.d.ts.map +1 -1
  49. package/package.json +9 -10
@@ -1,7 +1,6 @@
1
+ import type { Target, TargetId } from '@scalar/snippetz/types';
1
2
  import type { HiddenClients } from '@scalar/types/legacy';
2
- import { type TargetId } from 'httpsnippet-lite';
3
3
  import { type Ref } from 'vue';
4
- import type { AvailableTarget } from '../types';
5
4
  /**
6
5
  * Gets the client title from the availableTargets
7
6
  * { targetKey: 'shell', clientKey: 'curl' } -> 'Shell'
@@ -15,7 +14,7 @@ declare function getClientTitle(client: HttpClientState): string;
15
14
  /**
16
15
  * Filters out hidden clients from the available targets (based on the given configuration).
17
16
  */
18
- export declare function filterHiddenClients(targets: AvailableTarget[], exclude: Ref<HiddenClients>): AvailableTarget[];
17
+ export declare function filterHiddenClients(targets: Target[], exclude: Ref<HiddenClients>): Target[];
19
18
  /** The selected HTTP client */
20
19
  export type HttpClientState = {
21
20
  targetKey: TargetId;
@@ -34,7 +33,7 @@ export declare const useHttpClientStore: () => {
34
33
  setDefaultHttpClient: typeof setDefaultHttpClient;
35
34
  excludedClients: Ref<HiddenClients>;
36
35
  setExcludedClients: (v: HiddenClients) => void;
37
- availableTargets: import("vue").ComputedRef<AvailableTarget[]>;
36
+ availableTargets: import("vue").ComputedRef<Target[]>;
38
37
  getClientTitle: typeof getClientTitle;
39
38
  getTargetTitle: typeof getTargetTitle;
40
39
  httpTargetTitle: import("vue").ComputedRef<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"useHttpClientStore.d.ts","sourceRoot":"","sources":["../../src/stores/useHttpClientStore.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,EAAE,KAAK,QAAQ,EAAkC,MAAM,kBAAkB,CAAA;AAChF,OAAO,EAAE,KAAK,GAAG,EAAqC,MAAM,KAAK,CAAA;AAEjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAO/C;;;GAGG;AACH,iBAAS,cAAc,CAAC,MAAM,EAAE,eAAe,UAK9C;AAED;;;GAGG;AACH,iBAAS,cAAc,CAAC,MAAM,EAAE,eAAe,UAO9C;AAYD;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,eAAe,EAAE,EAC1B,OAAO,EAAE,GAAG,CAAC,aAAa,CAAC,GAC1B,eAAe,EAAE,CAkDnB;AAqBD,+BAA+B;AAC/B,MAAM,MAAM,eAAe,GAAG;IAAE,SAAS,EAAE,QAAQ,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAA;AAYxE,iBAAS,oBAAoB,CAAC,UAAU,CAAC,EAAE,eAAe,QAQzD;AAmCD,iBAAS,UAAU,SAElB;AAYD,kEAAkE;AAClE,eAAO,MAAM,kBAAkB;;4BAtEY,QAAQ;4BAAa,MAAM;;;8BA8DrC,OAAO,CAAC,eAAe,CAAC;;qBAcP,GAAG,CAAC,aAAa,CAAC;4BACxC,aAAa;;;;;;CAaxC,CAAA"}
1
+ {"version":3,"file":"useHttpClientStore.d.ts","sourceRoot":"","sources":["../../src/stores/useHttpClientStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,EAAE,KAAK,GAAG,EAAqC,MAAM,KAAK,CAAA;AASjE;;;GAGG;AACH,iBAAS,cAAc,CAAC,MAAM,EAAE,eAAe,UAK9C;AAED;;;GAGG;AACH,iBAAS,cAAc,CAAC,MAAM,EAAE,eAAe,UAO9C;AAYD;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,EAAE,EACjB,OAAO,EAAE,GAAG,CAAC,aAAa,CAAC,GAC1B,MAAM,EAAE,CAkDV;AASD,+BAA+B;AAC/B,MAAM,MAAM,eAAe,GAAG;IAAE,SAAS,EAAE,QAAQ,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAA;AAMxE,iBAAS,oBAAoB,CAAC,UAAU,CAAC,EAAE,eAAe,QAQzD;AAmCD,iBAAS,UAAU,SAElB;AAYD,kEAAkE;AAClE,eAAO,MAAM,kBAAkB;;4BAhEY,QAAQ;4BAAa,MAAM;;;8BAwDrC,OAAO,CAAC,eAAe,CAAC;;qBAcP,GAAG,CAAC,aAAa,CAAC;4BACxC,aAAa;;;;;;CAaxC,CAAA"}
@@ -1,82 +1,69 @@
1
- import { objectMerge as T } from "@scalar/oas-utils/helpers";
2
- import { availableTargets as m } from "httpsnippet-lite";
3
- import { computed as a, ref as k, reactive as A, readonly as f } from "vue";
1
+ import { objectMerge as p } from "@scalar/oas-utils/helpers";
2
+ import { snippetz as k } from "@scalar/snippetz";
3
+ import { computed as o, ref as d, reactive as m, readonly as a } from "vue";
4
4
  const y = {
5
5
  targetKey: "shell",
6
6
  clientKey: "curl"
7
- };
8
- function p(e) {
7
+ }, { clients: A } = k();
8
+ function C(t) {
9
9
  var n;
10
- return ((n = l.value.find((t) => t.key === e.targetKey)) == null ? void 0 : n.title) ?? e.targetKey;
10
+ return ((n = r.value.find((e) => e.key === t.targetKey)) == null ? void 0 : n.title) ?? t.targetKey;
11
11
  }
12
- function C(e) {
13
- var n, t;
14
- return ((t = (n = l.value.find((i) => i.key === e.targetKey)) == null ? void 0 : n.clients.find((i) => i.key === e.clientKey)) == null ? void 0 : t.title) ?? e.clientKey;
12
+ function K(t) {
13
+ var n, e;
14
+ return ((e = (n = r.value.find((i) => i.key === t.targetKey)) == null ? void 0 : n.clients.find((i) => i.client === t.clientKey)) == null ? void 0 : e.title) ?? t.clientKey;
15
15
  }
16
- const b = a(() => p(r)), h = a(() => C(r));
17
- function H(e, n) {
18
- return n.value === !0 ? [] : e.flatMap((t) => {
16
+ const H = o(() => C(l)), b = o(() => K(l));
17
+ function h(t, n) {
18
+ return n.value === !0 ? [] : t.flatMap((e) => {
19
19
  var i;
20
- return typeof n.value != "object" ? [] : Array.isArray(n.value) ? (t.clients = t.clients.filter(
20
+ return typeof n.value != "object" ? [] : Array.isArray(n.value) ? (e.clients = e.clients.filter(
21
21
  // @ts-expect-error Typescript, chill. It’s all good. It has to be an array.
22
- (s) => !n.value.includes(s.key)
23
- ), t.clients.length ? [t] : []) : n.value[t.key] === !0 ? [] : (Array.isArray(n.value[t.key]) && (t.clients = t.clients.filter((s) => !// @ts-expect-error We checked whether it’s an Array already.
24
- n.value[t.key].includes(s.key))), (i = t == null ? void 0 : t.clients) != null && i.length ? [t] : []);
22
+ (s) => !n.value.includes(s.client)
23
+ ), e.clients.length ? [e] : []) : n.value[e.key] === !0 ? [] : (Array.isArray(n.value[e.key]) && (e.clients = e.clients.filter((s) => !// @ts-expect-error We checked whether it’s an Array already.
24
+ n.value[e.key].includes(s.client))), (i = e == null ? void 0 : e.clients) != null && i.length ? [e] : []);
25
25
  });
26
26
  }
27
- const l = a(() => {
28
- var n;
29
- const e = m();
30
- return (n = e.find((t) => t.key === "node")) == null || n.clients.unshift({
31
- description: "An HTTP/1.1 client, written from scratch for Node.js.",
32
- key: "undici",
33
- link: "https://github.com/nodejs/undici",
34
- title: "undici"
35
- }), H(e, c);
36
- }), d = {
37
- node: ["unirest"]
38
- }, c = k({
39
- ...d === !0 ? {} : d
40
- }), o = k();
41
- function E(e) {
42
- e !== void 0 && (o.value = e, K(u()));
27
+ const r = o(() => h(A(), c)), c = d({}), f = d();
28
+ function j(t) {
29
+ t !== void 0 && (f.value = t, T(u()));
43
30
  }
44
31
  const u = () => {
45
- var e, n, t, i;
46
- return v(o.value) ? o.value : v(y) ? y : {
47
- targetKey: (e = l.value[0]) == null ? void 0 : e.key,
48
- clientKey: (i = (t = (n = l.value[0]) == null ? void 0 : n.clients) == null ? void 0 : t[0]) == null ? void 0 : i.key
32
+ var t, n, e, i;
33
+ return v(f.value) ? f.value : v(y) ? y : {
34
+ targetKey: (t = r.value[0]) == null ? void 0 : t.key,
35
+ clientKey: (i = (e = (n = r.value[0]) == null ? void 0 : n.clients) == null ? void 0 : e[0]) == null ? void 0 : i.client
49
36
  };
50
37
  };
51
- function v(e) {
52
- return e === void 0 ? !1 : !!l.value.find(
53
- (n) => n.key === e.targetKey && n.clients.find((t) => t.key === e.clientKey)
38
+ function v(t) {
39
+ return t === void 0 ? !1 : !!r.value.find(
40
+ (n) => n.key === t.targetKey && n.clients.find((e) => e.client === t.clientKey)
54
41
  );
55
42
  }
56
43
  function L() {
57
- T(r, u());
44
+ p(l, u());
58
45
  }
59
- const r = A(u()), K = (e) => {
60
- Object.assign(r, {
61
- ...r,
62
- ...e
46
+ const l = m(u()), T = (t) => {
47
+ Object.assign(l, {
48
+ ...l,
49
+ ...t
63
50
  });
64
- }, _ = () => ({
65
- httpClient: f(r),
51
+ }, S = () => ({
52
+ httpClient: a(l),
66
53
  resetState: L,
67
- setHttpClient: K,
68
- setDefaultHttpClient: E,
69
- excludedClients: f(c),
70
- setExcludedClients: (e) => {
71
- c.value = e, T(r, u());
54
+ setHttpClient: T,
55
+ setDefaultHttpClient: j,
56
+ excludedClients: a(c),
57
+ setExcludedClients: (t) => {
58
+ c.value = t, p(l, u());
72
59
  },
73
- availableTargets: l,
74
- getClientTitle: C,
75
- getTargetTitle: p,
76
- httpTargetTitle: b,
77
- httpClientTitle: h
60
+ availableTargets: r,
61
+ getClientTitle: K,
62
+ getTargetTitle: C,
63
+ httpTargetTitle: H,
64
+ httpClientTitle: b
78
65
  });
79
66
  export {
80
- H as filterHiddenClients,
81
- _ as useHttpClientStore
67
+ h as filterHiddenClients,
68
+ S as useHttpClientStore
82
69
  };