@scalar/api-client 2.6.1 → 2.7.0
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 +42 -0
- package/dist/analytics.d.ts +2 -18
- package/dist/analytics.d.ts.map +1 -1
- package/dist/components/CodeInput/CodeInput.vue.d.ts +1 -1
- package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +66 -42
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue.d.ts +2 -2
- package/dist/hooks/useAnalytics.d.ts +2 -18
- package/dist/hooks/useAnalytics.d.ts.map +1 -1
- package/dist/hooks/useClientConfig.d.ts +112 -112
- package/dist/hooks/useClientConfig.d.ts.map +1 -1
- package/dist/layouts/App/create-api-client-app.d.ts +1378 -1306
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/create-api-client-modal.d.ts +2752 -2608
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Web/create-api-client-web.d.ts +1378 -1306
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +1378 -1306
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/find-request.d.ts +17 -17
- package/dist/libs/find-request.d.ts.map +1 -1
- package/dist/libs/hot-keys.d.ts +1 -1
- package/dist/libs/local-storage.d.ts.map +1 -1
- package/dist/libs/send-request/build-request-security.d.ts +1 -1
- package/dist/libs/send-request/create-fetch-body.d.ts +1 -1
- package/dist/libs/send-request/create-request-operation.test.d.ts +82 -82
- package/dist/libs/send-request/create-request-operation.test.d.ts.map +1 -1
- package/dist/plugins/plugin-manager.d.ts +1 -1
- package/dist/store/active-entities.d.ts +118 -118
- package/dist/store/active-entities.d.ts.map +1 -1
- package/dist/store/collections.d.ts +127 -127
- package/dist/store/collections.d.ts.map +1 -1
- package/dist/store/cookies.d.ts +14 -14
- package/dist/store/environment.d.ts +23 -23
- package/dist/store/request-example.d.ts +546 -546
- package/dist/store/request-example.d.ts.map +1 -1
- package/dist/store/requests.d.ts +194 -194
- package/dist/store/requests.d.ts.map +1 -1
- package/dist/store/security-schemes.d.ts +281 -281
- package/dist/store/security-schemes.d.ts.map +1 -1
- package/dist/store/servers.d.ts +45 -45
- package/dist/store/servers.d.ts.map +1 -1
- package/dist/store/store.d.ts +1378 -1306
- package/dist/store/store.d.ts.map +1 -1
- package/dist/store/store.js +18 -18
- package/dist/store/tags.d.ts +35 -35
- package/dist/store/tags.d.ts.map +1 -1
- package/dist/store/workspace.d.ts +47 -47
- package/dist/store/workspace.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/v2/blocks/operation-code-sample/components/HttpMethod.test.d.ts +2 -0
- package/dist/v2/blocks/operation-code-sample/components/HttpMethod.test.d.ts.map +1 -0
- package/dist/v2/blocks/operation-code-sample/components/HttpMethod.vue.d.ts +25 -0
- package/dist/v2/blocks/operation-code-sample/components/HttpMethod.vue.d.ts.map +1 -0
- package/dist/v2/blocks/operation-code-sample/components/HttpMethod.vue.js +30 -0
- package/dist/v2/blocks/operation-code-sample/components/HttpMethod.vue2.js +4 -0
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js +3 -3
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue2.js +102 -95
- package/dist/v2/blocks/operation-code-sample/helpers/find-client.js +16 -14
- package/dist/v2/blocks/operation-code-sample/helpers/generate-client-options.js +31 -2
- package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.d.ts +6 -1
- 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 +198 -131
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.bench.d.ts +2 -0
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.bench.d.ts.map +1 -0
- package/dist/v2/blocks/operation-code-sample/index.d.ts +4 -1
- package/dist/v2/blocks/operation-code-sample/index.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/index.js +10 -4
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts +2 -6
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts +54 -54
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts +54 -54
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/dist/views/Request/libs/auth.d.ts +2 -2
- package/dist/views/Request/libs/watch-mode.d.ts +4 -4
- package/dist/views/Request/libs/watch-mode.d.ts.map +1 -1
- package/dist/views/Request/libs/watch-mode.js +241 -186
- package/package.json +25 -20
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { isDefined as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { isDefined as v } from "@scalar/helpers/array/is-defined";
|
|
2
|
+
import { getRaw as S } from "@scalar/json-magic/magic-proxy";
|
|
3
|
+
import { getResolvedRef as m } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
4
|
+
import { unpackOverridesProxy as N } from "@scalar/workspace-store/helpers/overrides-proxy";
|
|
5
|
+
const T = 10, j = 10, D = "propertyName*", A = (/* @__PURE__ */ new Date()).toISOString(), q = A.split("T")[0], k = A.split("T")[1].split(".")[0], I = {
|
|
6
|
+
"date-time": A,
|
|
7
|
+
date: q,
|
|
6
8
|
email: "hello@example.com",
|
|
7
9
|
hostname: "example.com",
|
|
8
10
|
// https://tools.ietf.org/html/rfc6531#section-3.3
|
|
@@ -20,190 +22,255 @@ const N = 10, A = 10, E = "propertyName*", O = (/* @__PURE__ */ new Date()).toIS
|
|
|
20
22
|
// https://tools.ietf.org/html/draft-handrews-relative-json-pointer-01
|
|
21
23
|
"relative-json-pointer": "1/nested/objects",
|
|
22
24
|
// full-time in https://tools.ietf.org/html/rfc3339#section-5.6
|
|
23
|
-
time:
|
|
25
|
+
time: k,
|
|
24
26
|
// either a URI or relative-reference https://tools.ietf.org/html/rfc3986#section-4.1
|
|
25
27
|
"uri-reference": "../folder",
|
|
26
28
|
"uri-template": "https://example.com/{id}",
|
|
27
29
|
uri: "https://example.com",
|
|
28
30
|
uuid: "123e4567-e89b-12d3-a456-426614174000",
|
|
29
31
|
"object-id": "6592008029c8c3e4dc76256c"
|
|
30
|
-
},
|
|
31
|
-
if (!
|
|
32
|
+
}, E = (e, r = !1, l = "") => "type" in e && e.type === "string" && "format" in e && e.format === "binary" ? new File([""], "filename") : r && "format" in e && e.format ? I[e.format] ?? l : l, O = /* @__PURE__ */ new WeakMap(), P = /* @__PURE__ */ new WeakMap(), M = (e) => {
|
|
33
|
+
if (!e)
|
|
32
34
|
return;
|
|
33
|
-
const r =
|
|
35
|
+
const r = P.get(e);
|
|
34
36
|
if (r)
|
|
35
37
|
return r;
|
|
36
|
-
if ("required" in
|
|
37
|
-
const
|
|
38
|
-
if (Array.isArray(
|
|
39
|
-
const
|
|
40
|
-
return
|
|
38
|
+
if ("required" in e) {
|
|
39
|
+
const l = e.required;
|
|
40
|
+
if (Array.isArray(l) && l.length > 0) {
|
|
41
|
+
const a = new Set(l);
|
|
42
|
+
return P.set(e, a), a;
|
|
41
43
|
}
|
|
42
44
|
}
|
|
43
|
-
},
|
|
44
|
-
if (
|
|
45
|
+
}, d = (e, r) => (typeof r != "object" || r === null || O.set(S(N(e)), r), r), _ = (e) => !!(e.allOf || e.oneOf || e.anyOf), C = (e, r, l, a) => {
|
|
46
|
+
if (a?.omitEmptyAndOptionalProperties !== !0 || "type" in e && (e.type === "object" || e.type === "array") || _(e) || "examples" in e && Array.isArray(e.examples) && e.examples.length > 0 || "example" in e && e.example !== void 0 || "default" in e && e.default !== void 0 || "const" in e && e.const !== void 0 || "enum" in e && Array.isArray(e.enum) && e.enum.length > 0)
|
|
45
47
|
return !1;
|
|
46
|
-
const
|
|
47
|
-
return !(
|
|
48
|
-
},
|
|
49
|
-
const
|
|
50
|
-
if ("properties" in
|
|
51
|
-
const
|
|
52
|
-
for (let
|
|
53
|
-
const
|
|
54
|
-
if (!
|
|
48
|
+
const o = l ?? e.title ?? "", i = M(r);
|
|
49
|
+
return !(i ? i.has(o) : !1);
|
|
50
|
+
}, R = (e, r) => Array.isArray(e) && Array.isArray(r) ? [...e, ...r] : e && typeof e == "object" && r && typeof r == "object" ? { ...e, ...r } : r, F = (e, r, l, a) => {
|
|
51
|
+
const n = {};
|
|
52
|
+
if ("properties" in e && e.properties) {
|
|
53
|
+
const o = Object.keys(e.properties), i = l > 3 ? Math.min(j, o.length) : o.length;
|
|
54
|
+
for (let t = 0; t < i; t++) {
|
|
55
|
+
const p = o[t], u = m(e.properties[p]);
|
|
56
|
+
if (!u)
|
|
55
57
|
continue;
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
+
const c = r?.xml && "xml" in u ? u.xml?.name : void 0, y = s(u, r, {
|
|
59
|
+
level: l + 1,
|
|
60
|
+
parentSchema: e,
|
|
61
|
+
name: p,
|
|
62
|
+
seen: a
|
|
63
|
+
});
|
|
64
|
+
typeof y < "u" && (n[c ?? p] = y);
|
|
58
65
|
}
|
|
59
|
-
|
|
66
|
+
l > 3 && o.length > j && (n["..."] = "[Additional Properties Truncated]");
|
|
60
67
|
}
|
|
61
|
-
if ("patternProperties" in
|
|
62
|
-
for (const
|
|
63
|
-
const
|
|
64
|
-
|
|
68
|
+
if ("patternProperties" in e && e.patternProperties)
|
|
69
|
+
for (const o of Object.keys(e.patternProperties)) {
|
|
70
|
+
const i = m(e.patternProperties[o]);
|
|
71
|
+
i && (n[o] = s(i, r, {
|
|
72
|
+
level: l + 1,
|
|
73
|
+
parentSchema: e,
|
|
74
|
+
name: o,
|
|
75
|
+
seen: a
|
|
76
|
+
}));
|
|
65
77
|
}
|
|
66
|
-
if ("additionalProperties" in
|
|
67
|
-
const
|
|
68
|
-
|
|
78
|
+
if ("additionalProperties" in e && e.additionalProperties !== void 0) {
|
|
79
|
+
const o = m(e.additionalProperties), i = e.additionalProperties === !0 || typeof e.additionalProperties == "object" && Object.keys(e.additionalProperties).length === 0, t = typeof o == "object" && "x-additionalPropertiesName" in o && typeof o["x-additionalPropertiesName"] == "string" && o["x-additionalPropertiesName"].trim().length > 0 ? `${o["x-additionalPropertiesName"].trim()}*` : D;
|
|
80
|
+
n[t] = i ? "anything" : typeof o == "object" ? s(o, r, {
|
|
81
|
+
level: l + 1,
|
|
82
|
+
seen: a
|
|
83
|
+
}) : "anything";
|
|
69
84
|
}
|
|
70
|
-
if (
|
|
71
|
-
Object.assign(
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
85
|
+
if (e.oneOf?.[0])
|
|
86
|
+
Object.assign(
|
|
87
|
+
n,
|
|
88
|
+
s(m(e.oneOf[0]), r, {
|
|
89
|
+
level: l + 1,
|
|
90
|
+
seen: a
|
|
91
|
+
})
|
|
92
|
+
);
|
|
93
|
+
else if (e.anyOf?.[0])
|
|
94
|
+
Object.assign(
|
|
95
|
+
n,
|
|
96
|
+
s(m(e.anyOf[0]), r, {
|
|
97
|
+
level: l + 1,
|
|
98
|
+
seen: a
|
|
99
|
+
})
|
|
100
|
+
);
|
|
101
|
+
else if (Array.isArray(e.allOf) && e.allOf.length > 0) {
|
|
102
|
+
let o = n;
|
|
103
|
+
for (const i of e.allOf) {
|
|
104
|
+
const t = s(m(i), r, {
|
|
105
|
+
level: l + 1,
|
|
106
|
+
parentSchema: e,
|
|
107
|
+
seen: a
|
|
108
|
+
});
|
|
109
|
+
o = R(o, t);
|
|
79
110
|
}
|
|
80
|
-
|
|
111
|
+
o && typeof o == "object" && Object.assign(n, o);
|
|
81
112
|
}
|
|
82
|
-
if (r?.xml && "xml" in
|
|
83
|
-
const
|
|
84
|
-
return
|
|
113
|
+
if (r?.xml && "xml" in e && e.xml?.name && l === 0) {
|
|
114
|
+
const o = {};
|
|
115
|
+
return o[e.xml.name] = n, d(e, o);
|
|
85
116
|
}
|
|
86
|
-
return
|
|
87
|
-
},
|
|
88
|
-
const
|
|
89
|
-
if (
|
|
90
|
-
return
|
|
91
|
-
if (
|
|
92
|
-
if (Array.isArray(
|
|
93
|
-
const
|
|
94
|
-
if (
|
|
95
|
-
const
|
|
96
|
-
|
|
117
|
+
return d(e, n);
|
|
118
|
+
}, L = (e, r, l, a) => {
|
|
119
|
+
const n = "items" in e ? m(e.items) : void 0, o = n && typeof n == "object" && "xml" in n ? n.xml?.name : void 0, i = !!(r?.xml && "xml" in e && e.xml?.wrapped && o);
|
|
120
|
+
if (e.example !== void 0)
|
|
121
|
+
return d(e, i ? { [o]: e.example } : e.example);
|
|
122
|
+
if (n && typeof n == "object") {
|
|
123
|
+
if (Array.isArray(n.allOf) && n.allOf.length > 0) {
|
|
124
|
+
const c = n.allOf.filter(v), y = m(c[0]);
|
|
125
|
+
if (y && typeof y == "object" && "type" in y && y.type === "object") {
|
|
126
|
+
const x = s({ type: "object", allOf: c }, r, {
|
|
127
|
+
level: l + 1,
|
|
128
|
+
parentSchema: e,
|
|
129
|
+
seen: a
|
|
130
|
+
});
|
|
131
|
+
return d(e, i ? [{ [o]: x }] : [x]);
|
|
97
132
|
}
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
133
|
+
const g = c.map(
|
|
134
|
+
(f) => s(m(f), r, {
|
|
135
|
+
level: l + 1,
|
|
136
|
+
parentSchema: e,
|
|
137
|
+
seen: a
|
|
138
|
+
})
|
|
139
|
+
).filter(v);
|
|
140
|
+
return d(
|
|
141
|
+
e,
|
|
142
|
+
i ? g.map((f) => ({ [o]: f })) : g
|
|
102
143
|
);
|
|
103
144
|
}
|
|
104
|
-
const
|
|
105
|
-
if (
|
|
106
|
-
const
|
|
107
|
-
|
|
145
|
+
const u = n.anyOf || n.oneOf;
|
|
146
|
+
if (u && u.length > 0) {
|
|
147
|
+
const c = u[0], y = s(m(c), r, {
|
|
148
|
+
level: l + 1,
|
|
149
|
+
parentSchema: e,
|
|
150
|
+
seen: a
|
|
151
|
+
});
|
|
152
|
+
return d(e, i ? [{ [o]: y }] : [y]);
|
|
108
153
|
}
|
|
109
154
|
}
|
|
110
|
-
const
|
|
111
|
-
if (
|
|
112
|
-
const
|
|
113
|
-
|
|
155
|
+
const t = n && typeof n == "object" && ("type" in n && n.type === "object" || "properties" in n), p = n && typeof n == "object" && ("type" in n && n.type === "array" || "items" in n);
|
|
156
|
+
if (n && typeof n == "object" && ("type" in n && n.type || t || p)) {
|
|
157
|
+
const u = s(n, r, {
|
|
158
|
+
level: l + 1,
|
|
159
|
+
seen: a
|
|
160
|
+
});
|
|
161
|
+
return d(e, i ? [{ [o]: u }] : [u]);
|
|
114
162
|
}
|
|
115
|
-
return
|
|
116
|
-
},
|
|
117
|
-
if ("type" in
|
|
118
|
-
switch (
|
|
163
|
+
return d(e, []);
|
|
164
|
+
}, X = (e, r, l) => {
|
|
165
|
+
if ("type" in e && e.type && !Array.isArray(e.type))
|
|
166
|
+
switch (e.type) {
|
|
119
167
|
case "string":
|
|
120
|
-
return
|
|
168
|
+
return E(e, r, l ?? "");
|
|
121
169
|
case "boolean":
|
|
122
170
|
return !0;
|
|
123
171
|
case "integer":
|
|
124
|
-
return "minimum" in
|
|
172
|
+
return "minimum" in e && typeof e.minimum == "number" ? e.minimum : 1;
|
|
125
173
|
case "number":
|
|
126
|
-
return "minimum" in
|
|
174
|
+
return "minimum" in e && typeof e.minimum == "number" ? e.minimum : 1;
|
|
127
175
|
case "array":
|
|
128
176
|
return [];
|
|
129
177
|
default:
|
|
130
178
|
return;
|
|
131
179
|
}
|
|
132
|
-
},
|
|
133
|
-
if ("type" in
|
|
134
|
-
if (
|
|
180
|
+
}, U = (e, r, l) => {
|
|
181
|
+
if ("type" in e && Array.isArray(e.type)) {
|
|
182
|
+
if (e.type.includes("null"))
|
|
135
183
|
return null;
|
|
136
|
-
const
|
|
137
|
-
if (
|
|
138
|
-
switch (
|
|
184
|
+
const a = e.type[0];
|
|
185
|
+
if (a)
|
|
186
|
+
switch (a) {
|
|
139
187
|
case "string":
|
|
140
|
-
return
|
|
188
|
+
return E(e, r, l ?? "");
|
|
141
189
|
case "boolean":
|
|
142
190
|
return !0;
|
|
143
191
|
case "integer":
|
|
144
|
-
return "minimum" in
|
|
192
|
+
return "minimum" in e && typeof e.minimum == "number" ? e.minimum : 1;
|
|
145
193
|
case "number":
|
|
146
|
-
return "minimum" in
|
|
194
|
+
return "minimum" in e && typeof e.minimum == "number" ? e.minimum : 1;
|
|
147
195
|
case "null":
|
|
148
196
|
return null;
|
|
149
197
|
default:
|
|
150
198
|
return;
|
|
151
199
|
}
|
|
152
200
|
}
|
|
153
|
-
},
|
|
154
|
-
const
|
|
155
|
-
if (!
|
|
201
|
+
}, s = (e, r, l) => {
|
|
202
|
+
const { level: a = 0, parentSchema: n, name: o, seen: i = /* @__PURE__ */ new WeakSet() } = l ?? {}, t = m(e);
|
|
203
|
+
if (!v(t))
|
|
156
204
|
return;
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
205
|
+
const p = S(N(t));
|
|
206
|
+
if (i.has(p))
|
|
207
|
+
return "[Circular Reference]";
|
|
208
|
+
if (i.add(p), O.has(p))
|
|
209
|
+
return i.delete(p), O.get(p);
|
|
210
|
+
if (a > T)
|
|
211
|
+
return i.delete(p), "[Max Depth Exceeded]";
|
|
161
212
|
const u = !!r?.emptyString;
|
|
162
|
-
if (
|
|
213
|
+
if (t.deprecated || r?.mode === "write" && t.readOnly || r?.mode === "read" && t.writeOnly || C(t, n, o, r)) {
|
|
214
|
+
i.delete(p);
|
|
163
215
|
return;
|
|
164
|
-
|
|
165
|
-
|
|
216
|
+
}
|
|
217
|
+
if ("x-variable" in t && t["x-variable"]) {
|
|
218
|
+
const f = r?.variables?.[t["x-variable"]];
|
|
166
219
|
if (f !== void 0)
|
|
167
|
-
return "type" in
|
|
220
|
+
return "type" in t && (t.type === "number" || t.type === "integer") ? (i.delete(p), d(t, Number(f))) : (i.delete(p), d(t, f));
|
|
168
221
|
}
|
|
169
|
-
if (Array.isArray(
|
|
170
|
-
return p(
|
|
171
|
-
if (
|
|
172
|
-
return p(
|
|
173
|
-
if (
|
|
174
|
-
return p(
|
|
175
|
-
if (
|
|
176
|
-
return p(
|
|
177
|
-
if (Array.isArray(
|
|
178
|
-
return p(
|
|
179
|
-
if ("properties" in
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
return p
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
222
|
+
if (Array.isArray(t.examples) && t.examples.length > 0)
|
|
223
|
+
return i.delete(p), d(t, t.examples[0]);
|
|
224
|
+
if (t.example !== void 0)
|
|
225
|
+
return i.delete(p), d(t, t.example);
|
|
226
|
+
if (t.default !== void 0)
|
|
227
|
+
return i.delete(p), d(t, t.default);
|
|
228
|
+
if (t.const !== void 0)
|
|
229
|
+
return i.delete(p), d(t, t.const);
|
|
230
|
+
if (Array.isArray(t.enum) && t.enum.length > 0)
|
|
231
|
+
return i.delete(p), d(t, t.enum[0]);
|
|
232
|
+
if ("properties" in t || "type" in t && t.type === "object") {
|
|
233
|
+
const f = F(t, r, a, i);
|
|
234
|
+
return i.delete(p), f;
|
|
235
|
+
}
|
|
236
|
+
if ("type" in t && t.type === "array" || "items" in t) {
|
|
237
|
+
const f = L(t, r, a, i);
|
|
238
|
+
return i.delete(p), f;
|
|
239
|
+
}
|
|
240
|
+
const c = X(t, u, r?.emptyString);
|
|
241
|
+
if (c !== void 0)
|
|
242
|
+
return i.delete(p), d(t, c);
|
|
243
|
+
const y = t.oneOf || t.anyOf;
|
|
244
|
+
if (Array.isArray(y) && y.length > 0) {
|
|
245
|
+
for (const f of y) {
|
|
246
|
+
const x = m(f);
|
|
247
|
+
if (x && (!("type" in x) || x.type !== "null"))
|
|
248
|
+
return i.delete(p), d(
|
|
249
|
+
t,
|
|
250
|
+
s(x, r, {
|
|
251
|
+
level: a + 1,
|
|
252
|
+
seen: i
|
|
253
|
+
})
|
|
254
|
+
);
|
|
192
255
|
}
|
|
193
|
-
return p(
|
|
256
|
+
return i.delete(p), d(t, null);
|
|
194
257
|
}
|
|
195
|
-
if (Array.isArray(
|
|
258
|
+
if (Array.isArray(t.allOf) && t.allOf.length > 0) {
|
|
196
259
|
let f;
|
|
197
|
-
const
|
|
198
|
-
for (const
|
|
199
|
-
const
|
|
200
|
-
|
|
260
|
+
const x = t.allOf;
|
|
261
|
+
for (const w of x) {
|
|
262
|
+
const b = s(w, r, {
|
|
263
|
+
level: a + 1,
|
|
264
|
+
parentSchema: t,
|
|
265
|
+
seen: i
|
|
266
|
+
});
|
|
267
|
+
f === void 0 ? f = b : f && typeof f == "object" && b && typeof b == "object" ? f = R(f, b) : b !== void 0 && (f = b);
|
|
201
268
|
}
|
|
202
|
-
return p(
|
|
269
|
+
return i.delete(p), d(t, f ?? null);
|
|
203
270
|
}
|
|
204
|
-
const
|
|
205
|
-
return
|
|
271
|
+
const g = U(t, u, r?.emptyString);
|
|
272
|
+
return g !== void 0 ? (i.delete(p), d(t, g)) : (i.delete(p), d(t, null));
|
|
206
273
|
};
|
|
207
274
|
export {
|
|
208
|
-
|
|
275
|
+
s as getExampleFromSchema
|
|
209
276
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation-to-har.bench.d.ts","sourceRoot":"","sources":["../../../../../../src/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.bench.ts"],"names":[],"mappings":""}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
export { default as RequestExample } from './components/OperationCodeSample.vue.js';
|
|
2
1
|
export { default as ExamplePicker } from './components/ExamplePicker.vue.js';
|
|
2
|
+
export { default as OperationCodeSample } from './components/OperationCodeSample.vue.js';
|
|
3
|
+
export { DEFAULT_CLIENT, findClient, isClient } from './helpers/find-client.js';
|
|
4
|
+
export { generateClientOptions } from './helpers/generate-client-options.js';
|
|
5
|
+
export type { ClientOption, ClientOptionGroup } from './types';
|
|
3
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/blocks/operation-code-sample/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/blocks/operation-code-sample/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,gCAAgC,CAAA;AACzE,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,sCAAsC,CAAA;AACrF,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAA;AACzE,YAAY,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA"}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
import { default as
|
|
2
|
-
import { default as
|
|
1
|
+
import { default as o } from "./components/ExamplePicker.vue.js";
|
|
2
|
+
import { default as a } from "./components/OperationCodeSample.vue.js";
|
|
3
|
+
import { DEFAULT_CLIENT as p, findClient as f, isClient as l } from "./helpers/find-client.js";
|
|
4
|
+
import { generateClientOptions as m } from "./helpers/generate-client-options.js";
|
|
3
5
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
+
p as DEFAULT_CLIENT,
|
|
7
|
+
o as ExamplePicker,
|
|
8
|
+
a as OperationCodeSample,
|
|
9
|
+
f as findClient,
|
|
10
|
+
m as generateClientOptions,
|
|
11
|
+
l as isClient
|
|
6
12
|
};
|
|
@@ -7,17 +7,13 @@ export declare const formatScheme: ({ name, type, value, }: {
|
|
|
7
7
|
}) => {
|
|
8
8
|
id: string;
|
|
9
9
|
label: string;
|
|
10
|
-
value:
|
|
11
|
-
[x: string]: string[];
|
|
12
|
-
};
|
|
10
|
+
value: import("@scalar/workspace-store/schemas/v3.1/strict/security-requirement").SecurityRequirementObject;
|
|
13
11
|
};
|
|
14
12
|
/** Formats complex security schemes */
|
|
15
13
|
export declare const formatComplexScheme: (scheme: NonNullable<OpenApiDocument["security"]>[number]) => {
|
|
16
14
|
id: string;
|
|
17
15
|
label: string;
|
|
18
|
-
value:
|
|
19
|
-
[x: string]: string[];
|
|
20
|
-
};
|
|
16
|
+
value: import("@scalar/workspace-store/schemas/v3.1/strict/security-requirement").SecurityRequirementObject;
|
|
21
17
|
};
|
|
22
18
|
export type SecuritySchemeOption = {
|
|
23
19
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"security-scheme.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACrB,MAAM,8DAA8D,CAAA;AAIrE,mDAAmD;AACnD,eAAO,MAAM,YAAY,GAAI,wBAI1B;IACD,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,oBAAoB,CAAC,MAAM,CAAC,GAAG,SAAS,CAAA;IAC9C,KAAK,EAAE,WAAW,CAAC,eAAe,CAAC,4BAA4B,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;CAC1E
|
|
1
|
+
{"version":3,"file":"security-scheme.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACrB,MAAM,8DAA8D,CAAA;AAIrE,mDAAmD;AACnD,eAAO,MAAM,YAAY,GAAI,wBAI1B;IACD,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,oBAAoB,CAAC,MAAM,CAAC,GAAG,SAAS,CAAA;IAC9C,KAAK,EAAE,WAAW,CAAC,eAAe,CAAC,4BAA4B,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;CAC1E;;;;CAIC,CAAA;AAEF,uCAAuC;AACvC,eAAO,MAAM,mBAAmB,GAAI,QAAQ,WAAW,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC;;;;CASzF,CAAA;AAEH,MAAM,MAAM,oBAAoB,GAAG;IACjC,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,WAAW,CAAC,eAAe,CAAC,4BAA4B,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;IACzE,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,OAAO,CAAC,EAAE,oBAAoB,CAAA;CAC/B,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,oBAAoB,EAAE,CAAA;CAChC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,GACnC,UAAU,WAAW,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,EAClD,iBAAiB,WAAW,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,CAAC,EACjE,aAAY,OAAe,KAC1B,oBAAoB,EAAE,GAAG,mBAAmB,EA6D9C,CAAA"}
|