@scalar/api-reference 1.24.20 → 1.24.23

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 (225) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/dist/browser/standalone.js +22673 -23143
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/ApiClientModal.vue.d.ts.map +1 -1
  5. package/dist/components/ApiClientModal.vue.js +19 -18
  6. package/dist/components/ApiClientModal.vue3.js +5 -0
  7. package/dist/components/ApiReference.vue.js +14 -14
  8. package/dist/components/ApiReferenceLayout.vue.d.ts +2 -2
  9. package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
  10. package/dist/components/ApiReferenceLayout.vue.js +2 -2
  11. package/dist/components/ApiReferenceLayout.vue2.js +123 -155
  12. package/dist/components/Content/Authentication/Authentication.vue.d.ts.map +1 -1
  13. package/dist/components/Content/Authentication/Authentication.vue.js +2 -2
  14. package/dist/components/Content/Authentication/Authentication.vue2.js +20 -18
  15. package/dist/components/Content/Content.vue.d.ts +3 -3
  16. package/dist/components/Content/Content.vue.d.ts.map +1 -1
  17. package/dist/components/Content/Content.vue.js +2 -2
  18. package/dist/components/Content/Content.vue2.js +72 -93
  19. package/dist/components/Content/Lazy/Loading.vue.js +1 -1
  20. package/dist/components/Content/Operation/CustomRequestExamples.vue.d.ts.map +1 -1
  21. package/dist/components/Content/Operation/CustomRequestExamples.vue.js +1 -1
  22. package/dist/components/Content/Operation/CustomRequestExamples.vue2.js +19 -19
  23. package/dist/components/Content/Operation/ExampleRequest.vue.d.ts.map +1 -1
  24. package/dist/components/Content/Operation/ExampleRequest.vue.js +2 -2
  25. package/dist/components/Content/Operation/ExampleRequest.vue2.js +63 -59
  26. package/dist/components/Content/Operation/OperationAccordion.vue.d.ts.map +1 -1
  27. package/dist/components/Content/Operation/OperationAccordion.vue.js +1 -1
  28. package/dist/components/Content/Operation/OperationAccordion.vue2.js +26 -26
  29. package/dist/components/Content/Operation/TestRequestButton.vue.d.ts.map +1 -1
  30. package/dist/components/Content/Operation/TestRequestButton.vue.js +2 -2
  31. package/dist/components/Content/Operation/TestRequestButton.vue2.js +18 -36
  32. package/dist/components/Content/Schema/Schema.vue.d.ts +2 -2
  33. package/dist/components/Content/Schema/SchemaHeading.vue.d.ts +2 -2
  34. package/dist/components/Content/Tag/Endpoints.vue.d.ts.map +1 -1
  35. package/dist/components/Content/Tag/Endpoints.vue.js +2 -2
  36. package/dist/components/Content/Tag/Endpoints.vue2.js +23 -23
  37. package/dist/components/HttpMethod/HttpMethod.vue.d.ts +42 -0
  38. package/dist/components/HttpMethod/HttpMethod.vue.d.ts.map +1 -0
  39. package/dist/components/HttpMethod/HttpMethod.vue.js +28 -0
  40. package/dist/components/HttpMethod/HttpMethod.vue2.js +4 -0
  41. package/dist/components/HttpMethod/constants.d.ts +9 -0
  42. package/dist/components/HttpMethod/constants.d.ts.map +1 -0
  43. package/dist/components/HttpMethod/constants.js +36 -0
  44. package/dist/components/HttpMethod/index.d.ts +2 -0
  45. package/dist/components/HttpMethod/index.d.ts.map +1 -0
  46. package/dist/components/HttpMethod/utils/isRequestMethod.d.ts +4 -0
  47. package/dist/components/HttpMethod/utils/isRequestMethod.d.ts.map +1 -0
  48. package/dist/components/HttpMethod/utils/isRequestMethod.js +7 -0
  49. package/dist/components/Sidebar/SidebarHttpBadge.vue.js +1 -1
  50. package/dist/components/Sidebar/SidebarHttpBadge.vue2.js +6 -6
  51. package/dist/components/api-client-bus.d.ts +1 -1
  52. package/dist/components/api-client-bus.d.ts.map +1 -1
  53. package/dist/features/BaseUrl/BaseUrl.vue.d.ts +40 -0
  54. package/dist/features/BaseUrl/BaseUrl.vue.d.ts.map +1 -0
  55. package/dist/features/BaseUrl/BaseUrl.vue.js +97 -0
  56. package/dist/features/BaseUrl/BaseUrl.vue2.js +4 -0
  57. package/dist/features/BaseUrl/ServerForm.vue.d.ts +41 -0
  58. package/dist/features/BaseUrl/ServerForm.vue.d.ts.map +1 -0
  59. package/dist/features/BaseUrl/ServerForm.vue.js +7 -0
  60. package/dist/features/BaseUrl/ServerForm.vue2.js +66 -0
  61. package/dist/{components/Content/BaseUrl/ServerItem.vue.d.ts → features/BaseUrl/ServerUrl.vue.d.ts} +6 -6
  62. package/dist/features/BaseUrl/ServerUrl.vue.d.ts.map +1 -0
  63. package/dist/features/BaseUrl/ServerUrl.vue.js +8 -0
  64. package/dist/features/BaseUrl/ServerUrl.vue2.js +29 -0
  65. package/dist/{components/ApiClientModalOld.vue.d.ts → features/BaseUrl/ServerUrlSelect.vue.d.ts} +9 -15
  66. package/dist/features/BaseUrl/ServerUrlSelect.vue.d.ts.map +1 -0
  67. package/dist/features/BaseUrl/ServerUrlSelect.vue.js +7 -0
  68. package/dist/features/BaseUrl/ServerUrlSelect.vue2.js +56 -0
  69. package/dist/features/BaseUrl/ServerVariablesForm.vue.d.ts +23 -0
  70. package/dist/features/BaseUrl/ServerVariablesForm.vue.d.ts.map +1 -0
  71. package/dist/features/BaseUrl/ServerVariablesForm.vue.js +7 -0
  72. package/dist/features/BaseUrl/ServerVariablesForm.vue2.js +53 -0
  73. package/dist/{components/Content/BaseUrl/ServerVariableSelect.vue.d.ts → features/BaseUrl/ServerVariablesSelect.vue.d.ts} +1 -1
  74. package/dist/features/BaseUrl/ServerVariablesSelect.vue.d.ts.map +1 -0
  75. package/dist/features/BaseUrl/ServerVariablesSelect.vue.js +7 -0
  76. package/dist/{components/Content/BaseUrl/ServerVariableSelect.vue2.js → features/BaseUrl/ServerVariablesSelect.vue2.js} +1 -1
  77. package/dist/{components/Content/BaseUrl/ServerVariableTextbox.vue.d.ts → features/BaseUrl/ServerVariablesTextbox.vue.d.ts} +1 -1
  78. package/dist/features/BaseUrl/ServerVariablesTextbox.vue.d.ts.map +1 -0
  79. package/dist/features/BaseUrl/ServerVariablesTextbox.vue.js +7 -0
  80. package/dist/{components/Content/BaseUrl/ServerVariableTextbox.vue2.js → features/BaseUrl/ServerVariablesTextbox.vue2.js} +6 -6
  81. package/dist/features/BaseUrl/index.d.ts +3 -0
  82. package/dist/features/BaseUrl/index.d.ts.map +1 -0
  83. package/dist/features/BaseUrl/types.d.ts +10 -0
  84. package/dist/features/BaseUrl/types.d.ts.map +1 -0
  85. package/dist/features/BaseUrl/utils/getServers.d.ts +15 -0
  86. package/dist/features/BaseUrl/utils/getServers.d.ts.map +1 -0
  87. package/dist/features/BaseUrl/utils/getServers.js +29 -0
  88. package/dist/features/BaseUrl/utils/index.d.ts +2 -0
  89. package/dist/features/BaseUrl/utils/index.d.ts.map +1 -0
  90. package/dist/helpers/createEmptySpecification.d.ts +1 -1
  91. package/dist/helpers/createEmptySpecification.d.ts.map +1 -1
  92. package/dist/helpers/createEmptySpecification.js +5 -4
  93. package/dist/helpers/getApiClientRequest.d.ts +1 -1
  94. package/dist/helpers/getApiClientRequest.d.ts.map +1 -1
  95. package/dist/helpers/getApiClientRequest.js +12 -11
  96. package/dist/helpers/getModels.d.ts +1 -1
  97. package/dist/helpers/index.d.ts +1 -1
  98. package/dist/helpers/index.d.ts.map +1 -1
  99. package/dist/helpers/openClientFor.js +10 -7
  100. package/dist/helpers/parse.d.ts.map +1 -1
  101. package/dist/helpers/parse.js +33 -31
  102. package/dist/hooks/useReactiveSpec.d.ts +9 -9
  103. package/dist/hooks/useSidebar.js +18 -17
  104. package/dist/index.d.ts +0 -2
  105. package/dist/index.d.ts.map +1 -1
  106. package/dist/index.js +101 -102
  107. package/dist/legacy/components/CardForm.vue.d.ts +10 -0
  108. package/dist/legacy/components/CardForm.vue.d.ts.map +1 -0
  109. package/dist/legacy/components/CardForm.vue.js +13 -0
  110. package/dist/legacy/components/CardFormButton.vue.d.ts +12 -0
  111. package/dist/legacy/components/CardFormButton.vue.d.ts.map +1 -0
  112. package/dist/legacy/components/CardFormButton.vue.js +7 -0
  113. package/dist/legacy/components/CardFormButton.vue2.js +18 -0
  114. package/dist/legacy/components/CardFormGroup.vue.d.ts +10 -0
  115. package/dist/legacy/components/CardFormGroup.vue.d.ts.map +1 -0
  116. package/dist/legacy/components/CardFormGroup.vue.js +13 -0
  117. package/dist/legacy/components/CardFormRows.vue.d.ts +10 -0
  118. package/dist/legacy/components/CardFormRows.vue.d.ts.map +1 -0
  119. package/dist/legacy/components/CardFormRows.vue.js +13 -0
  120. package/dist/legacy/components/CardFormTextInput.vue.d.ts +25 -0
  121. package/dist/legacy/components/CardFormTextInput.vue.d.ts.map +1 -0
  122. package/dist/legacy/components/CardFormTextInput.vue.js +7 -0
  123. package/dist/legacy/components/CardFormTextInput.vue2.js +37 -0
  124. package/dist/{components/Content/BaseUrl/ServerVariables.vue.d.ts → legacy/components/SecurityScheme.vue.d.ts} +6 -4
  125. package/dist/legacy/components/SecurityScheme.vue.d.ts.map +1 -0
  126. package/dist/legacy/components/SecurityScheme.vue.js +7 -0
  127. package/dist/legacy/components/SecurityScheme.vue2.js +364 -0
  128. package/dist/legacy/components/SecuritySchemeScopes.vue.d.ts +26 -0
  129. package/dist/legacy/components/SecuritySchemeScopes.vue.d.ts.map +1 -0
  130. package/dist/legacy/components/SecuritySchemeScopes.vue.js +7 -0
  131. package/dist/legacy/components/SecuritySchemeScopes.vue2.js +91 -0
  132. package/dist/legacy/components/SecuritySchemeSelector.vue.d.ts +25 -0
  133. package/dist/legacy/components/SecuritySchemeSelector.vue.d.ts.map +1 -0
  134. package/dist/legacy/components/SecuritySchemeSelector.vue.js +7 -0
  135. package/dist/legacy/components/SecuritySchemeSelector.vue2.js +64 -0
  136. package/dist/legacy/fixtures/httpHeaders.d.ts +6 -0
  137. package/dist/legacy/fixtures/httpHeaders.d.ts.map +1 -0
  138. package/dist/legacy/fixtures/httpRequestMethods.d.ts +10 -0
  139. package/dist/legacy/fixtures/httpRequestMethods.d.ts.map +1 -0
  140. package/dist/legacy/fixtures/httpRequestMethods.js +18 -0
  141. package/dist/legacy/fixtures/index.d.ts +3 -0
  142. package/dist/legacy/fixtures/index.d.ts.map +1 -0
  143. package/dist/legacy/helpers/createPlaceholderRequest.d.ts +6 -0
  144. package/dist/legacy/helpers/createPlaceholderRequest.d.ts.map +1 -0
  145. package/dist/legacy/helpers/createPlaceholderRequest.js +14 -0
  146. package/dist/legacy/helpers/encodeStringAsBase64.d.ts +5 -0
  147. package/dist/legacy/helpers/encodeStringAsBase64.d.ts.map +1 -0
  148. package/dist/legacy/helpers/encodeStringAsBase64.js +6 -0
  149. package/dist/legacy/helpers/getRequestFromAuthentication.d.ts +10 -0
  150. package/dist/legacy/helpers/getRequestFromAuthentication.d.ts.map +1 -0
  151. package/dist/legacy/helpers/getRequestFromAuthentication.js +83 -0
  152. package/dist/legacy/helpers/getUrlFromServerState.d.ts +6 -0
  153. package/dist/legacy/helpers/getUrlFromServerState.d.ts.map +1 -0
  154. package/dist/legacy/helpers/getUrlFromServerState.js +9 -0
  155. package/dist/legacy/helpers/humanDiff.d.ts +5 -0
  156. package/dist/legacy/helpers/humanDiff.d.ts.map +1 -0
  157. package/dist/legacy/helpers/index.d.ts +12 -0
  158. package/dist/legacy/helpers/index.d.ts.map +1 -0
  159. package/dist/legacy/helpers/mapFromArray.d.ts +5 -0
  160. package/dist/legacy/helpers/mapFromArray.d.ts.map +1 -0
  161. package/dist/legacy/helpers/normalizeHeaders.d.ts +9 -0
  162. package/dist/legacy/helpers/normalizeHeaders.d.ts.map +1 -0
  163. package/dist/legacy/helpers/normalizePath.d.ts +5 -0
  164. package/dist/legacy/helpers/normalizePath.d.ts.map +1 -0
  165. package/dist/legacy/helpers/normalizeRequestMethod.d.ts +6 -0
  166. package/dist/legacy/helpers/normalizeRequestMethod.d.ts.map +1 -0
  167. package/dist/legacy/helpers/normalizeRequestMethod.js +14 -0
  168. package/dist/legacy/helpers/normalizeUrl.d.ts +5 -0
  169. package/dist/legacy/helpers/normalizeUrl.d.ts.map +1 -0
  170. package/dist/legacy/helpers/prepareClientRequestConfig.d.ts +24 -0
  171. package/dist/legacy/helpers/prepareClientRequestConfig.d.ts.map +1 -0
  172. package/dist/legacy/index.d.ts +5 -0
  173. package/dist/legacy/index.d.ts.map +1 -0
  174. package/dist/legacy/stores/index.d.ts +6 -0
  175. package/dist/legacy/stores/index.d.ts.map +1 -0
  176. package/dist/legacy/stores/useApiClientStore.d.ts +18 -0
  177. package/dist/legacy/stores/useApiClientStore.d.ts.map +1 -0
  178. package/dist/legacy/stores/useApiClientStore.js +32 -0
  179. package/dist/legacy/stores/useAuthenticationStore.d.ts +59 -0
  180. package/dist/legacy/stores/useAuthenticationStore.d.ts.map +1 -0
  181. package/dist/legacy/stores/useAuthenticationStore.js +36 -0
  182. package/dist/legacy/stores/useOpenApiStore.d.ts +95 -0
  183. package/dist/legacy/stores/useOpenApiStore.d.ts.map +1 -0
  184. package/dist/legacy/stores/useOpenApiStore.js +23 -0
  185. package/dist/legacy/stores/useRequestStore.d.ts +58 -0
  186. package/dist/legacy/stores/useRequestStore.d.ts.map +1 -0
  187. package/dist/legacy/stores/useRequestStore.js +33 -0
  188. package/dist/legacy/stores/useServerStore.d.ts +18 -0
  189. package/dist/legacy/stores/useServerStore.d.ts.map +1 -0
  190. package/dist/legacy/stores/useServerStore.js +18 -0
  191. package/dist/legacy/types.d.ts +117 -0
  192. package/dist/legacy/types.d.ts.map +1 -0
  193. package/dist/stores/index.d.ts +1 -0
  194. package/dist/stores/index.d.ts.map +1 -1
  195. package/dist/style.css +1 -1
  196. package/dist/types.d.ts +8 -11
  197. package/dist/types.d.ts.map +1 -1
  198. package/package.json +16 -15
  199. package/dist/components/ApiClientModal.vue2.js +0 -4
  200. package/dist/components/ApiClientModalOld.vue.d.ts.map +0 -1
  201. package/dist/components/ApiClientModalOld.vue.js +0 -7
  202. package/dist/components/ApiClientModalOld.vue2.js +0 -88
  203. package/dist/components/Content/BaseUrl/BaseUrl.vue.d.ts +0 -3
  204. package/dist/components/Content/BaseUrl/BaseUrl.vue.d.ts.map +0 -1
  205. package/dist/components/Content/BaseUrl/BaseUrl.vue.js +0 -7
  206. package/dist/components/Content/BaseUrl/BaseUrl.vue2.js +0 -90
  207. package/dist/components/Content/BaseUrl/ServerItem.vue.d.ts.map +0 -1
  208. package/dist/components/Content/BaseUrl/ServerItem.vue.js +0 -8
  209. package/dist/components/Content/BaseUrl/ServerItem.vue2.js +0 -35
  210. package/dist/components/Content/BaseUrl/ServerVariableSelect.vue.d.ts.map +0 -1
  211. package/dist/components/Content/BaseUrl/ServerVariableSelect.vue.js +0 -7
  212. package/dist/components/Content/BaseUrl/ServerVariableTextbox.vue.d.ts.map +0 -1
  213. package/dist/components/Content/BaseUrl/ServerVariableTextbox.vue.js +0 -7
  214. package/dist/components/Content/BaseUrl/ServerVariables.vue.d.ts.map +0 -1
  215. package/dist/components/Content/BaseUrl/ServerVariables.vue.js +0 -7
  216. package/dist/components/Content/BaseUrl/ServerVariables.vue2.js +0 -47
  217. package/dist/components/Content/BaseUrl/index.d.ts +0 -2
  218. package/dist/components/Content/BaseUrl/index.d.ts.map +0 -1
  219. package/dist/components/Content/Schema/SchemaProperty.spec.d.ts +0 -2
  220. package/dist/components/Content/Schema/SchemaProperty.spec.d.ts.map +0 -1
  221. package/dist/features.d.ts +0 -8
  222. package/dist/features.d.ts.map +0 -1
  223. package/dist/features.js +0 -5
  224. package/dist/standalone.spec.d.ts +0 -2
  225. package/dist/standalone.spec.d.ts.map +0 -1
@@ -0,0 +1,56 @@
1
+ import { defineComponent as v, computed as s, openBlock as r, createElementBlock as f, createVNode as i, unref as l, withCtx as u, normalizeClass as g, createElementVNode as h, renderSlot as S, createBlock as _, createCommentVNode as V } from "vue";
2
+ import { ScalarListbox as C, ScalarButton as k, ScalarIcon as x } from "@scalar/components";
3
+ const B = { class: "w-full" }, N = /* @__PURE__ */ v({
4
+ __name: "ServerUrlSelect",
5
+ props: {
6
+ options: {},
7
+ value: {}
8
+ },
9
+ emits: ["change"],
10
+ setup(c, { emit: d }) {
11
+ const n = c, m = d, o = s(
12
+ () => n.options.map((e, t) => ({
13
+ id: t.toString(),
14
+ label: e.url ?? ""
15
+ }))
16
+ ), a = s({
17
+ get: () => {
18
+ var e;
19
+ return (e = o.value) == null ? void 0 : e.find((t) => t.id === n.value.toString());
20
+ },
21
+ set: (e) => m("change", (e == null ? void 0 : e.id) ?? "")
22
+ });
23
+ return (e, t) => (r(), f("div", B, [
24
+ i(l(C), {
25
+ modelValue: a.value,
26
+ "onUpdate:modelValue": t[0] || (t[0] = (p) => a.value = p),
27
+ options: o.value,
28
+ resize: ""
29
+ }, {
30
+ default: u(() => [
31
+ i(l(k), {
32
+ class: g(["url-select", { "pointer-events-none": o.value.length <= 1 }]),
33
+ fullWidth: "",
34
+ variant: "ghost"
35
+ }, {
36
+ default: u(() => [
37
+ h("span", null, [
38
+ S(e.$slots, "default", {}, void 0, !0)
39
+ ]),
40
+ o.value.length > 1 ? (r(), _(l(x), {
41
+ key: 0,
42
+ icon: "ChevronDown",
43
+ size: "xs"
44
+ })) : V("", !0)
45
+ ]),
46
+ _: 3
47
+ }, 8, ["class"])
48
+ ]),
49
+ _: 3
50
+ }, 8, ["modelValue", "options"])
51
+ ]));
52
+ }
53
+ });
54
+ export {
55
+ N as default
56
+ };
@@ -0,0 +1,23 @@
1
+ import type { ServerVariableValues, ServerVariables } from './types';
2
+ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
3
+ variables?: ServerVariables | undefined;
4
+ values?: ServerVariableValues | undefined;
5
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
+ "update:variable": (name: string, value: string) => void;
7
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
8
+ variables?: ServerVariables | undefined;
9
+ values?: ServerVariableValues | undefined;
10
+ }>>> & {
11
+ "onUpdate:variable"?: ((name: string, value: string) => any) | undefined;
12
+ }, {}, {}>;
13
+ export default _default;
14
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
15
+ type __VLS_TypePropsToOption<T> = {
16
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
17
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
18
+ } : {
19
+ type: import('vue').PropType<T[K]>;
20
+ required: true;
21
+ };
22
+ };
23
+ //# sourceMappingURL=ServerVariablesForm.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ServerVariablesForm.vue.d.ts","sourceRoot":"","sources":["../../../src/features/BaseUrl/ServerVariablesForm.vue"],"names":[],"mappings":"AA6EA,OAAO,KAAK,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;;;;;;;;;;;;AAmIpE,wBAOG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
@@ -0,0 +1,7 @@
1
+ import r from "./ServerVariablesForm.vue2.js";
2
+ /* empty css */
3
+ import o from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const m = /* @__PURE__ */ o(r, [["__scopeId", "data-v-d5675216"]]);
5
+ export {
6
+ m as default
7
+ };
@@ -0,0 +1,53 @@
1
+ import { defineComponent as h, openBlock as t, createElementBlock as o, Fragment as k, renderList as y, createElementVNode as m, toDisplayString as V, createBlock as p, createCommentVNode as C } from "vue";
2
+ import S from "./ServerVariablesSelect.vue.js";
3
+ import _ from "./ServerVariablesTextbox.vue.js";
4
+ const B = {
5
+ key: 0,
6
+ class: "variable-container"
7
+ }, j = ["for"], O = /* @__PURE__ */ h({
8
+ __name: "ServerVariablesForm",
9
+ props: {
10
+ variables: {},
11
+ values: {}
12
+ },
13
+ emits: ["update:variable"],
14
+ setup(d, { emit: f }) {
15
+ const i = d, g = f;
16
+ function n(a, r) {
17
+ g("update:variable", a, r);
18
+ }
19
+ const s = (a) => {
20
+ var r, e;
21
+ return (((r = i.values) == null ? void 0 : r[a]) ?? ((e = i.variables) == null ? void 0 : e[a].default) ?? "").toString();
22
+ };
23
+ return (a, r) => a.variables && Object.keys(a.variables ?? {}).length ? (t(), o("div", B, [
24
+ (t(!0), o(k, null, y(Object.keys(a.variables), (e) => {
25
+ var u, v, b, c;
26
+ return t(), o("div", {
27
+ key: e,
28
+ class: "variable-container-item"
29
+ }, [
30
+ m("label", {
31
+ class: "variable-label",
32
+ for: `variable-${e}`
33
+ }, [
34
+ m("code", null, V(e), 1)
35
+ ], 8, j),
36
+ (v = (u = a.variables) == null ? void 0 : u[e].enum) != null && v.length ? (t(), p(S, {
37
+ key: 0,
38
+ enum: ((c = (b = a.variables[e]) == null ? void 0 : b.enum) == null ? void 0 : c.map((l) => `${l}`)) ?? [],
39
+ value: s(e),
40
+ onChange: (l) => n(e, l)
41
+ }, null, 8, ["enum", "value", "onChange"])) : (t(), p(_, {
42
+ key: 1,
43
+ value: s(e),
44
+ onChange: (l) => n(e, l)
45
+ }, null, 8, ["value", "onChange"]))
46
+ ]);
47
+ }), 128))
48
+ ])) : C("", !0);
49
+ }
50
+ });
51
+ export {
52
+ O as default
53
+ };
@@ -19,4 +19,4 @@ type __VLS_TypePropsToOption<T> = {
19
19
  required: true;
20
20
  };
21
21
  };
22
- //# sourceMappingURL=ServerVariableSelect.vue.d.ts.map
22
+ //# sourceMappingURL=ServerVariablesSelect.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ServerVariablesSelect.vue.d.ts","sourceRoot":"","sources":["../../../src/features/BaseUrl/ServerVariablesSelect.vue"],"names":[],"mappings":";;;;;;;;;;;AA6LA,wBAOG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
@@ -0,0 +1,7 @@
1
+ import r from "./ServerVariablesSelect.vue2.js";
2
+ /* empty css */
3
+ import e from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const m = /* @__PURE__ */ e(r, [["__scopeId", "data-v-4b092d90"]]);
5
+ export {
6
+ m as default
7
+ };
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as p, computed as i, openBlock as v, createElementBlock as f, createVNode as t, unref as a, withCtx as r, createElementVNode as _, toDisplayString as h } from "vue";
2
2
  import { ScalarListbox as S, ScalarButton as V, ScalarIcon as g } from "@scalar/components";
3
3
  const b = { class: "w-full" }, B = /* @__PURE__ */ p({
4
- __name: "ServerVariableSelect",
4
+ __name: "ServerVariablesSelect",
5
5
  props: {
6
6
  enum: {},
7
7
  value: {}
@@ -17,4 +17,4 @@ type __VLS_TypePropsToOption<T> = {
17
17
  required: true;
18
18
  };
19
19
  };
20
- //# sourceMappingURL=ServerVariableTextbox.vue.d.ts.map
20
+ //# sourceMappingURL=ServerVariablesTextbox.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ServerVariablesTextbox.vue.d.ts","sourceRoot":"","sources":["../../../src/features/BaseUrl/ServerVariablesTextbox.vue"],"names":[],"mappings":";;;;;;;;;AAwGA,wBAOG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
@@ -0,0 +1,7 @@
1
+ import o from "./ServerVariablesTextbox.vue2.js";
2
+ /* empty css */
3
+ import r from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const c = /* @__PURE__ */ r(o, [["__scopeId", "data-v-fbcac0a4"]]);
5
+ export {
6
+ c as default
7
+ };
@@ -1,17 +1,17 @@
1
- import { defineComponent as r, computed as s, withDirectives as u, openBlock as m, createElementBlock as i, vModelText as v } from "vue";
2
- const x = /* @__PURE__ */ r({
3
- __name: "ServerVariableTextbox",
1
+ import { defineComponent as p, computed as r, withDirectives as u, openBlock as m, createElementBlock as i, vModelText as v } from "vue";
2
+ const x = /* @__PURE__ */ p({
3
+ __name: "ServerVariablesTextbox",
4
4
  props: {
5
5
  value: {}
6
6
  },
7
7
  emits: ["change"],
8
8
  setup(l, { emit: a }) {
9
- const n = l, c = a, e = s({
9
+ const n = l, s = a, e = r({
10
10
  get: () => n.value,
11
- set: (t) => c("change", t)
11
+ set: (t) => s("change", t)
12
12
  });
13
13
  return (t, o) => u((m(), i("input", {
14
- "onUpdate:modelValue": o[0] || (o[0] = (p) => e.value = p),
14
+ "onUpdate:modelValue": o[0] || (o[0] = (c) => e.value = c),
15
15
  autocomplete: "off",
16
16
  class: "variable-textbox",
17
17
  placeholder: "value",
@@ -0,0 +1,3 @@
1
+ export { default as BaseUrl } from './BaseUrl.vue.js';
2
+ export * from './types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,10 @@
1
+ import type { OpenAPIV3, OpenAPIV3_1 } from '@scalar/openapi-parser';
2
+ export type Server = OpenAPIV3.ServerObject | OpenAPIV3_1.ServerObject;
3
+ export type ServerVariables = {
4
+ [variable: string]: ServerVariable;
5
+ };
6
+ export type ServerVariableValues = {
7
+ [variable: string]: string;
8
+ };
9
+ export type ServerVariable = OpenAPIV3.ServerVariableObject | OpenAPIV3_1.ServerVariableObject;
10
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/features/BaseUrl/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAEpE,MAAM,MAAM,MAAM,GAAG,SAAS,CAAC,YAAY,GAAG,WAAW,CAAC,YAAY,CAAA;AAEtE,MAAM,MAAM,eAAe,GAAG;IAC5B,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,CAAA;CACnC,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,cAAc,GACtB,SAAS,CAAC,oBAAoB,GAC9B,WAAW,CAAC,oBAAoB,CAAA"}
@@ -0,0 +1,15 @@
1
+ import type { Spec } from '@scalar/oas-utils';
2
+ import type { Server } from '../types';
3
+ export type DefaultServerUrlOption = {
4
+ /**
5
+ * Sometimes you can’t add an URL to your OpenAPI document, so you can provide a default one here.
6
+ */
7
+ defaultServerUrl?: string;
8
+ };
9
+ /**
10
+ * Provide a specification and get the servers from it.
11
+ * If no servers are found, it will default to a specified URL or the current URL.
12
+ * Relative paths will be prepended with the default server URL or the current URL.
13
+ */
14
+ export declare function getServers(specification: Spec | undefined, options?: DefaultServerUrlOption): Server[];
15
+ //# sourceMappingURL=getServers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getServers.d.ts","sourceRoot":"","sources":["../../../../src/features/BaseUrl/utils/getServers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAG7C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEtC,MAAM,MAAM,sBAAsB,GAAG;IACnC;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B,CAAA;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,aAAa,EAAE,IAAI,GAAG,SAAS,EAC/B,OAAO,CAAC,EAAE,sBAAsB,YA6DjC"}
@@ -0,0 +1,29 @@
1
+ import { findVariables as v, concatenateUrlAndPath as w } from "@scalar/oas-utils/helpers";
2
+ function S(r, l) {
3
+ var h;
4
+ let e = [];
5
+ return r != null && r.servers && (r == null ? void 0 : r.servers.length) > 0 ? e = r.servers : r != null && r.host ? e = [
6
+ {
7
+ url: `${((h = r.schemes) == null ? void 0 : h[0]) ?? "http"}://${r.host}${(r == null ? void 0 : r.basePath) ?? ""}`
8
+ }
9
+ ] : e = [
10
+ {
11
+ url: l != null && l.defaultServerUrl ? l == null ? void 0 : l.defaultServerUrl : typeof window < "u" ? window.location.origin : "/"
12
+ }
13
+ ], (l != null && l.defaultServerUrl || typeof window < "u") && (e = e.map((d) => b(d, l))), e.map((d) => {
14
+ const a = d.variables ?? {};
15
+ return v(d.url ?? "").filter((u) => !a[u]).forEach((u) => {
16
+ d.variables === void 0 && (d.variables = {}), d.variables[u] = {};
17
+ }), d;
18
+ });
19
+ }
20
+ function b(r, l) {
21
+ var e;
22
+ return (e = r.url) != null && e.match(/^(?!(https?|file):\/\/|{).+/) && (r.url = w(
23
+ l != null && l.defaultServerUrl ? l == null ? void 0 : l.defaultServerUrl : typeof window < "u" ? window.location.origin : "",
24
+ r.url
25
+ )), r;
26
+ }
27
+ export {
28
+ S as getServers
29
+ };
@@ -0,0 +1,2 @@
1
+ export * from './getServers.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/BaseUrl/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA"}
@@ -3,5 +3,5 @@ import type { Spec } from '@scalar/oas-utils';
3
3
  * Creates an empty specification object.
4
4
  * The returning object has the same structure as a valid OpenAPI specification, but everything is empty.
5
5
  */
6
- export declare function createEmptySpecification(): Spec;
6
+ export declare function createEmptySpecification(partialSpecification?: Partial<Spec>): Spec;
7
7
  //# sourceMappingURL=createEmptySpecification.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createEmptySpecification.d.ts","sourceRoot":"","sources":["../../src/helpers/createEmptySpecification.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAE7C;;;GAGG;AACH,wBAAgB,wBAAwB,IAAI,IAAI,CAsB/C"}
1
+ {"version":3,"file":"createEmptySpecification.d.ts","sourceRoot":"","sources":["../../src/helpers/createEmptySpecification.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAI7C;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,QAsB5E"}
@@ -1,5 +1,6 @@
1
- function e() {
2
- return {
1
+ import { deepMerge as r } from "./deepMerge.js";
2
+ function i(e) {
3
+ return r(e ?? {}, {
3
4
  info: {
4
5
  title: "",
5
6
  description: "",
@@ -19,8 +20,8 @@ function e() {
19
20
  },
20
21
  servers: [],
21
22
  tags: []
22
- };
23
+ });
23
24
  }
24
25
  export {
25
- e as createEmptySpecification
26
+ i as createEmptySpecification
26
27
  };
@@ -1,4 +1,4 @@
1
- import { type ClientRequestConfig, type ServerState } from '@scalar/api-client';
1
+ import { type ClientRequestConfig, type ServerState } from '#legacy';
2
2
  import type { AuthenticationState, TransformedOperation } from '@scalar/oas-utils';
3
3
  import type { OpenAPIV3 } from '@scalar/openapi-parser';
4
4
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"getApiClientRequest.d.ts","sourceRoot":"","sources":["../../src/helpers/getApiClientRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAGjB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EACV,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,mBAAmB,CAAA;AAK1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAIvD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,WAAW,EACX,mBAAmB,EACnB,SAAS,EACT,cAAc,GACf,EAAE;IACD,WAAW,EAAE,WAAW,CAAA;IACxB,SAAS,EAAE,oBAAoB,CAAA;IAC/B,mBAAmB,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAA;IAChD,cAAc,CAAC,EAAE,SAAS,CAAC,yBAAyB,EAAE,GAAG,IAAI,CAAA;CAC9D,GAAG,mBAAmB,CAmCtB"}
1
+ {"version":3,"file":"getApiClientRequest.d.ts","sourceRoot":"","sources":["../../src/helpers/getApiClientRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAGjB,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EACV,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,mBAAmB,CAAA;AAK1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAIvD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,WAAW,EACX,mBAAmB,EACnB,SAAS,EACT,cAAc,GACf,EAAE;IACD,WAAW,EAAE,WAAW,CAAA;IACxB,SAAS,EAAE,oBAAoB,CAAA;IAC/B,mBAAmB,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAA;IAChD,cAAc,CAAC,EAAE,SAAS,CAAC,yBAAyB,EAAE,GAAG,IAAI,CAAA;CAC9D,GAAG,mBAAmB,CAmCtB"}
@@ -1,7 +1,8 @@
1
- import { getRequestFromAuthentication as p, getUrlFromServerState as s } from "@scalar/api-client";
2
- import { getRequestFromOperation as m, getParametersFromOperation as c } from "@scalar/oas-utils/spec-getters";
1
+ import { getRequestFromOperation as n, getParametersFromOperation as d } from "@scalar/oas-utils/spec-getters";
3
2
  import { getHarRequest as f } from "./getHarRequest.js";
4
- function F({
3
+ import { getRequestFromAuthentication as c } from "../legacy/helpers/getRequestFromAuthentication.js";
4
+ import { getUrlFromServerState as s } from "../legacy/helpers/getUrlFromServerState.js";
5
+ function O({
5
6
  serverState: t,
6
7
  authenticationState: o,
7
8
  operation: e,
@@ -12,23 +13,23 @@ function F({
12
13
  {
13
14
  url: s(t)
14
15
  },
15
- m(e, { requiredOnly: !1 }),
16
+ n(e, { requiredOnly: !1 }),
16
17
  // Only generate authentication parameters if an authentication state is passed.
17
- o ? p(
18
+ o ? c(
18
19
  o,
19
20
  ((u = e.information) == null ? void 0 : u.security) ?? l ?? []
20
21
  ) : {}
21
- ), q = m(e, {
22
+ ), p = n(e, {
22
23
  requiredOnly: !1
23
- }), d = c(e, "path", !1);
24
+ }), q = d(e, "path", !1);
24
25
  return {
25
26
  id: e.operationId,
26
27
  name: e.name,
27
28
  type: r.method,
28
- path: q.path ?? "",
29
- variables: d,
29
+ path: p.path ?? "",
30
+ variables: q,
30
31
  cookies: i(r.cookies),
31
- query: r.queryString.map((n) => ({ ...n, enabled: n.required ?? !0 })),
32
+ query: r.queryString.map((m) => ({ ...m, enabled: m.required ?? !0 })),
32
33
  headers: i(r.headers),
33
34
  url: s(t) ?? "",
34
35
  body: (a = r.postData) == null ? void 0 : a.text
@@ -38,5 +39,5 @@ function i(t) {
38
39
  return (t ?? []).map((o) => ({ ...o, enabled: !0 }));
39
40
  }
40
41
  export {
41
- F as getApiClientRequest
42
+ O as getApiClientRequest
42
43
  };
@@ -3,5 +3,5 @@ import type { OpenAPIV2, OpenAPIV3, OpenAPIV3_1 } from '@scalar/openapi-parser';
3
3
  /**
4
4
  * Returns all models from the specification, no matter if it’s Swagger 2.0 or OpenAPI 3.x.
5
5
  */
6
- export declare function getModels(spec?: Spec): Record<string, OpenAPIV3_1.SchemaObject> | OpenAPIV2.DefinitionsObject | Record<string, OpenAPIV3.SchemaObject>;
6
+ export declare function getModels(spec?: Spec): OpenAPIV2.DefinitionsObject | Record<string, OpenAPIV3_1.SchemaObject> | Record<string, OpenAPIV3.SchemaObject>;
7
7
  //# sourceMappingURL=getModels.d.ts.map
@@ -1,6 +1,7 @@
1
1
  export * from './createEmptySpecification.js';
2
2
  export * from './deepMerge.js';
3
3
  export * from './getApiClientRequest.js';
4
+ export * from './getHarRequest.js';
4
5
  export * from './getHeadingsFromMarkdown.js';
5
6
  export * from './getLowestHeadingLevel.js';
6
7
  export * from './getModels.js';
@@ -19,5 +20,4 @@ export * from './scrollToId.js';
19
20
  export * from './sleep.js';
20
21
  export * from './specDownloads.js';
21
22
  export * from './splitMarkdownInSections.js';
22
- export * from './getHarRequest.js';
23
23
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA;AAC1C,cAAc,aAAa,CAAA;AAC3B,cAAc,uBAAuB,CAAA;AACrC,cAAc,2BAA2B,CAAA;AACzC,cAAc,yBAAyB,CAAA;AACvC,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;AAClC,cAAc,aAAa,CAAA;AAC3B,cAAc,sBAAsB,CAAA;AACpC,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,SAAS,CAAA;AACvB,cAAc,kBAAkB,CAAA;AAChC,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AACvB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,2BAA2B,CAAA;AACzC,cAAc,iBAAiB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA;AAC1C,cAAc,aAAa,CAAA;AAC3B,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,2BAA2B,CAAA;AACzC,cAAc,yBAAyB,CAAA;AACvC,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;AAClC,cAAc,aAAa,CAAA;AAC3B,cAAc,sBAAsB,CAAA;AACpC,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,SAAS,CAAA;AACvB,cAAc,kBAAkB,CAAA;AAChC,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AACvB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,2BAA2B,CAAA"}
@@ -1,16 +1,19 @@
1
- import { useServerStore as r, useOpenApiStore as s, useApiClientStore as n, useRequestStore as i } from "@scalar/api-client";
2
- import { getApiClientRequest as u } from "./getApiClientRequest.js";
3
- const { server: l } = r(), { setOperation: c, setGlobalSecurity: p } = s(), { toggleApiClient: S } = n(), { setActiveRequest: a, resetActiveResponse: A } = i();
4
- function m(e, o) {
5
- const t = u({
1
+ import { useApiClientStore as r } from "../legacy/stores/useApiClientStore.js";
2
+ import { getApiClientRequest as s } from "./getApiClientRequest.js";
3
+ import { useServerStore as i } from "../legacy/stores/useServerStore.js";
4
+ import { useRequestStore as n } from "../legacy/stores/useRequestStore.js";
5
+ import { useOpenApiStore as u } from "../legacy/stores/useOpenApiStore.js";
6
+ const { server: l } = i(), { setOperation: p, setGlobalSecurity: c } = u(), { toggleApiClient: m } = r(), { setActiveRequest: S, resetActiveResponse: a } = n();
7
+ function C(e, o) {
8
+ const t = s({
6
9
  serverState: l,
7
10
  operation: e,
8
11
  // Let the API client handle the authentication.
9
12
  authenticationState: null,
10
13
  globalSecurity: null
11
14
  });
12
- A(), a(t), c(e), p(o), S(t, !0);
15
+ a(), S(t), p(e), c(o), m(t, !0);
13
16
  }
14
17
  export {
15
- m as openClientFor
18
+ C as openClientFor
16
19
  };
@@ -1 +1 @@
1
- {"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../src/helpers/parse.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAc7C,eAAO,MAAM,KAAK,kBACD,GAAG,eAGf;IACD,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,KACA,QAAQ,IAAI,CAmDd,CAAA"}
1
+ {"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../src/helpers/parse.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAe7C,eAAO,MAAM,KAAK,kBACD,GAAG,eAGf;IACD,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,KACA,QAAQ,IAAI,CAmDd,CAAA"}
@@ -1,8 +1,10 @@
1
- import { redirectToProxy as b, normalizeRequestMethod as E, validRequestMethods as j } from "@scalar/api-client";
2
- import { load as M, dereference as q } from "@scalar/openapi-parser";
3
- import { fetchUrls as k } from "@scalar/openapi-parser/plugins/fetch-urls";
1
+ import { redirectToProxy as b } from "@scalar/oas-utils/helpers";
2
+ import { load as j, dereference as M } from "@scalar/openapi-parser";
3
+ import { fetchUrls as q } from "@scalar/openapi-parser/plugins/fetch-urls";
4
4
  import { createEmptySpecification as m } from "./createEmptySpecification.js";
5
- const v = (p, {
5
+ import { normalizeRequestMethod as E } from "../legacy/helpers/normalizeRequestMethod.js";
6
+ import { validRequestMethods as k } from "../legacy/fixtures/httpRequestMethods.js";
7
+ const D = (p, {
6
8
  proxy: t
7
9
  } = {}) => new Promise(async (a, h) => {
8
10
  var s;
@@ -11,20 +13,20 @@ const v = (p, {
11
13
  return a(
12
14
  u(m())
13
15
  );
14
- const i = performance.now(), { filesystem: r } = await M(p, {
16
+ const i = performance.now(), { filesystem: n } = await j(p, {
15
17
  plugins: [
16
- k({
18
+ q({
17
19
  fetch: (o) => fetch(t ? b(t, o) : o)
18
20
  })
19
21
  ]
20
- }), { schema: e, errors: n } = await q(r), c = performance.now();
21
- return console.log(`dereference: ${Math.round(c - i)} ms`), n != null && n.length && console.warn(
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
24
  `Please open an issue on https://github.com/scalar/scalar
23
25
  `,
24
26
  `Scalar OpenAPI Parser Warning:
25
27
  `,
26
- n
27
- ), e === void 0 ? (h(((s = n == null ? void 0 : n[0]) == null ? void 0 : s.message) ?? "Failed to parse the OpenAPI file."), a(
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(
28
30
  u(m())
29
31
  )) : a(u(e));
30
32
  } catch (i) {
@@ -39,17 +41,17 @@ const v = (p, {
39
41
  const a = {};
40
42
  return Object.keys(t.webhooks ?? {}).forEach((s) => {
41
43
  var i;
42
- Object.keys(((i = t.webhooks) == null ? void 0 : i[s]) ?? {}).forEach((r) => {
43
- var n, c, o;
44
- const e = (n = t.webhooks) == null ? void 0 : n[s][r];
45
- (e == null ? void 0 : e["x-internal"]) !== !0 && (a[s] === void 0 && (a[s] = {}), a[s][r] = {
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] = {
46
48
  // Transformed data
47
- httpVerb: E(r),
49
+ httpVerb: E(n),
48
50
  path: s,
49
51
  operationId: (e == null ? void 0 : e.operationId) || s,
50
52
  name: (e == null ? void 0 : e.summary) || s || "",
51
53
  description: (e == null ? void 0 : e.description) || "",
52
- pathParameters: (o = (c = t.paths) == null ? void 0 : c[s]) == null ? void 0 : o.parameters,
54
+ pathParameters: (o = (f = t.paths) == null ? void 0 : f[s]) == null ? void 0 : o.parameters,
53
55
  // Original webhook
54
56
  information: {
55
57
  ...e
@@ -58,14 +60,14 @@ const v = (p, {
58
60
  });
59
61
  }), Object.keys(t.paths).forEach((s) => {
60
62
  Object.keys(t.paths[s]).filter(
61
- (r) => j.includes(r.toUpperCase())
62
- ).forEach((r) => {
63
- var c, o, g, w, y, x;
64
- const e = t.paths[s][r];
63
+ (n) => k.includes(n.toUpperCase())
64
+ ).forEach((n) => {
65
+ var f, o, g, w, y, x;
66
+ const e = t.paths[s][n];
65
67
  if (e === void 0 || e["x-internal"] === !0)
66
68
  return;
67
- const n = {
68
- httpVerb: E(r),
69
+ const r = {
70
+ httpVerb: E(n),
69
71
  path: s,
70
72
  operationId: e.operationId || s,
71
73
  name: e.summary || s || "",
@@ -73,33 +75,33 @@ const v = (p, {
73
75
  information: {
74
76
  ...e
75
77
  },
76
- pathParameters: (o = (c = t.paths) == null ? void 0 : c[s]) == null ? void 0 : o.parameters
78
+ pathParameters: (o = (f = t.paths) == null ? void 0 : f[s]) == null ? void 0 : o.parameters
77
79
  };
78
80
  if (!e.tags || e.tags.length === 0) {
79
81
  (g = t.tags) != null && g.find(
80
- (f) => f.name === "default"
82
+ (c) => c.name === "default"
81
83
  ) || (w = t.tags) == null || w.push({
82
84
  name: "default",
83
85
  description: "",
84
86
  operations: []
85
87
  });
86
88
  const d = (y = t.tags) == null ? void 0 : y.findIndex(
87
- (f) => f.name === "default"
89
+ (c) => c.name === "default"
88
90
  );
89
- d >= 0 && ((x = t.tags[d]) == null || x.operations.push(n));
91
+ d >= 0 && ((x = t.tags[d]) == null || x.operations.push(r));
90
92
  } else
91
93
  e.tags.forEach((d) => {
92
94
  var I, O, P;
93
- const f = (I = t.tags) == null ? void 0 : I.findIndex(
95
+ const c = (I = t.tags) == null ? void 0 : I.findIndex(
94
96
  // @ts-expect-error TODO: The types are just screwed, needs refactoring
95
97
  (R) => R.name === d
96
98
  );
97
- f === -1 && ((O = t.tags) == null || O.push({
99
+ c === -1 && ((O = t.tags) == null || O.push({
98
100
  name: d,
99
101
  description: ""
100
102
  }));
101
- const l = f !== -1 ? f : t.tags.length - 1;
102
- typeof ((P = t.tags[l]) == null ? void 0 : P.operations) > "u" && (t.tags[l].operations = []), t.tags[l].operations.push(n);
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);
103
105
  });
104
106
  });
105
107
  }), {
@@ -108,5 +110,5 @@ const v = (p, {
108
110
  };
109
111
  };
110
112
  export {
111
- v as parse
113
+ D as parse
112
114
  };