@scalar/api-client 2.3.12 → 2.3.13
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 +17 -0
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +6 -0
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
- package/dist/components/Server/ServerDropdownItem.vue.d.ts.map +1 -1
- package/dist/components/Server/ServerDropdownItem.vue.js +1 -1
- package/dist/components/Server/ServerDropdownItem.vue2.js +25 -22
- package/dist/layouts/App/create-api-client-app.d.ts +154 -4
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/create-api-client-modal.d.ts +308 -8
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Web/create-api-client-web.d.ts +154 -4
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +154 -4
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/find-request.d.ts +15 -0
- package/dist/libs/find-request.d.ts.map +1 -1
- package/dist/libs/send-request/create-request-operation.test.d.ts +15 -0
- package/dist/libs/send-request/create-request-operation.test.d.ts.map +1 -1
- package/dist/store/active-entities.d.ts +15 -0
- package/dist/store/active-entities.d.ts.map +1 -1
- package/dist/store/requests.d.ts +169 -4
- package/dist/store/requests.d.ts.map +1 -1
- package/dist/store/store.d.ts +154 -4
- package/dist/store/store.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/views/Request/RequestSection/RequestCodeExample.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestCodeExample.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestCodeExample.vue2.js +122 -78
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +10 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestCodeExample.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestCodeExample.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestCodeExample.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestCodeExample.vue"],"names":[],"mappings":"AAwRA,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,cAAc,EACd,MAAM,EACP,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAcrE,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,cAAc,CAAA;IACvB,SAAS,EAAE,SAAS,CAAA;IACpB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;;AA2WF,wBAOG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./RequestCodeExample.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-fdb4baba"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarCombobox as
|
|
3
|
-
import { snippetz as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { filterSecurityRequirements as
|
|
8
|
-
import
|
|
9
|
-
import { useWorkspace as
|
|
10
|
-
const
|
|
1
|
+
import { defineComponent as H, computed as a, ref as U, openBlock as v, createElementBlock as j, createVNode as i, withCtx as c, createTextVNode as D, createElementVNode as x, unref as r, toDisplayString as N, createBlock as C } from "vue";
|
|
2
|
+
import { ScalarCombobox as R, ScalarButton as T, ScalarIcon as W, ScalarCodeBlock as q } from "@scalar/components";
|
|
3
|
+
import { snippetz as z } from "@scalar/snippetz";
|
|
4
|
+
import I from "../../../components/DataTable/DataTable.vue.js";
|
|
5
|
+
import O from "../../../components/DataTable/DataTableRow.vue.js";
|
|
6
|
+
import M from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
|
|
7
|
+
import { filterSecurityRequirements as P } from "./helpers/filter-security-requirements.js";
|
|
8
|
+
import A from "../../Components/CodeSnippet/CodeSnippet.vue.js";
|
|
9
|
+
import { useWorkspace as F } from "../../../store/store.js";
|
|
10
|
+
const G = { class: "w-full" }, J = { class: "-mx-1 flex flex-1" }, L = { class: "bg-b-1 flex items-center justify-center overflow-hidden border-t" }, ne = /* @__PURE__ */ H({
|
|
11
11
|
__name: "RequestCodeExample",
|
|
12
12
|
props: {
|
|
13
13
|
collection: {},
|
|
@@ -16,82 +16,120 @@ const D = { class: "w-full" }, E = { class: "-mx-1 flex flex-1" }, N = { class:
|
|
|
16
16
|
server: {},
|
|
17
17
|
workspace: {}
|
|
18
18
|
},
|
|
19
|
-
setup(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
setup(n) {
|
|
20
|
+
var b, K, S, h;
|
|
21
|
+
const { securitySchemes: k, workspaceMutators: w } = F(), f = a(() => {
|
|
22
|
+
var t, e, l;
|
|
23
|
+
return d.value.targetKey === "custom" && ((t = u.value) == null ? void 0 : t.some(
|
|
24
|
+
(o) => o.lang === d.value.clientKey
|
|
25
|
+
)) ? d.value : {
|
|
26
|
+
targetKey: ((e = n.workspace.selectedHttpClient) == null ? void 0 : e.targetKey) ?? "js",
|
|
27
|
+
clientKey: ((l = n.workspace.selectedHttpClient) == null ? void 0 : l.clientKey) ?? "fetch"
|
|
28
|
+
};
|
|
29
|
+
}), u = a(
|
|
30
|
+
() => n.operation["x-codeSamples"] || n.operation["x-code-samples"] || n.operation["x-custom-examples"]
|
|
31
|
+
), d = U(
|
|
32
|
+
(b = u.value) != null && b.length ? {
|
|
33
|
+
targetKey: "custom",
|
|
34
|
+
clientKey: (K = u.value[0]) == null ? void 0 : K.lang
|
|
35
|
+
} : {
|
|
36
|
+
targetKey: ((S = n.workspace.selectedHttpClient) == null ? void 0 : S.targetKey) ?? "js",
|
|
37
|
+
clientKey: ((h = n.workspace.selectedHttpClient) == null ? void 0 : h.clientKey) ?? "fetch"
|
|
38
|
+
}
|
|
39
|
+
), $ = a(
|
|
40
|
+
() => P(
|
|
41
|
+
n.operation.security || n.collection.security || [],
|
|
42
|
+
n.operation.selectedSecuritySchemeUids || n.collection.selectedSecuritySchemeUids,
|
|
43
|
+
k
|
|
25
44
|
)
|
|
26
|
-
),
|
|
27
|
-
const e = {
|
|
28
|
-
|
|
29
|
-
options:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
45
|
+
), y = a(() => {
|
|
46
|
+
const t = {}, e = z().clients().map((o) => ({
|
|
47
|
+
label: o.title,
|
|
48
|
+
options: o.clients.map((p) => (t[`${o.key},${p.client}`] = p.title, {
|
|
49
|
+
id: `${o.key},${p.client}`,
|
|
50
|
+
label: p.title
|
|
51
|
+
}))
|
|
52
|
+
})), l = (n.operation["x-codeSamples"] || n.operation["x-code-samples"] || n.operation["x-custom-examples"] || []).map((o) => ({
|
|
53
|
+
id: `custom,${o.lang}`,
|
|
54
|
+
label: o.label || o.lang
|
|
55
|
+
})), m = l.length > 0 ? [
|
|
56
|
+
{
|
|
57
|
+
id: "customExamples",
|
|
58
|
+
label: "Code Examples",
|
|
59
|
+
options: l.map((o) => ({
|
|
60
|
+
id: o.id,
|
|
61
|
+
label: o.label ?? o.id
|
|
34
62
|
}))
|
|
35
|
-
}
|
|
36
|
-
|
|
63
|
+
},
|
|
64
|
+
...e
|
|
65
|
+
] : e;
|
|
66
|
+
return l.forEach((o) => {
|
|
67
|
+
t[o.id] = o.label ?? o.id;
|
|
68
|
+
}), {
|
|
69
|
+
options: m,
|
|
70
|
+
dict: t
|
|
37
71
|
};
|
|
38
|
-
}),
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
return
|
|
43
|
-
id:
|
|
44
|
-
label: "
|
|
72
|
+
}), s = a(() => {
|
|
73
|
+
const t = f.value;
|
|
74
|
+
if (t.targetKey === "custom") {
|
|
75
|
+
const l = `custom,${t.clientKey}`;
|
|
76
|
+
return {
|
|
77
|
+
id: l,
|
|
78
|
+
label: y.value.dict[l] ?? "Unknown"
|
|
45
79
|
};
|
|
46
|
-
|
|
80
|
+
}
|
|
81
|
+
const e = `${t.targetKey},${t.clientKey}`;
|
|
47
82
|
return {
|
|
48
|
-
id:
|
|
49
|
-
label:
|
|
83
|
+
id: e,
|
|
84
|
+
label: y.value.dict[e] ?? "Unknown"
|
|
50
85
|
};
|
|
51
|
-
}),
|
|
52
|
-
() =>
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
(
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
86
|
+
}), E = a(
|
|
87
|
+
() => f.value.targetKey
|
|
88
|
+
), V = a(
|
|
89
|
+
() => f.value.clientKey
|
|
90
|
+
), B = ({ id: t }) => {
|
|
91
|
+
const [e, l] = t.split(",");
|
|
92
|
+
!e || !l || (d.value = {
|
|
93
|
+
targetKey: e,
|
|
94
|
+
clientKey: l
|
|
95
|
+
}, e !== "custom" && w.edit(n.workspace.uid, "selectedHttpClient", {
|
|
96
|
+
targetKey: e,
|
|
97
|
+
clientKey: l
|
|
98
|
+
}));
|
|
99
|
+
}, g = a(() => {
|
|
100
|
+
var l;
|
|
101
|
+
if (!s.value.id.startsWith("custom,"))
|
|
102
|
+
return;
|
|
103
|
+
const t = s.value.id.split(",")[1], e = (l = u.value) == null ? void 0 : l.find((m) => m.lang === t);
|
|
104
|
+
return e == null ? void 0 : e.source;
|
|
105
|
+
});
|
|
106
|
+
return (t, e) => (v(), j("div", G, [
|
|
107
|
+
i(M, {
|
|
70
108
|
class: "group/preview w-full border-b-0",
|
|
71
109
|
defaultOpen: !0
|
|
72
110
|
}, {
|
|
73
|
-
title: c(() =>
|
|
74
|
-
|
|
111
|
+
title: c(() => e[0] || (e[0] = [
|
|
112
|
+
D("Code Snippet")
|
|
75
113
|
])),
|
|
76
114
|
actions: c(() => [
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
modelValue:
|
|
80
|
-
options:
|
|
115
|
+
x("div", J, [
|
|
116
|
+
i(r(R), {
|
|
117
|
+
modelValue: s.value,
|
|
118
|
+
options: y.value.options,
|
|
81
119
|
placement: "bottom-end",
|
|
82
|
-
"onUpdate:modelValue":
|
|
120
|
+
"onUpdate:modelValue": B
|
|
83
121
|
}, {
|
|
84
122
|
default: c(() => [
|
|
85
|
-
|
|
123
|
+
i(r(T), {
|
|
86
124
|
class: "text-c-1 hover:bg-b-3 py-0.75 flex h-full w-fit gap-1.5 px-1.5 font-normal",
|
|
87
125
|
fullWidth: "",
|
|
88
126
|
variant: "ghost"
|
|
89
127
|
}, {
|
|
90
128
|
default: c(() => {
|
|
91
|
-
var
|
|
129
|
+
var l;
|
|
92
130
|
return [
|
|
93
|
-
|
|
94
|
-
|
|
131
|
+
x("span", null, N((l = s.value) == null ? void 0 : l.label), 1),
|
|
132
|
+
i(r(W), {
|
|
95
133
|
icon: "ChevronDown",
|
|
96
134
|
size: "md"
|
|
97
135
|
})
|
|
@@ -105,20 +143,26 @@ const D = { class: "w-full" }, E = { class: "-mx-1 flex flex-1" }, N = { class:
|
|
|
105
143
|
])
|
|
106
144
|
]),
|
|
107
145
|
default: c(() => [
|
|
108
|
-
|
|
146
|
+
i(I, { columns: [""] }, {
|
|
109
147
|
default: c(() => [
|
|
110
|
-
|
|
148
|
+
i(O, null, {
|
|
111
149
|
default: c(() => [
|
|
112
|
-
|
|
113
|
-
|
|
150
|
+
x("div", L, [
|
|
151
|
+
g.value ? (v(), C(r(q), {
|
|
152
|
+
key: 0,
|
|
153
|
+
class: "px-3 py-1.5",
|
|
154
|
+
content: g.value,
|
|
155
|
+
lang: s.value.id.split(",")[1] ?? "plaintext"
|
|
156
|
+
}, null, 8, ["content", "lang"])) : (v(), C(r(A), {
|
|
157
|
+
key: 1,
|
|
114
158
|
class: "px-3 py-1.5",
|
|
115
|
-
client:
|
|
116
|
-
example:
|
|
117
|
-
operation:
|
|
118
|
-
securitySchemes:
|
|
119
|
-
server:
|
|
120
|
-
target:
|
|
121
|
-
}, null, 8, ["client", "example", "operation", "securitySchemes", "server", "target"])
|
|
159
|
+
client: V.value,
|
|
160
|
+
example: t.example,
|
|
161
|
+
operation: t.operation,
|
|
162
|
+
securitySchemes: $.value,
|
|
163
|
+
server: t.server,
|
|
164
|
+
target: E.value
|
|
165
|
+
}, null, 8, ["client", "example", "operation", "securitySchemes", "server", "target"]))
|
|
122
166
|
])
|
|
123
167
|
]),
|
|
124
168
|
_: 1
|
|
@@ -133,5 +177,5 @@ const D = { class: "w-full" }, E = { class: "-mx-1 flex flex-1" }, N = { class:
|
|
|
133
177
|
}
|
|
134
178
|
});
|
|
135
179
|
export {
|
|
136
|
-
|
|
180
|
+
ne as default
|
|
137
181
|
};
|
|
@@ -37,7 +37,7 @@ const P = { class: "col-1 flex-center relative gap-6 p-2 capitalize" }, T = {
|
|
|
37
37
|
}));
|
|
38
38
|
}, y = (s) => {
|
|
39
39
|
s != null && s.createNew && w.name === "request" && k();
|
|
40
|
-
}, N = "2.3.
|
|
40
|
+
}, N = "2.3.13";
|
|
41
41
|
return B(() => r.hotKeys.on(y)), E(() => r.hotKeys.off(y)), (s, e) => (u(), i("div", P, [
|
|
42
42
|
o("div", {
|
|
43
43
|
class: q(["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.
|
|
21
|
+
"version": "2.3.13",
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": ">=18"
|
|
24
24
|
},
|
|
@@ -189,22 +189,22 @@
|
|
|
189
189
|
"whatwg-mimetype": "^4.0.0",
|
|
190
190
|
"yaml": "^2.4.5",
|
|
191
191
|
"zod": "^3.23.8",
|
|
192
|
-
"@scalar/components": "0.13.
|
|
192
|
+
"@scalar/components": "0.13.44",
|
|
193
193
|
"@scalar/draggable": "0.1.11",
|
|
194
|
-
"@scalar/import": "0.3.9",
|
|
195
194
|
"@scalar/icons": "0.1.3",
|
|
195
|
+
"@scalar/import": "0.3.10",
|
|
196
|
+
"@scalar/oas-utils": "0.2.127",
|
|
196
197
|
"@scalar/object-utils": "1.1.13",
|
|
197
198
|
"@scalar/openapi-parser": "0.10.14",
|
|
198
199
|
"@scalar/openapi-types": "0.2.0",
|
|
199
|
-
"@scalar/postman-to-openapi": "0.1.49",
|
|
200
|
-
"@scalar/oas-utils": "0.2.126",
|
|
201
200
|
"@scalar/snippetz": "0.2.19",
|
|
201
|
+
"@scalar/postman-to-openapi": "0.2.0",
|
|
202
202
|
"@scalar/themes": "0.9.84",
|
|
203
203
|
"@scalar/types": "0.1.6",
|
|
204
|
-
"@scalar/use-codemirror": "0.11.88",
|
|
205
204
|
"@scalar/use-toasts": "0.7.9",
|
|
206
|
-
"@scalar/use-
|
|
207
|
-
"@scalar/use-
|
|
205
|
+
"@scalar/use-tooltip": "1.0.6",
|
|
206
|
+
"@scalar/use-codemirror": "0.11.89",
|
|
207
|
+
"@scalar/use-hooks": "0.1.38"
|
|
208
208
|
},
|
|
209
209
|
"devDependencies": {
|
|
210
210
|
"@types/shell-quote": "^1.7.5",
|
|
@@ -219,8 +219,8 @@
|
|
|
219
219
|
"vite": "^5.4.10",
|
|
220
220
|
"vite-svg-loader": "^5.1.0",
|
|
221
221
|
"vitest": "^1.6.0",
|
|
222
|
-
"@scalar/
|
|
223
|
-
"@scalar/
|
|
222
|
+
"@scalar/galaxy": "0.3.1",
|
|
223
|
+
"@scalar/build-tooling": "0.1.17"
|
|
224
224
|
},
|
|
225
225
|
"scripts": {
|
|
226
226
|
"build": "scalar-build-vite",
|