@scalar/api-client 2.2.6 → 2.2.7

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 (44) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/components/AddressBar/AddressBar.vue.js +2 -2
  3. package/dist/components/AddressBar/AddressBar.vue2.js +1 -1
  4. package/dist/components/AddressBar/AddressBarServer.vue.js +18 -18
  5. package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +20 -20
  6. package/dist/components/HttpMethod/HttpMethod.vue.js +2 -2
  7. package/dist/components/HttpMethod/HttpMethod.vue2.js +12 -12
  8. package/dist/components/HttpMethod/index.d.ts +0 -1
  9. package/dist/components/HttpMethod/index.d.ts.map +1 -1
  10. package/dist/components/HttpMethod/index.js +2 -4
  11. package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts.map +1 -1
  12. package/dist/components/ImportCollection/ImportCollectionModal.vue.js +119 -102
  13. package/dist/components/OpenApiClientButton.vue.d.ts +1 -0
  14. package/dist/components/OpenApiClientButton.vue.d.ts.map +1 -1
  15. package/dist/components/OpenApiClientButton.vue.js +2 -2
  16. package/dist/components/OpenApiClientButton.vue2.js +23 -17
  17. package/dist/components/Search/useSearch.d.ts.map +1 -1
  18. package/dist/components/Search/useSearch.js +45 -41
  19. package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -1
  20. package/dist/layouts/Modal/ApiClientModal.vue.js +2 -2
  21. package/dist/layouts/Modal/ApiClientModal.vue2.js +28 -23
  22. package/dist/libs/create-client.d.ts +1 -0
  23. package/dist/libs/create-client.d.ts.map +1 -1
  24. package/dist/libs/create-client.js +31 -30
  25. package/dist/style.css +1 -1
  26. package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
  27. package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +65 -62
  28. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
  29. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +1 -1
  30. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +82 -84
  31. package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
  32. package/dist/views/Request/RequestSection/RequestBody.vue.js +2 -2
  33. package/dist/views/Request/RequestSection/RequestBody.vue2.js +27 -24
  34. package/dist/views/Request/RequestSubpageHeader.vue.d.ts.map +1 -1
  35. package/dist/views/Request/RequestSubpageHeader.vue.js +3 -3
  36. package/dist/views/Request/RequestSubpageHeader.vue2.js +34 -32
  37. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  38. package/dist/views/Request/components/WorkspaceDropdown.vue.js +1 -1
  39. package/dist/views/Request/libs/live-sync.d.ts.map +1 -1
  40. package/dist/views/Request/libs/live-sync.js +77 -78
  41. package/package.json +10 -10
  42. package/dist/components/HttpMethod/helpers.d.ts +0 -4
  43. package/dist/components/HttpMethod/helpers.d.ts.map +0 -1
  44. package/dist/components/HttpMethod/helpers.js +0 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @scalar/api-client
2
2
 
3
+ ## 2.2.7
4
+
5
+ ### Patch Changes
6
+
7
+ - a90d827: feat(components): create ScalarTeleport component
8
+ - d0adebf: fix: updates tailwind config content
9
+ - c2be791: fix: watches text input to fuse search
10
+ - 3b4a788: fix: updates default row for request body
11
+ - f4440f5: feat: added logo functionality to the importer
12
+ - 4c5be96: feat: adds isHttpMethod to helpers
13
+ - Updated dependencies [a90d827]
14
+ - Updated dependencies [3b4a788]
15
+ - Updated dependencies [4c5be96]
16
+ - Updated dependencies [4c5be96]
17
+ - @scalar/components@0.13.2
18
+ - @scalar/oas-utils@0.2.85
19
+ - @scalar/use-codemirror@0.11.46
20
+ - @scalar/import@0.2.3
21
+
3
22
  ## 2.2.6
4
23
 
5
24
  ### Patch Changes
@@ -1,7 +1,7 @@
1
1
  import o from "./AddressBar.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../_virtual/_plugin-vue_export-helper.js";
4
- const d = /* @__PURE__ */ r(o, [["__scopeId", "data-v-4d3290fc"]]);
4
+ const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-455b0236"]]);
5
5
  export {
6
- d as default
6
+ m as default
7
7
  };
@@ -95,7 +95,7 @@ const te = {
95
95
  isEditable: !a(c),
96
96
  isSquare: "",
97
97
  method: a(l).method,
98
- teleport: ".scalar-client",
98
+ teleport: "",
99
99
  onChange: V
100
100
  }, null, 8, ["isEditable", "method"])
101
101
  ]),
@@ -1,4 +1,4 @@
1
- import { defineComponent as V, computed as u, watch as E, openBlock as l, createBlock as S, unref as n, withCtx as w, createElementBlock as o, createCommentVNode as v, Fragment as m, renderList as g, createVNode as p, createElementVNode as a, createTextVNode as O, toDisplayString as b } from "vue";
1
+ import { defineComponent as V, computed as c, watch as E, openBlock as l, createBlock as S, unref as o, withCtx as w, createElementBlock as n, createCommentVNode as v, Fragment as m, renderList as g, createVNode as p, createElementVNode as a, createTextVNode as O, toDisplayString as b } from "vue";
2
2
  import { useActiveEntities as R } from "../../store/active-entities.js";
3
3
  import { ScalarDropdown as W, ScalarDropdownDivider as A, ScalarDropdownItem as I, ScalarIcon as L } from "@scalar/components";
4
4
  import C from "./AddressBarServerItem.vue.js";
@@ -15,7 +15,7 @@ const j = {
15
15
  }, K = /* @__PURE__ */ V({
16
16
  __name: "AddressBarServer",
17
17
  setup(P) {
18
- const { activeRequest: y, activeCollection: k, activeServer: x } = R(), { isReadOnly: D, servers: _, collectionMutators: N, events: B } = T(), c = u(
18
+ const { activeRequest: y, activeCollection: k, activeServer: x } = R(), { isReadOnly: D, servers: _, collectionMutators: N, events: B } = T(), d = c(
19
19
  () => {
20
20
  var t, e;
21
21
  return (e = (t = y.value) == null ? void 0 : t.servers) == null ? void 0 : e.map((r) => {
@@ -26,7 +26,7 @@ const j = {
26
26
  };
27
27
  });
28
28
  }
29
- ), d = u(
29
+ ), u = c(
30
30
  () => {
31
31
  var t, e;
32
32
  return (e = (t = k.value) == null ? void 0 : t.servers) == null ? void 0 : e.map((r) => {
@@ -37,10 +37,10 @@ const j = {
37
37
  };
38
38
  });
39
39
  }
40
- ), h = u(
40
+ ), h = c(
41
41
  () => {
42
42
  var t, e;
43
- return ((t = c.value) == null ? void 0 : t.length) && ((e = d.value) == null ? void 0 : e.length);
43
+ return ((t = d.value) == null ? void 0 : t.length) && ((e = u.value) == null ? void 0 : e.length);
44
44
  }
45
45
  );
46
46
  E([k, y], ([t, e]) => {
@@ -52,43 +52,43 @@ const j = {
52
52
  });
53
53
  const U = () => B.commandPalette.emit({
54
54
  commandName: "Add Server"
55
- }), f = u(() => {
55
+ }), f = c(() => {
56
56
  var t, e, r;
57
57
  return (e = (t = x.value) == null ? void 0 : t.url) != null && e.endsWith("/") ? x.value.url.slice(0, -1) : ((r = x.value) == null ? void 0 : r.url) || "";
58
58
  });
59
59
  return (t, e) => {
60
60
  var r, s;
61
- return c.value && ((r = c.value) == null ? void 0 : r.length) > 1 || d.value && ((s = d.value) == null ? void 0 : s.length) > 1 ? (l(), S(n(W), {
61
+ return d.value && ((r = d.value) == null ? void 0 : r.length) > 1 || u.value && ((s = u.value) == null ? void 0 : s.length) > 1 ? (l(), S(o(W), {
62
62
  key: 0,
63
63
  class: "w-max",
64
- teleport: ".scalar-client"
64
+ teleport: ""
65
65
  }, {
66
66
  items: w(() => [
67
- h.value ? (l(), o("div", z, " Request Servers ")) : v("", !0),
68
- (l(!0), o(m, null, g(c.value, (i) => (l(), S(C, {
67
+ h.value ? (l(), n("div", z, " Request Servers ")) : v("", !0),
68
+ (l(!0), n(m, null, g(d.value, (i) => (l(), S(C, {
69
69
  key: i.id,
70
70
  serverOption: i,
71
71
  type: "request"
72
72
  }, null, 8, ["serverOption"]))), 128)),
73
- h.value ? (l(), o(m, { key: 1 }, [
74
- p(n(A)),
73
+ h.value ? (l(), n(m, { key: 1 }, [
74
+ p(o(A)),
75
75
  e[1] || (e[1] = a("div", { class: "text-xxs text-c-2 ml-8" }, "Collection Servers", -1))
76
76
  ], 64)) : v("", !0),
77
- (l(!0), o(m, null, g(d.value, (i) => (l(), S(C, {
77
+ (l(!0), n(m, null, g(u.value, (i) => (l(), S(C, {
78
78
  key: i.id,
79
79
  serverOption: i,
80
80
  type: "collection"
81
81
  }, null, 8, ["serverOption"]))), 128)),
82
- n(D) ? v("", !0) : (l(), o(m, { key: 2 }, [
83
- p(n(A)),
84
- p(n(I), null, {
82
+ o(D) ? v("", !0) : (l(), n(m, { key: 2 }, [
83
+ p(o(A)),
84
+ p(o(I), null, {
85
85
  default: w(() => [
86
86
  a("div", {
87
87
  class: "font-code text-xxs flex items-center gap-1.5",
88
88
  onClick: U
89
89
  }, [
90
90
  a("div", F, [
91
- p(n(L), {
91
+ p(o(L), {
92
92
  icon: "Add",
93
93
  size: "sm"
94
94
  })
@@ -107,7 +107,7 @@ const j = {
107
107
  ])
108
108
  ]),
109
109
  _: 1
110
- })) : f.value ? (l(), o("div", M, b(f.value), 1)) : v("", !0);
110
+ })) : f.value ? (l(), n("div", M, b(f.value), 1)) : v("", !0);
111
111
  };
112
112
  }
113
113
  });
@@ -1,26 +1,26 @@
1
- import { defineComponent as P, ref as c, computed as x, openBlock as h, createBlock as C, withCtx as u, createElementVNode as f, createVNode as i, unref as n, normalizeClass as q, toDisplayString as V, createCommentVNode as W, createTextVNode as j } from "vue";
2
- import H from "../HttpMethod/HttpMethod.vue.js";
3
- import { useActiveEntities as I } from "../../store/active-entities.js";
1
+ import { defineComponent as W, ref as c, computed as x, openBlock as h, createBlock as C, withCtx as u, createElementVNode as f, createVNode as i, unref as n, normalizeClass as q, toDisplayString as V, createCommentVNode as j, createTextVNode as H } from "vue";
2
+ import I from "../HttpMethod/HttpMethod.vue.js";
3
+ import { useActiveEntities as P } from "../../store/active-entities.js";
4
4
  import { ScalarListbox as w, ScalarButton as D, ScalarIcon as k } from "@scalar/components";
5
- import { useToasts as $ } from "@scalar/use-toasts";
6
- import { useRouter as A } from "vue-router";
7
- import L from "./CommandActionForm.vue.js";
8
- import O from "./CommandActionInput.vue.js";
9
- import { isHTTPMethod as F } from "../HttpMethod/helpers.js";
5
+ import { isHttpMethod as $ } from "@scalar/oas-utils/helpers";
6
+ import { useToasts as A } from "@scalar/use-toasts";
7
+ import { useRouter as L } from "vue-router";
8
+ import O from "./CommandActionForm.vue.js";
9
+ import F from "./CommandActionInput.vue.js";
10
10
  import { useWorkspace as G } from "../../store/store.js";
11
- const J = { class: "flex" }, se = /* @__PURE__ */ P({
11
+ const J = { class: "flex" }, se = /* @__PURE__ */ W({
12
12
  __name: "CommandPaletteRequest",
13
13
  props: {
14
14
  metaData: {}
15
15
  },
16
16
  emits: ["close", "back"],
17
17
  setup(S, { emit: _ }) {
18
- const r = S, b = _, { push: M } = A(), { toast: N } = $(), {
18
+ const r = S, b = _, { push: M } = L(), { toast: N } = A(), {
19
19
  activeCollection: R,
20
20
  activeWorkspace: U,
21
21
  activeWorkspaceCollections: g,
22
- activeRequest: T
23
- } = I(), { requestMutators: y, tags: z } = G(), o = c(""), m = c("get"), p = x(
22
+ activeRequest: y
23
+ } = P(), { requestMutators: T, tags: z } = G(), o = c(""), m = c("get"), p = x(
24
24
  () => g.value.map((t) => {
25
25
  var e;
26
26
  return {
@@ -61,7 +61,7 @@ const J = { class: "flex" }, se = /* @__PURE__ */ P({
61
61
  return t.id === ((e = r.metaData) == null ? void 0 : e.itemUid);
62
62
  }) : d.value.find((t) => {
63
63
  var e, a;
64
- return t.label === ((a = (e = T.value) == null ? void 0 : e.tags) == null ? void 0 : a[0]);
64
+ return t.label === ((a = (e = y.value) == null ? void 0 : e.tags) == null ? void 0 : a[0]);
65
65
  })
66
66
  ), B = (t) => m.value = t, E = () => {
67
67
  var e;
@@ -69,9 +69,9 @@ const J = { class: "flex" }, se = /* @__PURE__ */ P({
69
69
  N("Please enter a name before creating a request.", "error");
70
70
  return;
71
71
  }
72
- if (!((e = l.value) != null && e.id) || !F(m.value))
72
+ if (!((e = l.value) != null && e.id) || !$(m.value))
73
73
  return;
74
- const t = y.add(
74
+ const t = T.add(
75
75
  {
76
76
  path: "",
77
77
  method: m.value,
@@ -90,13 +90,13 @@ const J = { class: "flex" }, se = /* @__PURE__ */ P({
90
90
  }
91
91
  }), b("close");
92
92
  };
93
- return (t, e) => (h(), C(L, {
93
+ return (t, e) => (h(), C(O, {
94
94
  disabled: !o.value.trim(),
95
95
  onSubmit: E
96
96
  }, {
97
97
  options: u(() => [
98
98
  f("div", J, [
99
- i(H, {
99
+ i(I, {
100
100
  isEditable: !0,
101
101
  isSquare: "",
102
102
  method: m.value,
@@ -152,14 +152,14 @@ const J = { class: "flex" }, se = /* @__PURE__ */ P({
152
152
  })
153
153
  ]),
154
154
  _: 1
155
- }, 8, ["modelValue", "options"])) : W("", !0)
155
+ }, 8, ["modelValue", "options"])) : j("", !0)
156
156
  ])
157
157
  ]),
158
158
  submit: u(() => e[4] || (e[4] = [
159
- j("Create Request")
159
+ H("Create Request")
160
160
  ])),
161
161
  default: u(() => [
162
- i(O, {
162
+ i(F, {
163
163
  modelValue: o.value,
164
164
  "onUpdate:modelValue": e[0] || (e[0] = (a) => o.value = a),
165
165
  label: "Request Name",
@@ -1,7 +1,7 @@
1
1
  import t from "./HttpMethod.vue2.js";
2
2
  /* empty css */
3
3
  import o from "../../_virtual/_plugin-vue_export-helper.js";
4
- const f = /* @__PURE__ */ o(t, [["__scopeId", "data-v-fcbb6eeb"]]);
4
+ const _ = /* @__PURE__ */ o(t, [["__scopeId", "data-v-46723816"]]);
5
5
  export {
6
- f as default
6
+ _ as default
7
7
  };
@@ -1,5 +1,5 @@
1
- import { defineComponent as g, computed as a, openBlock as c, createBlock as y, unref as t, withCtx as q, createElementVNode as s, normalizeClass as l, toDisplayString as p, createElementBlock as w } from "vue";
2
- import { cva as k, ScalarListbox as x, cx as m } from "@scalar/components";
1
+ import { defineComponent as g, computed as a, openBlock as c, createBlock as y, unref as t, withCtx as q, createElementVNode as l, normalizeClass as s, toDisplayString as p, createElementBlock as k } from "vue";
2
+ import { cva as w, ScalarListbox as x, cx as m } from "@scalar/components";
3
3
  import { getHttpMethodInfo as f, REQUEST_METHODS as B } from "@scalar/oas-utils/helpers";
4
4
  const H = /* @__PURE__ */ g({
5
5
  __name: "HttpMethod",
@@ -12,12 +12,12 @@ const H = /* @__PURE__ */ g({
12
12
  setup(b, { emit: h }) {
13
13
  const r = b, v = h, o = a(() => f(r.method)), n = Object.entries(B).map(([e]) => ({
14
14
  id: e,
15
- label: e.charAt(0) + e.toLowerCase().slice(1),
15
+ label: e.toUpperCase(),
16
16
  color: f(e).color
17
17
  })), i = a({
18
18
  get: () => n.find(({ id: e }) => e === r.method),
19
19
  set: (e) => (e == null ? void 0 : e.id) && v("change", e.id)
20
- }), d = k({
20
+ }), d = w({
21
21
  base: "text-center font-code text-3xs justify-center items-center flex",
22
22
  variants: {
23
23
  isSquare: {
@@ -34,25 +34,25 @@ const H = /* @__PURE__ */ g({
34
34
  key: 0,
35
35
  modelValue: i.value,
36
36
  "onUpdate:modelValue": u[0] || (u[0] = (S) => i.value = S),
37
- class: "mt-1 font-code text-sm uppercase",
37
+ class: "mt-1 font-code text-sm scalar-client",
38
38
  options: t(n)
39
39
  }, {
40
40
  default: q(() => [
41
- s("div", {
42
- class: l(["h-full", { "pointer-events-none": !e.isEditable }])
41
+ l("div", {
42
+ class: s(["h-full", { "pointer-events-none": !e.isEditable }])
43
43
  }, [
44
- s("button", {
45
- class: l(["relative h-full", t(m)(t(d)({ isSquare: e.isSquare, isEditable: e.isEditable }), o.value.color)]),
44
+ l("button", {
45
+ class: s(["relative h-full", t(m)(t(d)({ isSquare: e.isSquare, isEditable: e.isEditable }), o.value.color)]),
46
46
  type: "button"
47
47
  }, [
48
- s("span", null, p(E.value), 1)
48
+ l("span", null, p(E.value), 1)
49
49
  ], 2)
50
50
  ], 2)
51
51
  ]),
52
52
  _: 1
53
- }, 8, ["modelValue", "options"])) : (c(), w("div", {
53
+ }, 8, ["modelValue", "options"])) : (c(), k("div", {
54
54
  key: 1,
55
- class: l(["relative gap-1 whitespace-nowrap", t(m)(t(d)({ isSquare: e.isSquare, isEditable: e.isEditable }), o.value.color)]),
55
+ class: s(["relative gap-1 whitespace-nowrap", t(m)(t(d)({ isSquare: e.isSquare, isEditable: e.isEditable }), o.value.color)]),
56
56
  type: "button"
57
57
  }, p(o.value.short), 3));
58
58
  }
@@ -1,3 +1,2 @@
1
1
  export { default as HttpMethod } from './HttpMethod.vue.js';
2
- export * from './helpers.js';
3
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/HttpMethod/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACxD,cAAc,WAAW,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/HttpMethod/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAA"}
@@ -1,6 +1,4 @@
1
- import { default as e } from "./HttpMethod.vue.js";
2
- import { isHTTPMethod as d } from "./helpers.js";
1
+ import { default as o } from "./HttpMethod.vue.js";
3
2
  export {
4
- e as HttpMethod,
5
- d as isHTTPMethod
3
+ o as HttpMethod
6
4
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ImportCollectionModal.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/ImportCollectionModal.vue"],"names":[],"mappings":"AA2XA,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,SAAS,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,IAAI,CAAA;CAC7C,CAAC;;;;;;AAybF,wBAQG"}
1
+ {"version":3,"file":"ImportCollectionModal.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/ImportCollectionModal.vue"],"names":[],"mappings":"AA4ZA,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,SAAS,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,IAAI,CAAA;CAC7C,CAAC;;;;;;AAodF,wBAQG"}