@scalar/api-client 2.5.5 → 2.5.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 (37) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
  3. package/dist/components/AddressBar/AddressBar.vue.js +2 -2
  4. package/dist/components/AddressBar/AddressBar.vue2.js +60 -57
  5. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +4 -4
  6. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
  7. package/dist/components/Server/ServerSelector.vue.d.ts.map +1 -1
  8. package/dist/components/Server/ServerSelector.vue.js +13 -13
  9. package/dist/layouts/App/create-api-client-app.d.ts +21 -20
  10. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  11. package/dist/layouts/Modal/create-api-client-modal.d.ts +42 -40
  12. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  13. package/dist/layouts/Web/create-api-client-web.d.ts +21 -20
  14. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  15. package/dist/libs/create-client.d.ts +21 -20
  16. package/dist/libs/create-client.d.ts.map +1 -1
  17. package/dist/libs/create-client.js +96 -92
  18. package/dist/libs/find-request.d.ts +2 -2
  19. package/dist/libs/find-request.d.ts.map +1 -1
  20. package/dist/libs/send-request/create-request-operation.d.ts.map +1 -1
  21. package/dist/libs/send-request/create-request-operation.js +26 -26
  22. package/dist/libs/send-request/create-request-operation.test.d.ts +2 -2
  23. package/dist/libs/send-request/create-request-operation.test.d.ts.map +1 -1
  24. package/dist/store/active-entities.d.ts +2 -2
  25. package/dist/store/active-entities.d.ts.map +1 -1
  26. package/dist/store/requests.d.ts +22 -22
  27. package/dist/store/requests.d.ts.map +1 -1
  28. package/dist/store/store.d.ts +20 -20
  29. package/dist/store/store.d.ts.map +1 -1
  30. package/dist/style.css +1 -1
  31. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +1 -1
  32. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +5 -5
  33. package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
  34. package/dist/views/Request/RequestSection/RequestBody.vue.js +2 -2
  35. package/dist/views/Request/RequestSection/RequestBody.vue2.js +43 -37
  36. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  37. package/package.json +16 -16
@@ -1,7 +1,7 @@
1
1
  import t from "./RequestAuthDataTable.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-f5c66331"]]);
4
+ const f = /* @__PURE__ */ o(t, [["__scopeId", "data-v-d0e4c96f"]]);
5
5
  export {
6
6
  f as default
7
7
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as b, ref as m, computed as y, watch as k, createElementBlock as l, openBlock as o, withModifiers as w, createCommentVNode as p, createBlock as g, createVNode as h, normalizeClass as s, Fragment as S, renderList as x, createElementVNode as v, toDisplayString as A, unref as i, withCtx as C } from "vue";
1
+ import { defineComponent as f, ref as m, computed as y, watch as k, createElementBlock as l, openBlock as o, withModifiers as w, createCommentVNode as p, createBlock as g, createVNode as h, normalizeClass as s, Fragment as S, renderList as x, createElementVNode as v, toDisplayString as A, unref as i, withCtx as C } from "vue";
2
2
  import { useModal as V } from "@scalar/components";
3
3
  import O from "./DeleteRequestAuthModal.vue.js";
4
4
  import z from "./RequestAuthTab.vue.js";
@@ -6,7 +6,7 @@ import B from "../../../../components/DataTable/DataTable.vue.js";
6
6
  const M = ["onClick"], N = { class: "relative z-10 font-medium whitespace-nowrap" }, $ = {
7
7
  key: 0,
8
8
  class: "absolute inset-x-1 bottom-[var(--scalar-border-width)] left-1/2 z-1 h-px w-full -translate-x-1/2 bg-current"
9
- }, j = /* @__PURE__ */ b({
9
+ }, j = /* @__PURE__ */ f({
10
10
  __name: "RequestAuthDataTable",
11
11
  props: {
12
12
  collection: {},
@@ -19,7 +19,7 @@ const M = ["onClick"], N = { class: "relative z-10 font-medium whitespace-nowrap
19
19
  workspace: {}
20
20
  },
21
21
  setup(c) {
22
- const u = V(), f = m(
22
+ const u = V(), b = m(
23
23
  null
24
24
  ), t = m(0), d = y(() => {
25
25
  const e = c.selectedSchemeOptions[t.value];
@@ -57,7 +57,7 @@ const M = ["onClick"], N = { class: "relative z-10 font-medium whitespace-nowrap
57
57
  ], 2)) : p("", !0),
58
58
  d.value.length ? (o(), g(i(B), {
59
59
  key: 1,
60
- class: s(["flex-1", e.layout === "reference" && "rounded-b-lg border border-t-0"]),
60
+ class: s(["flex-1", e.layout === "reference" && "bg-b-1 rounded-b-lg border border-t-0"]),
61
61
  columns: [""],
62
62
  presentational: ""
63
63
  }, {
@@ -82,7 +82,7 @@ const M = ["onClick"], N = { class: "relative z-10 font-medium whitespace-nowrap
82
82
  ])
83
83
  }, " No authentication selected ", 2)),
84
84
  h(O, {
85
- scheme: f.value,
85
+ scheme: b.value,
86
86
  state: i(u),
87
87
  onClose: r[0] || (r[0] = (n) => i(u).hide())
88
88
  }, null, 8, ["scheme", "state"])
@@ -1 +1 @@
1
- {"version":3,"file":"RequestBody.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestBody.vue"],"names":[],"mappings":"AA4nBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,cAAc,EACpB,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAarE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAM1D,KAAK,WAAW,GAAG;IACf,OAAO,EAAE,cAAc,CAAA;IACvB,SAAS,EAAE,SAAS,CAAA;IACpB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,SAAS,EAAE,SAAS,CAAA;IACpB,KAAK,EAAE,MAAM,CAAA;CACd,CAAC;;AA26BJ,wBAOG"}
1
+ {"version":3,"file":"RequestBody.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestBody.vue"],"names":[],"mappings":"AAsoBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,cAAc,EACpB,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAarE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAM1D,KAAK,WAAW,GAAG;IACf,OAAO,EAAE,cAAc,CAAA;IACvB,SAAS,EAAE,SAAS,CAAA;IACpB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,SAAS,EAAE,SAAS,CAAA;IACpB,KAAK,EAAE,MAAM,CAAA;CACd,CAAC;;AAq7BJ,wBAOG"}
@@ -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-4d8238b9"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-124bfbc5"]]);
5
5
  export {
6
- p as default
6
+ m as default
7
7
  };
@@ -1,5 +1,5 @@
1
- import { defineComponent as ee, computed as h, ref as ne, watch as $, createBlock as g, openBlock as b, withCtx as m, createVNode as c, createCommentVNode as ae, unref as v, createElementVNode as k, toDisplayString as F, createElementBlock as j, Fragment as te, createTextVNode as H, nextTick as oe } from "vue";
2
- import { ScalarListbox as X, ScalarButton as D, ScalarIcon as C } from "@scalar/components";
1
+ import { defineComponent as ee, computed as h, ref as ne, watch as $, createBlock as g, openBlock as b, withCtx as m, createVNode as c, createCommentVNode as ae, unref as y, createElementVNode as w, toDisplayString as D, createElementBlock as j, Fragment as te, createTextVNode as H, nextTick as oe } from "vue";
2
+ import { ScalarListbox as X, ScalarButton as F, ScalarIcon as C } from "@scalar/components";
3
3
  import { requestExampleParametersSchema as Y } from "@scalar/oas-utils/entities/spec";
4
4
  import { canMethodHaveBody as le } from "@scalar/oas-utils/helpers";
5
5
  import ie from "../../../components/CodeInput/CodeInput.vue.js";
@@ -61,13 +61,19 @@ const me = {
61
61
  var n;
62
62
  const e = (n = p.value) == null ? void 0 : n.id;
63
63
  return Q[e] ?? "plaintext";
64
- });
65
- function P() {
66
- console.log("deleteRow");
67
- }
68
- const N = (e, n, a) => {
64
+ }), P = (e) => {
65
+ const n = v.value;
66
+ if (n.length > e) {
67
+ const a = [...n];
68
+ a.splice(e, 1), d.edit(
69
+ l.example.uid,
70
+ "body.formData.value",
71
+ a
72
+ );
73
+ }
74
+ }, N = (e, n, a) => {
69
75
  var o, i, u, r, f, V, J;
70
- const t = y.value;
76
+ const t = v.value;
71
77
  if (t.length > e) {
72
78
  const s = [...t];
73
79
  s[e] = {
@@ -91,22 +97,22 @@ const me = {
91
97
  });
92
98
  }
93
99
  e === t.length - 1 && O();
94
- }, y = h(() => {
100
+ }, v = h(() => {
95
101
  var e;
96
102
  return ((e = l.example.body.formData) == null ? void 0 : e.value) ?? [];
97
103
  }), R = () => {
98
- const e = y.value[y.value.length - 1];
104
+ const e = v.value[v.value.length - 1];
99
105
  (!e || e.key !== "" || e.value !== "") && O();
100
106
  }, O = () => {
101
107
  const e = Y.parse({
102
108
  enabled: !1
103
- }), n = [...y.value, e];
109
+ }), n = [...v.value, e];
104
110
  l.example.body.formData ? d.edit(l.example.uid, "body.formData.value", n) : d.edit(l.example.uid, "body.formData", {
105
111
  value: n,
106
112
  encoding: "form-data"
107
113
  });
108
114
  }, S = (e, n) => {
109
- const a = y.value;
115
+ const a = v.value;
110
116
  if (a.length > e) {
111
117
  const t = [...a];
112
118
  t[e] && (t[e].enabled = n), d.edit(
@@ -191,7 +197,7 @@ const me = {
191
197
  var o, i;
192
198
  const t = a == null ? void 0 : a[0];
193
199
  if (t) {
194
- const r = [...y.value];
200
+ const r = [...v.value];
195
201
  r[e] = {
196
202
  ...r[e],
197
203
  file: t,
@@ -211,7 +217,7 @@ const me = {
211
217
  n();
212
218
  }, I = () => d.edit(l.example.uid, "body.binary", void 0);
213
219
  function z(e) {
214
- const n = y.value, a = [...n], t = n[e], o = t == null ? void 0 : t.file;
220
+ const n = v.value, a = [...n], t = n[e], o = t == null ? void 0 : t.file;
215
221
  n.length > 1 && (!(t != null && t.key) && !(t != null && t.value) || o && (t == null ? void 0 : t.key) === o.name && (t == null ? void 0 : t.value) === o.name) ? a.splice(e, 1) : a[e] && (a[e].file = void 0), d.edit(l.example.uid, "body.formData.value", a);
216
222
  }
217
223
  function _() {
@@ -240,7 +246,7 @@ const me = {
240
246
  },
241
247
  { immediate: !0 }
242
248
  );
243
- const w = h(() => {
249
+ const k = h(() => {
244
250
  var o, i, u;
245
251
  const e = (o = p.value) == null ? void 0 : o.id, { header: n } = L(e), a = ((i = l.operation.requestBody) == null ? void 0 : i.content) || {}, t = n ? ((u = a[n]) == null ? void 0 : u.examples) || {} : {};
246
252
  return Object.entries(t).map(([r, f]) => ({
@@ -252,14 +258,14 @@ const me = {
252
258
  get: () => {
253
259
  var t;
254
260
  const e = ((t = l.example.body.raw) == null ? void 0 : t.value) ?? "{}", n = JSON.parse(e);
255
- return w.value.find((o) => {
261
+ return k.value.find((o) => {
256
262
  const i = o.value;
257
263
  return JSON.stringify(i.value) === JSON.stringify(n);
258
- }) ?? w.value[0];
264
+ }) ?? k.value[0];
259
265
  },
260
266
  set: (e) => {
261
267
  if (e != null && e.id) {
262
- const n = w.value.find((a) => a.id === e.id);
268
+ const n = k.value.find((a) => a.id === e.id);
263
269
  if (n) {
264
270
  const a = n.value;
265
271
  q(JSON.stringify(a.value, null, 2));
@@ -269,7 +275,7 @@ const me = {
269
275
  });
270
276
  return (e, n) => (b(), g(se, null, {
271
277
  title: m(() => [
272
- H(F(e.title), 1)
278
+ H(D(e.title), 1)
273
279
  ]),
274
280
  default: m(() => [
275
281
  c(re, {
@@ -281,14 +287,14 @@ const me = {
281
287
  default: m(() => [
282
288
  c(de, { class: "relative col-span-full flex h-8 cursor-pointer items-center justify-between !p-0" }, {
283
289
  default: m(() => [
284
- c(v(X), {
290
+ c(y(X), {
285
291
  modelValue: p.value,
286
292
  "onUpdate:modelValue": n[0] || (n[0] = (a) => p.value = a),
287
- options: v(x),
293
+ options: y(x),
288
294
  teleport: ""
289
295
  }, {
290
296
  default: m(() => [
291
- c(v(D), {
297
+ c(y(F), {
292
298
  class: "text-c-2 hover:text-c-1 flex h-full w-fit gap-1.5 px-3 font-normal",
293
299
  fullWidth: "",
294
300
  variant: "ghost"
@@ -296,8 +302,8 @@ const me = {
296
302
  default: m(() => {
297
303
  var a;
298
304
  return [
299
- k("span", null, F((a = p.value) == null ? void 0 : a.label), 1),
300
- c(v(C), {
305
+ w("span", null, D((a = p.value) == null ? void 0 : a.label), 1),
306
+ c(y(C), {
301
307
  icon: "ChevronDown",
302
308
  size: "md"
303
309
  })
@@ -308,16 +314,16 @@ const me = {
308
314
  ]),
309
315
  _: 1
310
316
  }, 8, ["modelValue", "options"]),
311
- w.value.length > 0 ? (b(), g(v(X), {
317
+ k.value.length > 0 ? (b(), g(y(X), {
312
318
  key: 0,
313
319
  modelValue: U.value,
314
320
  "onUpdate:modelValue": n[1] || (n[1] = (a) => U.value = a),
315
- options: w.value,
321
+ options: k.value,
316
322
  side: "left",
317
323
  teleport: ""
318
324
  }, {
319
325
  default: m(() => [
320
- c(v(D), {
326
+ c(y(F), {
321
327
  class: "text-c-2 hover:text-c-1 flex h-full w-fit gap-1.5 px-2 font-normal",
322
328
  fullWidth: "",
323
329
  variant: "ghost"
@@ -325,8 +331,8 @@ const me = {
325
331
  default: m(() => {
326
332
  var a;
327
333
  return [
328
- k("span", null, F((a = U.value) == null ? void 0 : a.label), 1),
329
- c(v(C), {
334
+ w("span", null, D((a = U.value) == null ? void 0 : a.label), 1),
335
+ c(y(C), {
330
336
  icon: "ChevronDown",
331
337
  size: "md"
332
338
  })
@@ -348,11 +354,11 @@ const me = {
348
354
  var a, t, o, i, u, r;
349
355
  return [
350
356
  ((a = p.value) == null ? void 0 : a.id) === "none" ? (b(), j("div", me, n[2] || (n[2] = [
351
- k("span", null, "No Body", -1)
357
+ w("span", null, "No Body", -1)
352
358
  ]))) : ((t = p.value) == null ? void 0 : t.id) === "binaryFile" ? (b(), j("div", ce, [
353
359
  e.example.body.binary ? (b(), j(te, { key: 0 }, [
354
- k("span", fe, F(e.example.body.binary.name), 1),
355
- c(v(D), {
360
+ w("span", fe, D(e.example.body.binary.name), 1),
361
+ c(y(F), {
356
362
  class: "bg-b-2 hover:bg-b-3 text-c-2 ml-1 border-0 shadow-none",
357
363
  size: "sm",
358
364
  variant: "outlined",
@@ -363,7 +369,7 @@ const me = {
363
369
  ])),
364
370
  _: 1
365
371
  })
366
- ], 64)) : (b(), g(v(D), {
372
+ ], 64)) : (b(), g(y(F), {
367
373
  key: 1,
368
374
  class: "bg-b-2 hover:bg-b-3 text-c-2 border-0 shadow-none",
369
375
  size: "sm",
@@ -371,8 +377,8 @@ const me = {
371
377
  onClick: _
372
378
  }, {
373
379
  default: m(() => [
374
- n[4] || (n[4] = k("span", null, "Upload File", -1)),
375
- c(v(C), {
380
+ n[4] || (n[4] = w("span", null, "Upload File", -1)),
381
+ c(y(C), {
376
382
  class: "ml-1",
377
383
  icon: "Upload",
378
384
  size: "xs",
@@ -389,7 +395,7 @@ const me = {
389
395
  columns: ["32px", "", "", "104px"],
390
396
  envVariables: e.envVariables,
391
397
  environment: e.environment,
392
- items: y.value,
398
+ items: v.value,
393
399
  showUploadButton: "",
394
400
  workspace: e.workspace,
395
401
  onDeleteRow: P,
@@ -405,7 +411,7 @@ const me = {
405
411
  columns: ["32px", "", "", "104px"],
406
412
  envVariables: e.envVariables,
407
413
  environment: e.environment,
408
- items: y.value,
414
+ items: v.value,
409
415
  showUploadButton: "",
410
416
  workspace: e.workspace,
411
417
  onDeleteRow: P,
@@ -34,7 +34,7 @@ const W = { class: "flex-center relative flex flex-1 flex-col gap-6 p-2 capitali
34
34
  }));
35
35
  }, k = (o) => {
36
36
  o != null && o.createNew && g.name === "request" && f();
37
- }, w = "2.5.5";
37
+ }, w = "2.5.7";
38
38
  return R(() => a.hotKeys.on(k)), v(() => a.hotKeys.off(k)), (o, e) => (u(), i("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.5.5",
21
+ "version": "2.5.7",
22
22
  "engines": {
23
23
  "node": ">=20"
24
24
  },
@@ -204,23 +204,23 @@
204
204
  "whatwg-mimetype": "^4.0.0",
205
205
  "yaml": "^2.4.5",
206
206
  "zod": "3.24.1",
207
- "@scalar/components": "0.14.7",
207
+ "@scalar/components": "0.14.9",
208
208
  "@scalar/draggable": "0.2.0",
209
- "@scalar/import": "0.4.9",
210
- "@scalar/helpers": "0.0.3",
211
- "@scalar/oas-utils": "0.4.4",
212
- "@scalar/icons": "0.4.2",
213
- "@scalar/openapi-parser": "0.16.0",
214
- "@scalar/openapi-types": "0.3.2",
215
- "@scalar/postman-to-openapi": "0.3.7",
216
- "@scalar/snippetz": "0.3.0",
217
- "@scalar/themes": "0.13.2",
218
- "@scalar/types": "0.2.2",
209
+ "@scalar/icons": "0.4.3",
210
+ "@scalar/helpers": "0.0.4",
211
+ "@scalar/import": "0.4.10",
212
+ "@scalar/oas-utils": "0.4.5",
213
+ "@scalar/openapi-parser": "0.17.0",
219
214
  "@scalar/object-utils": "1.2.1",
215
+ "@scalar/openapi-types": "0.3.3",
216
+ "@scalar/postman-to-openapi": "0.3.8",
217
+ "@scalar/use-codemirror": "0.12.10",
218
+ "@scalar/types": "0.2.3",
219
+ "@scalar/themes": "0.13.3",
220
220
  "@scalar/use-hooks": "0.2.2",
221
221
  "@scalar/use-toasts": "0.8.0",
222
- "@scalar/use-codemirror": "0.12.8",
223
- "@scalar/use-tooltip": "1.1.0"
222
+ "@scalar/use-tooltip": "1.1.0",
223
+ "@scalar/snippetz": "0.3.1"
224
224
  },
225
225
  "devDependencies": {
226
226
  "@tailwindcss/vite": "^4.1.7",
@@ -233,8 +233,8 @@
233
233
  "vite": "5.4.19",
234
234
  "vite-svg-loader": "^5.1.0",
235
235
  "vitest": "^1.6.0",
236
- "@scalar/galaxy": "0.5.0",
237
- "@scalar/build-tooling": "0.2.2"
236
+ "@scalar/build-tooling": "0.2.3",
237
+ "@scalar/galaxy": "0.5.1"
238
238
  },
239
239
  "scripts": {
240
240
  "build": "scalar-build-vite",