@scalar/api-client 2.3.17 → 2.3.18

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 (31) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/components/CommandPalette/CommandPaletteImport.vue.js +9 -9
  3. package/dist/components/SideNav/SideHelp.vue.js +1 -1
  4. package/dist/hooks/useClientConfig.d.ts +69 -0
  5. package/dist/hooks/useClientConfig.d.ts.map +1 -0
  6. package/dist/hooks/useClientConfig.js +7 -0
  7. package/dist/layouts/App/create-api-client-app.d.ts +34 -34
  8. package/dist/layouts/Modal/create-api-client-modal.d.ts +68 -68
  9. package/dist/layouts/Web/create-api-client-web.d.ts +34 -34
  10. package/dist/libs/create-client.d.ts +34 -34
  11. package/dist/libs/create-client.d.ts.map +1 -1
  12. package/dist/libs/create-client.js +63 -62
  13. package/dist/libs/hot-keys.d.ts +1 -1
  14. package/dist/store/collections.d.ts +4 -4
  15. package/dist/store/request-example.d.ts +2 -2
  16. package/dist/store/requests.d.ts +4 -4
  17. package/dist/store/security-schemes.d.ts +10 -10
  18. package/dist/store/servers.d.ts +4 -4
  19. package/dist/store/store.d.ts +34 -34
  20. package/dist/store/tags.d.ts +2 -2
  21. package/dist/store/workspace.d.ts +4 -4
  22. package/dist/style.css +1 -1
  23. package/dist/views/Request/RequestRoot.vue.d.ts.map +1 -1
  24. package/dist/views/Request/RequestRoot.vue.js +1 -1
  25. package/dist/views/Request/RequestRoot.vue2.js +67 -66
  26. package/dist/views/Request/RequestSection/RequestBody.vue.js +2 -2
  27. package/dist/views/Request/RequestSection/RequestBody.vue2.js +1 -1
  28. package/dist/views/Request/RequestSection/RequestTable.vue.js +2 -2
  29. package/dist/views/Request/RequestSection/RequestTable.vue2.js +5 -5
  30. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  31. package/package.json +10 -10
@@ -1 +1 @@
1
- {"version":3,"file":"RequestRoot.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestRoot.vue"],"names":[],"mappings":";;cA2P8C,MAAM;aAAO,MAAM;;;;cAAnB,MAAM;aAAO,MAAM;;;AA8SjE,wBAMG"}
1
+ {"version":3,"file":"RequestRoot.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestRoot.vue"],"names":[],"mappings":";;cAkQ8C,MAAM;aAAO,MAAM;;;;cAAnB,MAAM;aAAO,MAAM;;;AAmTjE,wBAMG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./RequestRoot.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-cc62b119"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-985ee6ae"]]);
5
5
  export {
6
6
  m as default
7
7
  };
@@ -1,76 +1,77 @@
1
- import { defineComponent as M, ref as c, computed as $, onMounted as H, onBeforeUnmount as Q, watch as F, openBlock as f, createElementBlock as G, normalizeClass as V, unref as r, createBlock as C, isRef as K, createCommentVNode as B, createElementVNode as T, createVNode as X } from "vue";
2
- import { isDefined as Y } from "@scalar/oas-utils/helpers";
3
- import { safeJSON as Z } from "@scalar/object-utils/parse";
4
- import { useToasts as ee } from "@scalar/use-toasts";
5
- import { RouterView as te } from "vue-router";
6
- import oe from "../../components/Sidebar/SidebarToggle.vue.js";
7
- import { useSidebar as re } from "../../hooks/useSidebar.js";
8
- import { validateParameters as se } from "../../libs/validate-parameters.js";
9
- import { useActiveEntities as ae } from "../../store/active-entities.js";
10
- import { useOpenApiWatcher as le } from "./hooks/useOpenApiWatcher.js";
11
- import ne from "./RequestSidebar.vue.js";
12
- import { createRequestOperation as ue } from "../../libs/send-request/create-request-operation.js";
13
- import { ERRORS as ce } from "../../libs/errors.js";
14
- import { useWorkspace as ie } from "../../store/store.js";
15
- import { useLayout as me } from "../../hooks/useLayout.js";
16
- const fe = { class: "flex h-full" }, de = { class: "flex h-full flex-1 flex-col" }, Ve = /* @__PURE__ */ M({
1
+ import { defineComponent as Q, ref as m, computed as F, onMounted as G, onBeforeUnmount as K, watch as X, openBlock as d, createElementBlock as Y, normalizeClass as g, unref as r, createBlock as B, isRef as Z, createCommentVNode as T, createElementVNode as A, createVNode as ee } from "vue";
2
+ import { isDefined as te } from "@scalar/oas-utils/helpers";
3
+ import { safeJSON as oe } from "@scalar/object-utils/parse";
4
+ import { useToasts as re } from "@scalar/use-toasts";
5
+ import { RouterView as se } from "vue-router";
6
+ import ae from "../../components/Sidebar/SidebarToggle.vue.js";
7
+ import { useClientConfig as le } from "../../hooks/useClientConfig.js";
8
+ import { useSidebar as ne } from "../../hooks/useSidebar.js";
9
+ import { validateParameters as ue } from "../../libs/validate-parameters.js";
10
+ import { useActiveEntities as ie } from "../../store/active-entities.js";
11
+ import { useOpenApiWatcher as ce } from "./hooks/useOpenApiWatcher.js";
12
+ import me from "./RequestSidebar.vue.js";
13
+ import { createRequestOperation as fe } from "../../libs/send-request/create-request-operation.js";
14
+ import { ERRORS as de } from "../../libs/errors.js";
15
+ import { useWorkspace as pe } from "../../store/store.js";
16
+ import { useLayout as ve } from "../../hooks/useLayout.js";
17
+ const Se = { class: "flex h-full" }, Re = { class: "flex h-full flex-1 flex-col" }, Ae = /* @__PURE__ */ Q({
17
18
  __name: "RequestRoot",
18
19
  emits: ["newTab"],
19
- setup(pe) {
20
- const A = ie(), { toast: d } = ee(), { layout: p } = me(), {
20
+ setup(ye) {
21
+ const D = pe(), { toast: p } = re(), { layout: v } = ve(), P = le(), { isSidebarOpen: s } = ne(), {
21
22
  activeCollection: l,
22
23
  activeExample: n,
23
- activeEnvironment: v,
24
- activeRequest: i,
25
- activeWorkspace: S,
26
- activeServer: g
27
- } = ae(), { cookies: D, requestHistory: P, showSidebar: R, securitySchemes: z, events: u } = A, { isSidebarOpen: s } = re(), I = c(), y = c(), m = c(/* @__PURE__ */ new Set()), q = c(null), x = $(
24
+ activeEnvironment: S,
25
+ activeRequest: u,
26
+ activeWorkspace: R,
27
+ activeServer: z
28
+ } = ie(), { cookies: I, requestHistory: J, showSidebar: y, securitySchemes: W, events: i } = D, j = m(), q = m(), f = m(/* @__PURE__ */ new Set()), x = m(null), b = F(
28
29
  () => {
29
30
  var e, t, o;
30
- return ((e = l.value) != null && e.useCollectionSecurity ? (t = l.value) == null ? void 0 : t.selectedSecuritySchemeUids : (o = i.value) == null ? void 0 : o.selectedSecuritySchemeUids) ?? [];
31
+ return ((e = l.value) != null && e.useCollectionSecurity ? (t = l.value) == null ? void 0 : t.selectedSecuritySchemeUids : (o = u.value) == null ? void 0 : o.selectedSecuritySchemeUids) ?? [];
31
32
  }
32
- ), b = async () => {
33
- var U, _, w, O;
34
- if (!i.value || !n.value || !l.value)
33
+ ), h = async () => {
34
+ var U, _, w, O, c, V;
35
+ if (!u.value || !n.value || !l.value)
35
36
  return;
36
- m.value = se(n.value);
37
- const e = typeof v.value == "object" ? v.value.value : "{}", t = Z.parse(e);
37
+ f.value = ue(n.value);
38
+ const e = typeof S.value == "object" ? S.value.value : "{}", t = oe.parse(e);
38
39
  t.error && console.error("INVALID ENVIRONMENT!");
39
- const o = t.error || typeof t.data != "object" ? {} : t.data ?? {}, a = ((U = S.value) == null ? void 0 : U.cookies.map((L) => D[L]).filter(Y)) ?? [], j = ((w = (_ = l.value) == null ? void 0 : _.info) == null ? void 0 : w.title) === "Drafts" ? void 0 : g.value, [h, k] = ue({
40
- request: i.value,
40
+ const o = t.error || typeof t.data != "object" ? {} : t.data ?? {}, a = ((U = R.value) == null ? void 0 : U.cookies.map((H) => I[H]).filter(te)) ?? [], $ = ((w = (_ = l.value) == null ? void 0 : _.info) == null ? void 0 : w.title) === "Drafts" ? void 0 : z.value, [k, E] = fe({
41
+ request: u.value,
41
42
  example: n.value,
42
- selectedSecuritySchemeUids: x.value,
43
- proxyUrl: ((O = S.value) == null ? void 0 : O.proxyUrl) ?? "",
43
+ selectedSecuritySchemeUids: b.value,
44
+ proxyUrl: ((O = R.value) == null ? void 0 : O.proxyUrl) ?? "",
44
45
  environment: o,
45
46
  globalCookies: a,
46
- status: u.requestStatus,
47
- securitySchemes: z,
48
- server: j
47
+ status: i.requestStatus,
48
+ securitySchemes: W,
49
+ server: $
49
50
  });
50
- if (h) {
51
- d(h.message, "error");
51
+ if ((V = (c = P.value) == null ? void 0 : c.onRequestSent) == null || V.call(c, u.value.path ?? ""), k) {
52
+ p(k.message, "error");
52
53
  return;
53
54
  }
54
- y.value = k.controller;
55
- const [E, N] = await k.sendRequest();
56
- q.value = N, E ? d(E.message, "error") : P.push(W(N));
57
- }, J = async () => {
55
+ q.value = E.controller;
56
+ const [C, N] = await E.sendRequest();
57
+ x.value = N, C ? p(C.message, "error") : J.push(M(N));
58
+ }, L = async () => {
58
59
  var e;
59
- return (e = y.value) == null ? void 0 : e.abort(ce.REQUEST_ABORTED);
60
+ return (e = q.value) == null ? void 0 : e.abort(de.REQUEST_ABORTED);
60
61
  };
61
- H(() => {
62
- u.executeRequest.on(b), u.cancelRequest.on(J);
63
- }), le(), Q(() => u.executeRequest.off(b)), F(
62
+ G(() => {
63
+ i.executeRequest.on(h), i.cancelRequest.on(L);
64
+ }), ce(), K(() => i.executeRequest.off(h)), X(
64
65
  () => {
65
66
  var e;
66
67
  return (e = n.value) == null ? void 0 : e.parameters;
67
68
  },
68
69
  () => {
69
- m.value.clear();
70
+ f.value.clear();
70
71
  },
71
72
  { deep: !0 }
72
73
  );
73
- const W = (e) => {
74
+ const M = (e) => {
74
75
  var t;
75
76
  try {
76
77
  return structuredClone(e);
@@ -79,33 +80,33 @@ const fe = { class: "flex h-full" }, de = { class: "flex h-full flex-1 flex-col"
79
80
  return (t = e.response) != null && t.data && (e.response.data instanceof Blob || e.response.data instanceof ArrayBuffer ? a.response.data = e.response.data : a.response.data = JSON.parse(JSON.stringify(e.response.data))), a;
80
81
  }
81
82
  };
82
- return (e, t) => (f(), G("div", {
83
+ return (e, t) => (d(), Y("div", {
83
84
  ref_key: "element",
84
- ref: I,
85
- class: V(["bg-b-1 relative z-0 flex h-full flex-1 flex-col overflow-hidden pt-0", {
86
- "!mb-0 !mr-0 !border-0": r(p) === "modal"
85
+ ref: j,
86
+ class: g(["bg-b-1 relative z-0 flex h-full flex-1 flex-col overflow-hidden pt-0", {
87
+ "!mb-0 !mr-0 !border-0": r(v) === "modal"
87
88
  }])
88
89
  }, [
89
- r(R) ? (f(), C(oe, {
90
+ r(y) ? (d(), B(ae, {
90
91
  key: 0,
91
92
  modelValue: r(s),
92
- "onUpdate:modelValue": t[0] || (t[0] = (o) => K(s) ? s.value = o : null),
93
- class: V(["absolute left-3 top-2 z-50", [
93
+ "onUpdate:modelValue": t[0] || (t[0] = (o) => Z(s) ? s.value = o : null),
94
+ class: g(["absolute left-3 top-2 z-50", [
94
95
  { hidden: r(s) },
95
96
  { "xl:!flex": !r(s) },
96
- { "!flex": r(p) === "modal" }
97
+ { "!flex": r(v) === "modal" }
97
98
  ]])
98
- }, null, 8, ["modelValue", "class"])) : B("", !0),
99
- T("div", fe, [
100
- r(R) ? (f(), C(ne, {
99
+ }, null, 8, ["modelValue", "class"])) : T("", !0),
100
+ A("div", Se, [
101
+ r(y) ? (d(), B(me, {
101
102
  key: 0,
102
103
  onNewTab: t[1] || (t[1] = (o) => e.$emit("newTab", o))
103
- })) : B("", !0),
104
- T("div", de, [
105
- X(r(te), {
106
- invalidParams: m.value,
107
- selectedSecuritySchemeUids: x.value,
108
- requestResult: q.value
104
+ })) : T("", !0),
105
+ A("div", Re, [
106
+ ee(r(se), {
107
+ invalidParams: f.value,
108
+ selectedSecuritySchemeUids: b.value,
109
+ requestResult: x.value
109
110
  }, null, 8, ["invalidParams", "selectedSecuritySchemeUids", "requestResult"])
110
111
  ])
111
112
  ])
@@ -113,5 +114,5 @@ const fe = { class: "flex h-full" }, de = { class: "flex h-full flex-1 flex-col"
113
114
  }
114
115
  });
115
116
  export {
116
- Ve as default
117
+ Ae as default
117
118
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./RequestBody.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-e20988de"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-435b665f"]]);
5
5
  export {
6
- p as default
6
+ m as default
7
7
  };
@@ -371,7 +371,7 @@ const me = {
371
371
  a[4] || (a[4] = k("span", null, "Upload File", -1)),
372
372
  c(v(C), {
373
373
  class: "ml-1",
374
- icon: "UploadSimple",
374
+ icon: "Upload",
375
375
  size: "xs",
376
376
  thickness: "2.5"
377
377
  })
@@ -1,7 +1,7 @@
1
1
  import o from "./RequestTable.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-5b22d4e0"]]);
4
+ const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-682f7941"]]);
5
5
  export {
6
- m as default
6
+ f as default
7
7
  };
@@ -30,9 +30,9 @@ const j = { class: "text-c-2 filemask flex w-full max-w-[100%] items-end justify
30
30
  setup(C, { emit: F }) {
31
31
  const b = C, s = F, U = ["", "", "36px"], y = (e, a, l) => {
32
32
  s("updateRow", e, a, l);
33
- }, S = (e) => {
33
+ }, $ = (e) => {
34
34
  s("uploadFile", e);
35
- }, $ = (e) => Array.isArray(e.default) && e.default.length === 1 ? e.default[0] : e.default;
35
+ }, S = (e) => Array.isArray(e.default) && e.default.length === 1 ? e.default[0] : e.default;
36
36
  return (e, a) => (r(), p(E, {
37
37
  class: "group/table flex-1",
38
38
  columns: U
@@ -157,7 +157,7 @@ const j = { class: "text-c-2 filemask flex w-full max-w-[100%] items-end justify
157
157
  icon: n(() => [
158
158
  u(R)(l) ? (r(), p(P, {
159
159
  key: 0,
160
- item: { ...l, default: $(l) }
160
+ item: { ...l, default: S(l) }
161
161
  }, null, 8, ["item"])) : g("", !0)
162
162
  ]),
163
163
  _: 2
@@ -186,13 +186,13 @@ const j = { class: "text-c-2 filemask flex w-full max-w-[100%] items-end justify
186
186
  class: "bg-b-2 hover:bg-b-3 text-c-2 h-fit border-0 py-px shadow-none",
187
187
  size: "sm",
188
188
  variant: "outlined",
189
- onClick: (T) => S(d)
189
+ onClick: (T) => $(d)
190
190
  }, {
191
191
  default: n(() => [
192
192
  a[6] || (a[6] = i("span", null, "Upload File", -1)),
193
193
  t(u(B), {
194
194
  class: "ml-1",
195
- icon: "UploadSimple",
195
+ icon: "Upload",
196
196
  size: "xs",
197
197
  thickness: "2.5"
198
198
  })
@@ -34,7 +34,7 @@ const W = { class: "col-1 flex-center relative gap-6 p-2 capitalize" }, $ = {
34
34
  }));
35
35
  }, k = (o) => {
36
36
  o != null && o.createNew && x.name === "request" && f();
37
- }, w = "2.3.17";
37
+ }, w = "2.3.18";
38
38
  return R(() => a.hotKeys.on(k)), v(() => a.hotKeys.off(k)), (o, e) => (l(), u("div", W, [
39
39
  s("div", {
40
40
  class: y(["flex h-[calc(100%_-_50px)] flex-col items-center justify-center", {
package/package.json CHANGED
@@ -18,7 +18,7 @@
18
18
  "rest",
19
19
  "testing"
20
20
  ],
21
- "version": "2.3.17",
21
+ "version": "2.3.18",
22
22
  "engines": {
23
23
  "node": ">=18"
24
24
  },
@@ -189,21 +189,21 @@
189
189
  "whatwg-mimetype": "^4.0.0",
190
190
  "yaml": "^2.4.5",
191
191
  "zod": "^3.23.8",
192
- "@scalar/components": "0.13.46",
193
- "@scalar/import": "0.3.12",
192
+ "@scalar/components": "0.13.47",
194
193
  "@scalar/icons": "0.1.3",
195
194
  "@scalar/draggable": "0.1.11",
196
- "@scalar/oas-utils": "0.2.129",
197
- "@scalar/openapi-parser": "0.10.14",
195
+ "@scalar/import": "0.3.13",
198
196
  "@scalar/object-utils": "1.1.13",
197
+ "@scalar/oas-utils": "0.2.130",
199
198
  "@scalar/openapi-types": "0.2.0",
199
+ "@scalar/postman-to-openapi": "0.2.3",
200
+ "@scalar/themes": "0.9.86",
200
201
  "@scalar/snippetz": "0.2.19",
201
- "@scalar/postman-to-openapi": "0.2.2",
202
- "@scalar/themes": "0.9.85",
203
- "@scalar/types": "0.1.6",
202
+ "@scalar/types": "0.1.7",
203
+ "@scalar/openapi-parser": "0.10.14",
204
+ "@scalar/use-codemirror": "0.11.92",
205
+ "@scalar/use-hooks": "0.1.40",
204
206
  "@scalar/use-toasts": "0.7.9",
205
- "@scalar/use-codemirror": "0.11.91",
206
- "@scalar/use-hooks": "0.1.39",
207
207
  "@scalar/use-tooltip": "1.0.6"
208
208
  },
209
209
  "devDependencies": {