@scalar/api-client 2.6.0 → 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.
Files changed (84) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/dist/analytics.d.ts +2 -18
  3. package/dist/analytics.d.ts.map +1 -1
  4. package/dist/components/CodeInput/CodeInput.vue.d.ts +1 -1
  5. package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
  6. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +66 -42
  7. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
  8. package/dist/components/HttpMethod/HttpMethod.vue.d.ts +2 -2
  9. package/dist/hooks/useAnalytics.d.ts +2 -18
  10. package/dist/hooks/useAnalytics.d.ts.map +1 -1
  11. package/dist/hooks/useClientConfig.d.ts +115 -112
  12. package/dist/hooks/useClientConfig.d.ts.map +1 -1
  13. package/dist/layouts/App/create-api-client-app.d.ts +1378 -1306
  14. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  15. package/dist/layouts/Modal/create-api-client-modal.d.ts +2752 -2608
  16. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  17. package/dist/layouts/Web/create-api-client-web.d.ts +1378 -1306
  18. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  19. package/dist/libs/create-client.d.ts +1378 -1306
  20. package/dist/libs/create-client.d.ts.map +1 -1
  21. package/dist/libs/find-request.d.ts +17 -17
  22. package/dist/libs/find-request.d.ts.map +1 -1
  23. package/dist/libs/hot-keys.d.ts +1 -1
  24. package/dist/libs/local-storage.d.ts.map +1 -1
  25. package/dist/libs/send-request/build-request-security.d.ts +1 -1
  26. package/dist/libs/send-request/create-fetch-body.d.ts +1 -1
  27. package/dist/libs/send-request/create-request-operation.test.d.ts +82 -82
  28. package/dist/libs/send-request/create-request-operation.test.d.ts.map +1 -1
  29. package/dist/plugins/plugin-manager.d.ts +1 -1
  30. package/dist/store/active-entities.d.ts +118 -118
  31. package/dist/store/active-entities.d.ts.map +1 -1
  32. package/dist/store/collections.d.ts +127 -127
  33. package/dist/store/collections.d.ts.map +1 -1
  34. package/dist/store/cookies.d.ts +14 -14
  35. package/dist/store/environment.d.ts +23 -23
  36. package/dist/store/request-example.d.ts +546 -546
  37. package/dist/store/request-example.d.ts.map +1 -1
  38. package/dist/store/requests.d.ts +194 -194
  39. package/dist/store/requests.d.ts.map +1 -1
  40. package/dist/store/security-schemes.d.ts +281 -281
  41. package/dist/store/security-schemes.d.ts.map +1 -1
  42. package/dist/store/servers.d.ts +45 -45
  43. package/dist/store/servers.d.ts.map +1 -1
  44. package/dist/store/store.d.ts +1378 -1306
  45. package/dist/store/store.d.ts.map +1 -1
  46. package/dist/store/store.js +18 -18
  47. package/dist/store/tags.d.ts +35 -35
  48. package/dist/store/tags.d.ts.map +1 -1
  49. package/dist/store/workspace.d.ts +47 -47
  50. package/dist/store/workspace.d.ts.map +1 -1
  51. package/dist/style.css +1 -1
  52. package/dist/v2/blocks/operation-code-sample/components/HttpMethod.test.d.ts +2 -0
  53. package/dist/v2/blocks/operation-code-sample/components/HttpMethod.test.d.ts.map +1 -0
  54. package/dist/v2/blocks/operation-code-sample/components/HttpMethod.vue.d.ts +25 -0
  55. package/dist/v2/blocks/operation-code-sample/components/HttpMethod.vue.d.ts.map +1 -0
  56. package/dist/v2/blocks/operation-code-sample/components/HttpMethod.vue.js +30 -0
  57. package/dist/v2/blocks/operation-code-sample/components/HttpMethod.vue2.js +4 -0
  58. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts.map +1 -1
  59. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js +3 -3
  60. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue2.js +102 -95
  61. package/dist/v2/blocks/operation-code-sample/helpers/find-client.js +16 -14
  62. package/dist/v2/blocks/operation-code-sample/helpers/generate-client-options.js +31 -2
  63. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.d.ts +6 -1
  64. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.d.ts.map +1 -1
  65. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.js +198 -131
  66. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.bench.d.ts +2 -0
  67. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.bench.d.ts.map +1 -0
  68. package/dist/v2/blocks/operation-code-sample/index.d.ts +4 -1
  69. package/dist/v2/blocks/operation-code-sample/index.d.ts.map +1 -1
  70. package/dist/v2/blocks/operation-code-sample/index.js +10 -4
  71. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts +2 -6
  72. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts.map +1 -1
  73. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts +54 -54
  74. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
  75. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts +54 -54
  76. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts.map +1 -1
  77. package/dist/views/Request/ResponseSection/RequestHeaders.vue.js +1 -1
  78. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  79. package/dist/views/Request/ResponseSection/ResponseHeaders.vue.js +1 -1
  80. package/dist/views/Request/libs/auth.d.ts +2 -2
  81. package/dist/views/Request/libs/watch-mode.d.ts +4 -4
  82. package/dist/views/Request/libs/watch-mode.d.ts.map +1 -1
  83. package/dist/views/Request/libs/watch-mode.js +241 -186
  84. package/package.json +25 -20
@@ -1,8 +1,10 @@
1
- import { isDefined as x } from "@scalar/helpers/array/is-defined";
2
- import { getResolvedRef as l } from "@scalar/workspace-store/helpers/get-resolved-ref";
3
- const N = 10, A = 10, E = "propertyName*", O = (/* @__PURE__ */ new Date()).toISOString(), S = O.split("T")[0], R = O.split("T")[1].split(".")[0], T = {
4
- "date-time": O,
5
- date: S,
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: R,
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
- }, v = (t, r = !1, o = "") => "type" in t && t.type === "string" && "format" in t && t.format === "binary" ? new File([""], "filename") : r && "format" in t && t.format ? T[t.format] ?? o : o, g = /* @__PURE__ */ new WeakMap(), j = /* @__PURE__ */ new WeakMap(), D = (t) => {
31
- if (!t)
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 = j.get(t);
35
+ const r = P.get(e);
34
36
  if (r)
35
37
  return r;
36
- if ("required" in t) {
37
- const o = t.required;
38
- if (Array.isArray(o) && o.length > 0) {
39
- const i = new Set(o);
40
- return j.set(t, i), i;
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
- }, p = (t, r) => (typeof r != "object" || r === null || g.set(t, r), r), q = (t) => !!(t.allOf || t.oneOf || t.anyOf), w = (t, r, o, i) => {
44
- if (i?.omitEmptyAndOptionalProperties !== !0 || "type" in t && (t.type === "object" || t.type === "array") || q(t) || "examples" in t && Array.isArray(t.examples) && t.examples.length > 0 || "example" in t && t.example !== void 0 || "default" in t && t.default !== void 0 || "const" in t && t.const !== void 0 || "enum" in t && Array.isArray(t.enum) && t.enum.length > 0)
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 e = o ?? t.title ?? "", u = D(r);
47
- return !(u ? u.has(e) : !1);
48
- }, P = (t, r) => Array.isArray(t) && Array.isArray(r) ? [...t, ...r] : t && typeof t == "object" && r && typeof r == "object" ? { ...t, ...r } : r, I = (t, r, o) => {
49
- const i = {};
50
- if ("properties" in t && t.properties) {
51
- const n = Object.keys(t.properties), e = o > 3 ? Math.min(A, n.length) : n.length;
52
- for (let u = 0; u < e; u++) {
53
- const s = n[u], a = l(t.properties[s]);
54
- if (!a)
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 y = r?.xml && "xml" in a ? a.xml?.name : void 0, f = d(a, r, o + 1, t, s);
57
- typeof f < "u" && (i[y ?? s] = f);
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
- o > 3 && n.length > A && (i["..."] = "[Additional Properties Truncated]");
66
+ l > 3 && o.length > j && (n["..."] = "[Additional Properties Truncated]");
60
67
  }
61
- if ("patternProperties" in t && t.patternProperties)
62
- for (const n of Object.keys(t.patternProperties)) {
63
- const e = l(t.patternProperties[n]);
64
- e && (i[n] = d(e, r, o + 1, t, n));
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 t && t.additionalProperties !== void 0) {
67
- const n = l(t.additionalProperties), e = t.additionalProperties === !0 || typeof t.additionalProperties == "object" && Object.keys(t.additionalProperties).length === 0, u = typeof n == "object" && "x-additionalPropertiesName" in n && typeof n["x-additionalPropertiesName"] == "string" && n["x-additionalPropertiesName"].trim().length > 0 ? `${n["x-additionalPropertiesName"].trim()}*` : E;
68
- i[u] = e ? "anything" : typeof n == "object" ? d(n, r, o + 1) : "anything";
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 (t.oneOf?.[0])
71
- Object.assign(i, d(l(t.oneOf[0]), r, o + 1));
72
- else if (t.anyOf?.[0])
73
- Object.assign(i, d(l(t.anyOf[0]), r, o + 1));
74
- else if (Array.isArray(t.allOf) && t.allOf.length > 0) {
75
- let n = i;
76
- for (const e of t.allOf) {
77
- const u = d(l(e), r, o + 1, t);
78
- n = P(n, u);
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
- n && typeof n == "object" && Object.assign(i, n);
111
+ o && typeof o == "object" && Object.assign(n, o);
81
112
  }
82
- if (r?.xml && "xml" in t && t.xml?.name && o === 0) {
83
- const n = {};
84
- return n[t.xml.name] = i, p(t, n);
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 p(t, i);
87
- }, M = (t, r, o) => {
88
- const i = "items" in t ? l(t.items) : void 0, n = i && typeof i == "object" && "xml" in i ? i.xml?.name : void 0, e = !!(r?.xml && "xml" in t && t.xml?.wrapped && n);
89
- if (t.example !== void 0)
90
- return p(t, e ? { [n]: t.example } : t.example);
91
- if (i && typeof i == "object") {
92
- if (Array.isArray(i.allOf) && i.allOf.length > 0) {
93
- const y = i.allOf.filter(x), f = l(y[0]);
94
- if (f && typeof f == "object" && "type" in f && f.type === "object") {
95
- const c = d({ type: "object", allOf: y }, r, o + 1, t);
96
- return p(t, e ? [{ [n]: c }] : [c]);
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 m = y.map((b) => d(l(b), r, o + 1, t)).filter(x);
99
- return p(
100
- t,
101
- e ? m.map((b) => ({ [n]: b })) : m
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 a = i.anyOf || i.oneOf;
105
- if (a && a.length > 0) {
106
- const y = a[0], f = d(l(y), r, o + 1, t);
107
- return p(t, e ? [{ [n]: f }] : [f]);
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 u = i && typeof i == "object" && ("type" in i && i.type === "object" || "properties" in i), s = i && typeof i == "object" && ("type" in i && i.type === "array" || "items" in i);
111
- if (i && typeof i == "object" && ("type" in i && i.type || u || s)) {
112
- const a = d(i, r, o + 1);
113
- return p(t, e ? [{ [n]: a }] : [a]);
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 p(t, []);
116
- }, _ = (t, r, o) => {
117
- if ("type" in t && t.type && !Array.isArray(t.type))
118
- switch (t.type) {
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 v(t, r, o ?? "");
168
+ return E(e, r, l ?? "");
121
169
  case "boolean":
122
170
  return !0;
123
171
  case "integer":
124
- return "minimum" in t && typeof t.minimum == "number" ? t.minimum : 1;
172
+ return "minimum" in e && typeof e.minimum == "number" ? e.minimum : 1;
125
173
  case "number":
126
- return "minimum" in t && typeof t.minimum == "number" ? t.minimum : 1;
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
- }, k = (t, r, o) => {
133
- if ("type" in t && Array.isArray(t.type)) {
134
- if (t.type.includes("null"))
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 i = t.type[0];
137
- if (i)
138
- switch (i) {
184
+ const a = e.type[0];
185
+ if (a)
186
+ switch (a) {
139
187
  case "string":
140
- return v(t, r, o ?? "");
188
+ return E(e, r, l ?? "");
141
189
  case "boolean":
142
190
  return !0;
143
191
  case "integer":
144
- return "minimum" in t && typeof t.minimum == "number" ? t.minimum : 1;
192
+ return "minimum" in e && typeof e.minimum == "number" ? e.minimum : 1;
145
193
  case "number":
146
- return "minimum" in t && typeof t.minimum == "number" ? t.minimum : 1;
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
- }, d = (t, r, o = 0, i, n) => {
154
- const e = l(t);
155
- if (!x(e))
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
- if (g.has(e))
158
- return g.get(e);
159
- if (o > N)
160
- return "[Max Depth Exceeded]";
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 (e.deprecated || r?.mode === "write" && e.readOnly || r?.mode === "read" && e.writeOnly || w(e, i, n, r))
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
- if ("x-variable" in e && e["x-variable"]) {
165
- const f = r?.variables?.[e["x-variable"]];
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 e && (e.type === "number" || e.type === "integer") ? p(e, Number(f)) : p(e, f);
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(e.examples) && e.examples.length > 0)
170
- return p(e, e.examples[0]);
171
- if (e.example !== void 0)
172
- return p(e, e.example);
173
- if (e.default !== void 0)
174
- return p(e, e.default);
175
- if (e.const !== void 0)
176
- return p(e, e.const);
177
- if (Array.isArray(e.enum) && e.enum.length > 0)
178
- return p(e, e.enum[0]);
179
- if ("properties" in e || "type" in e && e.type === "object")
180
- return I(t, r, o);
181
- if ("type" in e && e.type === "array" || "items" in e)
182
- return M(e, r, o);
183
- const s = _(e, u, r?.emptyString);
184
- if (s !== void 0)
185
- return p(e, s);
186
- const a = e.oneOf || e.anyOf;
187
- if (Array.isArray(a) && a.length > 0) {
188
- for (const f of a) {
189
- const m = l(f);
190
- if (m && (!("type" in m) || m.type !== "null"))
191
- return p(e, d(m, r, o + 1));
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(e, null);
256
+ return i.delete(p), d(t, null);
194
257
  }
195
- if (Array.isArray(e.allOf) && e.allOf.length > 0) {
258
+ if (Array.isArray(t.allOf) && t.allOf.length > 0) {
196
259
  let f;
197
- const m = e.allOf;
198
- for (const b of m) {
199
- const c = d(b, r, o + 1, e);
200
- f === void 0 ? f = c : f && typeof f == "object" && c && typeof c == "object" ? f = P(f, c) : c !== void 0 && (f = c);
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(e, f ?? null);
269
+ return i.delete(p), d(t, f ?? null);
203
270
  }
204
- const y = k(e, u, r?.emptyString);
205
- return y !== void 0 ? p(e, y) : p(e, null);
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
- d as getExampleFromSchema
275
+ s as getExampleFromSchema
209
276
  };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=operation-to-har.bench.d.ts.map
@@ -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":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,sCAAsC,CAAA;AAChF,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,gCAAgC,CAAA"}
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 r } from "./components/OperationCodeSample.vue.js";
2
- import { default as f } from "./components/ExamplePicker.vue.js";
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
- f as ExamplePicker,
5
- r as RequestExample
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;;;;;;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"}
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"}