@scalar/api-client 2.5.0 → 2.5.2

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":"RequestSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestSection.vue"],"names":[],"mappings":"AAuVA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAA;AACnF,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,cAAc,EACd,MAAM,EACP,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAUrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAU1D,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,OAAO,EAAE,cAAc,CAAA;IACvB,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;IACpB,0BAA0B,EAAE,0BAA0B,CAAA;IACtD,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;;AA2XF,wBAOG"}
1
+ {"version":3,"file":"RequestSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestSection.vue"],"names":[],"mappings":"AA+VA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAA;AACnF,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,cAAc,EACd,MAAM,EACP,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAUrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAU1D,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,OAAO,EAAE,cAAc,CAAA;IACvB,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;IACpB,0BAA0B,EAAE,0BAA0B,CAAA;IACtD,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;;AAmYF,wBAOG"}
@@ -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-26a349d9"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-5dc4344b"]]);
5
5
  export {
6
6
  m as default
7
7
  };
@@ -1,21 +1,21 @@
1
- import { defineComponent as U, computed as v, useId as g, ref as D, watch as M, createBlock as p, openBlock as n, withCtx as c, createElementVNode as y, withDirectives as s, createCommentVNode as h, createElementBlock as f, createVNode as i, unref as r, vShow as m, Fragment as K, renderList as L, resolveDynamicComponent as Q, toDisplayString as $ } from "vue";
2
- import { ScalarErrorBoundary as P } from "@scalar/components";
3
- import { canMethodHaveBody as k, isDefined as F, REGEX as S } from "@scalar/oas-utils/helpers";
1
+ import { defineComponent as D, computed as v, useId as g, ref as M, watch as P, createBlock as p, openBlock as n, withCtx as c, createElementVNode as h, withDirectives as s, createCommentVNode as k, createElementBlock as f, createVNode as i, unref as r, vShow as u, Fragment as K, renderList as L, resolveDynamicComponent as Q, toDisplayString as $ } from "vue";
2
+ import { ScalarErrorBoundary as S } from "@scalar/components";
3
+ import { canMethodHaveBody as b, isDefined as F, REGEX as C } from "@scalar/oas-utils/helpers";
4
4
  import j from "../../../components/SectionFilter.vue.js";
5
5
  import T from "../../../components/ViewLayout/ViewLayoutSection.vue.js";
6
6
  import { matchesDomain as W } from "../../../libs/send-request/set-request-cookies.js";
7
7
  import z from "./RequestBody.vue.js";
8
- import b from "./RequestParams.vue.js";
8
+ import V from "./RequestParams.vue.js";
9
9
  import G from "./RequestPathParams.vue.js";
10
10
  import X from "./RequestAuth/RequestAuth.vue.js";
11
11
  import J from "./RequestCodeExample.vue.js";
12
12
  import { usePluginManager as Y } from "../../../plugins/hooks/usePluginManager.js";
13
13
  import { useWorkspace as Z } from "../../../store/store.js";
14
14
  import { useLayout as x } from "../../../hooks/useLayout.js";
15
- const _ = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:pr-24" }, ee = ["for"], ae = ["id", "placeholder", "value"], oe = {
15
+ const _ = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:pr-24" }, ee = ["for"], ae = ["id", "placeholder", "value"], le = {
16
16
  key: 2,
17
17
  class: "text-c-1 flex h-8 items-center"
18
- }, le = ["id", "role"], be = /* @__PURE__ */ U({
18
+ }, oe = ["id", "role"], be = /* @__PURE__ */ D({
19
19
  __name: "RequestSection",
20
20
  props: {
21
21
  collection: {},
@@ -28,42 +28,37 @@ const _ = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
28
28
  server: {},
29
29
  workspace: {}
30
30
  },
31
- setup(o) {
32
- const C = [
31
+ setup(l) {
32
+ const B = [
33
33
  "Auth",
34
34
  "Variables",
35
35
  "Cookies",
36
36
  "Headers",
37
37
  "Query",
38
- "Body",
39
- "Scripts"
40
- ], { requestMutators: V, cookies: B, securitySchemes: R } = Z(), { layout: d } = x(), w = v(() => {
41
- const e = /* @__PURE__ */ new Set(["All", ...C]);
42
- return o.example.parameters.path.length || e.delete("Variables"), k(o.operation.method ?? "get") || e.delete("Body"), A.value && e.delete("Auth"), [...e];
38
+ "Body"
39
+ // 'Scripts',
40
+ ], { requestMutators: w, cookies: R, securitySchemes: O } = Z(), { layout: d } = x(), A = v(() => {
41
+ const e = /* @__PURE__ */ new Set(["All", ...B]);
42
+ return l.example.parameters.path.length || e.delete("Variables"), b(l.operation.method ?? "get") || e.delete("Body"), y.value && e.delete("Auth"), [...e];
43
43
  }), t = v(
44
44
  () => Object.fromEntries(
45
- w.value.map((e) => [e, g()])
45
+ A.value.map((e) => [e, g()])
46
46
  )
47
- ), A = v(
48
- () => {
49
- var e;
50
- return d === "modal" && ((e = o.operation.security) == null ? void 0 : e.length) === 0;
51
- }
52
- ), a = D("All");
53
- M(
54
- () => o.operation,
47
+ ), y = v(() => d === "modal" && !l.operation.security), a = M("All");
48
+ P(
49
+ () => l.operation,
55
50
  (e) => {
56
- a.value === "Body" && e && !k(e.method) && (a.value = "All");
51
+ a.value === "Body" && e && !b(e.method) && (a.value = "All");
57
52
  }
58
53
  );
59
- const O = (e) => {
60
- const l = e.target;
61
- V.edit(o.operation.uid, "summary", l.value);
62
- }, E = v(
63
- () => (o.workspace.cookies ?? []).map((e) => B[e]).filter(F).filter((e) => e.name).filter(
54
+ const E = (e) => {
55
+ const o = e.target;
56
+ w.edit(l.operation.uid, "summary", o.value);
57
+ }, H = v(
58
+ () => (l.workspace.cookies ?? []).map((e) => R[e]).filter(F).filter((e) => e.name).filter(
64
59
  (e) => {
65
- var l;
66
- return W(((l = o.server) == null ? void 0 : l.url) || o.operation.path, e.domain);
60
+ var o;
61
+ return W(((o = l.server) == null ? void 0 : o.url) || l.operation.path, e.domain);
67
62
  }
68
63
  ).map((e) => ({
69
64
  key: e.name,
@@ -76,40 +71,45 @@ const _ = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
76
71
  },
77
72
  enabled: !0
78
73
  }))
79
- ), H = () => o.operation.summary ? o.operation.summary : o.operation.path.replace(S.PROTOCOL, "") ? o.operation.path.replace(S.PROTOCOL, "") : "Request Name", q = g(), N = Y().getViewComponents("request.section"), I = (e, l) => V.edit(o.operation.uid, e, l);
80
- return (e, l) => (n(), p(T, {
74
+ ), N = () => l.operation.summary ? l.operation.summary : l.operation.path.replace(C.PROTOCOL, "") ? l.operation.path.replace(C.PROTOCOL, "") : "Request Name", q = g(), I = Y().getViewComponents("request.section"), U = (e, o) => w.edit(l.operation.uid, e, o);
75
+ return P(
76
+ () => y.value,
77
+ (e) => {
78
+ e && a.value === "Auth" && (a.value = "All");
79
+ }
80
+ ), (e, o) => (n(), p(T, {
81
81
  "aria-label": `Request: ${e.operation.summary}`
82
82
  }, {
83
83
  title: c(() => [
84
- y("div", _, [
84
+ h("div", _, [
85
85
  r(d) !== "modal" ? (n(), f("label", {
86
86
  key: 0,
87
87
  class: "pointer-events-auto absolute top-0 left-0 h-full w-full cursor-text opacity-0",
88
88
  for: r(q)
89
- }, null, 8, ee)) : h("", !0),
89
+ }, null, 8, ee)) : k("", !0),
90
90
  r(d) !== "modal" ? (n(), f("input", {
91
91
  key: 1,
92
92
  id: r(q),
93
93
  class: "text-c-1 group-hover-input pointer-events-auto relative z-10 -ml-0.5 h-8 w-full rounded pl-1.25 has-[:focus-visible]:outline md:-ml-1.25",
94
- placeholder: H(),
94
+ placeholder: N(),
95
95
  value: e.operation.summary,
96
- onInput: O
97
- }, null, 40, ae)) : (n(), f("span", oe, $(e.operation.summary), 1))
96
+ onInput: E
97
+ }, null, 40, ae)) : (n(), f("span", le, $(e.operation.summary), 1))
98
98
  ]),
99
99
  i(j, {
100
100
  modelValue: a.value,
101
- "onUpdate:modelValue": l[0] || (l[0] = (u) => a.value = u),
101
+ "onUpdate:modelValue": o[0] || (o[0] = (m) => a.value = m),
102
102
  filterIds: t.value,
103
- filters: w.value
103
+ filters: A.value
104
104
  }, null, 8, ["modelValue", "filterIds", "filters"])
105
105
  ]),
106
106
  default: c(() => [
107
- y("div", {
107
+ h("div", {
108
108
  id: t.value.All,
109
109
  class: "request-section-content custom-scroll relative flex flex-1 flex-col",
110
110
  role: a.value === "All" ? "tabpanel" : "none"
111
111
  }, [
112
- e.collection && e.workspace && (r(d) !== "modal" || Object.keys(r(R) ?? {}).length) ? s((n(), p(X, {
112
+ e.collection && e.workspace && (r(d) !== "modal" || Object.keys(r(O) ?? {}).length) ? s((n(), p(X, {
113
113
  key: 0,
114
114
  id: t.value.Auth,
115
115
  class: "request-section-content-auth",
@@ -125,10 +125,10 @@ const _ = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
125
125
  workspace: e.workspace
126
126
  }, null, 8, ["id", "collection", "envVariables", "environment", "operation", "role", "selectedSecuritySchemeUids", "server", "workspace"])), [
127
127
  [
128
- m,
129
- !A.value && (a.value === "All" || a.value === "Auth")
128
+ u,
129
+ !y.value && (a.value === "All" || a.value === "Auth")
130
130
  ]
131
- ]) : h("", !0),
131
+ ]) : k("", !0),
132
132
  s(i(G, {
133
133
  id: t.value.Variables,
134
134
  class: "request-section-content-path-params",
@@ -143,11 +143,11 @@ const _ = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
143
143
  workspace: e.workspace
144
144
  }, null, 8, ["id", "envVariables", "environment", "example", "invalidParams", "operation", "role", "workspace"]), [
145
145
  [
146
- m,
146
+ u,
147
147
  (a.value === "All" || a.value === "Variables") && e.example.parameters.path.length
148
148
  ]
149
149
  ]),
150
- s(i(b, {
150
+ s(i(V, {
151
151
  id: t.value.Cookies,
152
152
  class: "request-section-content-cookies",
153
153
  envVariables: e.envVariables,
@@ -157,14 +157,14 @@ const _ = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
157
157
  label: "Cookie",
158
158
  operation: e.operation,
159
159
  paramKey: "cookies",
160
- readOnlyEntries: E.value,
160
+ readOnlyEntries: H.value,
161
161
  role: a.value === "All" ? "none" : "tabpanel",
162
162
  title: "Cookies",
163
163
  workspace: e.workspace
164
164
  }, null, 8, ["id", "envVariables", "environment", "example", "invalidParams", "operation", "readOnlyEntries", "role", "workspace"]), [
165
- [m, a.value === "All" || a.value === "Cookies"]
165
+ [u, a.value === "All" || a.value === "Cookies"]
166
166
  ]),
167
- s(i(b, {
167
+ s(i(V, {
168
168
  id: t.value.Headers,
169
169
  class: "request-section-content-headers",
170
170
  envVariables: e.envVariables,
@@ -178,9 +178,9 @@ const _ = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
178
178
  title: "Headers",
179
179
  workspace: e.workspace
180
180
  }, null, 8, ["id", "envVariables", "environment", "example", "invalidParams", "operation", "role", "workspace"]), [
181
- [m, a.value === "All" || a.value === "Headers"]
181
+ [u, a.value === "All" || a.value === "Headers"]
182
182
  ]),
183
- s(i(b, {
183
+ s(i(V, {
184
184
  id: t.value.Query,
185
185
  class: "request-section-content-query",
186
186
  envVariables: e.envVariables,
@@ -194,9 +194,9 @@ const _ = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
194
194
  title: "Query Parameters",
195
195
  workspace: e.workspace
196
196
  }, null, 8, ["id", "envVariables", "environment", "example", "invalidParams", "operation", "role", "workspace"]), [
197
- [m, a.value === "All" || a.value === "Query"]
197
+ [u, a.value === "All" || a.value === "Query"]
198
198
  ]),
199
- e.operation.method && (a.value === "All" || a.value === "Body") && r(k)(e.operation.method) ? (n(), p(z, {
199
+ e.operation.method && (a.value === "All" || a.value === "Body") && r(b)(e.operation.method) ? (n(), p(z, {
200
200
  key: 1,
201
201
  id: t.value.Body,
202
202
  class: "request-section-content-body",
@@ -207,22 +207,22 @@ const _ = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
207
207
  role: a.value === "All" ? "none" : "tabpanel",
208
208
  title: "Body",
209
209
  workspace: e.workspace
210
- }, null, 8, ["id", "envVariables", "environment", "example", "operation", "role", "workspace"])) : h("", !0),
211
- (n(!0), f(K, null, L(r(N), (u) => (n(), p(r(P), {
212
- key: u.component
210
+ }, null, 8, ["id", "envVariables", "environment", "example", "operation", "role", "workspace"])) : k("", !0),
211
+ (n(!0), f(K, null, L(r(I), (m) => (n(), p(r(S), {
212
+ key: m.component
213
213
  }, {
214
214
  default: c(() => [
215
- s((n(), p(Q(u.component), {
216
- "onUpdate:operation": I,
215
+ s((n(), p(Q(m.component), {
216
+ "onUpdate:operation": U,
217
217
  operation: e.operation
218
218
  }, null, 40, ["operation"])), [
219
- [m, a.value === "All" || a.value === u.title]
219
+ [u, a.value === "All" || a.value === m.title]
220
220
  ])
221
221
  ]),
222
222
  _: 2
223
223
  }, 1024))), 128)),
224
- l[1] || (l[1] = y("div", { class: "flex flex-grow" }, null, -1)),
225
- i(r(P), null, {
224
+ o[1] || (o[1] = h("div", { class: "flex flex-grow" }, null, -1)),
225
+ i(r(S), null, {
226
226
  default: c(() => [
227
227
  i(J, {
228
228
  class: "request-section-content-code-example -mt-1/2 border-t",
@@ -236,7 +236,7 @@ const _ = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
236
236
  ]),
237
237
  _: 1
238
238
  })
239
- ], 8, le)
239
+ ], 8, oe)
240
240
  ]),
241
241
  _: 1
242
242
  }, 8, ["aria-label"]));
@@ -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.0";
37
+ }, w = "2.5.2";
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.0",
21
+ "version": "2.5.2",
22
22
  "engines": {
23
23
  "node": ">=20"
24
24
  },
@@ -204,22 +204,22 @@
204
204
  "whatwg-mimetype": "^4.0.0",
205
205
  "yaml": "^2.4.5",
206
206
  "zod": "3.24.1",
207
- "@scalar/components": "0.14.3",
208
- "@scalar/icons": "0.4.2",
207
+ "@scalar/components": "0.14.5",
209
208
  "@scalar/draggable": "0.2.0",
210
- "@scalar/import": "0.4.4",
211
- "@scalar/oas-utils": "0.4.0",
209
+ "@scalar/oas-utils": "0.4.2",
210
+ "@scalar/import": "0.4.6",
212
211
  "@scalar/object-utils": "1.2.1",
213
- "@scalar/openapi-parser": "0.13.0",
212
+ "@scalar/openapi-parser": "0.14.0",
213
+ "@scalar/icons": "0.4.2",
214
214
  "@scalar/openapi-types": "0.3.1",
215
- "@scalar/postman-to-openapi": "0.3.3",
216
215
  "@scalar/snippetz": "0.3.0",
217
- "@scalar/themes": "0.13.0",
216
+ "@scalar/postman-to-openapi": "0.3.5",
218
217
  "@scalar/types": "0.2.1",
218
+ "@scalar/themes": "0.13.1",
219
219
  "@scalar/use-hooks": "0.2.2",
220
+ "@scalar/use-toasts": "0.8.0",
220
221
  "@scalar/use-tooltip": "1.1.0",
221
- "@scalar/use-codemirror": "0.12.4",
222
- "@scalar/use-toasts": "0.8.0"
222
+ "@scalar/use-codemirror": "0.12.6"
223
223
  },
224
224
  "devDependencies": {
225
225
  "@tailwindcss/vite": "^4.1.7",