@scalar/api-reference 1.25.68 → 1.25.70

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 (144) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/dist/browser/standalone.js +10519 -10533
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/ApiReferenceLayout.vue.js +2 -2
  5. package/dist/components/ApiReferenceLayout.vue2.js +1 -1
  6. package/dist/components/Content/Content.vue.d.ts +4 -2
  7. package/dist/components/Content/Content.vue.d.ts.map +1 -1
  8. package/dist/components/Content/Content.vue.js +1 -1
  9. package/dist/components/Content/Content.vue2.js +33 -33
  10. package/dist/components/Content/Lazy/Loading.vue.d.ts +3 -3
  11. package/dist/components/Content/Lazy/Loading.vue.d.ts.map +1 -1
  12. package/dist/components/Content/Lazy/Loading.vue.js +27 -27
  13. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
  14. package/dist/components/Content/Schema/SchemaProperty.vue.js +2 -2
  15. package/dist/components/Content/Tag/TagList.vue.d.ts +1 -1
  16. package/dist/components/Content/Tag/TagList.vue.d.ts.map +1 -1
  17. package/dist/components/Content/Tag/TagList.vue.js +33 -35
  18. package/dist/components/Content/Webhooks/index.d.ts +1 -1
  19. package/dist/components/Content/Webhooks/index.d.ts.map +1 -1
  20. package/dist/components/Layouts/ClassicLayout.vue.d.ts.map +1 -1
  21. package/dist/components/{Content/Operation/EndpointPath.vue.d.ts → OperationPath.vue.d.ts} +1 -1
  22. package/dist/components/OperationPath.vue.d.ts.map +1 -0
  23. package/dist/components/OperationPath.vue.js +7 -0
  24. package/dist/components/OperationPath.vue2.js +23 -0
  25. package/dist/components/Section/Section.vue.d.ts.map +1 -1
  26. package/dist/components/Section/Section.vue.js +2 -2
  27. package/dist/components/Section/Section.vue2.js +4 -4
  28. package/dist/components/Section/SectionContainer.vue.d.ts.map +1 -1
  29. package/dist/components/Section/SectionContainer.vue.js +2 -2
  30. package/dist/embeds/ExampleRequest/ExampleRequest.vue.d.ts.map +1 -1
  31. package/dist/embeds/OpenApiDocument/OpenApiDocument.vue.d.ts.map +1 -1
  32. package/dist/features/BaseUrl/ServerUrlSelect.vue.js +3 -3
  33. package/dist/features/BaseUrl/ServerVariablesForm.vue.js +1 -1
  34. package/dist/{components/Content/Operation/EndpointDetailsCard.vue.d.ts → features/Operation/Operation.vue.d.ts} +6 -2
  35. package/dist/features/Operation/Operation.vue.d.ts.map +1 -0
  36. package/dist/features/Operation/Operation.vue.js +25 -0
  37. package/dist/features/Operation/Operation.vue2.js +4 -0
  38. package/dist/features/Operation/Webhooks.vue.d.ts.map +1 -0
  39. package/dist/features/Operation/Webhooks.vue.js +7 -0
  40. package/dist/{components/Content/Webhooks → features/Operation}/Webhooks.vue2.js +12 -12
  41. package/dist/features/Operation/components/ContentTypeSelect.vue.d.ts.map +1 -0
  42. package/dist/{components/Content/Operation → features/Operation/components}/ContentTypeSelect.vue.js +2 -2
  43. package/dist/{components/Content/Operation → features/Operation/components}/ContentTypeSelect.vue2.js +8 -8
  44. package/dist/features/Operation/components/OperationParameters.vue.d.ts +7 -0
  45. package/dist/features/Operation/components/OperationParameters.vue.d.ts.map +1 -0
  46. package/dist/features/Operation/components/OperationParameters.vue.js +71 -0
  47. package/dist/features/Operation/components/OperationParameters.vue2.js +4 -0
  48. package/dist/{components/Content/Operation/EndpointDetails.vue.d.ts → features/Operation/components/OperationResponses.vue.d.ts} +5 -2
  49. package/dist/features/Operation/components/OperationResponses.vue.d.ts.map +1 -0
  50. package/dist/features/Operation/components/OperationResponses.vue.js +25 -0
  51. package/dist/features/Operation/components/OperationResponses.vue2.js +4 -0
  52. package/dist/features/Operation/components/ParameterHeaders.vue.d.ts.map +1 -0
  53. package/dist/features/Operation/components/ParameterHeaders.vue.js +7 -0
  54. package/dist/{components/Content/Operation → features/Operation/components}/ParameterHeaders.vue2.js +8 -8
  55. package/dist/{components/Content/Operation/Parameters.vue.d.ts → features/Operation/components/ParameterList.vue.d.ts} +3 -3
  56. package/dist/features/Operation/components/ParameterList.vue.d.ts.map +1 -0
  57. package/dist/features/Operation/components/ParameterList.vue.js +7 -0
  58. package/dist/{components/Content/Operation/Parameters.vue2.js → features/Operation/components/ParameterList.vue2.js} +7 -7
  59. package/dist/{components/Content/Operation/ParameterItem.vue.d.ts → features/Operation/components/ParameterListItem.vue.d.ts} +3 -3
  60. package/dist/features/Operation/components/ParameterListItem.vue.d.ts.map +1 -0
  61. package/dist/features/Operation/components/ParameterListItem.vue.js +7 -0
  62. package/dist/{components/Content/Operation/ParameterItem.vue2.js → features/Operation/components/ParameterListItem.vue2.js} +20 -20
  63. package/dist/features/Operation/components/RequestBody.vue.d.ts.map +1 -0
  64. package/dist/{components/Content/Operation → features/Operation/components}/RequestBody.vue.js +1 -1
  65. package/dist/{components/Content/Operation → features/Operation/components}/RequestBody.vue2.js +1 -1
  66. package/dist/features/Operation/components/RequestBodyPropertiesChild.vue.d.ts.map +1 -0
  67. package/dist/features/Operation/components/Webhook.vue.d.ts.map +1 -0
  68. package/dist/{components/Content/Webhooks → features/Operation/components}/Webhook.vue.js +2 -2
  69. package/dist/features/Operation/components/Webhook.vue2.js +29 -0
  70. package/dist/{hooks → features/Operation/hooks}/useResponses.d.ts +1 -1
  71. package/dist/features/Operation/hooks/useResponses.d.ts.map +1 -0
  72. package/dist/features/Operation/index.d.ts +3 -0
  73. package/dist/features/Operation/index.d.ts.map +1 -0
  74. package/dist/{components/Content/Operation/OperationAccordion.vue.d.ts → features/Operation/layouts/ClassicLayout.vue.d.ts} +1 -1
  75. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -0
  76. package/dist/features/Operation/layouts/ClassicLayout.vue.js +7 -0
  77. package/dist/features/Operation/layouts/ClassicLayout.vue2.js +114 -0
  78. package/dist/{components/Content/Operation/Operation.vue.d.ts → features/Operation/layouts/ModernLayout.vue.d.ts} +1 -1
  79. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -0
  80. package/dist/features/Operation/layouts/ModernLayout.vue.js +7 -0
  81. package/dist/features/Operation/layouts/ModernLayout.vue2.js +114 -0
  82. package/dist/features/Search/SearchButton.vue.js +2 -2
  83. package/dist/features/Search/SearchButton.vue2.js +1 -1
  84. package/dist/features/Search/useSearchIndex.js +8 -8
  85. package/dist/features/TestRequestButton/TestRequestButton.vue.d.ts.map +1 -0
  86. package/dist/features/TestRequestButton/TestRequestButton.vue.js +7 -0
  87. package/dist/{components/Content/Operation → features/TestRequestButton}/TestRequestButton.vue2.js +6 -6
  88. package/dist/features/TestRequestButton/index.d.ts +2 -0
  89. package/dist/features/TestRequestButton/index.d.ts.map +1 -0
  90. package/dist/helpers/parse.d.ts.map +1 -1
  91. package/dist/helpers/parse.js +55 -52
  92. package/dist/hooks/index.d.ts +0 -1
  93. package/dist/hooks/index.d.ts.map +1 -1
  94. package/dist/hooks/useOperation.d.ts +7 -10
  95. package/dist/hooks/useOperation.d.ts.map +1 -1
  96. package/dist/hooks/useOperation.js +13 -11
  97. package/dist/index.js +12 -14
  98. package/dist/legacy/components/CardFormGroup.vue.d.ts.map +1 -1
  99. package/dist/legacy/components/CardFormGroup.vue.js +1 -1
  100. package/dist/legacy/components/SecurityScheme.vue2.js +6 -6
  101. package/dist/legacy/components/SecuritySchemeSelector.vue.js +3 -3
  102. package/dist/style.css +1 -1
  103. package/package.json +11 -10
  104. package/dist/components/Content/Operation/ContentTypeSelect.vue.d.ts.map +0 -1
  105. package/dist/components/Content/Operation/EndpointDetails.vue.d.ts.map +0 -1
  106. package/dist/components/Content/Operation/EndpointDetails.vue.js +0 -88
  107. package/dist/components/Content/Operation/EndpointDetails.vue2.js +0 -4
  108. package/dist/components/Content/Operation/EndpointDetailsCard.vue.d.ts.map +0 -1
  109. package/dist/components/Content/Operation/EndpointDetailsCard.vue.js +0 -7
  110. package/dist/components/Content/Operation/EndpointDetailsCard.vue2.js +0 -67
  111. package/dist/components/Content/Operation/EndpointPath.vue.d.ts.map +0 -1
  112. package/dist/components/Content/Operation/EndpointPath.vue.js +0 -7
  113. package/dist/components/Content/Operation/EndpointPath.vue2.js +0 -23
  114. package/dist/components/Content/Operation/Operation.vue.d.ts.map +0 -1
  115. package/dist/components/Content/Operation/Operation.vue.js +0 -7
  116. package/dist/components/Content/Operation/Operation.vue2.js +0 -105
  117. package/dist/components/Content/Operation/OperationAccordion.vue.d.ts.map +0 -1
  118. package/dist/components/Content/Operation/OperationAccordion.vue.js +0 -7
  119. package/dist/components/Content/Operation/OperationAccordion.vue2.js +0 -103
  120. package/dist/components/Content/Operation/ParameterHeaders.vue.d.ts.map +0 -1
  121. package/dist/components/Content/Operation/ParameterHeaders.vue.js +0 -7
  122. package/dist/components/Content/Operation/ParameterItem.vue.d.ts.map +0 -1
  123. package/dist/components/Content/Operation/ParameterItem.vue.js +0 -7
  124. package/dist/components/Content/Operation/Parameters.vue.d.ts.map +0 -1
  125. package/dist/components/Content/Operation/Parameters.vue.js +0 -7
  126. package/dist/components/Content/Operation/RequestBody.vue.d.ts.map +0 -1
  127. package/dist/components/Content/Operation/RequestBodyPropertiesChild.vue.d.ts.map +0 -1
  128. package/dist/components/Content/Operation/TestRequestButton.vue.d.ts.map +0 -1
  129. package/dist/components/Content/Operation/TestRequestButton.vue.js +0 -7
  130. package/dist/components/Content/Operation/index.d.ts +0 -3
  131. package/dist/components/Content/Operation/index.d.ts.map +0 -1
  132. package/dist/components/Content/Webhooks/Webhook.vue.d.ts.map +0 -1
  133. package/dist/components/Content/Webhooks/Webhook.vue2.js +0 -39
  134. package/dist/components/Content/Webhooks/Webhooks.vue.d.ts.map +0 -1
  135. package/dist/components/Content/Webhooks/Webhooks.vue.js +0 -7
  136. package/dist/hooks/useResponses.d.ts.map +0 -1
  137. /package/dist/{components/Content/Webhooks → features/Operation}/Webhooks.vue.d.ts +0 -0
  138. /package/dist/{components/Content/Operation → features/Operation/components}/ContentTypeSelect.vue.d.ts +0 -0
  139. /package/dist/{components/Content/Operation → features/Operation/components}/ParameterHeaders.vue.d.ts +0 -0
  140. /package/dist/{components/Content/Operation → features/Operation/components}/RequestBody.vue.d.ts +0 -0
  141. /package/dist/{components/Content/Operation → features/Operation/components}/RequestBodyPropertiesChild.vue.d.ts +0 -0
  142. /package/dist/{components/Content/Webhooks → features/Operation/components}/Webhook.vue.d.ts +0 -0
  143. /package/dist/{hooks → features/Operation/hooks}/useResponses.js +0 -0
  144. /package/dist/{components/Content/Operation → features/TestRequestButton}/TestRequestButton.vue.d.ts +0 -0
@@ -0,0 +1,29 @@
1
+ import { defineComponent as n, openBlock as a, createElementBlock as m, Fragment as s, createVNode as r, withCtx as p, createTextVNode as i, createCommentVNode as d } from "vue";
2
+ import u from "./OperationResponses.vue.js";
3
+ import k from "./RequestBody.vue.js";
4
+ const c = /* @__PURE__ */ n({
5
+ __name: "Webhook",
6
+ props: {
7
+ webhook: {}
8
+ },
9
+ setup(l) {
10
+ return (e, o) => {
11
+ var t;
12
+ return e.webhook ? (a(), m(s, { key: 0 }, [
13
+ r(k, {
14
+ class: "webhook-request-body",
15
+ requestBody: (t = e.webhook.information) == null ? void 0 : t.requestBody
16
+ }, {
17
+ title: p(() => o[0] || (o[0] = [
18
+ i("Payload")
19
+ ])),
20
+ _: 1
21
+ }, 8, ["requestBody"]),
22
+ r(u, { operation: e.webhook }, null, 8, ["operation"])
23
+ ], 64)) : d("", !0);
24
+ };
25
+ }
26
+ });
27
+ export {
28
+ c as default
29
+ };
@@ -1,7 +1,7 @@
1
1
  import type { OpenAPI } from '@scalar/openapi-types';
2
2
  import type { RequestBodyMimeTypes, TransformedOperation } from '@scalar/types/legacy';
3
3
  /**
4
- * This hook is used to generate the responses for the request from the parameters in the swagger file
4
+ * Generates the responses for the request from the parameters in the OpenAPI document
5
5
  */
6
6
  export declare function useResponses(operation: TransformedOperation): {
7
7
  responses: import("vue").ComputedRef<{
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useResponses.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/hooks/useResponses.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,KAAK,EACV,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,sBAAsB,CAAA;AAG7B;;GAEG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,oBAAoB;;cAOhD,MAAM;qBACC,MAAM;iBACV,oBAAoB;kBACnB;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAA;SAAE;;EAkBtD"}
@@ -0,0 +1,3 @@
1
+ export { default as Operation } from './Operation.vue.js';
2
+ export { default as Webhooks } from './Webhooks.vue.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/features/Operation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,gBAAgB,CAAA"}
@@ -5,4 +5,4 @@ type __VLS_Props = {
5
5
  };
6
6
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
7
  export default _default;
8
- //# sourceMappingURL=OperationAccordion.vue.d.ts.map
8
+ //# sourceMappingURL=ClassicLayout.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ClassicLayout.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/layouts/ClassicLayout.vue"],"names":[],"mappings":"AA4RA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAShE,KAAK,WAAW,GAAG;IACjB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,SAAS,EAAE,oBAAoB,CAAA;CAChC,CAAC;;AAsPF,wBAOG"}
@@ -0,0 +1,7 @@
1
+ import o from "./ClassicLayout.vue2.js";
2
+ /* empty css */
3
+ import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
+ const c = /* @__PURE__ */ t(o, [["__scopeId", "data-v-d9c1078a"]]);
5
+ export {
6
+ c as default
7
+ };
@@ -0,0 +1,114 @@
1
+ import { defineComponent as m, inject as f, openBlock as r, createBlock as s, unref as e, createSlots as h, withCtx as n, createElementVNode as t, createVNode as i, toDisplayString as u, createCommentVNode as _, withModifiers as v } from "vue";
2
+ import y from "../../../components/OperationPath.vue.js";
3
+ import { ScalarIcon as b, ScalarIconButton as C, ScalarMarkdown as S } from "@scalar/components";
4
+ import { useClipboard as k } from "@scalar/use-hooks/useClipboard";
5
+ import T from "../components/OperationParameters.vue.js";
6
+ import B from "../components/OperationResponses.vue.js";
7
+ import E from "../../../components/Section/SectionAccordion.vue.js";
8
+ import R from "../../../components/HttpMethod/HttpMethod.vue.js";
9
+ import I from "../../../components/Anchor/Anchor.vue.js";
10
+ import g from "../../TestRequestButton/TestRequestButton.vue.js";
11
+ import w from "../../ExampleResponses/ExampleResponses.vue.js";
12
+ import N from "../../ExampleRequest/ExampleRequest.vue.js";
13
+ import { HIDE_TEST_REQUEST_BUTTON_SYMBOL as V } from "../../../helpers/provideSymbols.js";
14
+ const $ = { class: "operation-title" }, q = { class: "operation-details" }, L = { class: "endpoint-label" }, M = { class: "endpoint-label-path" }, O = { class: "endpoint-label-name" }, U = { class: "endpoint-content" }, A = { class: "operation-details-card" }, D = { class: "operation-details-card-item" }, H = { class: "operation-details-card-item" }, to = /* @__PURE__ */ m({
15
+ __name: "ClassicLayout",
16
+ props: {
17
+ id: {},
18
+ operation: {}
19
+ },
20
+ setup(P) {
21
+ const { copyToClipboard: d } = k(), c = f(V);
22
+ return (o, p) => (r(), s(e(E), {
23
+ id: o.id,
24
+ class: "reference-endpoint",
25
+ transparent: ""
26
+ }, h({
27
+ title: n(() => [
28
+ t("h3", $, [
29
+ t("div", q, [
30
+ i(e(R), {
31
+ class: "endpoint-type",
32
+ method: o.operation.httpVerb,
33
+ short: ""
34
+ }, null, 8, ["method"]),
35
+ i(e(I), {
36
+ id: o.id ?? "",
37
+ class: "endpoint-anchor"
38
+ }, {
39
+ default: n(() => {
40
+ var a;
41
+ return [
42
+ t("div", L, [
43
+ t("div", M, [
44
+ i(y, {
45
+ deprecated: (a = o.operation.information) == null ? void 0 : a.deprecated,
46
+ path: o.operation.path
47
+ }, null, 8, ["deprecated", "path"])
48
+ ]),
49
+ t("div", O, u(o.operation.name), 1)
50
+ ])
51
+ ];
52
+ }),
53
+ _: 1
54
+ }, 8, ["id"])
55
+ ])
56
+ ])
57
+ ]),
58
+ actions: n(({ active: a }) => {
59
+ var l;
60
+ return [
61
+ a ? (r(), s(e(g), {
62
+ key: 0,
63
+ operation: o.operation
64
+ }, null, 8, ["operation"])) : (l = e(c)) != null && l() ? _("", !0) : (r(), s(e(b), {
65
+ key: 1,
66
+ class: "endpoint-try-hint",
67
+ icon: "Play",
68
+ thickness: "1.75px"
69
+ })),
70
+ i(e(C), {
71
+ class: "endpoint-copy",
72
+ icon: "Clipboard",
73
+ label: "Copy endpoint URL",
74
+ size: "xs",
75
+ variant: "ghost",
76
+ onClick: p[0] || (p[0] = v((j) => e(d)(o.operation.path), ["stop"]))
77
+ })
78
+ ];
79
+ }),
80
+ default: n(() => [
81
+ t("div", U, [
82
+ t("div", A, [
83
+ t("div", D, [
84
+ i(T, { operation: o.operation }, null, 8, ["operation"])
85
+ ]),
86
+ t("div", H, [
87
+ i(B, {
88
+ collapsableItems: !1,
89
+ operation: o.operation
90
+ }, null, 8, ["operation"])
91
+ ])
92
+ ]),
93
+ i(e(w), { operation: o.operation }, null, 8, ["operation"]),
94
+ i(e(N), { operation: o.operation }, null, 8, ["operation"])
95
+ ])
96
+ ]),
97
+ _: 2
98
+ }, [
99
+ o.operation.description ? {
100
+ name: "description",
101
+ fn: n(() => [
102
+ i(e(S), {
103
+ value: o.operation.description,
104
+ withImages: ""
105
+ }, null, 8, ["value"])
106
+ ]),
107
+ key: "0"
108
+ } : void 0
109
+ ]), 1032, ["id"]));
110
+ }
111
+ });
112
+ export {
113
+ to as default
114
+ };
@@ -5,4 +5,4 @@ type __VLS_Props = {
5
5
  };
6
6
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
7
  export default _default;
8
- //# sourceMappingURL=Operation.vue.d.ts.map
8
+ //# sourceMappingURL=ModernLayout.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModernLayout.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/layouts/ModernLayout.vue"],"names":[],"mappings":"AA0GA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAOhE,KAAK,WAAW,GAAG;IACjB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,SAAS,EAAE,oBAAoB,CAAA;CAChC,CAAC;;AAoMF,wBAOG"}
@@ -0,0 +1,7 @@
1
+ import o from "./ModernLayout.vue2.js";
2
+ /* empty css */
3
+ import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
+ const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-f5ec41fb"]]);
5
+ export {
6
+ e as default
7
+ };
@@ -0,0 +1,114 @@
1
+ import { defineComponent as f, openBlock as l, createBlock as m, unref as t, withCtx as r, createVNode as o, createTextVNode as d, createCommentVNode as u, createElementVNode as n, normalizeClass as c, toDisplayString as h } from "vue";
2
+ import _ from "../../../components/OperationPath.vue.js";
3
+ import { ScalarMarkdown as C } from "@scalar/components";
4
+ import S from "../components/OperationParameters.vue.js";
5
+ import v from "../components/OperationResponses.vue.js";
6
+ import k from "../../../components/Section/Section.vue.js";
7
+ import g from "../../../components/Section/SectionContent.vue.js";
8
+ import y from "../../../components/Section/SectionColumns.vue.js";
9
+ import s from "../../../components/Section/SectionColumn.vue.js";
10
+ import B from "../../../components/Badge/Badge.vue.js";
11
+ import N from "../../../components/Section/SectionHeader.vue.js";
12
+ import V from "../../../components/Anchor/Anchor.vue.js";
13
+ import b from "../../ExampleRequest/ExampleRequest.vue.js";
14
+ import w from "../../TestRequestButton/TestRequestButton.vue.js";
15
+ import E from "../../ExampleResponses/ExampleResponses.vue.js";
16
+ const R = { class: "operation-details" }, q = { class: "examples" }, Q = /* @__PURE__ */ f({
17
+ __name: "ModernLayout",
18
+ props: {
19
+ id: {},
20
+ operation: {}
21
+ },
22
+ setup(D) {
23
+ return (e, i) => (l(), m(t(k), {
24
+ id: e.id,
25
+ label: e.operation.name
26
+ }, {
27
+ default: r(() => [
28
+ o(t(g), null, {
29
+ default: r(() => [
30
+ o(t(y), null, {
31
+ default: r(() => [
32
+ o(t(s), null, {
33
+ default: r(() => {
34
+ var a, p;
35
+ return [
36
+ (a = e.operation.information) != null && a.deprecated ? (l(), m(t(B), { key: 0 }, {
37
+ default: r(() => i[0] || (i[0] = [
38
+ d(" Deprecated ")
39
+ ])),
40
+ _: 1
41
+ })) : u("", !0),
42
+ n("div", {
43
+ class: c((p = e.operation.information) != null && p.deprecated ? "deprecated" : "")
44
+ }, [
45
+ o(t(N), { level: 3 }, {
46
+ default: r(() => [
47
+ o(t(V), {
48
+ id: e.id ?? ""
49
+ }, {
50
+ default: r(() => [
51
+ d(h(e.operation.name), 1)
52
+ ]),
53
+ _: 1
54
+ }, 8, ["id"])
55
+ ]),
56
+ _: 1
57
+ })
58
+ ], 2),
59
+ n("div", R, [
60
+ o(t(C), {
61
+ value: e.operation.description,
62
+ withImages: ""
63
+ }, null, 8, ["value"]),
64
+ o(S, { operation: e.operation }, null, 8, ["operation"]),
65
+ o(v, { operation: e.operation }, null, 8, ["operation"])
66
+ ])
67
+ ];
68
+ }),
69
+ _: 1
70
+ }),
71
+ o(t(s), null, {
72
+ default: r(() => [
73
+ n("div", q, [
74
+ o(t(b), {
75
+ fallback: "",
76
+ operation: e.operation
77
+ }, {
78
+ header: r(() => {
79
+ var a;
80
+ return [
81
+ o(_, {
82
+ class: "example-path",
83
+ deprecated: (a = e.operation.information) == null ? void 0 : a.deprecated,
84
+ path: e.operation.path
85
+ }, null, 8, ["deprecated", "path"])
86
+ ];
87
+ }),
88
+ footer: r(() => [
89
+ o(t(w), { operation: e.operation }, null, 8, ["operation"])
90
+ ]),
91
+ _: 1
92
+ }, 8, ["operation"]),
93
+ o(t(E), {
94
+ operation: e.operation,
95
+ style: { "margin-top": "12px" }
96
+ }, null, 8, ["operation"])
97
+ ])
98
+ ]),
99
+ _: 1
100
+ })
101
+ ]),
102
+ _: 1
103
+ })
104
+ ]),
105
+ _: 1
106
+ })
107
+ ]),
108
+ _: 1
109
+ }, 8, ["id", "label"]));
110
+ }
111
+ });
112
+ export {
113
+ Q as default
114
+ };
@@ -1,7 +1,7 @@
1
1
  import o from "./SearchButton.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-d362607b"]]);
4
+ const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-3ed69c39"]]);
5
5
  export {
6
- p as default
6
+ e as default
7
7
  };
@@ -31,7 +31,7 @@ const C = { class: "sidebar-search-input" }, H = { class: "sidebar-search-shortc
31
31
  (...m) => a(t).show && a(t).show(...m))
32
32
  }, [
33
33
  l(a(k), {
34
- class: "search-icon",
34
+ class: "scalar-search-icon",
35
35
  icon: "Search",
36
36
  size: "sm",
37
37
  thickness: "2.5"
@@ -2,14 +2,14 @@ import H from "fuse.js";
2
2
  import { ref as c, computed as N, watch as V } from "vue";
3
3
  import { extractRequestBody as A } from "../../helpers/specHelpers.js";
4
4
  import { useSidebar as B } from "../../hooks/useSidebar.js";
5
- import { useOperation as P } from "../../hooks/useOperation.js";
6
- import { useNavState as z } from "../../hooks/useNavState.js";
7
- import { getHeadingsFromMarkdown as G } from "../../helpers/getHeadingsFromMarkdown.js";
8
- import { getModels as J } from "../../helpers/getModels.js";
5
+ import { getHeadingsFromMarkdown as P } from "../../helpers/getHeadingsFromMarkdown.js";
6
+ import { useOperation as z } from "../../hooks/useOperation.js";
7
+ import { getModels as G } from "../../helpers/getModels.js";
8
+ import { useNavState as J } from "../../hooks/useNavState.js";
9
9
  function te({
10
10
  specification: a
11
11
  }) {
12
- const { getHeadingId: O, getWebhookId: R, getModelId: T, getOperationId: j, getTagId: L } = z(), { hideModels: W } = B(), o = c([]), n = c([]), h = c(0), s = c(""), d = new H(o.value, {
12
+ const { getHeadingId: O, getWebhookId: R, getModelId: T, getOperationId: j, getTagId: L } = J(), { hideModels: W } = B(), o = c([]), n = c([]), h = c(0), s = c(""), d = new H(o.value, {
13
13
  keys: ["title", "description", "body"]
14
14
  }), q = () => {
15
15
  h.value = 0, n.value = d.search(s.value);
@@ -30,7 +30,7 @@ function te({
30
30
  d.setCollection([]);
31
31
  return;
32
32
  }
33
- const i = [], r = G(
33
+ const i = [], r = P(
34
34
  ((M = (k = a.value) == null ? void 0 : k.info) == null ? void 0 : M.description) ?? ""
35
35
  );
36
36
  r.length && (r.forEach((e) => {
@@ -52,7 +52,7 @@ function te({
52
52
  body: ""
53
53
  };
54
54
  o.value.push(E), e.operations && e.operations.forEach((t) => {
55
- const { parameterMap: u } = P({ operation: t }), S = A(t) || u.value;
55
+ const { parameterMap: u } = z(t), S = A(t) || u.value;
56
56
  let v = null;
57
57
  typeof S != "boolean" && (v = S);
58
58
  const x = {
@@ -86,7 +86,7 @@ function te({
86
86
  });
87
87
  }), o.value = o.value.concat(f);
88
88
  });
89
- const p = W.value ? {} : J(a.value), m = [];
89
+ const p = W.value ? {} : G(a.value), m = [];
90
90
  p && (Object.keys(p).forEach((e) => {
91
91
  m.push({
92
92
  type: "model",
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TestRequestButton.vue.d.ts","sourceRoot":"","sources":["../../../src/features/TestRequestButton/TestRequestButton.vue"],"names":[],"mappings":"AA4EA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAKhE,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,oBAAoB,CAAA;CAChC,CAAC;;AAiGF,wBAMG"}
@@ -0,0 +1,7 @@
1
+ import t from "./TestRequestButton.vue2.js";
2
+ /* empty css */
3
+ import o from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const f = /* @__PURE__ */ o(t, [["__scopeId", "data-v-77256f36"]]);
5
+ export {
6
+ f as default
7
+ };
@@ -1,8 +1,8 @@
1
1
  import { defineComponent as d, inject as f, unref as o, openBlock as p, createElementBlock as i, withModifiers as c, createVNode as s, createElementVNode as h, withCtx as T, createTextVNode as a, toDisplayString as m, Fragment as b } from "vue";
2
- import { ScalarIcon as B } from "@scalar/components";
3
- import E from "../../ScreenReader.vue.js";
4
- import { HIDE_TEST_REQUEST_BUTTON_SYMBOL as S } from "../../../helpers/provideSymbols.js";
5
- import { useApiClient as V } from "../../../features/ApiClientModal/useApiClient.js";
2
+ import B from "../../components/ScreenReader.vue.js";
3
+ import { ScalarIcon as E } from "@scalar/components";
4
+ import { HIDE_TEST_REQUEST_BUTTON_SYMBOL as S } from "../../helpers/provideSymbols.js";
5
+ import { useApiClient as V } from "../ApiClientModal/useApiClient.js";
6
6
  const _ = ["method"], w = /* @__PURE__ */ d({
7
7
  __name: "TestRequestButton",
8
8
  props: {
@@ -25,12 +25,12 @@ const _ = ["method"], w = /* @__PURE__ */ d({
25
25
  });
26
26
  }, ["stop"]))
27
27
  }, [
28
- s(o(B), {
28
+ s(o(E), {
29
29
  icon: "Play",
30
30
  size: "sm"
31
31
  }),
32
32
  e[1] || (e[1] = h("span", null, "Test Request", -1)),
33
- s(E, null, {
33
+ s(B, null, {
34
34
  default: T(() => [
35
35
  a("(" + m(t.operation.httpVerb) + " " + m(t.operation.path) + ")", 1)
36
36
  ]),
@@ -0,0 +1,2 @@
1
+ export { default as TestRequestButton } from './TestRequestButton.vue.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/features/TestRequestButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,yBAAyB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../src/helpers/parse.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAMhD,eAAO,MAAM,KAAK,kBACD,GAAG,eAGf;IACD,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,KACA,OAAO,CAAC,IAAI,CAmDd,CAAA"}
1
+ {"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../src/helpers/parse.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAMhD,eAAO,MAAM,KAAK,kBACD,GAAG,eAGf;IACD,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,KACA,OAAO,CAAC,IAAI,CAyDd,CAAA"}
@@ -1,11 +1,11 @@
1
- import { redirectToProxy as b } from "@scalar/oas-utils/helpers";
1
+ import { redirectToProxy as R } from "@scalar/oas-utils/helpers";
2
2
  import { load as j, dereference as M } from "@scalar/openapi-parser";
3
3
  import { fetchUrls as q } from "@scalar/openapi-parser/plugins/fetch-urls";
4
4
  import { createEmptySpecification as m } from "./createEmptySpecification.js";
5
5
  import { normalizeRequestMethod as E } from "../legacy/helpers/normalizeRequestMethod.js";
6
- import { validRequestMethods as k } from "../legacy/fixtures/httpRequestMethods.js";
7
- const D = (p, {
8
- proxy: t
6
+ import { validRequestMethods as A } from "../legacy/fixtures/httpRequestMethods.js";
7
+ const z = (p, {
8
+ proxy: e
9
9
  } = {}) => new Promise(async (a, h) => {
10
10
  var s;
11
11
  try {
@@ -13,102 +13,105 @@ const D = (p, {
13
13
  return a(
14
14
  u(m())
15
15
  );
16
- const i = performance.now(), { filesystem: n } = await j(p, {
16
+ const o = performance.now(), { filesystem: n } = await j(p, {
17
17
  plugins: [
18
18
  q({
19
- fetch: (o) => fetch(t ? b(t, o) : o)
19
+ fetch: (i) => fetch(e ? R(e, i) : i)
20
20
  })
21
21
  ]
22
- }), { schema: e, errors: r } = await M(n), f = performance.now();
23
- return console.log(`dereference: ${Math.round(f - i)} ms`), r != null && r.length && console.warn(
22
+ }), { schema: t, errors: r } = await M(n), c = performance.now();
23
+ return console.log(`dereference: ${Math.round(c - o)} ms`), r != null && r.length && console.warn(
24
24
  `Please open an issue on https://github.com/scalar/scalar
25
25
  `,
26
26
  `Scalar OpenAPI Parser Warning:
27
27
  `,
28
28
  r
29
- ), e === void 0 ? (h(((s = r == null ? void 0 : r[0]) == null ? void 0 : s.message) ?? "Failed to parse the OpenAPI file."), a(
29
+ ), t === void 0 ? (h(((s = r == null ? void 0 : r[0]) == null ? void 0 : s.message) ?? "Failed to parse the OpenAPI file."), a(
30
30
  u(m())
31
- )) : a(u(e));
32
- } catch (i) {
33
- h(i);
31
+ )) : a(u(t));
32
+ } catch (o) {
33
+ console.error(
34
+ "[@scalar/api-reference]",
35
+ "Failed to parse the OpenAPI document. It might be invalid?"
36
+ ), console.error(o), h(o);
34
37
  }
35
38
  return a(
36
39
  u(m())
37
40
  );
38
41
  }), u = (p) => {
39
- let t = {};
40
- p && typeof p == "object" ? t = structuredClone(p) : t = m(), t.tags || (t.tags = []), t.paths || (t.paths = {});
42
+ let e = {};
43
+ p && typeof p == "object" ? e = structuredClone(p) : e = m(), e.tags || (e.tags = []), e.paths || (e.paths = {});
41
44
  const a = {};
42
- return Object.keys(t.webhooks ?? {}).forEach((s) => {
43
- var i;
44
- Object.keys(((i = t.webhooks) == null ? void 0 : i[s]) ?? {}).forEach((n) => {
45
- var r, f, o;
46
- const e = (r = t.webhooks) == null ? void 0 : r[s][n];
47
- (e == null ? void 0 : e["x-internal"]) !== !0 && (a[s] === void 0 && (a[s] = {}), a[s][n] = {
45
+ return Object.keys(e.webhooks ?? {}).forEach((s) => {
46
+ var o;
47
+ Object.keys(((o = e.webhooks) == null ? void 0 : o[s]) ?? {}).forEach((n) => {
48
+ var r, c, i;
49
+ const t = (r = e.webhooks) == null ? void 0 : r[s][n];
50
+ (t == null ? void 0 : t["x-internal"]) !== !0 && (a[s] === void 0 && (a[s] = {}), a[s][n] = {
48
51
  // Transformed data
49
52
  httpVerb: E(n),
50
53
  path: s,
51
- operationId: (e == null ? void 0 : e.operationId) || s,
52
- name: (e == null ? void 0 : e.summary) || s || "",
53
- description: (e == null ? void 0 : e.description) || "",
54
- pathParameters: (o = (f = t.paths) == null ? void 0 : f[s]) == null ? void 0 : o.parameters,
54
+ operationId: (t == null ? void 0 : t.operationId) || s,
55
+ name: (t == null ? void 0 : t.summary) || s || "",
56
+ description: (t == null ? void 0 : t.description) || "",
57
+ pathParameters: (i = (c = e.paths) == null ? void 0 : c[s]) == null ? void 0 : i.parameters,
55
58
  // Original webhook
56
59
  information: {
57
- ...e
60
+ ...t
58
61
  }
59
62
  });
60
63
  });
61
- }), Object.keys(t.paths).forEach((s) => {
62
- Object.keys(t.paths[s]).filter(
63
- (n) => k.includes(n.toUpperCase())
64
+ }), Object.keys(e.paths).forEach((s) => {
65
+ Object.keys(e.paths[s]).filter(
66
+ (n) => A.includes(n.toUpperCase())
64
67
  ).forEach((n) => {
65
- var f, o, g, w, y, x;
66
- const e = t.paths[s][n];
67
- if (e === void 0 || e["x-internal"] === !0)
68
+ var c, i, g, w, y, I;
69
+ const t = e.paths[s][n];
70
+ if (t === void 0 || t["x-internal"] === !0)
68
71
  return;
69
72
  const r = {
70
73
  httpVerb: E(n),
71
74
  path: s,
72
- operationId: e.operationId || s,
73
- name: e.summary || s || "",
74
- description: e.description || "",
75
+ operationId: t.operationId || s,
76
+ name: t.summary || s || "",
77
+ description: t.description || "",
75
78
  information: {
76
- ...e
79
+ ...t
77
80
  },
78
- pathParameters: (o = (f = t.paths) == null ? void 0 : f[s]) == null ? void 0 : o.parameters
81
+ pathParameters: (i = (c = e.paths) == null ? void 0 : c[s]) == null ? void 0 : i.parameters
79
82
  };
80
- if (!e.tags || e.tags.length === 0) {
81
- (g = t.tags) != null && g.find(
82
- (c) => c.name === "default"
83
- ) || (w = t.tags) == null || w.push({
83
+ if (!t.tags || t.tags.length === 0) {
84
+ (g = e.tags) != null && g.find(
85
+ (f) => f.name === "default"
86
+ ) || (w = e.tags) == null || w.push({
84
87
  name: "default",
85
88
  description: "",
86
89
  operations: []
87
90
  });
88
- const d = (y = t.tags) == null ? void 0 : y.findIndex(
89
- (c) => c.name === "default"
91
+ const d = (y = e.tags) == null ? void 0 : y.findIndex(
92
+ (f) => f.name === "default"
90
93
  );
91
- d >= 0 && ((x = t.tags[d]) == null || x.operations.push(r));
94
+ d >= 0 && ((I = e.tags[d]) == null || I.operations.push(r));
92
95
  } else
93
- e.tags.forEach((d) => {
94
- var I, O, P;
95
- const c = (I = t.tags) == null ? void 0 : I.findIndex(
96
+ t.tags.forEach((d) => {
97
+ var O, x, P;
98
+ const f = (O = e.tags) == null ? void 0 : O.findIndex(
96
99
  // @ts-expect-error TODO: The types are just screwed, needs refactoring
97
- (R) => R.name === d
100
+ (b) => b.name === d
98
101
  );
99
- c === -1 && ((O = t.tags) == null || O.push({
102
+ f === -1 && ((x = e.tags) == null || x.push({
100
103
  name: d,
101
104
  description: ""
102
105
  }));
103
- const l = c !== -1 ? c : t.tags.length - 1;
104
- typeof ((P = t.tags[l]) == null ? void 0 : P.operations) > "u" && (t.tags[l].operations = []), t.tags[l].operations.push(r);
106
+ const l = f !== -1 ? f : e.tags.length - 1;
107
+ typeof ((P = e.tags[l]) == null ? void 0 : P.operations) > "u" && (e.tags[l].operations = []), e.tags[l].operations.push(r);
105
108
  });
106
109
  });
107
110
  }), {
108
- ...t,
111
+ ...e,
109
112
  webhooks: a
110
113
  };
111
114
  };
112
115
  export {
113
- D as parse
116
+ z as parse
114
117
  };
@@ -4,6 +4,5 @@ export * from './useNavState.js';
4
4
  export * from './useOperation.js';
5
5
  export * from './useReactiveSpec.js';
6
6
  export * from './useRefOnMount.js';
7
- export * from './useResponses.js';
8
7
  export * from './useSidebar.js';
9
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,0BAA0B,CAAA;AACxC,cAAc,eAAe,CAAA;AAC7B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,mBAAmB,CAAA;AACjC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,cAAc,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,0BAA0B,CAAA;AACxC,cAAc,eAAe,CAAA;AAC7B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,mBAAmB,CAAA;AACjC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA"}