@scalar/api-client 2.23.2 → 2.23.3
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.
- package/CHANGELOG.md +22 -0
- package/dist/style.css +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request-parameters.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request-parameters.js +54 -53
- package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.js +78 -78
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js +63 -51
- package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBody.vue.js +2 -2
- package/dist/v2/features/operation/Operation.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +12 -12
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { defineComponent as q, ref as x, watch as
|
|
1
|
+
import { defineComponent as q, ref as x, watch as g, computed as o, createBlock as s, openBlock as d, unref as n, normalizeClass as E, withCtx as m, createVNode as u, createCommentVNode as f, createElementBlock as R, Fragment as N, createElementVNode as h, toDisplayString as P } from "vue";
|
|
2
2
|
import { ScalarButton as C, ScalarIconButton as j, ScalarIcon as G } from "@scalar/components";
|
|
3
3
|
import { ScalarIconTrash as K, ScalarIconGlobe as O } from "@scalar/icons";
|
|
4
4
|
import { unpackProxyObject as B } from "@scalar/workspace-store/helpers/unpack-proxy";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { resolve as W } from "@scalar/workspace-store/resolve";
|
|
6
|
+
import { getFileName as A } from "../helpers/files.js";
|
|
7
|
+
import { validateParameter as H } from "../helpers/validate-parameter.js";
|
|
7
8
|
import D from "./RequestTableTooltip.vue.js";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
const
|
|
9
|
+
import J from "../../../components/data-table/DataTableRow.vue.js";
|
|
10
|
+
import L from "../../../components/data-table/DataTableCheckbox.vue.js";
|
|
11
|
+
import y from "../../../components/data-table/DataTableCell.vue.js";
|
|
12
|
+
import S from "../../../components/code-input/CodeInput.vue.js";
|
|
13
|
+
const M = { class: "text-c-2 filemask flex w-full max-w-[100%] items-center justify-center overflow-hidden p-1" }, Q = {
|
|
13
14
|
key: 1,
|
|
14
15
|
class: "p-0.5"
|
|
15
|
-
},
|
|
16
|
+
}, de = /* @__PURE__ */ q({
|
|
16
17
|
__name: "RequestTableRow",
|
|
17
18
|
props: {
|
|
18
19
|
data: {},
|
|
@@ -23,52 +24,63 @@ const L = { class: "text-c-2 filemask flex w-full max-w-[100%] items-center just
|
|
|
23
24
|
showUploadButton: { type: Boolean }
|
|
24
25
|
},
|
|
25
26
|
emits: ["upsertRow", "deleteRow", "uploadFile", "removeFile", "navigate"],
|
|
26
|
-
setup(e, { emit:
|
|
27
|
-
const r =
|
|
28
|
-
|
|
27
|
+
setup(e, { emit: F }) {
|
|
28
|
+
const r = F, c = x(e.data.name ?? ""), i = x(B(e.data.value) ?? ""), v = x(e.data.isDisabled ?? !1);
|
|
29
|
+
g(
|
|
29
30
|
() => e.data.name,
|
|
30
|
-
(
|
|
31
|
-
),
|
|
31
|
+
(t) => c.value = t ?? ""
|
|
32
|
+
), g(
|
|
32
33
|
() => e.data.value,
|
|
33
|
-
(
|
|
34
|
-
),
|
|
34
|
+
(t) => i.value = B(t) ?? ""
|
|
35
|
+
), g(
|
|
35
36
|
() => e.data.isDisabled,
|
|
36
|
-
(
|
|
37
|
+
(t) => v.value = t ?? !1
|
|
37
38
|
);
|
|
38
|
-
const k = o(() =>
|
|
39
|
-
() => (k.value ?
|
|
40
|
-
), z = o(() => e.data.schema?.default), I = o(() =>
|
|
39
|
+
const k = o(() => i.value instanceof File), w = o(
|
|
40
|
+
() => (k.value ? A(i.value) : i.value) ?? ""
|
|
41
|
+
), z = o(() => e.data.schema?.default), I = o(() => {
|
|
42
|
+
if (!e.data.schema)
|
|
43
|
+
return [];
|
|
44
|
+
if (e.data.schema.enum)
|
|
45
|
+
return e.data.schema.enum.map((t) => String(t));
|
|
46
|
+
if ("items" in e.data.schema) {
|
|
47
|
+
const t = W.schema(e.data.schema.items);
|
|
48
|
+
if (t?.enum)
|
|
49
|
+
return t.enum.map((a) => String(a));
|
|
50
|
+
}
|
|
51
|
+
return [];
|
|
52
|
+
}), T = o(
|
|
41
53
|
() => e.data.schema && "minimum" in e.data.schema ? e.data.schema.minimum : void 0
|
|
42
54
|
), $ = o(
|
|
43
55
|
() => e.data.schema && "maximum" in e.data.schema ? e.data.schema.maximum : void 0
|
|
44
56
|
), U = o(
|
|
45
57
|
() => e.data.schema && "type" in e.data.schema ? e.data.schema.type : void 0
|
|
46
58
|
), V = o(
|
|
47
|
-
() =>
|
|
48
|
-
), b = (
|
|
49
|
-
|
|
59
|
+
() => H(e.data.schema, i.value)
|
|
60
|
+
), b = (t) => {
|
|
61
|
+
t.name !== void 0 && (c.value = t.name), t.value !== void 0 && (i.value = t.value), v.value = t.isDisabled ?? !1, r("upsertRow", {
|
|
50
62
|
name: c.value,
|
|
51
|
-
value:
|
|
63
|
+
value: i.value,
|
|
52
64
|
isDisabled: v.value
|
|
53
65
|
});
|
|
54
66
|
};
|
|
55
|
-
return (
|
|
67
|
+
return (t, a) => (d(), s(n(J), {
|
|
56
68
|
id: e.data.name,
|
|
57
69
|
class: E({
|
|
58
70
|
alert: V.value.ok === !1,
|
|
59
71
|
error: V.value.ok === !1 && e.invalidParams?.has(e.data.name)
|
|
60
72
|
})
|
|
61
73
|
}, {
|
|
62
|
-
default:
|
|
63
|
-
u(
|
|
74
|
+
default: m(() => [
|
|
75
|
+
u(n(L), {
|
|
64
76
|
class: "!border-r",
|
|
65
77
|
disabled: e.hasCheckboxDisabled ?? !1,
|
|
66
78
|
modelValue: !v.value,
|
|
67
79
|
"onUpdate:modelValue": a[0] || (a[0] = (l) => b({ isDisabled: !l }))
|
|
68
80
|
}, null, 8, ["disabled", "modelValue"]),
|
|
69
|
-
u(
|
|
70
|
-
default:
|
|
71
|
-
u(
|
|
81
|
+
u(n(y), null, {
|
|
82
|
+
default: m(() => [
|
|
83
|
+
u(n(S), {
|
|
72
84
|
"aria-label": `${e.label} Key`,
|
|
73
85
|
disableCloseBrackets: "",
|
|
74
86
|
disabled: e.data.isReadonly,
|
|
@@ -85,9 +97,9 @@ const L = { class: "text-c-2 filemask flex w-full max-w-[100%] items-center just
|
|
|
85
97
|
]),
|
|
86
98
|
_: 1
|
|
87
99
|
}),
|
|
88
|
-
u(
|
|
89
|
-
default:
|
|
90
|
-
u(
|
|
100
|
+
u(n(y), null, {
|
|
101
|
+
default: m(() => [
|
|
102
|
+
u(n(S), {
|
|
91
103
|
"aria-label": `${e.label} Value`,
|
|
92
104
|
class: "pr-6 group-hover:pr-10 group-has-[.cm-focused]:pr-10",
|
|
93
105
|
default: z.value,
|
|
@@ -95,7 +107,7 @@ const L = { class: "text-c-2 filemask flex w-full max-w-[100%] items-center just
|
|
|
95
107
|
disabled: e.data.isReadonly,
|
|
96
108
|
disableEnter: "",
|
|
97
109
|
disableTabIndent: "",
|
|
98
|
-
enum: I.value
|
|
110
|
+
enum: I.value,
|
|
99
111
|
environment: e.environment,
|
|
100
112
|
examples: e.data.schema?.examples?.map((l) => String(l)) ?? [],
|
|
101
113
|
linethrough: e.data.isOverridden,
|
|
@@ -107,38 +119,38 @@ const L = { class: "text-c-2 filemask flex w-full max-w-[100%] items-center just
|
|
|
107
119
|
type: U.value,
|
|
108
120
|
"onUpdate:modelValue": a[5] || (a[5] = (l) => b({ value: l }))
|
|
109
121
|
}, {
|
|
110
|
-
icon:
|
|
111
|
-
(e.data.name ||
|
|
122
|
+
icon: m(() => [
|
|
123
|
+
(e.data.name || i.value) && !e.data.isRequired && e.data.isReadonly !== !0 ? (d(), s(n(C), {
|
|
112
124
|
key: 0,
|
|
113
125
|
class: "text-c-2 hover:text-c-1 hover:bg-b-2 z-context -mr-0.5 hidden h-fit rounded p-1 group-hover:flex group-has-[.cm-focused]:flex",
|
|
114
126
|
size: "sm",
|
|
115
127
|
variant: "ghost",
|
|
116
128
|
onClick: a[3] || (a[3] = (l) => r("deleteRow"))
|
|
117
129
|
}, {
|
|
118
|
-
default:
|
|
119
|
-
u(
|
|
130
|
+
default: m(() => [
|
|
131
|
+
u(n(K), { class: "size-3.5" })
|
|
120
132
|
]),
|
|
121
133
|
_: 1
|
|
122
134
|
})) : f("", !0),
|
|
123
|
-
e.data.globalRoute !== void 0 ? (d(),
|
|
135
|
+
e.data.globalRoute !== void 0 ? (d(), s(n(j), {
|
|
124
136
|
key: 1,
|
|
125
137
|
class: "text-c-2 hover:text-c-1 hover:bg-b-2 z-context -mr-0.5 h-fit",
|
|
126
|
-
icon:
|
|
138
|
+
icon: n(O),
|
|
127
139
|
label: "Global cookies are shared across the whole workspace. Click to navigate.",
|
|
128
140
|
size: "xs",
|
|
129
141
|
tooltip: "top",
|
|
130
142
|
variant: "ghost",
|
|
131
143
|
onClick: a[4] || (a[4] = (l) => r("navigate", e.data.globalRoute))
|
|
132
144
|
}, null, 8, ["icon"])) : f("", !0),
|
|
133
|
-
e.data.isReadonly ? (d(),
|
|
145
|
+
e.data.isReadonly ? (d(), s(D, {
|
|
134
146
|
key: 2,
|
|
135
147
|
description: "This is a readonly property and you can not modify it! If you want to change it you have to override it or disable it using the checkbox",
|
|
136
148
|
value: null
|
|
137
|
-
})) : e.data.schema ? (d(),
|
|
149
|
+
})) : e.data.schema ? (d(), s(D, {
|
|
138
150
|
key: 3,
|
|
139
151
|
description: e.data.description,
|
|
140
152
|
schema: e.data.schema,
|
|
141
|
-
value:
|
|
153
|
+
value: i.value
|
|
142
154
|
}, null, 8, ["description", "schema", "value"])) : f("", !0)
|
|
143
155
|
]),
|
|
144
156
|
_: 1
|
|
@@ -146,13 +158,13 @@ const L = { class: "text-c-2 filemask flex w-full max-w-[100%] items-center just
|
|
|
146
158
|
]),
|
|
147
159
|
_: 1
|
|
148
160
|
}),
|
|
149
|
-
e.showUploadButton ? (d(),
|
|
161
|
+
e.showUploadButton ? (d(), s(n(y), {
|
|
150
162
|
key: 0,
|
|
151
163
|
class: "group/upload flex items-center justify-center whitespace-nowrap"
|
|
152
164
|
}, {
|
|
153
|
-
default:
|
|
165
|
+
default: m(() => [
|
|
154
166
|
k.value ? (d(), R(N, { key: 0 }, [
|
|
155
|
-
h("div",
|
|
167
|
+
h("div", M, [
|
|
156
168
|
h("span", null, P(w.value), 1)
|
|
157
169
|
]),
|
|
158
170
|
h("button", {
|
|
@@ -160,16 +172,16 @@ const L = { class: "text-c-2 filemask flex w-full max-w-[100%] items-center just
|
|
|
160
172
|
type: "button",
|
|
161
173
|
onClick: a[6] || (a[6] = (l) => r("removeFile"))
|
|
162
174
|
}, " Delete ")
|
|
163
|
-
], 64)) : (d(), R("div",
|
|
164
|
-
u(
|
|
175
|
+
], 64)) : (d(), R("div", Q, [
|
|
176
|
+
u(n(C), {
|
|
165
177
|
class: "bg-b-2 hover:bg-b-3 text-c-2 h-fit border-0 py-px shadow-none",
|
|
166
178
|
size: "sm",
|
|
167
179
|
variant: "outlined",
|
|
168
180
|
onClick: a[7] || (a[7] = (l) => r("uploadFile"))
|
|
169
181
|
}, {
|
|
170
|
-
default:
|
|
182
|
+
default: m(() => [
|
|
171
183
|
a[8] || (a[8] = h("span", null, "Select File", -1)),
|
|
172
|
-
u(
|
|
184
|
+
u(n(G), {
|
|
173
185
|
class: "ml-1",
|
|
174
186
|
icon: "Upload",
|
|
175
187
|
size: "xs",
|
|
@@ -188,5 +200,5 @@ const L = { class: "text-c-2 filemask flex w-full max-w-[100%] items-center just
|
|
|
188
200
|
}
|
|
189
201
|
});
|
|
190
202
|
export {
|
|
191
|
-
|
|
203
|
+
de as default
|
|
192
204
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { canMethodHaveBody as p } from "@scalar/helpers/http/can-method-have-body";
|
|
2
2
|
import { getResolvedRef as n } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
3
3
|
import { isElectron as u } from "../../../../libs/electron.js";
|
|
4
|
-
const i = "2.23.
|
|
4
|
+
const i = "2.23.3", m = "application/json", h = "*/*", c = (r, t, o) => ({
|
|
5
5
|
name: r,
|
|
6
6
|
defaultValue: t,
|
|
7
7
|
isOverridden: o.has(r.toLowerCase())
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./ResponseBody.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const s = /* @__PURE__ */ t(o, [["__scopeId", "data-v-8ae4f555"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
s as default
|
|
7
7
|
};
|
|
@@ -33,7 +33,7 @@ const W = { class: "flex-center relative flex flex-1 flex-col gap-6 p-2 capitali
|
|
|
33
33
|
}));
|
|
34
34
|
}, f = (u) => {
|
|
35
35
|
u?.createNew && g.name === "request" && p();
|
|
36
|
-
}, v = "2.23.
|
|
36
|
+
}, v = "2.23.3";
|
|
37
37
|
return q(() => a.hotKeys.on(f)), R(() => a.hotKeys.off(f)), (u, e) => (l(), n("div", W, [
|
|
38
38
|
s("div", {
|
|
39
39
|
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.23.
|
|
21
|
+
"version": "2.23.3",
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": ">=20"
|
|
24
24
|
},
|
|
@@ -326,26 +326,26 @@
|
|
|
326
326
|
"whatwg-mimetype": "4.0.0",
|
|
327
327
|
"yaml": "^2.8.0",
|
|
328
328
|
"zod": "^4.3.5",
|
|
329
|
-
"@scalar/analytics-client": "1.0.1",
|
|
330
|
-
"@scalar/components": "0.17.3",
|
|
331
329
|
"@scalar/draggable": "0.3.0",
|
|
332
|
-
"@scalar/
|
|
330
|
+
"@scalar/components": "0.17.4",
|
|
331
|
+
"@scalar/analytics-client": "1.0.1",
|
|
333
332
|
"@scalar/icons": "0.5.2",
|
|
334
333
|
"@scalar/import": "0.4.48",
|
|
335
334
|
"@scalar/json-magic": "0.9.6",
|
|
336
|
-
"@scalar/
|
|
335
|
+
"@scalar/helpers": "0.2.11",
|
|
336
|
+
"@scalar/oas-utils": "0.6.34",
|
|
337
|
+
"@scalar/object-utils": "1.2.25",
|
|
337
338
|
"@scalar/openapi-parser": "0.24.7",
|
|
338
|
-
"@scalar/
|
|
339
|
+
"@scalar/sidebar": "0.7.27",
|
|
339
340
|
"@scalar/openapi-types": "0.5.3",
|
|
340
|
-
"@scalar/object-utils": "1.2.25",
|
|
341
|
-
"@scalar/sidebar": "0.7.26",
|
|
342
341
|
"@scalar/snippetz": "0.6.11",
|
|
342
|
+
"@scalar/postman-to-openapi": "0.4.3",
|
|
343
343
|
"@scalar/themes": "0.14.0",
|
|
344
344
|
"@scalar/types": "0.6.2",
|
|
345
|
-
"@scalar/use-codemirror": "0.13.30",
|
|
346
345
|
"@scalar/use-hooks": "0.3.7",
|
|
346
|
+
"@scalar/use-codemirror": "0.13.31",
|
|
347
347
|
"@scalar/use-toasts": "0.9.1",
|
|
348
|
-
"@scalar/workspace-store": "0.28.
|
|
348
|
+
"@scalar/workspace-store": "0.28.3"
|
|
349
349
|
},
|
|
350
350
|
"devDependencies": {
|
|
351
351
|
"@tailwindcss/vite": "^4.1.18",
|
|
@@ -360,8 +360,8 @@
|
|
|
360
360
|
"vite": "^7.3.1",
|
|
361
361
|
"vite-svg-loader": "5.1.0",
|
|
362
362
|
"vitest": "4.0.16",
|
|
363
|
-
"@scalar/
|
|
364
|
-
"@scalar/
|
|
363
|
+
"@scalar/galaxy": "0.5.12",
|
|
364
|
+
"@scalar/build-tooling": "0.4.1"
|
|
365
365
|
},
|
|
366
366
|
"scripts": {
|
|
367
367
|
"build": "scalar-build-vite",
|