@scalar/api-reference 1.34.1 → 1.34.4

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 (113) hide show
  1. package/CHANGELOG.md +99 -0
  2. package/README.md +1 -1
  3. package/dist/browser/standalone.js +13121 -12730
  4. package/dist/browser/webpack-stats.json +1 -1
  5. package/dist/components/Badge/Badge.vue.d.ts +4 -1
  6. package/dist/components/Badge/Badge.vue.d.ts.map +1 -1
  7. package/dist/components/Badge/Badge.vue.js +5 -11
  8. package/dist/components/Badge/Badge.vue2.js +22 -2
  9. package/dist/components/Badge/Badge.vue3.js +4 -0
  10. package/dist/components/Content/ClientLibraries/ClientLibraries.vue.d.ts +1 -1
  11. package/dist/components/Content/ClientLibraries/ClientLibraries.vue.d.ts.map +1 -1
  12. package/dist/components/Content/ClientLibraries/ClientLibraries.vue.js +1 -1
  13. package/dist/components/Content/Models/Models.vue.d.ts.map +1 -1
  14. package/dist/components/Content/Models/Models.vue.js +30 -31
  15. package/dist/components/Content/Models/ModernLayout.vue.d.ts +2 -0
  16. package/dist/components/Content/Models/ModernLayout.vue.d.ts.map +1 -1
  17. package/dist/components/Content/Models/ModernLayout.vue.js +2 -2
  18. package/dist/components/Content/Models/ModernLayout.vue2.js +39 -37
  19. package/dist/components/Content/Operations/TraversedEntry.vue.js +12 -12
  20. package/dist/components/Content/Tags/TagSection.vue.js +6 -6
  21. package/dist/components/GettingStarted.vue.js +3 -3
  22. package/dist/components/GettingStarted.vue2.js +21 -21
  23. package/dist/components/MobileHeader.vue.d.ts.map +1 -1
  24. package/dist/components/MobileHeader.vue.js +3 -3
  25. package/dist/components/Section/CompactSection.vue.d.ts +2 -0
  26. package/dist/components/Section/CompactSection.vue.d.ts.map +1 -1
  27. package/dist/components/Section/CompactSection.vue.js +1 -1
  28. package/dist/components/Section/CompactSection.vue2.js +30 -29
  29. package/dist/features/Operation/Operation.vue.d.ts +2 -1
  30. package/dist/features/Operation/Operation.vue.d.ts.map +1 -1
  31. package/dist/features/Operation/Operation.vue.js +53 -52
  32. package/dist/features/Operation/components/callbacks/Callback.vue.d.ts +1 -2
  33. package/dist/features/Operation/components/callbacks/Callback.vue.d.ts.map +1 -1
  34. package/dist/features/Operation/components/callbacks/Callback.vue.js +3 -3
  35. package/dist/features/Operation/components/callbacks/Callback.vue3.js +2 -2
  36. package/dist/features/Operation/components/callbacks/Callbacks.vue.d.ts.map +1 -1
  37. package/dist/features/Operation/components/callbacks/Callbacks.vue.js +16 -16
  38. package/dist/features/Operation/helpers/combine-params.d.ts +5 -0
  39. package/dist/features/Operation/helpers/combine-params.d.ts.map +1 -0
  40. package/dist/features/Operation/helpers/combine-params.js +13 -0
  41. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +3 -4
  42. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
  43. package/dist/features/Operation/layouts/ClassicLayout.vue.js +2 -2
  44. package/dist/features/Operation/layouts/ClassicLayout.vue2.js +59 -50
  45. package/dist/features/Operation/layouts/ClassicLayout.vue3.js +2 -2
  46. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts +3 -4
  47. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
  48. package/dist/features/Operation/layouts/ModernLayout.vue.js +2 -2
  49. package/dist/features/Operation/layouts/ModernLayout.vue2.js +94 -78
  50. package/dist/features/Search/helpers/create-fuse-instance.d.ts.map +1 -1
  51. package/dist/features/Search/helpers/create-fuse-instance.js +0 -3
  52. package/dist/features/api-client-modal/ApiClientModal.vue.d.ts.map +1 -1
  53. package/dist/features/api-client-modal/ApiClientModal.vue.js +51 -48
  54. package/dist/features/api-client-modal/useApiClient.d.ts +100 -100
  55. package/dist/features/api-client-modal/useApiClient.d.ts.map +1 -1
  56. package/dist/features/document-source/hooks/useDocumentFetcher.d.ts.map +1 -1
  57. package/dist/features/document-source/hooks/useDocumentFetcher.js +16 -18
  58. package/dist/features/document-source/hooks/useDocumentSource.d.ts.map +1 -1
  59. package/dist/features/document-source/hooks/useDocumentSource.js +30 -33
  60. package/dist/features/example-responses/ExampleResponse.vue.d.ts +1 -1
  61. package/dist/features/example-responses/ExampleResponse.vue.d.ts.map +1 -1
  62. package/dist/features/example-responses/ExampleResponse.vue.js +2 -2
  63. package/dist/features/example-responses/ExampleResponse.vue2.js +15 -13
  64. package/dist/features/example-responses/ExampleResponses.vue.d.ts +2 -3
  65. package/dist/features/example-responses/ExampleResponses.vue.d.ts.map +1 -1
  66. package/dist/features/example-responses/ExampleResponses.vue.js +2 -2
  67. package/dist/features/example-responses/ExampleResponses.vue2.js +73 -69
  68. package/dist/features/example-responses/helpers/get-resolved-ref-deep.d.ts +26 -0
  69. package/dist/features/example-responses/helpers/get-resolved-ref-deep.d.ts.map +1 -0
  70. package/dist/features/example-responses/helpers/get-resolved-ref-deep.js +29 -0
  71. package/dist/features/sidebar/components/SidebarElement.vue.d.ts.map +1 -1
  72. package/dist/features/sidebar/components/SidebarElement.vue.js +1 -1
  73. package/dist/features/sidebar/components/SidebarElement.vue2.js +6 -6
  74. package/dist/features/sidebar/helpers/create-sidebar.d.ts.map +1 -1
  75. package/dist/features/sidebar/helpers/create-sidebar.js +13 -14
  76. package/dist/features/traverse-schema/helpers/traverse-paths.d.ts +1 -2
  77. package/dist/features/traverse-schema/helpers/traverse-paths.d.ts.map +1 -1
  78. package/dist/features/traverse-schema/helpers/traverse-schemas.d.ts.map +1 -1
  79. package/dist/features/traverse-schema/helpers/traverse-tags.d.ts.map +1 -1
  80. package/dist/features/traverse-schema/helpers/traverse-webhooks.d.ts.map +1 -1
  81. package/dist/features/traverse-schema/types.d.ts +11 -12
  82. package/dist/features/traverse-schema/types.d.ts.map +1 -1
  83. package/dist/features/x-badges/XBadges.vue.d.ts +8 -0
  84. package/dist/features/x-badges/XBadges.vue.d.ts.map +1 -0
  85. package/dist/features/x-badges/XBadges.vue.js +26 -0
  86. package/dist/features/x-badges/XBadges.vue2.js +4 -0
  87. package/dist/features/x-badges/index.d.ts +2 -0
  88. package/dist/features/x-badges/index.d.ts.map +1 -0
  89. package/dist/helpers/test-utils.d.ts +1 -1
  90. package/dist/helpers/test-utils.d.ts.map +1 -1
  91. package/dist/hooks/useNavState.d.ts +1 -2
  92. package/dist/hooks/useNavState.d.ts.map +1 -1
  93. package/dist/index.js +1 -1
  94. package/dist/libs/openapi.d.ts +4 -14
  95. package/dist/libs/openapi.d.ts.map +1 -1
  96. package/dist/libs/openapi.js +55 -36
  97. package/dist/style.css +1 -1
  98. package/dist/v2/ApiReferenceWorkspace.vue.d.ts.map +1 -1
  99. package/dist/v2/ApiReferenceWorkspace.vue.js +64 -64
  100. package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue.d.ts +1 -2
  101. package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue.d.ts.map +1 -1
  102. package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue.js +2 -2
  103. package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue2.js +97 -100
  104. package/dist/v2/blocks/scalar-request-example-block/helpers/generate-code-snippet.d.ts +1 -2
  105. package/dist/v2/blocks/scalar-request-example-block/helpers/generate-code-snippet.d.ts.map +1 -1
  106. package/dist/v2/blocks/scalar-request-example-block/helpers/generate-code-snippet.js +17 -20
  107. package/dist/v2/blocks/scalar-request-example-block/helpers/get-secrets.d.ts.map +1 -1
  108. package/dist/v2/helpers/map-configuration.d.ts +66 -0
  109. package/dist/v2/helpers/map-configuration.d.ts.map +1 -0
  110. package/dist/v2/helpers/map-configuration.js +53 -0
  111. package/dist/vitest.setup.d.ts +2 -0
  112. package/dist/vitest.setup.d.ts.map +1 -0
  113. package/package.json +24 -20
@@ -1,93 +1,96 @@
1
- import { defineComponent as S, ref as g, onMounted as E, watch as B, onBeforeUnmount as b, createElementBlock as R, openBlock as k } from "vue";
2
- import { useActiveEntities as q, useWorkspace as x } from "@scalar/api-client/store";
3
- import { mutateSecuritySchemeDiff as y } from "@scalar/api-client/views/Request/libs";
4
- import { getServersFromOpenApiDocument as D } from "@scalar/oas-utils/transforms";
5
- import { watchDebounced as d } from "@vueuse/core";
6
- import M from "microdiff";
7
- import { useNavState as U } from "../../hooks/useNavState.js";
1
+ import { defineComponent as E, ref as B, onMounted as b, watch as R, onBeforeUnmount as k, createElementBlock as q, openBlock as x } from "vue";
2
+ import { useActiveEntities as D, useWorkspace as M } from "@scalar/api-client/store";
3
+ import { mutateSecuritySchemeDiff as U } from "@scalar/api-client/views/Request/libs";
4
+ import { getServersFromDocument as C } from "@scalar/oas-utils/helpers";
5
+ import { watchDebounced as v } from "@vueuse/core";
6
+ import h from "microdiff";
7
+ import { useNavState as y } from "../../hooks/useNavState.js";
8
8
  import { useApiClient as A } from "./useApiClient.js";
9
- import { useExampleStore as C } from "../../legacy/stores/useExampleStore.js";
10
- const j = /* @__PURE__ */ S({
9
+ import { useExampleStore as L } from "../../legacy/stores/useExampleStore.js";
10
+ const z = /* @__PURE__ */ E({
11
11
  __name: "ApiClientModal",
12
12
  props: {
13
13
  configuration: {},
14
14
  dereferencedDocument: {}
15
15
  },
16
- setup(r) {
17
- const s = g(null), { client: c, init: v } = A(), { selectedExampleKey: p, operationId: f } = C(), a = q(), n = x(), { isIntersectionEnabled: m } = U(), h = () => ({
16
+ setup(o) {
17
+ const l = B(null), { client: c, init: p } = A(), { selectedExampleKey: S, operationId: m } = L(), a = D(), n = M(), { isIntersectionEnabled: d } = y(), g = () => ({
18
18
  name: "on-before-request",
19
19
  hooks: {
20
- onBeforeRequest: r.configuration.onBeforeRequest
20
+ onBeforeRequest: o.configuration.onBeforeRequest
21
21
  }
22
22
  });
23
- return E(() => {
24
- s.value && v({
25
- el: s.value,
23
+ return b(() => {
24
+ l.value && p({
25
+ el: l.value,
26
26
  configuration: {
27
- ...r.configuration,
27
+ ...o.configuration,
28
28
  // If the onBeforeRequest hook is configured, we add the plugin to the API client.
29
- plugins: r.configuration.onBeforeRequest ? [h] : []
29
+ plugins: o.configuration.onBeforeRequest ? [g] : []
30
30
  },
31
31
  store: n
32
32
  });
33
- }), d(
34
- () => r.dereferencedDocument,
35
- (e, i) => {
36
- var o, u;
37
- e && JSON.stringify(e) !== JSON.stringify(i || {}) && (a.activeCollection.value && ((o = c.value) == null || o.resetStore()), n.importSpecFile(void 0, "default", {
33
+ }), v(
34
+ () => o.dereferencedDocument,
35
+ (e, u) => {
36
+ var i, s;
37
+ if (!e)
38
+ return;
39
+ const r = h(e, u || {});
40
+ r != null && r.length && (a.activeCollection.value && ((i = c.value) == null || i.resetStore()), n.importSpecFile(void 0, "default", {
38
41
  dereferencedDocument: e,
39
42
  shouldLoad: !1,
40
- documentUrl: (u = r.configuration) == null ? void 0 : u.url,
43
+ documentUrl: (s = o.configuration) == null ? void 0 : s.url,
41
44
  useCollectionSecurity: !0,
42
- ...r.configuration
45
+ ...o.configuration
43
46
  }));
44
47
  }
45
- ), d(
46
- () => r.configuration,
47
- (e, i) => {
48
- if (!i || !a.activeCollection.value)
48
+ ), v(
49
+ () => o.configuration,
50
+ (e, u) => {
51
+ if (!u || !a.activeCollection.value)
49
52
  return;
50
- const o = a.activeCollection.value, u = M(i, e);
51
- if (!u.some(
53
+ const r = a.activeCollection.value, i = h(u, e);
54
+ if (!i.some(
52
55
  (t) => t.path[0] === "url" || t.path[0] === "content" || t.path[1] === "url" || t.path[1] === "content"
53
56
  )) {
54
- if (u.forEach((t) => {
55
- t.path[0] === "authentication" && y(t, a, n);
56
- }), e.servers || i.servers) {
57
- o.servers.forEach((l) => {
58
- n.serverMutators.delete(l, o.uid);
57
+ if (i.forEach((t) => {
58
+ t.path[0] === "authentication" && U(t, a, n);
59
+ }), e.servers || u.servers) {
60
+ r.servers.forEach((f) => {
61
+ n.serverMutators.delete(f, r.uid);
59
62
  });
60
- const t = D(
61
- e.servers ?? r.dereferencedDocument.servers,
63
+ const t = C(
64
+ e.servers ?? o.dereferencedDocument.servers,
62
65
  {
63
66
  baseServerURL: e.baseServerURL
64
67
  }
65
68
  );
66
- t.forEach((l) => {
67
- n.serverMutators.add(l, o.uid);
69
+ t.forEach((f) => {
70
+ n.serverMutators.add(f, r.uid);
68
71
  }), t.length && n.collectionMutators.edit(
69
- o.uid,
72
+ r.uid,
70
73
  "selectedServerUid",
71
74
  t[t.length - 1].uid
72
75
  );
73
76
  }
74
77
  }
75
- m.value = !1, setTimeout(() => {
76
- m.value = !0;
78
+ d.value = !1, setTimeout(() => {
79
+ d.value = !0;
77
80
  }, 1e3);
78
81
  },
79
82
  { deep: !0, debounce: 300 }
80
- ), B(p, (e) => {
81
- c.value && e && f.value && c.value.updateExample(e, f.value);
82
- }), b(() => {
83
+ ), R(S, (e) => {
84
+ c.value && e && m.value && c.value.updateExample(e, m.value);
85
+ }), k(() => {
83
86
  var e;
84
87
  return (e = c.value) == null ? void 0 : e.app.unmount();
85
- }), (e, i) => (k(), R("div", {
88
+ }), (e, u) => (x(), q("div", {
86
89
  ref_key: "el",
87
- ref: s
90
+ ref: l
88
91
  }, null, 512));
89
92
  }
90
93
  });
91
94
  export {
92
- j as default
95
+ z as default
93
96
  };