@scalar/api-reference 1.32.1 → 1.32.5

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 (110) hide show
  1. package/CHANGELOG.md +83 -0
  2. package/README.md +1 -1
  3. package/dist/browser/standalone.js +15738 -15439
  4. package/dist/browser/webpack-stats.json +1 -1
  5. package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
  6. package/dist/components/ApiReferenceLayout.vue.js +1 -1
  7. package/dist/components/ApiReferenceLayout.vue2.js +163 -158
  8. package/dist/components/Badge/Badge.vue.d.ts.map +1 -1
  9. package/dist/components/Badge/Badge.vue.js +1 -1
  10. package/dist/components/Card/CardHeader.vue.d.ts.map +1 -1
  11. package/dist/components/Card/CardHeader.vue.js +2 -2
  12. package/dist/components/Card/CardTab.vue.d.ts.map +1 -1
  13. package/dist/components/Card/CardTab.vue.js +3 -3
  14. package/dist/components/Card/CardTabHeader.vue.d.ts.map +1 -1
  15. package/dist/components/Card/CardTabHeader.vue.js +2 -2
  16. package/dist/components/Content/ClientLibraries/ClientLibraries.vue.js +1 -1
  17. package/dist/components/Content/ClientLibraries/ClientSelector.vue.js +1 -1
  18. package/dist/components/Content/Introduction/Introduction.vue.js +2 -2
  19. package/dist/components/Content/Lazy/Loading.vue.d.ts +1 -3
  20. package/dist/components/Content/Lazy/Loading.vue.d.ts.map +1 -1
  21. package/dist/components/Content/Lazy/Loading.vue.js +89 -89
  22. package/dist/components/Content/Models/Models.vue.d.ts.map +1 -1
  23. package/dist/components/Content/Models/Models.vue.js +2 -2
  24. package/dist/components/Content/Models/Models.vue2.js +59 -56
  25. package/dist/components/Content/Schema/RenderString.vue.d.ts +6 -0
  26. package/dist/components/Content/Schema/RenderString.vue.d.ts.map +1 -0
  27. package/dist/components/Content/Schema/RenderString.vue.js +14 -0
  28. package/dist/components/Content/Schema/RenderString.vue2.js +4 -0
  29. package/dist/components/Content/Schema/Schema.vue.d.ts +1 -1
  30. package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
  31. package/dist/components/Content/Schema/Schema.vue.js +2 -2
  32. package/dist/components/Content/Schema/Schema.vue2.js +76 -75
  33. package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
  34. package/dist/components/Content/Schema/SchemaComposition.vue.js +58 -66
  35. package/dist/components/Content/Schema/SchemaEnumValues.vue.d.ts +19 -0
  36. package/dist/components/Content/Schema/SchemaEnumValues.vue.d.ts.map +1 -0
  37. package/dist/components/Content/Schema/SchemaEnumValues.vue.js +7 -0
  38. package/dist/components/Content/Schema/SchemaEnumValues.vue2.js +125 -0
  39. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +2 -2
  40. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
  41. package/dist/components/Content/Schema/SchemaProperty.vue.js +1 -1
  42. package/dist/components/Content/Schema/SchemaProperty.vue2.js +96 -170
  43. package/dist/components/Content/Schema/SchemaPropertyDescription.vue.d.ts +18 -0
  44. package/dist/components/Content/Schema/SchemaPropertyDescription.vue.d.ts.map +1 -0
  45. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
  46. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +1 -1
  47. package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +155 -160
  48. package/dist/components/Content/Schema/helpers/get-schema-type.d.ts +6 -0
  49. package/dist/components/Content/Schema/helpers/get-schema-type.d.ts.map +1 -0
  50. package/dist/components/Content/Schema/helpers/get-schema-type.js +20 -0
  51. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js +1 -1
  52. package/dist/components/Content/Schema/helpers/optimizeValueForDisplay.d.ts.map +1 -1
  53. package/dist/components/Content/Schema/helpers/schema-name.d.ts.map +1 -1
  54. package/dist/components/Content/Schema/helpers/schema-name.js +20 -46
  55. package/dist/features/Operation/components/ContentTypeSelect.vue.d.ts.map +1 -1
  56. package/dist/features/Operation/components/ContentTypeSelect.vue.js +6 -6
  57. package/dist/features/Operation/components/ParameterListItem.vue.js +3 -3
  58. package/dist/features/Operation/components/RequestBody.vue.d.ts.map +1 -1
  59. package/dist/features/Operation/components/RequestBody.vue.js +1 -1
  60. package/dist/features/Operation/components/RequestBody.vue2.js +13 -10
  61. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
  62. package/dist/features/Operation/layouts/ClassicLayout.vue.js +1 -1
  63. package/dist/features/Operation/layouts/ClassicLayout.vue2.js +64 -60
  64. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
  65. package/dist/features/Operation/layouts/ModernLayout.vue.js +2 -2
  66. package/dist/features/Operation/layouts/ModernLayout.vue2.js +13 -13
  67. package/dist/features/Search/SearchButton.vue.d.ts +1 -0
  68. package/dist/features/Search/SearchButton.vue.d.ts.map +1 -1
  69. package/dist/features/Search/SearchButton.vue.js +36 -34
  70. package/dist/features/Search/SearchModal.vue.d.ts +1 -0
  71. package/dist/features/Search/SearchModal.vue.d.ts.map +1 -1
  72. package/dist/features/Search/SearchModal.vue.js +1 -1
  73. package/dist/features/Search/SearchModal.vue2.js +112 -112
  74. package/dist/features/Search/useSearchIndex.d.ts +4 -3
  75. package/dist/features/Search/useSearchIndex.d.ts.map +1 -1
  76. package/dist/features/Search/useSearchIndex.js +119 -82
  77. package/dist/features/api-client-modal/ApiClientModal.vue.d.ts +2 -2
  78. package/dist/features/api-client-modal/ApiClientModal.vue.d.ts.map +1 -1
  79. package/dist/features/api-client-modal/ApiClientModal.vue.js +47 -38
  80. package/dist/features/api-client-modal/useApiClient.d.ts +334 -334
  81. package/dist/features/api-client-modal/useApiClient.d.ts.map +1 -1
  82. package/dist/features/base-url/BaseUrl.vue.js +1 -1
  83. package/dist/features/example-responses/ExampleResponse.vue.js +3 -3
  84. package/dist/features/example-responses/ExampleResponse.vue2.js +7 -7
  85. package/dist/features/example-responses/ExampleResponses.vue.d.ts +1 -1
  86. package/dist/features/example-responses/ExampleResponses.vue.d.ts.map +1 -1
  87. package/dist/features/example-responses/ExampleResponses.vue.js +2 -2
  88. package/dist/features/sidebar/components/SidebarElement.vue.d.ts.map +1 -1
  89. package/dist/features/sidebar/components/SidebarElement.vue.js +1 -1
  90. package/dist/features/sidebar/components/SidebarElement.vue2.js +23 -21
  91. package/dist/features/sidebar/components/SidebarHttpBadge.vue.d.ts.map +1 -1
  92. package/dist/features/sidebar/components/SidebarHttpBadge.vue.js +2 -2
  93. package/dist/features/sidebar/components/SidebarHttpBadge.vue2.js +5 -6
  94. package/dist/features/test-request-button/TestRequestButton.vue.js +2 -2
  95. package/dist/features/traverse-schema/helpers/traverse-tags.js +26 -26
  96. package/dist/features/traverse-schema/index.d.ts +1 -1
  97. package/dist/features/traverse-schema/index.d.ts.map +1 -1
  98. package/dist/index.js +1 -1
  99. package/dist/libs/openapi.d.ts +15 -1
  100. package/dist/libs/openapi.d.ts.map +1 -1
  101. package/dist/libs/openapi.js +66 -47
  102. package/dist/standalone/lib/html-api.d.ts.map +1 -1
  103. package/dist/stores/useHttpClientStore.js +2 -2
  104. package/dist/style.css +1 -1
  105. package/dist/types.d.ts +3 -3
  106. package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue.d.ts +2 -2
  107. package/package.json +18 -18
  108. package/dist/hooks/useOperation.d.ts +0 -16
  109. package/dist/hooks/useOperation.d.ts.map +0 -1
  110. package/dist/hooks/useOperation.js +0 -27
@@ -1,79 +1,88 @@
1
- import { defineComponent as h, ref as S, onMounted as E, watch as g, onBeforeUnmount as D, createElementBlock as b, openBlock as x } from "vue";
2
- import { useActiveEntities as M, useWorkspace as U } from "@scalar/api-client/store";
3
- import { mutateSecuritySchemeDiff as k } from "@scalar/api-client/views/Request/libs";
4
- import { getServersFromOpenApiDocument as A } from "@scalar/oas-utils/transforms";
1
+ import { defineComponent as S, ref as g, onMounted as E, watch as B, onBeforeUnmount as b, createElementBlock as D, openBlock as R } from "vue";
2
+ import { useActiveEntities as k, useWorkspace as q } from "@scalar/api-client/store";
3
+ import { mutateSecuritySchemeDiff as x } from "@scalar/api-client/views/Request/libs";
4
+ import { getServersFromOpenApiDocument as M } from "@scalar/oas-utils/transforms";
5
5
  import { watchDebounced as d } from "@vueuse/core";
6
- import C from "microdiff";
7
- import { useNavState as y } from "../../hooks/useNavState.js";
8
- import { useApiClient as B } from "./useApiClient.js";
9
- import { useExampleStore as L } from "../../legacy/stores/useExampleStore.js";
10
- const z = /* @__PURE__ */ h({
6
+ import U from "microdiff";
7
+ import { useNavState as A } from "../../hooks/useNavState.js";
8
+ import { useApiClient as C } from "./useApiClient.js";
9
+ import { useExampleStore as y } from "../../legacy/stores/useExampleStore.js";
10
+ const z = /* @__PURE__ */ S({
11
11
  __name: "ApiClientModal",
12
12
  props: {
13
13
  configuration: {},
14
14
  dereferencedDocument: {}
15
15
  },
16
- setup(n) {
17
- const a = S(null), { client: c, init: v } = B(), { selectedExampleKey: p, operationId: s } = L(), u = M(), i = U(), { isIntersectionEnabled: m } = y();
16
+ setup(o) {
17
+ const a = g(null), { client: i, init: v } = C(), { selectedExampleKey: p, operationId: s } = y(), c = k(), u = q(), { isIntersectionEnabled: f } = A(), h = () => ({
18
+ name: "on-before-request",
19
+ hooks: {
20
+ onBeforeRequest: o.configuration.onBeforeRequest
21
+ }
22
+ });
18
23
  return E(() => {
19
24
  a.value && v({
20
25
  el: a.value,
21
- configuration: n.configuration,
22
- store: i
26
+ configuration: {
27
+ ...o.configuration,
28
+ // If the onBeforeRequest hook is configured, we add the plugin to the API client.
29
+ plugins: o.configuration.onBeforeRequest ? [h] : []
30
+ },
31
+ store: u
23
32
  });
24
33
  }), d(
25
- () => n.dereferencedDocument,
34
+ () => o.dereferencedDocument,
26
35
  (e) => {
27
- var r, o;
28
- e && (u.activeCollection.value && ((r = c.value) == null || r.resetStore()), i.importSpecFile(void 0, "default", {
36
+ var r, n;
37
+ e && (c.activeCollection.value && ((r = i.value) == null || r.resetStore()), u.importSpecFile(void 0, "default", {
29
38
  dereferencedDocument: e,
30
39
  shouldLoad: !1,
31
- documentUrl: (o = n.configuration) == null ? void 0 : o.url,
40
+ documentUrl: (n = o.configuration) == null ? void 0 : n.url,
32
41
  useCollectionSecurity: !0,
33
- ...n.configuration
42
+ ...o.configuration
34
43
  }));
35
44
  }
36
45
  ), d(
37
- () => n.configuration,
46
+ () => o.configuration,
38
47
  (e, r) => {
39
- if (!r || !u.activeCollection.value)
48
+ if (!r || !c.activeCollection.value)
40
49
  return;
41
- const o = u.activeCollection.value, f = C(r, e);
42
- if (!f.some(
50
+ const n = c.activeCollection.value, m = U(r, e);
51
+ if (!m.some(
43
52
  (t) => t.path[0] === "url" || t.path[0] === "content" || t.path[1] === "url" || t.path[1] === "content"
44
53
  )) {
45
- if (f.forEach((t) => {
46
- t.path[0] === "authentication" && k(t, u, i);
54
+ if (m.forEach((t) => {
55
+ t.path[0] === "authentication" && x(t, c, u);
47
56
  }), e.servers || r.servers) {
48
- o.servers.forEach((l) => {
49
- i.serverMutators.delete(l, o.uid);
57
+ n.servers.forEach((l) => {
58
+ u.serverMutators.delete(l, n.uid);
50
59
  });
51
- const t = A(
52
- e.servers ?? n.dereferencedDocument.servers,
60
+ const t = M(
61
+ e.servers ?? o.dereferencedDocument.servers,
53
62
  {
54
63
  baseServerURL: e.baseServerURL
55
64
  }
56
65
  );
57
66
  t.forEach((l) => {
58
- i.serverMutators.add(l, o.uid);
59
- }), t.length && i.collectionMutators.edit(
60
- o.uid,
67
+ u.serverMutators.add(l, n.uid);
68
+ }), t.length && u.collectionMutators.edit(
69
+ n.uid,
61
70
  "selectedServerUid",
62
71
  t[t.length - 1].uid
63
72
  );
64
73
  }
65
74
  }
66
- m.value = !1, setTimeout(() => {
67
- m.value = !0;
75
+ f.value = !1, setTimeout(() => {
76
+ f.value = !0;
68
77
  }, 1e3);
69
78
  },
70
79
  { deep: !0, debounce: 300 }
71
- ), g(p, (e) => {
72
- c.value && e && s.value && c.value.updateExample(e, s.value);
73
- }), D(() => {
80
+ ), B(p, (e) => {
81
+ i.value && e && s.value && i.value.updateExample(e, s.value);
82
+ }), b(() => {
74
83
  var e;
75
- return (e = c.value) == null ? void 0 : e.app.unmount();
76
- }), (e, r) => (x(), b("div", {
84
+ return (e = i.value) == null ? void 0 : e.app.unmount();
85
+ }), (e, r) => (R(), D("div", {
77
86
  ref_key: "el",
78
87
  ref: a
79
88
  }, null, 512));