@scalar/api-client 2.34.1 → 2.36.1

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 (68) hide show
  1. package/CHANGELOG.md +88 -0
  2. package/dist/components/ViewLayout/ViewLayoutSection.vue.d.ts.map +1 -1
  3. package/dist/components/ViewLayout/ViewLayoutSection.vue.js +1 -1
  4. package/dist/style.css +1 -1
  5. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  6. package/dist/v2/blocks/operation-block/OperationBlock.vue.js +88 -80
  7. package/dist/v2/blocks/operation-block/helpers/build-request-body.d.ts.map +1 -1
  8. package/dist/v2/blocks/operation-block/helpers/build-request-body.js +28 -27
  9. package/dist/v2/blocks/operation-block/helpers/de-serialize-parameter.js +6 -4
  10. package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.d.ts +16 -0
  11. package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.d.ts.map +1 -0
  12. package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.js +17 -0
  13. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.d.ts.map +1 -1
  14. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.js +90 -84
  15. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.d.ts.map +1 -1
  16. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.js +47 -42
  17. package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
  18. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.d.ts.map +1 -1
  19. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.js +76 -50
  20. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
  21. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +65 -59
  22. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts.map +1 -1
  23. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.js +57 -42
  24. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
  25. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js +44 -41
  26. package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts +2 -2
  27. package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts.map +1 -1
  28. package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
  29. package/dist/v2/components/sidebar/Sidebar.vue.js +50 -44
  30. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  31. package/dist/v2/features/app/App.vue.js +41 -35
  32. package/dist/v2/features/app/app-events.d.ts +5 -2
  33. package/dist/v2/features/app/app-events.d.ts.map +1 -1
  34. package/dist/v2/features/app/app-events.js +58 -44
  35. package/dist/v2/features/app/app-state.d.ts.map +1 -1
  36. package/dist/v2/features/app/app-state.js +82 -80
  37. package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
  38. package/dist/v2/features/app/components/AppSidebar.vue.js +2 -2
  39. package/dist/v2/features/app/components/AppSidebar.vue2.js +78 -76
  40. package/dist/v2/features/app/components/DesktopTabs.vue.d.ts.map +1 -1
  41. package/dist/v2/features/app/components/DesktopTabs.vue.js +34 -30
  42. package/dist/v2/features/app/components/SidebarItemMenu.vue.d.ts.map +1 -1
  43. package/dist/v2/features/app/components/SidebarItemMenu.vue.js +73 -45
  44. package/dist/v2/features/collection/DocumentCollection.vue.d.ts.map +1 -1
  45. package/dist/v2/features/collection/DocumentCollection.vue.js +20 -20
  46. package/dist/v2/features/collection/OperationCollection.vue.d.ts.map +1 -1
  47. package/dist/v2/features/collection/OperationCollection.vue.js +7 -7
  48. package/dist/v2/features/collection/WorkspaceCollection.vue.d.ts.map +1 -1
  49. package/dist/v2/features/collection/WorkspaceCollection.vue.js +5 -4
  50. package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
  51. package/dist/v2/features/collection/components/Authentication.vue.js +1 -1
  52. package/dist/v2/features/collection/components/Authentication.vue2.js +84 -66
  53. package/dist/v2/features/collection/components/LabelInput.vue.d.ts.map +1 -1
  54. package/dist/v2/features/collection/components/LabelInput.vue.js +2 -2
  55. package/dist/v2/features/collection/components/LabelInput.vue2.js +1 -1
  56. package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.d.ts +5 -0
  57. package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.d.ts.map +1 -1
  58. package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.js +131 -96
  59. package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts +25 -0
  60. package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts.map +1 -1
  61. package/dist/v2/features/command-palette/hooks/use-command-palette-state.js +42 -36
  62. package/dist/v2/features/operation/Operation.vue.js +1 -1
  63. package/dist/v2/workspace-events.d.ts.map +1 -1
  64. package/dist/v2/workspace-events.js +8 -5
  65. package/dist/views/Components/CodeSnippet/helpers/get-har-request.d.ts.map +1 -1
  66. package/dist/views/Components/CodeSnippet/helpers/get-har-request.js +44 -45
  67. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  68. package/package.json +19 -19
@@ -1,9 +1,9 @@
1
- import { isDefined as v } from "@scalar/helpers/array/is-defined";
1
+ import { isDefined as O } from "@scalar/helpers/array/is-defined";
2
2
  import { unpackProxyObject as D } from "@scalar/workspace-store/helpers/unpack-proxy";
3
- import { resolve as y } from "@scalar/workspace-store/resolve";
4
- const T = 10, q = "additionalProperty", j = (/* @__PURE__ */ new Date()).toISOString(), k = j.split("T")[0], C = j.split("T")[1].split(".")[0], M = {
3
+ import { resolve as s } from "@scalar/workspace-store/resolve";
4
+ const T = 10, q = "additionalProperty", j = (/* @__PURE__ */ new Date()).toISOString(), C = j.split("T")[0], k = j.split("T")[1].split(".")[0], M = {
5
5
  "date-time": j,
6
- date: k,
6
+ date: C,
7
7
  email: "hello@example.com",
8
8
  hostname: "example.com",
9
9
  // https://tools.ietf.org/html/rfc6531#section-3.3
@@ -21,14 +21,20 @@ const T = 10, q = "additionalProperty", j = (/* @__PURE__ */ new Date()).toISOSt
21
21
  // https://tools.ietf.org/html/draft-handrews-relative-json-pointer-01
22
22
  "relative-json-pointer": "1/nested/objects",
23
23
  // full-time in https://tools.ietf.org/html/rfc3339#section-5.6
24
- time: C,
24
+ time: k,
25
25
  // either a URI or relative-reference https://tools.ietf.org/html/rfc3986#section-4.1
26
26
  "uri-reference": "../folder",
27
27
  "uri-template": "https://example.com/{id}",
28
28
  uri: "https://example.com",
29
29
  uuid: "123e4567-e89b-12d3-a456-426614174000",
30
30
  "object-id": "6592008029c8c3e4dc76256c"
31
- }, S = (e, i = !1, o = "") => "type" in e && e.type === "string" && "format" in e && e.format === "binary" ? "@filename" : i && "format" in e && e.format ? M[e.format] ?? o : o, A = /* @__PURE__ */ new WeakMap(), P = /* @__PURE__ */ new WeakMap(), N = (e) => D(e, { depth: 1 }), I = (e) => {
31
+ }, I = (e) => {
32
+ if (!("propertyNames" in e) || !e.propertyNames)
33
+ return;
34
+ const i = s.schema(e.propertyNames);
35
+ if (i && "enum" in i && Array.isArray(i.enum) && i.enum.length > 0)
36
+ return i.enum;
37
+ }, S = (e, i = !1, o = "") => "type" in e && e.type === "string" && "format" in e && e.format === "binary" ? "@filename" : i && "format" in e && e.format ? M[e.format] ?? o : o, A = /* @__PURE__ */ new WeakMap(), P = /* @__PURE__ */ new WeakMap(), N = (e) => D(e, { depth: 1 }), R = (e) => {
32
38
  if (!e)
33
39
  return;
34
40
  const i = P.get(e);
@@ -37,81 +43,81 @@ const T = 10, q = "additionalProperty", j = (/* @__PURE__ */ new Date()).toISOSt
37
43
  if ("required" in e) {
38
44
  const o = e.required;
39
45
  if (Array.isArray(o) && o.length > 0) {
40
- const l = new Set(o);
41
- return P.set(e, l), l;
46
+ const a = new Set(o);
47
+ return P.set(e, a), a;
42
48
  }
43
49
  }
44
50
  }, d = (e, i, o) => {
45
51
  if (typeof i != "object" || i === null)
46
52
  return i;
47
- const l = N(e), f = A.get(l) ?? /* @__PURE__ */ new Map();
48
- return f && f.set(o, i), A.set(l, f), i;
49
- }, R = (e) => !!(e.allOf || e.oneOf || e.anyOf), _ = (e, i, o, l) => {
50
- if (e.deprecated || l?.mode === "write" && e.readOnly || l?.mode === "read" && e.writeOnly)
53
+ const a = N(e), f = A.get(a) ?? /* @__PURE__ */ new Map();
54
+ return f && f.set(o, i), A.set(a, f), i;
55
+ }, _ = (e) => !!(e.allOf || e.oneOf || e.anyOf), F = (e, i, o, a) => {
56
+ if (e.deprecated || a?.mode === "write" && e.readOnly || a?.mode === "read" && e.writeOnly)
51
57
  return !0;
52
- if (l?.omitEmptyAndOptionalProperties !== !0 || "type" in e && (e.type === "object" || e.type === "array") || R(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)
58
+ 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)
53
59
  return !1;
54
- const r = o ?? e.title ?? "", t = I(i);
60
+ const r = o ?? e.title ?? "", t = R(i);
55
61
  return !(t ? t.has(r) : !1);
56
- }, E = (e, i) => Array.isArray(e) && Array.isArray(i) ? [...e, ...i] : e && typeof e == "object" && i && typeof i == "object" ? { ...e, ...i } : i, F = (e, i, o, l, f) => {
62
+ }, E = (e, i) => Array.isArray(e) && Array.isArray(i) ? [...e, ...i] : e && typeof e == "object" && i && typeof i == "object" ? { ...e, ...i } : i, L = (e, i, o, a, f) => {
57
63
  const r = {};
58
64
  if ("properties" in e && e.properties) {
59
65
  const t = Object.keys(e.properties), n = t.length;
60
- for (let a = 0; a < n; a++) {
61
- const g = t[a], u = y.schema(e.properties[g]);
66
+ for (let l = 0; l < n; l++) {
67
+ const c = t[l], u = s.schema(e.properties[c]);
62
68
  if (!u)
63
69
  continue;
64
- const s = i?.xml && "xml" in u ? u.xml?.name : void 0, m = c(u, i, {
70
+ const y = i?.xml && "xml" in u ? u.xml?.name : void 0, m = g(u, i, {
65
71
  level: o + 1,
66
72
  parentSchema: e,
67
- name: g,
68
- seen: l
73
+ name: c,
74
+ seen: a
69
75
  });
70
- typeof m < "u" && (r[s ?? g] = m);
76
+ typeof m < "u" && (r[y ?? c] = m);
71
77
  }
72
78
  }
73
79
  if ("patternProperties" in e && e.patternProperties)
74
80
  for (const t of Object.keys(e.patternProperties)) {
75
- const n = y.schema(e.patternProperties[t]);
76
- n && (r[t] = c(n, i, {
81
+ const n = s.schema(e.patternProperties[t]);
82
+ n && (r[t] = g(n, i, {
77
83
  level: o + 1,
78
84
  parentSchema: e,
79
85
  name: t,
80
- seen: l
86
+ seen: a
81
87
  }));
82
88
  }
83
89
  if ("additionalProperties" in e && e.additionalProperties) {
84
- const t = typeof e.additionalProperties == "boolean" ? e.additionalProperties : y.schema(e.additionalProperties), n = e.additionalProperties === !0 || typeof e.additionalProperties == "object" && Object.keys(e.additionalProperties).length === 0, a = typeof t == "object" && "x-additionalPropertiesName" in t && typeof t["x-additionalPropertiesName"] == "string" && t["x-additionalPropertiesName"].trim().length > 0 ? t["x-additionalPropertiesName"].trim() : q;
85
- r[a] = n ? "anything" : typeof t == "object" ? c(t, i, {
90
+ const t = typeof e.additionalProperties == "boolean" ? e.additionalProperties : s.schema(e.additionalProperties), n = e.additionalProperties === !0 || typeof e.additionalProperties == "object" && Object.keys(e.additionalProperties).length === 0, l = typeof t == "object" && "x-additionalPropertiesName" in t && typeof t["x-additionalPropertiesName"] == "string" && t["x-additionalPropertiesName"].trim().length > 0, c = l ? void 0 : I(e), u = l ? t["x-additionalPropertiesName"].trim() : q, y = n ? "anything" : typeof t == "object" ? g(t, i, {
86
91
  level: o + 1,
87
- seen: l
92
+ seen: a
88
93
  }) : "anything";
94
+ c && c.length > 0 ? r[String(c[0])] = y : r[u] = y;
89
95
  }
90
96
  if (e.oneOf?.[0])
91
97
  Object.assign(
92
98
  r,
93
- c(y.schema(e.oneOf[0]), i, {
99
+ g(s.schema(e.oneOf[0]), i, {
94
100
  level: o + 1,
95
- seen: l
101
+ seen: a
96
102
  })
97
103
  );
98
104
  else if (e.anyOf?.[0])
99
105
  Object.assign(
100
106
  r,
101
- c(y.schema(e.anyOf[0]), i, {
107
+ g(s.schema(e.anyOf[0]), i, {
102
108
  level: o + 1,
103
- seen: l
109
+ seen: a
104
110
  })
105
111
  );
106
112
  else if (Array.isArray(e.allOf) && e.allOf.length > 0) {
107
113
  let t = r;
108
114
  for (const n of e.allOf) {
109
- const a = c(y.schema(n), i, {
115
+ const l = g(s.schema(n), i, {
110
116
  level: o + 1,
111
117
  parentSchema: e,
112
- seen: l
118
+ seen: a
113
119
  });
114
- t = E(t, a);
120
+ t = E(t, l);
115
121
  }
116
122
  t && typeof t == "object" && Object.assign(r, t);
117
123
  }
@@ -120,54 +126,54 @@ const T = 10, q = "additionalProperty", j = (/* @__PURE__ */ new Date()).toISOSt
120
126
  return t[e.xml.name] = r, d(e, t, f);
121
127
  }
122
128
  return d(e, r, f);
123
- }, L = (e, i, o, l, f) => {
124
- const r = "items" in e ? y.schema(e.items) : void 0, t = r && typeof r == "object" && "xml" in r ? r.xml?.name : void 0, n = !!(i?.xml && "xml" in e && e.xml?.wrapped && t);
129
+ }, U = (e, i, o, a, f) => {
130
+ const r = "items" in e ? s.schema(e.items) : void 0, t = r && typeof r == "object" && "xml" in r ? r.xml?.name : void 0, n = !!(i?.xml && "xml" in e && e.xml?.wrapped && t);
125
131
  if (e.example !== void 0)
126
132
  return d(e, n ? { [t]: e.example } : e.example, f);
127
133
  if (r && typeof r == "object") {
128
134
  if (Array.isArray(r.allOf) && r.allOf.length > 0) {
129
- const s = r.allOf.filter(v), m = y.schema(s[0]);
135
+ const y = r.allOf.filter(O), m = s.schema(y[0]);
130
136
  if (m && typeof m == "object" && "type" in m && m.type === "object") {
131
- const b = c({ type: "object", allOf: s }, i, {
137
+ const b = g({ type: "object", allOf: y }, i, {
132
138
  level: o + 1,
133
139
  parentSchema: e,
134
- seen: l
140
+ seen: a
135
141
  });
136
142
  return d(e, n ? [{ [t]: b }] : [b], f);
137
143
  }
138
- const O = s.map(
139
- (p) => c(y.schema(p), i, {
144
+ const v = y.map(
145
+ (p) => g(s.schema(p), i, {
140
146
  level: o + 1,
141
147
  parentSchema: e,
142
- seen: l
148
+ seen: a
143
149
  })
144
- ).filter(v);
150
+ ).filter(O);
145
151
  return d(
146
152
  e,
147
- n ? O.map((p) => ({ [t]: p })) : O,
153
+ n ? v.map((p) => ({ [t]: p })) : v,
148
154
  f
149
155
  );
150
156
  }
151
157
  const u = r.anyOf || r.oneOf;
152
158
  if (u && u.length > 0) {
153
- const s = u[0], m = c(y.schema(s), i, {
159
+ const y = u[0], m = g(s.schema(y), i, {
154
160
  level: o + 1,
155
161
  parentSchema: e,
156
- seen: l
162
+ seen: a
157
163
  });
158
164
  return d(e, n ? [{ [t]: m }] : [m], f);
159
165
  }
160
166
  }
161
- const a = r && typeof r == "object" && ("type" in r && r.type === "object" || "properties" in r), g = r && typeof r == "object" && ("type" in r && r.type === "array" || "items" in r);
162
- if (r && typeof r == "object" && ("type" in r && r.type || a || g)) {
163
- const u = c(r, i, {
167
+ const l = r && typeof r == "object" && ("type" in r && r.type === "object" || "properties" in r), c = r && typeof r == "object" && ("type" in r && r.type === "array" || "items" in r);
168
+ if (r && typeof r == "object" && ("type" in r && r.type || l || c)) {
169
+ const u = g(r, i, {
164
170
  level: o + 1,
165
- seen: l
171
+ seen: a
166
172
  });
167
173
  return d(e, n ? [{ [t]: u }] : [u], f);
168
174
  }
169
175
  return d(e, [], f);
170
- }, U = (e, i, o) => {
176
+ }, W = (e, i, o) => {
171
177
  if ("type" in e && e.type && !Array.isArray(e.type))
172
178
  switch (e.type) {
173
179
  case "string":
@@ -183,13 +189,13 @@ const T = 10, q = "additionalProperty", j = (/* @__PURE__ */ new Date()).toISOSt
183
189
  default:
184
190
  return;
185
191
  }
186
- }, W = (e, i, o) => {
192
+ }, X = (e, i, o) => {
187
193
  if ("type" in e && Array.isArray(e.type)) {
188
194
  if (e.type.includes("null"))
189
195
  return null;
190
- const l = e.type[0];
191
- if (l)
192
- switch (l) {
196
+ const a = e.type[0];
197
+ if (a)
198
+ switch (a) {
193
199
  case "string":
194
200
  return S(e, i, o ?? "");
195
201
  case "boolean":
@@ -204,93 +210,93 @@ const T = 10, q = "additionalProperty", j = (/* @__PURE__ */ new Date()).toISOSt
204
210
  return;
205
211
  }
206
212
  }
207
- }, X = (e) => JSON.stringify({
213
+ }, z = (e) => JSON.stringify({
208
214
  emptyString: e?.emptyString,
209
215
  xml: e?.xml,
210
216
  mode: e?.mode,
211
217
  variables: e?.variables,
212
218
  omitEmptyAndOptionalProperties: e?.omitEmptyAndOptionalProperties
213
- }), c = (e, i, {
219
+ }), g = (e, i, {
214
220
  level: o = 0,
215
- parentSchema: l,
221
+ parentSchema: a,
216
222
  name: f,
217
223
  seen: r = /* @__PURE__ */ new WeakSet()
218
224
  } = {}) => {
219
- const t = y.schema(e);
220
- if (!v(t))
225
+ const t = s.schema(e);
226
+ if (!O(t))
221
227
  return;
222
228
  const n = N(t);
223
229
  if (r.has(n))
224
230
  return;
225
231
  r.add(n);
226
- const a = X(i), g = A.get(n)?.get(a);
227
- if (typeof g < "u")
228
- return r.delete(n), g;
232
+ const l = z(i), c = A.get(n)?.get(l);
233
+ if (typeof c < "u")
234
+ return r.delete(n), c;
229
235
  if (o > T)
230
236
  return r.delete(n), "[Max Depth Exceeded]";
231
237
  const u = !!i?.emptyString;
232
- if (_(t, l, f, i)) {
238
+ if (F(t, a, f, i)) {
233
239
  r.delete(n);
234
240
  return;
235
241
  }
236
242
  if ("x-variable" in t && t["x-variable"]) {
237
243
  const p = i?.variables?.[t["x-variable"]];
238
244
  if (p !== void 0)
239
- return "type" in t && (t.type === "number" || t.type === "integer") ? (r.delete(n), d(t, Number(p), a)) : (r.delete(n), d(t, p, a));
245
+ return "type" in t && (t.type === "number" || t.type === "integer") ? (r.delete(n), d(t, Number(p), l)) : (r.delete(n), d(t, p, l));
240
246
  }
241
247
  if (Array.isArray(t.examples) && t.examples.length > 0)
242
- return r.delete(n), d(t, t.examples[0], a);
248
+ return r.delete(n), d(t, t.examples[0], l);
243
249
  if (t.example !== void 0)
244
- return r.delete(n), d(t, t.example, a);
250
+ return r.delete(n), d(t, t.example, l);
245
251
  if (t.default !== void 0)
246
- return r.delete(n), d(t, t.default, a);
252
+ return r.delete(n), d(t, t.default, l);
247
253
  if (t.const !== void 0)
248
- return r.delete(n), d(t, t.const, a);
254
+ return r.delete(n), d(t, t.const, l);
249
255
  if (Array.isArray(t.enum) && t.enum.length > 0)
250
- return r.delete(n), d(t, t.enum[0], a);
256
+ return r.delete(n), d(t, t.enum[0], l);
251
257
  if ("properties" in t || "type" in t && t.type === "object") {
252
- const p = F(t, i, o, r, a);
258
+ const p = L(t, i, o, r, l);
253
259
  return r.delete(n), p;
254
260
  }
255
261
  if ("type" in t && t.type === "array" || "items" in t) {
256
- const p = L(t, i, o, r, a);
262
+ const p = U(t, i, o, r, l);
257
263
  return r.delete(n), p;
258
264
  }
259
- const s = U(t, u, i?.emptyString);
260
- if (s !== void 0)
261
- return r.delete(n), d(t, s, a);
265
+ const y = W(t, u, i?.emptyString);
266
+ if (y !== void 0)
267
+ return r.delete(n), d(t, y, l);
262
268
  const m = t.oneOf || t.anyOf;
263
269
  if (Array.isArray(m) && m.length > 0) {
264
270
  for (const p of m) {
265
- const b = y.schema(p);
271
+ const b = s.schema(p);
266
272
  if (b && (!("type" in b) || b.type !== "null"))
267
273
  return r.delete(n), d(
268
274
  t,
269
- c(b, i, {
275
+ g(b, i, {
270
276
  level: o + 1,
271
277
  seen: r
272
278
  }),
273
- a
279
+ l
274
280
  );
275
281
  }
276
- return r.delete(n), d(t, null, a);
282
+ return r.delete(n), d(t, null, l);
277
283
  }
278
284
  if (Array.isArray(t.allOf) && t.allOf.length > 0) {
279
285
  let p;
280
286
  const b = t.allOf;
281
287
  for (const w of b) {
282
- const x = c(w, i, {
288
+ const x = g(w, i, {
283
289
  level: o + 1,
284
290
  parentSchema: t,
285
291
  seen: r
286
292
  });
287
293
  p === void 0 ? p = x : p && typeof p == "object" && x && typeof x == "object" ? p = E(p, x) : x !== void 0 && (p = x);
288
294
  }
289
- return r.delete(n), d(t, p ?? null, a);
295
+ return r.delete(n), d(t, p ?? null, l);
290
296
  }
291
- const O = W(t, u, i?.emptyString);
292
- return O !== void 0 ? (r.delete(n), d(t, O, a)) : (r.delete(n), d(t, null, a));
297
+ const v = X(t, u, i?.emptyString);
298
+ return v !== void 0 ? (r.delete(n), d(t, v, l)) : (r.delete(n), d(t, null, l));
293
299
  };
294
300
  export {
295
- c as getExampleFromSchema
301
+ g as getExampleFromSchema
296
302
  };
@@ -1 +1 @@
1
- {"version":3,"file":"process-body.d.ts","sourceRoot":"","sources":["../../../../../../src/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8DAA8D,CAAA;AAErG,OAAO,KAAK,EAAS,QAAQ,EAAE,MAAM,YAAY,CAAA;AAIjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAE7D,KAAK,gBAAgB,GAAG,IAAI,CAAC,mBAAmB,EAAE,aAAa,GAAG,SAAS,CAAC,GAAG;IAC7E,WAAW,EAAE,iBAAiB,CAAA;CAC/B,CAAA;AAoDD;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAI,uCAAuC,gBAAgB,KAAG,QAAQ,GAAG,SAiEhG,CAAA"}
1
+ {"version":3,"file":"process-body.d.ts","sourceRoot":"","sources":["../../../../../../src/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8DAA8D,CAAA;AAErG,OAAO,KAAK,EAAS,QAAQ,EAAE,MAAM,YAAY,CAAA;AAIjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAE7D,KAAK,gBAAgB,GAAG,IAAI,CAAC,mBAAmB,EAAE,aAAa,GAAG,SAAS,CAAC,GAAG;IAC7E,WAAW,EAAE,iBAAiB,CAAA;CAC/B,CAAA;AAoDD;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAI,uCAAuC,gBAAgB,KAAG,QAAQ,GAAG,SA8EhG,CAAA"}
@@ -1,58 +1,63 @@
1
- import { json2xml as l } from "@scalar/helpers/file/json2xml";
2
- import { getResolvedRef as c } from "@scalar/workspace-store/helpers/get-resolved-ref";
3
- import { unpackProxyObject as p } from "@scalar/workspace-store/helpers/unpack-proxy";
4
- import { getExampleFromSchema as u } from "../get-example-from-schema.js";
5
- import { getExample as y } from "../../../operation-block/helpers/get-example.js";
6
- const s = (a) => {
7
- const i = [], m = Array.isArray(a) ? a.filter((e) => !e.isDisabled).map((e) => [e.name, e.value]) : Object.entries(a);
8
- for (const [e, n] of m)
1
+ import { json2xml as c } from "@scalar/helpers/file/json2xml";
2
+ import { getResolvedRef as u } from "@scalar/workspace-store/helpers/get-resolved-ref";
3
+ import { unpackProxyObject as s } from "@scalar/workspace-store/helpers/unpack-proxy";
4
+ import { getExampleFromSchema as y } from "../get-example-from-schema.js";
5
+ import { getExample as x } from "../../../operation-block/helpers/get-example.js";
6
+ const f = (a) => {
7
+ const r = [], l = Array.isArray(a) ? a.filter((t) => !t.isDisabled).map((t) => [t.name, t.value]) : Object.entries(a);
8
+ for (const [t, n] of l)
9
9
  if (n != null)
10
10
  if (n instanceof File) {
11
- const o = p(n);
12
- i.push({ name: e, value: `@${o.name}` });
11
+ const o = s(n);
12
+ r.push({ name: t, value: `@${o.name}` });
13
13
  } else if (Array.isArray(n))
14
14
  for (const o of n)
15
15
  if (o instanceof File) {
16
- const t = p(o);
17
- i.push({ name: e, value: `@${t.name}` });
16
+ const i = s(o);
17
+ r.push({ name: t, value: `@${i.name}` });
18
18
  } else
19
- i.push({ name: e, value: String(o) });
19
+ r.push({ name: t, value: String(o) });
20
20
  else if (typeof n == "object") {
21
- const o = s(n);
22
- for (const t of o)
23
- i.push({ name: `${e}.${t.name}`, value: t.value });
21
+ const o = f(n);
22
+ for (const i of o)
23
+ r.push({ name: `${t}.${i.name}`, value: i.value });
24
24
  } else
25
- i.push({ name: e, value: String(n) });
26
- return i;
27
- }, h = ({ requestBody: a, contentType: i, example: m }) => {
28
- const e = i || Object.keys(a.content)[0] || "", n = e === "multipart/form-data" || e === "application/x-www-form-urlencoded", o = e === "application/xml", t = y(a, m, i)?.value;
29
- if (typeof t < "u")
30
- return n && typeof t == "object" && t !== null ? {
31
- mimeType: e,
32
- params: s(t)
33
- } : o && typeof t == "object" && t !== null ? {
34
- mimeType: e,
35
- text: l(t)
25
+ r.push({ name: t, value: String(n) });
26
+ return r;
27
+ }, h = ({ requestBody: a, contentType: r, example: l }) => {
28
+ const t = r || Object.keys(a.content)[0] || "", n = (e) => `@${s(e).name || "filename"}`, o = t === "multipart/form-data" || t === "application/x-www-form-urlencoded", i = t === "application/xml", m = x(a, l, r)?.value;
29
+ if (typeof m < "u") {
30
+ const e = m !== null && typeof m == "object" ? s(m) : m;
31
+ return o && typeof e == "object" && e !== null ? {
32
+ mimeType: t,
33
+ params: f(e)
34
+ } : i && typeof e == "object" && e !== null ? {
35
+ mimeType: t,
36
+ text: c(e)
37
+ } : e instanceof File ? {
38
+ mimeType: t,
39
+ text: n(e)
36
40
  } : {
37
- mimeType: e,
38
- text: typeof t == "string" ? t : JSON.stringify(t)
41
+ mimeType: t,
42
+ text: typeof e == "string" ? e : JSON.stringify(e)
39
43
  };
40
- const f = c(a.content[e]?.schema);
41
- if (typeof f < "u") {
42
- const r = u(f, {
44
+ }
45
+ const p = u(a.content[t]?.schema);
46
+ if (typeof p < "u") {
47
+ const e = y(p, {
43
48
  mode: "write",
44
- xml: o
49
+ xml: i
45
50
  });
46
- if (r !== void 0)
47
- return n && typeof r == "object" && r !== null ? {
48
- mimeType: e,
49
- params: s(r)
50
- } : o && typeof r == "object" && r !== null ? {
51
- mimeType: e,
52
- text: l(r)
51
+ if (e !== void 0)
52
+ return o && typeof e == "object" && e !== null ? {
53
+ mimeType: t,
54
+ params: f(e)
55
+ } : i && typeof e == "object" && e !== null ? {
56
+ mimeType: t,
57
+ text: c(e)
53
58
  } : {
54
- mimeType: e,
55
- text: typeof r == "string" ? r : JSON.stringify(r)
59
+ mimeType: t,
60
+ text: typeof e == "string" ? e : JSON.stringify(e)
56
61
  };
57
62
  }
58
63
  };
@@ -1,7 +1,7 @@
1
1
  import { canMethodHaveBody as m } from "@scalar/helpers/http/can-method-have-body";
2
2
  import { getResolvedRef as r } from "@scalar/workspace-store/helpers/get-resolved-ref";
3
3
  import { isElectron as y } from "../../../../libs/electron.js";
4
- const l = "2.34.1", T = "application/json", C = "*/*", a = (n, s, o) => ({
4
+ const l = "2.36.1", T = "application/json", C = "*/*", a = (n, s, o) => ({
5
5
  name: n,
6
6
  defaultValue: s,
7
7
  isOverridden: o.has(n.toLowerCase())
@@ -1 +1 @@
1
- {"version":3,"file":"EnvironmentSelector.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue"],"names":[],"mappings":"AAqLA,KAAK,WAAW,GAAG;IACjB,qCAAqC;IACrC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;IACvB,qCAAqC;IACrC,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B,CAAC;AAyZF,QAAA,MAAM,YAAY;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"EnvironmentSelector.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue"],"names":[],"mappings":"AAmOA,KAAK,WAAW,GAAG;IACjB,qCAAqC;IACrC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;IACvB,qCAAqC;IACrC,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B,CAAC;AAghBF,QAAA,MAAM,YAAY;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}