@scalar/api-client 2.1.49 → 2.1.51

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 (52) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/components/CodeInput/CodeInput.vue.js +2 -2
  3. package/dist/components/CodeInput/CodeInput.vue2.js +1 -1
  4. package/dist/components/DataTable/DataTableInput.vue.d.ts +1 -1
  5. package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
  6. package/dist/components/Sidebar/SidebarListElementActions.vue.js +1 -1
  7. package/dist/components/TopNav/TopNav.vue.js +2 -2
  8. package/dist/components/TopNav/TopNav.vue2.js +7 -7
  9. package/dist/hooks/index.d.ts +0 -2
  10. package/dist/hooks/index.d.ts.map +1 -1
  11. package/dist/hooks/index.js +8 -12
  12. package/dist/layouts/App/ApiClientApp.vue.js +19 -19
  13. package/dist/layouts/App/create-api-client-app.d.ts +317 -151
  14. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  15. package/dist/layouts/Modal/create-api-client-modal.d.ts +634 -302
  16. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  17. package/dist/layouts/Web/ApiClientWeb.vue.js +20 -20
  18. package/dist/layouts/Web/create-api-client-web.d.ts +317 -151
  19. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  20. package/dist/libs/create-client.d.ts +310 -144
  21. package/dist/libs/create-client.d.ts.map +1 -1
  22. package/dist/store/collections.d.ts +134 -4
  23. package/dist/store/collections.d.ts.map +1 -1
  24. package/dist/store/cookies.d.ts +4 -4
  25. package/dist/store/environment.d.ts +4 -4
  26. package/dist/store/import-spec.d.ts +26 -0
  27. package/dist/store/import-spec.d.ts.map +1 -1
  28. package/dist/store/request-example.d.ts +22 -72
  29. package/dist/store/request-example.d.ts.map +1 -1
  30. package/dist/store/requests.d.ts +15 -15
  31. package/dist/store/requests.d.ts.map +1 -1
  32. package/dist/store/servers.d.ts +4 -4
  33. package/dist/store/store.d.ts +632 -300
  34. package/dist/store/store.d.ts.map +1 -1
  35. package/dist/store/tags.d.ts +34 -34
  36. package/dist/store/tags.d.ts.map +1 -1
  37. package/dist/style.css +1 -1
  38. package/dist/views/Request/RequestSection/RequestAuthDataTableInput.vue.d.ts +1 -1
  39. package/dist/views/Request/RequestSection/RequestAuthDataTableInput.vue.d.ts.map +1 -1
  40. package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
  41. package/dist/views/Request/RequestSection/RequestBody.vue.js +1 -1
  42. package/dist/views/Request/RequestSection/RequestBody.vue2.js +20 -21
  43. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  44. package/dist/views/Settings/SettingsGeneralMode.vue.d.ts.map +1 -1
  45. package/dist/views/Settings/SettingsGeneralMode.vue.js +38 -46
  46. package/package.json +5 -4
  47. package/dist/hooks/useClipboard.d.ts +0 -4
  48. package/dist/hooks/useClipboard.d.ts.map +0 -1
  49. package/dist/hooks/useClipboard.js +0 -14
  50. package/dist/hooks/useDarkModeState.d.ts +0 -8
  51. package/dist/hooks/useDarkModeState.d.ts.map +0 -1
  52. package/dist/hooks/useDarkModeState.js +0 -46
package/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # @scalar/api-client
2
2
 
3
+ ## 2.1.51
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [7abe0f9]
8
+ - @scalar/components@0.12.71
9
+ - @scalar/use-codemirror@0.11.38
10
+
11
+ ## 2.1.50
12
+
13
+ ### Patch Changes
14
+
15
+ - bfad6dc: feat(use-hooks): create @scalar/use-hooks with useColorMode and useClipboard
16
+ - c8fae11: fix(components): cleanup ScalarMenu and ScalarListbox
17
+ - c87353e: Add serialization back to OpenAPI spec for custom entities
18
+ - Updated dependencies [bfad6dc]
19
+ - Updated dependencies [c8fae11]
20
+ - Updated dependencies [6894b7d]
21
+ - Updated dependencies [c87353e]
22
+ - Updated dependencies [c3d9f3c]
23
+ - @scalar/components@0.12.70
24
+ - @scalar/use-hooks@0.1.0
25
+ - @scalar/oas-utils@0.2.76
26
+ - @scalar/use-codemirror@0.11.37
27
+
3
28
  ## 2.1.49
4
29
 
5
30
  ### Patch Changes
@@ -2,7 +2,7 @@ import o from "./CodeInput.vue2.js";
2
2
  /* empty css */
3
3
  /* empty css */
4
4
  import t from "../../_virtual/_plugin-vue_export-helper.js";
5
- const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-b4428c61"]]);
5
+ const _ = /* @__PURE__ */ t(o, [["__scopeId", "data-v-a82747d2"]]);
6
6
  export {
7
- a as default
7
+ _ as default
8
8
  };
@@ -4,7 +4,7 @@ import { nanoid as oe } from "nanoid";
4
4
  import R from "../DataTable/DataTableInputSelect.vue.js";
5
5
  import { pillPlugin as te, backspaceCommand as le } from "./codeVariableWidget.js";
6
6
  import ne from "../../views/Environment/EnvironmentVariableDropdown.vue.js";
7
- import { useClipboard as ae } from "../../hooks/useClipboard.js";
7
+ import { useClipboard as ae } from "@scalar/use-hooks/useClipboard";
8
8
  import { ScalarIcon as re } from "@scalar/components";
9
9
  import { prettyPrintJson as ue } from "@scalar/oas-utils/helpers";
10
10
  import { useWorkspace as ie } from "../../store/store.js";
@@ -34,9 +34,9 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}
34
34
  onInputFocus?: (() => any) | undefined;
35
35
  onInputBlur?: (() => any) | undefined;
36
36
  }>, {
37
+ readOnly: boolean;
37
38
  required: boolean;
38
39
  canAddCustomEnumValue: boolean;
39
- readOnly: boolean;
40
40
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
41
41
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
42
42
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"DataTableInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/DataTableInput.vue"],"names":[],"mappings":"AAsLA,KAAK,WAAW,GAAG;IACf,EAAE,CA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O,CAAA;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;IACf,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,CAAC;AAqDJ,iBAAS,cAAc;WA4OT,OAAO,IAA6B;;yBAVrB,GAAG;yBACF,GAAG;sBACN,GAAG;;;;EAa7B;AAkBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;;;cA7TN,OAAO;cAJP,OAAO;2BAGM,OAAO;6EAsUjC,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAgBpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as C, ref as y, openBlock as n, createElementBlock as i, Fragment as h, createElementVNode as w, unref as a, createVNode as r, createCommentVNode as s, withModifiers as k, withCtx as M, createBlock as D } from "vue";
2
2
  import N from "./Actions/DeleteSidebarListElement.vue.js";
3
3
  import { useModal as $, ScalarIcon as c, ScalarModal as B } from "@scalar/components";
4
- import { useClipboard as S } from "../../hooks/useClipboard.js";
4
+ import { useClipboard as S } from "@scalar/use-hooks/useClipboard";
5
5
  const x = { class: "absolute flex right-1 opacity-0 group-hover:opacity-100" }, z = /* @__PURE__ */ C({
6
6
  __name: "SidebarListElementActions",
7
7
  props: {
@@ -1,7 +1,7 @@
1
1
  import o from "./TopNav.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-09bb5ecf"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-b07590ec"]]);
5
5
  export {
6
- f as default
6
+ m as default
7
7
  };
@@ -1,9 +1,9 @@
1
1
  import { defineComponent as z, reactive as A, ref as M, computed as j, watch as w, onMounted as B, onBeforeUnmount as E, openBlock as m, createElementBlock as b, createElementVNode as f, createVNode as n, unref as l, withCtx as u, toDisplayString as O, createTextVNode as x, Fragment as V, renderList as D, createBlock as K } from "vue";
2
2
  import q from "../ScalarHotkey.vue.js";
3
3
  import { ROUTES as F } from "../../constants.js";
4
- import { useClipboard as H } from "../../hooks/useClipboard.js";
5
- import { ScalarContextMenu as W, ScalarIcon as d, ScalarDropdown as G, ScalarDropdownItem as _ } from "@scalar/components";
6
- import { capitalize as J } from "@scalar/oas-utils/helpers";
4
+ import { ScalarContextMenu as H, ScalarIcon as d, ScalarDropdown as W, ScalarDropdownItem as _ } from "@scalar/components";
5
+ import { capitalize as G } from "@scalar/oas-utils/helpers";
6
+ import { useClipboard as J } from "@scalar/use-hooks/useClipboard";
7
7
  import P from "./TopNavItem.vue.js";
8
8
  import { useWorkspace as Q } from "../../store/store.js";
9
9
  const X = { class: "flex h-10 t-app__top-nav" }, Y = { class: "flex h-10 flex-1 items-center gap-1.5 text-sm font-medium pr-2.5 relative overflow-hidden" }, Z = {
@@ -15,7 +15,7 @@ const X = { class: "flex h-10 t-app__top-nav" }, Y = { class: "flex h-10 flex-1
15
15
  openNewTab: {}
16
16
  },
17
17
  setup(I) {
18
- const L = I, { activeRequest: S, router: i, events: g } = Q(), { copyToClipboard: U } = H(), t = A([{ label: "", path: "", icon: "Add" }]), a = M(0), T = j(() => a.value);
18
+ const L = I, { activeRequest: S, router: i, events: g } = Q(), { copyToClipboard: U } = J(), t = A([{ label: "", path: "", icon: "Add" }]), a = M(0), T = j(() => a.value);
19
19
  function k() {
20
20
  var o;
21
21
  const e = F.find((c) => i.currentRoute.value.name == c.name);
@@ -24,7 +24,7 @@ const X = { class: "flex h-10 t-app__top-nav" }, Y = { class: "flex h-10 flex-1
24
24
  path: i.currentRoute.value.path,
25
25
  icon: e.icon
26
26
  } : t[a.value] = {
27
- label: J(e == null ? void 0 : e.name) || "",
27
+ label: G(e == null ? void 0 : e.name) || "",
28
28
  path: i.currentRoute.value.path,
29
29
  icon: e.icon
30
30
  });
@@ -81,7 +81,7 @@ const X = { class: "flex h-10 t-app__top-nav" }, Y = { class: "flex h-10 flex-1
81
81
  o[3] || (o[3] = f("div", { class: "t-app__top-nav-draggable" }, null, -1)),
82
82
  f("div", Y, [
83
83
  t.length === 1 ? (m(), b("div", Z, [
84
- n(l(W), { triggerClass: "flex custom-scroll gap-1.5 h-full items-center justify-center w-full whitespace-nowrap" }, {
84
+ n(l(H), { triggerClass: "flex custom-scroll gap-1.5 h-full items-center justify-center w-full whitespace-nowrap" }, {
85
85
  trigger: u(() => [
86
86
  n(l(d), {
87
87
  icon: t[0].icon,
@@ -91,7 +91,7 @@ const X = { class: "flex h-10 t-app__top-nav" }, Y = { class: "flex h-10 flex-1
91
91
  f("span", null, O(t[0].label), 1)
92
92
  ]),
93
93
  content: u(() => [
94
- n(l(G), {
94
+ n(l(W), {
95
95
  class: "scalar-client",
96
96
  static: ""
97
97
  }, {
@@ -1,5 +1,3 @@
1
- export * from './useDarkModeState.js';
2
- export * from './useClipboard.js';
3
1
  export * from './useKeyMap.js';
4
2
  export * from './useFileDialog.js';
5
3
  export * from './useSidebar.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA"}
@@ -1,14 +1,10 @@
1
- import { useDarkModeState as r } from "./useDarkModeState.js";
2
- import { useClipboard as p } from "./useClipboard.js";
3
- import { keyMap as f } from "./useKeyMap.js";
4
- import { useFileDialog as u } from "./useFileDialog.js";
5
- import { useSidebar as s } from "./useSidebar.js";
6
- import { useLayout as d } from "./useLayout.js";
1
+ import { keyMap as r } from "./useKeyMap.js";
2
+ import { useFileDialog as t } from "./useFileDialog.js";
3
+ import { useSidebar as f } from "./useSidebar.js";
4
+ import { useLayout as u } from "./useLayout.js";
7
5
  export {
8
- f as keyMap,
9
- p as useClipboard,
10
- r as useDarkModeState,
11
- u as useFileDialog,
12
- d as useLayout,
13
- s as useSidebar
6
+ r as keyMap,
7
+ t as useFileDialog,
8
+ u as useLayout,
9
+ f as useSidebar
14
10
  };
@@ -1,24 +1,24 @@
1
- import { defineComponent as v, ref as T, onBeforeMount as _, onMounted as y, onBeforeUnmount as h, computed as k, openBlock as n, createElementBlock as K, Fragment as C, createElementVNode as N, createVNode as a, unref as r, createBlock as m, withCtx as p, KeepAlive as S, resolveDynamicComponent as E, createCommentVNode as H } from "vue";
1
+ import { defineComponent as v, ref as T, onBeforeMount as _, onMounted as y, onBeforeUnmount as h, computed as k, openBlock as n, createElementBlock as K, Fragment as C, createElementVNode as N, createVNode as r, unref as a, createBlock as m, withCtx as p, KeepAlive as E, resolveDynamicComponent as H, createCommentVNode as S } from "vue";
2
2
  import b from "../../components/TopNav/TopNav.vue.js";
3
- import D from "./MainLayout.vue.js";
4
- import { addScalarClassesToHeadless as A } from "@scalar/components";
5
- import { getThemeStyles as B } from "@scalar/themes";
6
- import { ScalarToasts as L } from "@scalar/use-toasts";
7
- import { RouterView as M } from "vue-router";
8
- import { APP_HOTKEYS as P } from "./hotkeys.js";
9
- import { useDarkModeState as V } from "../../hooks/useDarkModeState.js";
3
+ import A from "./MainLayout.vue.js";
4
+ import { addScalarClassesToHeadless as B } from "@scalar/components";
5
+ import { getThemeStyles as D } from "@scalar/themes";
6
+ import { useColorMode as L } from "@scalar/use-hooks/useColorMode";
7
+ import { ScalarToasts as M } from "@scalar/use-toasts";
8
+ import { RouterView as P } from "vue-router";
9
+ import { APP_HOTKEYS as V } from "./hotkeys.js";
10
10
  import { DEFAULT_HOTKEYS as W, handleHotKeyDown as g } from "../../libs/hot-keys.js";
11
11
  import { useWorkspace as x } from "../../store/store.js";
12
12
  const F = ["innerHTML"], Z = /* @__PURE__ */ v({
13
13
  __name: "ApiClientApp",
14
14
  emits: ["newTab"],
15
15
  setup(O) {
16
- const d = { ...W, ...P }, l = T(null), u = (e) => {
16
+ const d = { ...W, ...V }, l = T(null), u = (e) => {
17
17
  l.value = e;
18
18
  };
19
- V();
19
+ L();
20
20
  const o = x(), { events: t } = o;
21
- _(() => A());
21
+ _(() => B());
22
22
  const s = (e) => g(e, t.hotKeys, { hotKeys: d }), c = (e) => {
23
23
  e && e.openCommandPalette && (e.openCommandPalette.preventDefault(), t.commandPalette.emit());
24
24
  };
@@ -28,27 +28,27 @@ const F = ["innerHTML"], Z = /* @__PURE__ */ v({
28
28
  window.removeEventListener("keydown", s), t.hotKeys.off(c);
29
29
  });
30
30
  const f = k(
31
- () => o.activeWorkspace.value && `<style>${B(o.activeWorkspace.value.themeId)}</style>`
31
+ () => o.activeWorkspace.value && `<style>${D(o.activeWorkspace.value.themeId)}</style>`
32
32
  );
33
33
  return (e, U) => {
34
34
  var i;
35
35
  return n(), K(C, null, [
36
36
  N("div", { innerHTML: f.value }, null, 8, F),
37
- a(b, { openNewTab: l.value }, null, 8, ["openNewTab"]),
38
- (i = r(o).activeWorkspace.value) != null && i.uid ? (n(), m(D, { key: 0 }, {
37
+ r(b, { openNewTab: l.value }, null, 8, ["openNewTab"]),
38
+ (i = a(o).activeWorkspace.value) != null && i.uid ? (n(), m(A, { key: 0 }, {
39
39
  default: p(() => [
40
- a(r(M), { onNewTab: u }, {
40
+ r(a(P), { onNewTab: u }, {
41
41
  default: p(({ Component: w }) => [
42
- (n(), m(S, null, [
43
- (n(), m(E(w)))
42
+ (n(), m(E, null, [
43
+ (n(), m(H(w)))
44
44
  ], 1024))
45
45
  ]),
46
46
  _: 1
47
47
  })
48
48
  ]),
49
49
  _: 1
50
- })) : H("", !0),
51
- a(r(L))
50
+ })) : S("", !0),
51
+ r(a(M))
52
52
  ], 64);
53
53
  };
54
54
  }