@scalar/api-client 2.2.11 → 2.2.12

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.
@@ -1 +1 @@
1
- {"version":3,"file":"RequestPathParams.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestPathParams.vue"],"names":[],"mappings":"AAoIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAMrE,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,cAAc,CAAC,YAAY,CAAC,CAAA;CAC7C,CAAC;;AA0MF,wBAOG"}
1
+ {"version":3,"file":"RequestPathParams.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestPathParams.vue"],"names":[],"mappings":"AA8IA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAMrE,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,cAAc,CAAC,YAAY,CAAC,CAAA;CAC7C,CAAC;;AAyMF,wBAOG"}
@@ -1,96 +1,98 @@
1
- import { defineComponent as _, computed as $, watch as K, openBlock as d, createBlock as h, withCtx as y, createTextVNode as x, toDisplayString as q, createElementBlock as C, createElementVNode as P } from "vue";
2
- import w from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
3
- import { useActiveEntities as V } from "../../../store/active-entities.js";
4
- import M from "./RequestTable.vue.js";
5
- import { REGEX as B } from "@scalar/oas-utils/helpers";
6
- import { useWorkspace as N } from "../../../store/store.js";
7
- const T = {
8
- key: 1,
9
- class: "text-c-3 px-4 text-sm border rounded min-h-12 justify-center flex items-center bg-b-1 mx-1"
10
- }, O = /* @__PURE__ */ _({
1
+ import { defineComponent as P, computed as _, watch as y, openBlock as g, createBlock as R, withCtx as $, createTextVNode as b, toDisplayString as q, createCommentVNode as w } from "vue";
2
+ import V from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
3
+ import { useActiveEntities as M } from "../../../store/active-entities.js";
4
+ import U from "./RequestTable.vue.js";
5
+ import { REGEX as N } from "@scalar/oas-utils/helpers";
6
+ import { useWorkspace as T } from "../../../store/store.js";
7
+ const S = /* @__PURE__ */ P({
11
8
  __name: "RequestPathParams",
12
9
  props: {
13
10
  title: {},
14
11
  paramKey: {}
15
12
  },
16
- setup(b) {
17
- const o = b, { activeRequest: s, activeExample: n } = V(), { requestMutators: v, requestExampleMutators: f } = N(), l = $(() => {
13
+ setup(E) {
14
+ const o = E, { activeRequest: s, activeExample: n, activeServer: d } = M(), { requestMutators: f, requestExampleMutators: v } = T(), p = _(() => {
18
15
  const e = n.value;
19
- return e ? e.parameters[o.paramKey].map((a) => {
16
+ return e ? e.parameters[o.paramKey].map((t) => {
20
17
  var r;
21
18
  return {
22
- ...a,
23
- enum: a.enum || ((r = e.serverVariables) == null ? void 0 : r[a.key])
19
+ ...t,
20
+ enum: t.enum || ((r = e.serverVariables) == null ? void 0 : r[t.key])
24
21
  };
25
22
  }) : [];
26
- }), g = (e, a, r) => {
27
- var u, t;
23
+ }), K = (e, t, r) => {
24
+ var l, a;
28
25
  if (!s.value || !n.value) return;
29
- const i = n.value.parameters[o.paramKey], p = (u = i[e]) == null ? void 0 : u.key;
30
- if (a === "key") {
31
- if ((t = i[e]) != null && t.required)
26
+ const i = n.value.parameters[o.paramKey], u = (l = i[e]) == null ? void 0 : l.key;
27
+ if (t === "key") {
28
+ if ((a = i[e]) != null && a.required)
32
29
  return;
33
30
  if (r) {
34
- const c = encodeURIComponent(p), m = encodeURIComponent(r), k = new RegExp(`(?<=/):${c}(?=[/?#]|$)`, "g"), R = s.value.path.replace(
35
- k,
31
+ const c = encodeURIComponent(u), m = encodeURIComponent(r), x = new RegExp(`(?<=/):${c}(?=[/?#]|$)`, "g"), C = s.value.path.replace(
32
+ x,
36
33
  `:${m}`
37
34
  );
38
- v.edit(s.value.uid, "path", R);
35
+ f.edit(s.value.uid, "path", C);
39
36
  } else {
40
37
  i.splice(e, 1);
41
- const c = new RegExp(`/:${encodeURIComponent(p)}(?=[/?#]|$)`, "g"), m = s.value.path.replace(c, "");
42
- v.edit(s.value.uid, "path", m);
38
+ const c = new RegExp(`/:${encodeURIComponent(u)}(?=[/?#]|$)`, "g"), m = s.value.path.replace(c, "");
39
+ f.edit(s.value.uid, "path", m);
43
40
  }
44
41
  }
45
- f.edit(
42
+ v.edit(
46
43
  n.value.uid,
47
- `parameters.${o.paramKey}.${e}.${a}`,
44
+ `parameters.${o.paramKey}.${e}.${t}`,
48
45
  r
49
46
  );
50
- }, E = (e) => {
51
- var u;
47
+ }, k = (e) => {
48
+ var l;
52
49
  if (!n.value) return;
53
- const a = ((u = e.match(B.PATH)) == null ? void 0 : u.map((t) => t.slice(1, -1))) || [], r = n.value.parameters[o.paramKey], i = new Map(r.map((t) => [t.key, t])), p = a.map(
54
- (t) => i.get(t) || { key: t, value: "", enabled: !0 }
50
+ const t = ((l = e.match(N.PATH)) == null ? void 0 : l.map((a) => a.slice(1, -1))) || [], r = n.value.parameters[o.paramKey], i = new Map(r.map((a) => [a.key, a])), u = t.map(
51
+ (a) => i.get(a) || { key: a, value: "", enabled: !0 }
55
52
  );
56
- r.forEach((t) => {
57
- !a.includes(t.key) && (t.value || t.required) && p.push(t);
58
- }), r.splice(0, r.length, ...p), f.edit(
53
+ r.forEach((a) => {
54
+ !t.includes(a.key) && (a.value || a.required) && u.push(a);
55
+ }), r.splice(0, r.length, ...u), t.length === 0 && r.splice(0, r.length), v.edit(
59
56
  n.value.uid,
60
57
  `parameters.${o.paramKey}`,
61
58
  r
62
59
  );
60
+ }, h = (e) => {
61
+ e && k(e);
63
62
  };
64
- return K(
63
+ return y(
64
+ () => s.value,
65
+ (e) => {
66
+ var t;
67
+ e && h((t = d.value) == null ? void 0 : t.url);
68
+ }
69
+ ), y(
65
70
  () => {
66
71
  var e;
67
- return (e = s.value) == null ? void 0 : e.path;
72
+ return (e = d.value) == null ? void 0 : e.url;
68
73
  },
69
- (e) => {
70
- e && E(e);
74
+ (e, t) => {
75
+ e !== t && h(e);
71
76
  }
72
- ), (e, a) => (d(), h(w, {
73
- itemCount: l.value.length
77
+ ), (e, t) => (g(), R(V, {
78
+ itemCount: p.value.length
74
79
  }, {
75
- title: y(() => [
76
- x(q(e.title), 1)
80
+ title: $(() => [
81
+ b(q(e.title), 1)
77
82
  ]),
78
- default: y(() => [
79
- l.value.length ? (d(), h(M, {
83
+ default: $(() => [
84
+ p.value.length ? (g(), R(U, {
80
85
  key: 0,
81
86
  class: "flex-1",
82
87
  isEnabledHidden: "",
83
- items: l.value,
84
- onUpdateRow: g
85
- }, null, 8, ["items"])) : (d(), C("div", T, a[0] || (a[0] = [
86
- x(" You can use variables in your path: "),
87
- P("code", { class: "bg-b-2 ml-1 px-1 rounded" }, "/endpoint/{my_path_variable}", -1)
88
- ])))
88
+ items: p.value,
89
+ onUpdateRow: K
90
+ }, null, 8, ["items"])) : w("", !0)
89
91
  ]),
90
92
  _: 1
91
93
  }, 8, ["itemCount"]));
92
94
  }
93
95
  });
94
96
  export {
95
- O as default
97
+ S as default
96
98
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./RequestSection.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-ade1db3e"]]);
4
+ const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-317bb675"]]);
5
5
  export {
6
- m as default
6
+ p as default
7
7
  };
@@ -3,24 +3,24 @@ import H from "../../../components/ContextBar.vue.js";
3
3
  import N from "../../../components/ViewLayout/ViewLayoutSection.vue.js";
4
4
  import { useActiveEntities as E } from "../../../store/active-entities.js";
5
5
  import K from "./RequestBody.vue.js";
6
- import h from "./RequestParams.vue.js";
6
+ import f from "./RequestParams.vue.js";
7
7
  import U from "./RequestPathParams.vue.js";
8
- import { canMethodHaveBody as f } from "@scalar/oas-utils/helpers";
8
+ import { canMethodHaveBody as h } from "@scalar/oas-utils/helpers";
9
9
  import Q from "./RequestAuth/RequestAuth.vue.js";
10
10
  import { useWorkspace as $ } from "../../../store/store.js";
11
11
  const D = { class: "flex-1 flex gap-1 items-center lg:pr-24 pointer-events-none group" }, M = {
12
12
  key: 0,
13
13
  class: "absolute w-full h-full top-0 left-0 pointer-events-auto opacity-0 cursor-text",
14
14
  for: "requestname"
15
- }, P = ["value"], z = {
15
+ }, z = ["value"], I = {
16
16
  key: 2,
17
17
  class: "flex items-center text-c-1 h-8"
18
- }, I = { class: "request-section-content custom-scroll flex flex-1 flex-col px-3 xl:px-4 py-2.5" }, ee = /* @__PURE__ */ B({
18
+ }, L = { class: "request-section-content custom-scroll flex flex-1 flex-col px-3 xl:px-4 py-2.5" }, ee = /* @__PURE__ */ B({
19
19
  __name: "RequestSection",
20
20
  props: {
21
21
  selectedSecuritySchemeUids: {}
22
22
  },
23
- setup(L) {
23
+ setup(O) {
24
24
  const { activeRequest: l, activeExample: y } = E(), { isReadOnly: p, requestMutators: g } = $(), k = S(() => {
25
25
  var a, u;
26
26
  const t = /* @__PURE__ */ new Set([
@@ -32,7 +32,7 @@ const D = { class: "flex-1 flex gap-1 items-center lg:pr-24 pointer-events-none
32
32
  "Headers",
33
33
  "Body"
34
34
  ]);
35
- return (a = y.value) != null && a.parameters.path.length || t.delete("Variables"), f(((u = l.value) == null ? void 0 : u.method) ?? "get") || t.delete("Body"), _.value && t.delete("Auth"), [...t];
35
+ return (a = y.value) != null && a.parameters.path.length || t.delete("Variables"), h(((u = l.value) == null ? void 0 : u.method) ?? "get") || t.delete("Body"), _.value && t.delete("Auth"), [...t];
36
36
  }), _ = S(
37
37
  () => {
38
38
  var t, a;
@@ -40,7 +40,7 @@ const D = { class: "flex-1 flex gap-1 items-center lg:pr-24 pointer-events-none
40
40
  }
41
41
  ), e = b("All");
42
42
  V(l, (t) => {
43
- e.value === "Body" && t && !f(t.method) && (e.value = "All");
43
+ e.value === "Body" && t && !h(t.method) && (e.value = "All");
44
44
  });
45
45
  const q = (t) => {
46
46
  if (!l.value) return;
@@ -57,14 +57,14 @@ const D = { class: "flex-1 flex gap-1 items-center lg:pr-24 pointer-events-none
57
57
  return [
58
58
  A("div", D, [
59
59
  o(p) ? C("", !0) : (d(), v("label", M)),
60
- o(p) ? (d(), v("span", z, R((c = o(l)) == null ? void 0 : c.summary), 1)) : (d(), v("input", {
60
+ o(p) ? (d(), v("span", I, R((c = o(l)) == null ? void 0 : c.summary), 1)) : (d(), v("input", {
61
61
  key: 1,
62
62
  id: "requestname",
63
63
  class: "text-c-1 rounded pointer-events-auto relative w-full pl-2 -ml-0.5 md:-ml-1 xl:-ml-2 has-[:focus-visible]:outline h-8 group-hover-input has-[:focus-visible]:outline z-10",
64
64
  placeholder: "Request Name",
65
65
  value: (n = o(l)) == null ? void 0 : n.summary,
66
66
  onInput: q
67
- }, null, 40, P))
67
+ }, null, 40, z))
68
68
  ]),
69
69
  s(H, {
70
70
  activeSection: e.value,
@@ -76,7 +76,7 @@ const D = { class: "flex-1 flex gap-1 items-center lg:pr-24 pointer-events-none
76
76
  default: x(() => {
77
77
  var n, c, m;
78
78
  return [
79
- A("div", I, [
79
+ A("div", L, [
80
80
  i(s(Q, {
81
81
  selectedSecuritySchemeUids: t.selectedSecuritySchemeUids,
82
82
  title: "Authentication"
@@ -88,26 +88,26 @@ const D = { class: "flex-1 flex gap-1 items-center lg:pr-24 pointer-events-none
88
88
  ]),
89
89
  i(s(U, {
90
90
  paramKey: "path",
91
- title: "Path Variables"
91
+ title: "Variables"
92
92
  }, null, 512), [
93
93
  [
94
94
  r,
95
95
  (e.value === "All" || e.value === "Variables") && ((m = (c = (n = o(y)) == null ? void 0 : n.parameters) == null ? void 0 : c.path) == null ? void 0 : m.length)
96
96
  ]
97
97
  ]),
98
- i(s(h, {
98
+ i(s(f, {
99
99
  paramKey: "cookies",
100
100
  title: "Cookies"
101
101
  }, null, 512), [
102
102
  [r, e.value === "All" || e.value === "Cookies"]
103
103
  ]),
104
- i(s(h, {
104
+ i(s(f, {
105
105
  paramKey: "headers",
106
106
  title: "Headers"
107
107
  }, null, 512), [
108
108
  [r, e.value === "All" || e.value === "Headers"]
109
109
  ]),
110
- i(s(h, {
110
+ i(s(f, {
111
111
  paramKey: "query",
112
112
  title: "Query Parameters"
113
113
  }, null, 512), [
@@ -116,7 +116,7 @@ const D = { class: "flex-1 flex gap-1 items-center lg:pr-24 pointer-events-none
116
116
  i(s(K, { title: "Body" }, null, 512), [
117
117
  [
118
118
  r,
119
- o(l) && (e.value === "All" || e.value === "Body") && o(f)(o(l).method)
119
+ o(l) && (e.value === "All" || e.value === "Body") && o(h)(o(l).method)
120
120
  ]
121
121
  ])
122
122
  ])
@@ -17,7 +17,7 @@ const K = { class: "relative col-1 flex-center gap-6 p-2 capitalize" }, A = {
17
17
  a.commandPalette.emit({ commandName: "Create Request" });
18
18
  }, y = (i) => {
19
19
  i != null && i.createNew && v.name === "request" && f();
20
- }, h = "2.2.11";
20
+ }, h = "2.2.12";
21
21
  return R(() => a.hotKeys.on(y)), C(() => a.hotKeys.off(y)), (i, e) => (r(), l("div", K, [
22
22
  o("div", {
23
23
  class: k(["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.2.11",
21
+ "version": "2.2.12",
22
22
  "engines": {
23
23
  "node": ">=18"
24
24
  },
@@ -169,19 +169,19 @@
169
169
  "whatwg-mimetype": "^4.0.0",
170
170
  "yaml": "^2.4.5",
171
171
  "zod": "^3.23.8",
172
- "@scalar/components": "0.13.4",
173
172
  "@scalar/draggable": "0.1.7",
174
173
  "@scalar/icons": "0.1.2",
175
- "@scalar/import": "0.2.6",
174
+ "@scalar/components": "0.13.5",
175
+ "@scalar/import": "0.2.7",
176
176
  "@scalar/object-utils": "1.1.12",
177
- "@scalar/openapi-parser": "0.9.0",
177
+ "@scalar/oas-utils": "0.2.88",
178
+ "@scalar/openapi-parser": "0.10.0",
178
179
  "@scalar/openapi-types": "0.1.5",
179
- "@scalar/oas-utils": "0.2.87",
180
- "@scalar/themes": "0.9.54",
181
- "@scalar/types": "0.0.23",
182
- "@scalar/postman-to-openapi": "0.1.10",
183
- "@scalar/use-hooks": "0.1.7",
184
- "@scalar/use-codemirror": "0.11.48",
180
+ "@scalar/postman-to-openapi": "0.1.11",
181
+ "@scalar/types": "0.0.24",
182
+ "@scalar/use-codemirror": "0.11.49",
183
+ "@scalar/use-hooks": "0.1.8",
184
+ "@scalar/themes": "0.9.55",
185
185
  "@scalar/use-toasts": "0.7.7",
186
186
  "@scalar/use-tooltip": "1.0.4"
187
187
  },