@scalar/api-reference 1.24.21 → 1.24.24

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 (168) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/dist/browser/standalone.js +21905 -22407
  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/ApiReference.vue.js +14 -14
  7. package/dist/components/ApiReferenceLayout.vue.d.ts +2 -2
  8. package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
  9. package/dist/components/ApiReferenceLayout.vue.js +1 -1
  10. package/dist/components/ApiReferenceLayout.vue2.js +130 -151
  11. package/dist/components/Content/Authentication/Authentication.vue.d.ts.map +1 -1
  12. package/dist/components/Content/Authentication/Authentication.vue.js +2 -2
  13. package/dist/components/Content/Authentication/Authentication.vue2.js +20 -18
  14. package/dist/components/Content/Content.vue.d.ts +3 -0
  15. package/dist/components/Content/Content.vue.d.ts.map +1 -1
  16. package/dist/components/Content/Content.vue.js +2 -2
  17. package/dist/components/Content/Content.vue2.js +29 -27
  18. package/dist/components/Content/Introduction/Introduction.vue.d.ts +2 -2
  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/Tag/Endpoints.vue.d.ts.map +1 -1
  33. package/dist/components/Content/Tag/Endpoints.vue.js +2 -2
  34. package/dist/components/Content/Tag/Endpoints.vue2.js +23 -23
  35. package/dist/components/HttpMethod/HttpMethod.vue.d.ts +42 -0
  36. package/dist/components/HttpMethod/HttpMethod.vue.d.ts.map +1 -0
  37. package/dist/components/HttpMethod/HttpMethod.vue.js +28 -0
  38. package/dist/components/HttpMethod/HttpMethod.vue2.js +4 -0
  39. package/dist/components/HttpMethod/constants.d.ts +9 -0
  40. package/dist/components/HttpMethod/constants.d.ts.map +1 -0
  41. package/dist/components/HttpMethod/constants.js +36 -0
  42. package/dist/components/HttpMethod/index.d.ts +2 -0
  43. package/dist/components/HttpMethod/index.d.ts.map +1 -0
  44. package/dist/components/HttpMethod/utils/isRequestMethod.d.ts +4 -0
  45. package/dist/components/HttpMethod/utils/isRequestMethod.d.ts.map +1 -0
  46. package/dist/components/HttpMethod/utils/isRequestMethod.js +7 -0
  47. package/dist/components/Sidebar/SidebarHttpBadge.vue.js +1 -1
  48. package/dist/components/Sidebar/SidebarHttpBadge.vue2.js +6 -6
  49. package/dist/components/api-client-bus.d.ts +1 -1
  50. package/dist/features/BaseUrl/BaseUrl.vue.d.ts +9 -0
  51. package/dist/features/BaseUrl/BaseUrl.vue.d.ts.map +1 -1
  52. package/dist/features/BaseUrl/BaseUrl.vue.js +43 -33
  53. package/dist/helpers/getApiClientRequest.d.ts +1 -1
  54. package/dist/helpers/getApiClientRequest.d.ts.map +1 -1
  55. package/dist/helpers/getApiClientRequest.js +12 -11
  56. package/dist/helpers/index.d.ts +1 -1
  57. package/dist/helpers/index.d.ts.map +1 -1
  58. package/dist/helpers/openClientFor.js +10 -7
  59. package/dist/helpers/parse.d.ts.map +1 -1
  60. package/dist/helpers/parse.js +33 -31
  61. package/dist/hooks/useReactiveSpec.d.ts +1 -1
  62. package/dist/hooks/useSidebar.js +18 -17
  63. package/dist/index.d.ts +0 -2
  64. package/dist/index.d.ts.map +1 -1
  65. package/dist/index.js +101 -102
  66. package/dist/legacy/components/CardForm.vue.d.ts +10 -0
  67. package/dist/legacy/components/CardForm.vue.d.ts.map +1 -0
  68. package/dist/legacy/components/CardForm.vue.js +13 -0
  69. package/dist/legacy/components/CardFormButton.vue.d.ts +12 -0
  70. package/dist/legacy/components/CardFormButton.vue.d.ts.map +1 -0
  71. package/dist/legacy/components/CardFormButton.vue.js +7 -0
  72. package/dist/legacy/components/CardFormButton.vue2.js +18 -0
  73. package/dist/legacy/components/CardFormGroup.vue.d.ts +10 -0
  74. package/dist/legacy/components/CardFormGroup.vue.d.ts.map +1 -0
  75. package/dist/legacy/components/CardFormGroup.vue.js +13 -0
  76. package/dist/legacy/components/CardFormRows.vue.d.ts +10 -0
  77. package/dist/legacy/components/CardFormRows.vue.d.ts.map +1 -0
  78. package/dist/legacy/components/CardFormRows.vue.js +13 -0
  79. package/dist/legacy/components/CardFormTextInput.vue.d.ts +25 -0
  80. package/dist/legacy/components/CardFormTextInput.vue.d.ts.map +1 -0
  81. package/dist/legacy/components/CardFormTextInput.vue.js +7 -0
  82. package/dist/legacy/components/CardFormTextInput.vue2.js +37 -0
  83. package/dist/legacy/components/SecurityScheme.vue.d.ts +19 -0
  84. package/dist/legacy/components/SecurityScheme.vue.d.ts.map +1 -0
  85. package/dist/legacy/components/SecurityScheme.vue.js +7 -0
  86. package/dist/legacy/components/SecurityScheme.vue2.js +364 -0
  87. package/dist/legacy/components/SecuritySchemeScopes.vue.d.ts +26 -0
  88. package/dist/legacy/components/SecuritySchemeScopes.vue.d.ts.map +1 -0
  89. package/dist/legacy/components/SecuritySchemeScopes.vue.js +7 -0
  90. package/dist/legacy/components/SecuritySchemeScopes.vue2.js +91 -0
  91. package/dist/legacy/components/SecuritySchemeSelector.vue.d.ts +25 -0
  92. package/dist/legacy/components/SecuritySchemeSelector.vue.d.ts.map +1 -0
  93. package/dist/legacy/components/SecuritySchemeSelector.vue.js +7 -0
  94. package/dist/legacy/components/SecuritySchemeSelector.vue2.js +64 -0
  95. package/dist/legacy/fixtures/httpHeaders.d.ts +6 -0
  96. package/dist/legacy/fixtures/httpHeaders.d.ts.map +1 -0
  97. package/dist/legacy/fixtures/httpRequestMethods.d.ts +10 -0
  98. package/dist/legacy/fixtures/httpRequestMethods.d.ts.map +1 -0
  99. package/dist/legacy/fixtures/httpRequestMethods.js +18 -0
  100. package/dist/legacy/fixtures/index.d.ts +3 -0
  101. package/dist/legacy/fixtures/index.d.ts.map +1 -0
  102. package/dist/legacy/helpers/createPlaceholderRequest.d.ts +6 -0
  103. package/dist/legacy/helpers/createPlaceholderRequest.d.ts.map +1 -0
  104. package/dist/legacy/helpers/createPlaceholderRequest.js +14 -0
  105. package/dist/legacy/helpers/encodeStringAsBase64.d.ts +5 -0
  106. package/dist/legacy/helpers/encodeStringAsBase64.d.ts.map +1 -0
  107. package/dist/legacy/helpers/encodeStringAsBase64.js +6 -0
  108. package/dist/legacy/helpers/getRequestFromAuthentication.d.ts +10 -0
  109. package/dist/legacy/helpers/getRequestFromAuthentication.d.ts.map +1 -0
  110. package/dist/legacy/helpers/getRequestFromAuthentication.js +83 -0
  111. package/dist/legacy/helpers/getUrlFromServerState.d.ts +6 -0
  112. package/dist/legacy/helpers/getUrlFromServerState.d.ts.map +1 -0
  113. package/dist/legacy/helpers/getUrlFromServerState.js +9 -0
  114. package/dist/legacy/helpers/humanDiff.d.ts +5 -0
  115. package/dist/legacy/helpers/humanDiff.d.ts.map +1 -0
  116. package/dist/legacy/helpers/index.d.ts +12 -0
  117. package/dist/legacy/helpers/index.d.ts.map +1 -0
  118. package/dist/legacy/helpers/mapFromArray.d.ts +5 -0
  119. package/dist/legacy/helpers/mapFromArray.d.ts.map +1 -0
  120. package/dist/legacy/helpers/normalizeHeaders.d.ts +9 -0
  121. package/dist/legacy/helpers/normalizeHeaders.d.ts.map +1 -0
  122. package/dist/legacy/helpers/normalizePath.d.ts +5 -0
  123. package/dist/legacy/helpers/normalizePath.d.ts.map +1 -0
  124. package/dist/legacy/helpers/normalizeRequestMethod.d.ts +6 -0
  125. package/dist/legacy/helpers/normalizeRequestMethod.d.ts.map +1 -0
  126. package/dist/legacy/helpers/normalizeRequestMethod.js +14 -0
  127. package/dist/legacy/helpers/normalizeUrl.d.ts +5 -0
  128. package/dist/legacy/helpers/normalizeUrl.d.ts.map +1 -0
  129. package/dist/legacy/helpers/prepareClientRequestConfig.d.ts +24 -0
  130. package/dist/legacy/helpers/prepareClientRequestConfig.d.ts.map +1 -0
  131. package/dist/legacy/index.d.ts +5 -0
  132. package/dist/legacy/index.d.ts.map +1 -0
  133. package/dist/legacy/stores/index.d.ts +6 -0
  134. package/dist/legacy/stores/index.d.ts.map +1 -0
  135. package/dist/legacy/stores/useApiClientStore.d.ts +18 -0
  136. package/dist/legacy/stores/useApiClientStore.d.ts.map +1 -0
  137. package/dist/legacy/stores/useApiClientStore.js +32 -0
  138. package/dist/legacy/stores/useAuthenticationStore.d.ts +59 -0
  139. package/dist/legacy/stores/useAuthenticationStore.d.ts.map +1 -0
  140. package/dist/legacy/stores/useAuthenticationStore.js +36 -0
  141. package/dist/legacy/stores/useOpenApiStore.d.ts +95 -0
  142. package/dist/legacy/stores/useOpenApiStore.d.ts.map +1 -0
  143. package/dist/legacy/stores/useOpenApiStore.js +23 -0
  144. package/dist/legacy/stores/useRequestStore.d.ts +58 -0
  145. package/dist/legacy/stores/useRequestStore.d.ts.map +1 -0
  146. package/dist/legacy/stores/useRequestStore.js +33 -0
  147. package/dist/legacy/stores/useServerStore.d.ts +18 -0
  148. package/dist/legacy/stores/useServerStore.d.ts.map +1 -0
  149. package/dist/legacy/stores/useServerStore.js +18 -0
  150. package/dist/legacy/types.d.ts +117 -0
  151. package/dist/legacy/types.d.ts.map +1 -0
  152. package/dist/stores/index.d.ts +1 -0
  153. package/dist/stores/index.d.ts.map +1 -1
  154. package/dist/style.css +1 -1
  155. package/dist/types.d.ts +7 -7
  156. package/dist/types.d.ts.map +1 -1
  157. package/package.json +14 -13
  158. package/dist/components/ApiClientModalOld.vue.d.ts +0 -36
  159. package/dist/components/ApiClientModalOld.vue.d.ts.map +0 -1
  160. package/dist/components/ApiClientModalOld.vue.js +0 -7
  161. package/dist/components/ApiClientModalOld.vue2.js +0 -88
  162. package/dist/components/Content/Schema/SchemaProperty.spec.d.ts +0 -2
  163. package/dist/components/Content/Schema/SchemaProperty.spec.d.ts.map +0 -1
  164. package/dist/features.d.ts +0 -8
  165. package/dist/features.d.ts.map +0 -1
  166. package/dist/features.js +0 -5
  167. package/dist/standalone.spec.d.ts +0 -2
  168. package/dist/standalone.spec.d.ts.map +0 -1
@@ -1,87 +1,97 @@
1
1
  import { defineComponent as b, ref as S, watch as c, openBlock as U, createBlock as g, unref as u } from "vue";
2
- import { useServerStore as j } from "@scalar/api-client";
3
- import O from "./ServerForm.vue.js";
4
- import { getServers as _ } from "./utils/getServers.js";
5
- const k = /* @__PURE__ */ b({
2
+ import j from "./ServerForm.vue.js";
3
+ import { getServers as E } from "./utils/getServers.js";
4
+ import { createEmptySpecification as O } from "../../helpers/createEmptySpecification.js";
5
+ import { useServerStore as _ } from "../../legacy/stores/useServerStore.js";
6
+ const w = /* @__PURE__ */ b({
6
7
  __name: "BaseUrl",
7
8
  props: {
8
9
  specification: {},
9
- defaultServerUrl: {}
10
+ defaultServerUrl: {},
11
+ servers: {}
10
12
  },
11
13
  setup(f) {
12
- const i = f, { server: s, setServer: o } = j(), t = S(0);
14
+ const a = f, { server: i, setServer: o } = _(), s = S(0);
13
15
  c(
14
- t,
16
+ s,
15
17
  () => o({
16
- selectedServer: t.value
18
+ selectedServer: s.value
17
19
  }),
18
20
  {
19
21
  immediate: !0
20
22
  }
21
23
  ), c(
22
- () => i.specification,
24
+ () => a.specification,
23
25
  () => {
24
- var e;
25
- const r = _(i.specification, {
26
- defaultServerUrl: i.defaultServerUrl
26
+ var r;
27
+ const t = (
28
+ // Use the specification
29
+ a.servers === void 0 ? a.specification : (
30
+ // Or create an empty one with the specified servers list
31
+ O({
32
+ servers: a.servers
33
+ })
34
+ )
35
+ ), e = E(t, {
36
+ defaultServerUrl: a.defaultServerUrl
27
37
  });
28
38
  o({
29
- servers: r,
39
+ servers: e,
30
40
  variables: {
31
41
  // Set the initial values for the variables
32
42
  ...m(
33
- ((e = r[t.value]) == null ? void 0 : e.variables) ?? {}
43
+ ((r = e[s.value]) == null ? void 0 : r.variables) ?? {}
34
44
  ),
35
45
  // Don’t overwrite existing values, but filter out non-existing variables
36
46
  ...p(
37
- s.variables,
38
- r[t.value]
47
+ i.variables,
48
+ e[s.value]
39
49
  )
40
50
  }
41
51
  });
42
52
  },
43
53
  { deep: !0, immediate: !0 }
44
54
  );
45
- function m(r) {
55
+ function m(t) {
46
56
  return Object.fromEntries(
47
- Object.entries(r ?? {}).map(([e, a]) => {
57
+ Object.entries(t ?? {}).map(([e, r]) => {
48
58
  var n, l, v;
49
59
  return [
50
60
  e,
51
61
  // 1) Default
52
- ((n = a.default) == null ? void 0 : n.toString()) ?? // 2) First enum value
53
- ((v = (l = a.enum) == null ? void 0 : l[0]) == null ? void 0 : v.toString()) ?? // 3) Empty string
62
+ ((n = r.default) == null ? void 0 : n.toString()) ?? // 2) First enum value
63
+ ((v = (l = r.enum) == null ? void 0 : l[0]) == null ? void 0 : v.toString()) ?? // 3) Empty string
54
64
  ""
55
65
  ];
56
66
  })
57
67
  );
58
68
  }
59
- function p(r, e) {
69
+ function p(t, e) {
60
70
  return Object.fromEntries(
61
- Object.entries(r).filter(
62
- ([a]) => a in (e.variables ?? {})
71
+ Object.entries(t).filter(
72
+ ([r]) => r in (e.variables ?? {})
63
73
  )
64
74
  );
65
75
  }
66
- function d(r, e) {
76
+ function d(t, e) {
67
77
  o({
68
78
  variables: {
69
- ...s.variables,
70
- [r]: e
79
+ ...i.variables,
80
+ [t]: e
71
81
  }
72
82
  });
73
83
  }
74
- return (r, e) => (U(), g(O, {
75
- selected: t.value,
76
- servers: u(s).servers,
77
- variables: u(s).variables,
78
- "onUpdate:selected": e[0] || (e[0] = (a) => {
79
- t.value = a;
84
+ return (t, e) => (U(), g(j, {
85
+ selected: s.value,
86
+ servers: u(i).servers,
87
+ variables: u(i).variables,
88
+ "onUpdate:selected": e[0] || (e[0] = (r) => {
89
+ s.value = r;
80
90
  }),
81
91
  "onUpdate:variable": d
82
92
  }, null, 8, ["selected", "servers", "variables"]));
83
93
  }
84
94
  });
85
95
  export {
86
- k as default
96
+ w as default
87
97
  };
@@ -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
  };
@@ -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
  };
@@ -13,7 +13,7 @@ export declare function useReactiveSpec({ specConfig, proxy, }: {
13
13
  name: string;
14
14
  description: string;
15
15
  operations: {
16
- httpVerb: "CONNECT" | "DELETE" | "GET" | "HEAD" | "OPTIONS" | "PATCH" | "POST" | "PUT" | "TRACE";
16
+ httpVerb: "GET" | "POST" | "PUT" | "HEAD" | "DELETE" | "PATCH" | "OPTIONS" | "CONNECT" | "TRACE";
17
17
  path: string;
18
18
  operationId?: string | undefined;
19
19
  name?: string | undefined;
@@ -1,13 +1,14 @@
1
- import { useApiClientStore as Q, useOpenApiStore as R } from "@scalar/api-client";
2
- import { ssrState as U } from "@scalar/oas-utils/helpers";
3
- import { ref as g, reactive as X, computed as P, watch as L } from "vue";
4
- import { useNavState as Y } from "./useNavState.js";
1
+ import { ssrState as Q } from "@scalar/oas-utils/helpers";
2
+ import { ref as g, reactive as R, computed as P, watch as L } from "vue";
3
+ import { useNavState as U } from "./useNavState.js";
5
4
  import { getLowestHeadingLevel as q } from "../helpers/getLowestHeadingLevel.js";
6
5
  import { openClientFor as W } from "../helpers/openClientFor.js";
7
- import { hasModels as Z } from "../helpers/hasModels.js";
6
+ import { hasModels as X } from "../helpers/hasModels.js";
8
7
  import { getModels as D } from "../helpers/getModels.js";
9
- import { hasWebhooks as _ } from "../helpers/hasWebhooks.js";
10
- import { getHeadingsFromMarkdown as $ } from "../helpers/getHeadingsFromMarkdown.js";
8
+ import { hasWebhooks as Y } from "../helpers/hasWebhooks.js";
9
+ import { getHeadingsFromMarkdown as Z } from "../helpers/getHeadingsFromMarkdown.js";
10
+ import { useApiClientStore as _ } from "../legacy/stores/useApiClientStore.js";
11
+ import { useOpenApiStore as $ } from "../legacy/stores/useOpenApiStore.js";
11
12
  const {
12
13
  getHeadingId: F,
13
14
  getModelId: V,
@@ -16,12 +17,12 @@ const {
16
17
  getTagId: z,
17
18
  getWebhookId: S,
18
19
  hash: I
19
- } = Y(), o = g(void 0);
20
+ } = U(), o = g(void 0);
20
21
  function te(t) {
21
22
  return o.value = t;
22
23
  }
23
- const J = g(!1), w = X(
24
- U["useSidebarContent-collapsedSidebarItems"] ?? {}
24
+ const J = g(!1), w = R(
25
+ Q["useSidebarContent-collapsedSidebarItems"] ?? {}
25
26
  );
26
27
  function se(t) {
27
28
  w[t] = !w[t];
@@ -30,7 +31,7 @@ function C(t, s) {
30
31
  w[t] = s;
31
32
  }
32
33
  const b = g([]), ie = async (t) => {
33
- const s = await $(t), l = q(s);
34
+ const s = await Z(t), l = q(s);
34
35
  return s.filter((n) => (
35
36
  // highest level, eg. # Introduction
36
37
  n.depth === l || // second highest level, eg. ## Authentication
@@ -38,9 +39,9 @@ const b = g([]), ie = async (t) => {
38
39
  ));
39
40
  }, K = P(() => {
40
41
  var k, A, O, y, T, H, M, x, j, E;
41
- const { state: t } = Q(), s = {}, {
42
+ const { state: t } = _(), s = {}, {
42
43
  openApi: { globalSecurity: l }
43
- } = R(), n = [];
44
+ } = $(), n = [];
44
45
  let p = null;
45
46
  b.value.forEach((e) => {
46
47
  var i;
@@ -96,7 +97,7 @@ const b = g([]), ie = async (t) => {
96
97
  }
97
98
  };
98
99
  });
99
- let f = Z(o.value) && !J.value ? [
100
+ let f = X(o.value) && !J.value ? [
100
101
  {
101
102
  id: V(),
102
103
  title: "Models",
@@ -113,7 +114,7 @@ const b = g([]), ie = async (t) => {
113
114
  }
114
115
  )
115
116
  }
116
- ] : [], m = _(o.value) ? [
117
+ ] : [], m = Y(o.value) ? [
117
118
  {
118
119
  id: S(),
119
120
  title: "Webhook",
@@ -170,7 +171,7 @@ const b = g([]), ie = async (t) => {
170
171
  var t, s;
171
172
  return ((s = (t = K.value) == null ? void 0 : t.titles) == null ? void 0 : s[I.value]) ?? "";
172
173
  });
173
- function we(t) {
174
+ function be(t) {
174
175
  return t != null && t.parsedSpec && (o.value = t.parsedSpec, L(
175
176
  () => {
176
177
  var s, l;
@@ -208,5 +209,5 @@ function we(t) {
208
209
  };
209
210
  }
210
211
  export {
211
- we as useSidebar
212
+ be as useSidebar
212
213
  };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- export { default as ApiClientModal } from './components/ApiClientModalOld.vue.js';
2
1
  export { default as ApiReference } from './components/ApiReference.vue.js';
3
2
  export { default as ApiReferenceLayout } from './components/ApiReferenceLayout.vue.js';
4
3
  export { default as ModernLayout } from './components/Layouts/ModernLayout.vue.js';
@@ -16,5 +15,4 @@ export * from './stores';
16
15
  export * from './helpers';
17
16
  export * from './types';
18
17
  export * from './hooks';
19
- export { useApiClientStore } from '@scalar/api-client';
20
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,oCAAoC,CAAA;AAC9E,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACvE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,qCAAqC,CAAA;AACnF,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,uCAAuC,CAAA;AAC/E,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AAC/E,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,8BAA8B,CAAA;AACrE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACvE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,OAAO,CAAA;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAEzD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,sBAAsB,CAAA;AACpC,cAAc,mBAAmB,CAAA;AACjC,cAAc,sBAAsB,CAAA;AAEpC,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA;AAEvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACvE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,qCAAqC,CAAA;AACnF,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,uCAAuC,CAAA;AAC/E,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AAC/E,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,8BAA8B,CAAA;AACrE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACvE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,OAAO,CAAA;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAEzD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,sBAAsB,CAAA;AACpC,cAAc,mBAAmB,CAAA;AACjC,cAAc,sBAAsB,CAAA;AAEpC,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA"}