@scalar/api-reference 1.28.31 → 1.28.33

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 (30) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/dist/browser/standalone.js +5966 -5747
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
  5. package/dist/components/ApiReferenceLayout.vue.js +2 -2
  6. package/dist/components/ApiReferenceLayout.vue2.js +13 -10
  7. package/dist/components/Content/ClientLibraries/ClientLibraries.vue.d.ts.map +1 -1
  8. package/dist/components/Content/ClientLibraries/ClientLibraries.vue.js +2 -2
  9. package/dist/components/Content/ClientLibraries/ClientSelector.vue.d.ts.map +1 -1
  10. package/dist/components/Content/ClientLibraries/ClientSelector.vue.js +2 -2
  11. package/dist/components/Content/Content.vue.d.ts.map +1 -1
  12. package/dist/components/Content/Content.vue.js +1 -1
  13. package/dist/components/Content/Content.vue2.js +51 -50
  14. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts +1 -4
  15. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
  16. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +1 -1
  17. package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +133 -129
  18. package/dist/components/Section/SectionHeader.vue.js +2 -2
  19. package/dist/components/SpecificationExtension/SpecificationExtension.vue.d.ts.map +1 -1
  20. package/dist/components/SpecificationExtension/SpecificationExtension.vue.js +30 -21
  21. package/dist/features/ApiClientModal/ApiClientModal.vue.d.ts +2 -0
  22. package/dist/features/ApiClientModal/ApiClientModal.vue.d.ts.map +1 -1
  23. package/dist/features/ApiClientModal/ApiClientModal.vue.js +51 -29
  24. package/dist/features/ApiClientModal/useApiClient.d.ts +128 -48
  25. package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -1
  26. package/dist/features/BaseUrl/BaseUrl.vue.d.ts.map +1 -1
  27. package/dist/features/BaseUrl/BaseUrl.vue.js +33 -28
  28. package/dist/index.js +1 -1
  29. package/dist/style.css +1 -1
  30. package/package.json +17 -12
@@ -1,32 +1,33 @@
1
- import { defineComponent as j, createElementBlock as s, openBlock as i, createCommentVNode as m, createBlock as l, normalizeClass as I, renderSlot as B, Fragment as a, createTextVNode as r, toDisplayString as d, createVNode as u, unref as k, withCtx as n } from "vue";
2
- import { stringify as b } from "flatted";
3
- import { discriminators as M } from "./helpers/optimizeValueForDisplay.js";
4
- import V from "./SchemaPropertyExamples.vue.js";
5
- import x from "../../ScreenReader.vue.js";
6
- import p from "./SchemaPropertyDetail.vue.js";
7
- import N from "../../Badge/Badge.vue.js";
8
- const A = { class: "property-heading" }, C = {
1
+ import { defineComponent as T, createElementBlock as i, openBlock as l, createCommentVNode as u, createBlock as o, normalizeClass as z, renderSlot as D, Fragment as s, createTextVNode as r, toDisplayString as n, createVNode as p, unref as g, withCtx as a } from "vue";
2
+ import { isDefined as H } from "@scalar/oas-utils/helpers";
3
+ import { stringify as E } from "flatted";
4
+ import { discriminators as J } from "./helpers/optimizeValueForDisplay.js";
5
+ import R from "./SchemaPropertyExamples.vue.js";
6
+ import B from "../../ScreenReader.vue.js";
7
+ import m from "./SchemaPropertyDetail.vue.js";
8
+ import L from "../../Badge/Badge.vue.js";
9
+ const G = { class: "property-heading" }, K = {
9
10
  key: 1,
10
11
  class: "property-additional"
11
- }, E = {
12
+ }, Q = {
12
13
  key: 2,
13
14
  class: "property-pattern"
14
- }, L = {
15
+ }, U = {
15
16
  key: 3,
16
17
  class: "property-deprecated"
17
- }, $ = {
18
+ }, W = {
18
19
  key: 4,
19
20
  class: "property-const"
20
- }, D = {
21
+ }, X = {
21
22
  key: 7,
22
23
  class: "property-write-only"
23
- }, F = {
24
+ }, Y = {
24
25
  key: 8,
25
26
  class: "property-read-only"
26
- }, O = {
27
+ }, Z = {
27
28
  key: 9,
28
29
  class: "property-required"
29
- }, Q = /* @__PURE__ */ j({
30
+ }, ae = /* @__PURE__ */ T({
30
31
  __name: "SchemaPropertyHeading",
31
32
  props: {
32
33
  value: {},
@@ -37,214 +38,217 @@ const A = { class: "property-heading" }, C = {
37
38
  withExamples: { type: Boolean, default: !0 },
38
39
  schemas: {}
39
40
  },
40
- setup(S) {
41
- const { value: e, schemas: f } = S, q = M.find((o) => !e || typeof e != "object" ? !1 : o in e || e.items && typeof e.items == "object" && o in e.items), w = (o) => Array.isArray(o == null ? void 0 : o.default) && o.default.length === 1 ? o.default[0] : o == null ? void 0 : o.default, P = (o) => {
42
- if (!o)
41
+ setup(d) {
42
+ const O = J.find((e) => !d.value || typeof d.value != "object" ? !1 : e in d.value || d.value.items && typeof d.value.items == "object" && e in d.value.items), $ = (e) => (e == null ? void 0 : e.default) === null ? "null" : Array.isArray(e == null ? void 0 : e.default) && e.default.length === 1 ? e.default[0] : typeof (e == null ? void 0 : e.default) == "string" ? JSON.stringify(e.default) : e == null ? void 0 : e.default, F = (e) => {
43
+ if (!e)
43
44
  return null;
44
- if (o.name)
45
- return o.name;
46
- if (f && typeof f == "object") {
47
- for (const [t, y] of Object.entries(f))
48
- if (b(y) === b(o))
45
+ if (e.name)
46
+ return e.name;
47
+ if (d.schemas && typeof d.schemas == "object") {
48
+ for (const [t, k] of Object.entries(d.schemas))
49
+ if (E(k) === E(e))
49
50
  return t;
50
51
  }
51
52
  return null;
52
53
  };
53
- return (o, t) => {
54
- var y;
55
- return i(), s("div", A, [
56
- o.$slots.name ? (i(), s("div", {
54
+ return (e, t) => {
55
+ var k, b, N, S, q, w, P, j, I, M, V, A, C;
56
+ return l(), i("div", G, [
57
+ e.$slots.name ? (l(), i("div", {
57
58
  key: 0,
58
- class: I(["property-name", { deprecated: e == null ? void 0 : e.deprecated }])
59
+ class: z(["property-name", { deprecated: (k = e.value) == null ? void 0 : k.deprecated }])
59
60
  }, [
60
- o.pattern ? (i(), s(a, { key: 1 }, [
61
+ e.pattern ? (l(), i(s, { key: 1 }, [
61
62
  t[0] || (t[0] = r("/")),
62
- B(o.$slots, "name", {}, void 0, !0),
63
+ D(e.$slots, "name", {}, void 0, !0),
63
64
  t[1] || (t[1] = r("/"))
64
- ], 64)) : B(o.$slots, "name", { key: 0 }, void 0, !0)
65
- ], 2)) : m("", !0),
66
- o.additional ? (i(), s("div", C, [
67
- e != null && e["x-additionalPropertiesName"] ? (i(), s(a, { key: 0 }, [
68
- r(d(e["x-additionalPropertiesName"]), 1)
69
- ], 64)) : (i(), s(a, { key: 1 }, [
65
+ ], 64)) : D(e.$slots, "name", { key: 0 }, void 0, !0)
66
+ ], 2)) : u("", !0),
67
+ e.additional ? (l(), i("div", K, [
68
+ (b = e.value) != null && b["x-additionalPropertiesName"] ? (l(), i(s, { key: 0 }, [
69
+ r(n(e.value["x-additionalPropertiesName"]), 1)
70
+ ], 64)) : (l(), i(s, { key: 1 }, [
70
71
  r("additional properties")
71
72
  ], 64))
72
- ])) : m("", !0),
73
- o.pattern ? (i(), s("div", E, [
74
- u(k(N), null, {
75
- default: n(() => t[2] || (t[2] = [
73
+ ])) : u("", !0),
74
+ e.pattern ? (l(), i("div", Q, [
75
+ p(g(L), null, {
76
+ default: a(() => t[2] || (t[2] = [
76
77
  r("pattern")
77
78
  ])),
78
79
  _: 1
79
80
  })
80
- ])) : m("", !0),
81
- e != null && e.deprecated ? (i(), s("div", L, [
82
- u(k(N), null, {
83
- default: n(() => t[3] || (t[3] = [
81
+ ])) : u("", !0),
82
+ (N = e.value) != null && N.deprecated ? (l(), i("div", U, [
83
+ p(g(L), null, {
84
+ default: a(() => t[3] || (t[3] = [
84
85
  r("deprecated")
85
86
  ])),
86
87
  _: 1
87
88
  })
88
- ])) : m("", !0),
89
- e != null && e.const || e != null && e.enum && e.enum.length === 1 ? (i(), s("div", $, [
90
- u(p, { truncate: "" }, {
91
- prefix: n(() => t[4] || (t[4] = [
89
+ ])) : u("", !0),
90
+ g(H)((S = e.value) == null ? void 0 : S.const) || (q = e.value) != null && q.enum && e.value.enum.length === 1 ? (l(), i("div", W, [
91
+ p(m, { truncate: "" }, {
92
+ prefix: a(() => t[4] || (t[4] = [
92
93
  r("const:")
93
94
  ])),
94
- default: n(() => [
95
- r(" " + d(e.const ?? e.enum[0]), 1)
96
- ]),
95
+ default: a(() => {
96
+ var y, f, v;
97
+ return [
98
+ r(" " + n(((y = e.value) == null ? void 0 : y.const) ?? ((v = (f = e.value) == null ? void 0 : f.enum) == null ? void 0 : v[0])), 1)
99
+ ];
100
+ }),
97
101
  _: 1
98
102
  })
99
- ])) : e != null && e.type ? (i(), s(a, { key: 5 }, [
100
- u(p, null, {
101
- default: n(() => {
102
- var g;
103
+ ])) : (w = e.value) != null && w.type ? (l(), i(s, { key: 5 }, [
104
+ p(m, null, {
105
+ default: a(() => {
106
+ var y, f, v;
103
107
  return [
104
- u(x, null, {
105
- default: n(() => t[5] || (t[5] = [
108
+ p(B, null, {
109
+ default: a(() => t[5] || (t[5] = [
106
110
  r("Type:")
107
111
  ])),
108
112
  _: 1
109
113
  }),
110
- (g = e == null ? void 0 : e.items) != null && g.type ? (i(), s(a, { key: 0 }, [
111
- r(d(e.type) + " " + d(P(e.items) || e.items.type) + "[] ", 1)
112
- ], 64)) : (i(), s(a, { key: 1 }, [
113
- r(d(Array.isArray(e.type) ? e.type.join(" | ") : e.type) + " " + d(e != null && e.nullable ? " | nullable" : ""), 1)
114
+ (f = (y = e.value) == null ? void 0 : y.items) != null && f.type ? (l(), i(s, { key: 0 }, [
115
+ r(n(e.value.type) + " " + n(F(e.value.items) || e.value.items.type) + "[] ", 1)
116
+ ], 64)) : (l(), i(s, { key: 1 }, [
117
+ r(n(Array.isArray(e.value.type) ? e.value.type.join(" | ") : e.value.type) + " " + n((v = e.value) != null && v.nullable ? " | nullable" : ""), 1)
114
118
  ], 64)),
115
- e.minItems || e.maxItems ? (i(), s(a, { key: 2 }, [
116
- r(d(e.minItems) + "…" + d(e.maxItems), 1)
117
- ], 64)) : m("", !0)
119
+ e.value.minItems || e.value.maxItems ? (l(), i(s, { key: 2 }, [
120
+ r(n(e.value.minItems) + "…" + n(e.value.maxItems), 1)
121
+ ], 64)) : u("", !0)
118
122
  ];
119
123
  }),
120
124
  _: 1
121
125
  }),
122
- e.minLength ? (i(), l(p, { key: 0 }, {
123
- prefix: n(() => t[6] || (t[6] = [
126
+ e.value.minLength ? (l(), o(m, { key: 0 }, {
127
+ prefix: a(() => t[6] || (t[6] = [
124
128
  r("min:")
125
129
  ])),
126
- default: n(() => [
127
- r(" " + d(e.minLength), 1)
130
+ default: a(() => [
131
+ r(" " + n(e.value.minLength), 1)
128
132
  ]),
129
133
  _: 1
130
- })) : m("", !0),
131
- e.maxLength ? (i(), l(p, { key: 1 }, {
132
- prefix: n(() => t[7] || (t[7] = [
134
+ })) : u("", !0),
135
+ e.value.maxLength ? (l(), o(m, { key: 1 }, {
136
+ prefix: a(() => t[7] || (t[7] = [
133
137
  r("max:")
134
138
  ])),
135
- default: n(() => [
136
- r(" " + d(e.maxLength), 1)
139
+ default: a(() => [
140
+ r(" " + n(e.value.maxLength), 1)
137
141
  ]),
138
142
  _: 1
139
- })) : m("", !0),
140
- e.uniqueItems ? (i(), l(p, { key: 2 }, {
141
- default: n(() => t[8] || (t[8] = [
143
+ })) : u("", !0),
144
+ e.value.uniqueItems ? (l(), o(m, { key: 2 }, {
145
+ default: a(() => t[8] || (t[8] = [
142
146
  r(" unique! ")
143
147
  ])),
144
148
  _: 1
145
- })) : m("", !0),
146
- e.format ? (i(), l(p, { key: 3 }, {
147
- default: n(() => [
148
- u(x, null, {
149
- default: n(() => t[9] || (t[9] = [
149
+ })) : u("", !0),
150
+ e.value.format ? (l(), o(m, { key: 3 }, {
151
+ default: a(() => [
152
+ p(B, null, {
153
+ default: a(() => t[9] || (t[9] = [
150
154
  r("Format:")
151
155
  ])),
152
156
  _: 1
153
157
  }),
154
- r(" " + d(e.format), 1)
158
+ r(" " + n(e.value.format), 1)
155
159
  ]),
156
160
  _: 1
157
- })) : m("", !0),
158
- e.minimum !== void 0 && e.exclusiveMinimum ? (i(), l(p, { key: 4 }, {
159
- prefix: n(() => t[10] || (t[10] = [
161
+ })) : u("", !0),
162
+ e.value.minimum !== void 0 && e.value.exclusiveMinimum ? (l(), o(m, { key: 4 }, {
163
+ prefix: a(() => t[10] || (t[10] = [
160
164
  r("greater than:")
161
165
  ])),
162
- default: n(() => [
163
- r(" " + d(e.minimum), 1)
166
+ default: a(() => [
167
+ r(" " + n(e.value.minimum), 1)
164
168
  ]),
165
169
  _: 1
166
- })) : m("", !0),
167
- e.minimum !== void 0 && !e.exclusiveMinimum ? (i(), l(p, { key: 5 }, {
168
- prefix: n(() => t[11] || (t[11] = [
170
+ })) : u("", !0),
171
+ e.value.minimum !== void 0 && !e.value.exclusiveMinimum ? (l(), o(m, { key: 5 }, {
172
+ prefix: a(() => t[11] || (t[11] = [
169
173
  r("min:")
170
174
  ])),
171
- default: n(() => [
172
- r(" " + d(e.minimum), 1)
175
+ default: a(() => [
176
+ r(" " + n(e.value.minimum), 1)
173
177
  ]),
174
178
  _: 1
175
- })) : m("", !0),
176
- e.maximum !== void 0 && e.exclusiveMaximum ? (i(), l(p, { key: 6 }, {
177
- prefix: n(() => t[12] || (t[12] = [
179
+ })) : u("", !0),
180
+ e.value.maximum !== void 0 && e.value.exclusiveMaximum ? (l(), o(m, { key: 6 }, {
181
+ prefix: a(() => t[12] || (t[12] = [
178
182
  r("less than:")
179
183
  ])),
180
- default: n(() => [
181
- r(" " + d(e.maximum), 1)
184
+ default: a(() => [
185
+ r(" " + n(e.value.maximum), 1)
182
186
  ]),
183
187
  _: 1
184
- })) : m("", !0),
185
- e.maximum !== void 0 && !e.exclusiveMaximum ? (i(), l(p, { key: 7 }, {
186
- prefix: n(() => t[13] || (t[13] = [
188
+ })) : u("", !0),
189
+ e.value.maximum !== void 0 && !e.value.exclusiveMaximum ? (l(), o(m, { key: 7 }, {
190
+ prefix: a(() => t[13] || (t[13] = [
187
191
  r("max:")
188
192
  ])),
189
- default: n(() => [
190
- r(" " + d(e.maximum), 1)
193
+ default: a(() => [
194
+ r(" " + n(e.value.maximum), 1)
191
195
  ]),
192
196
  _: 1
193
- })) : m("", !0),
194
- e.pattern ? (i(), l(p, {
197
+ })) : u("", !0),
198
+ e.value.pattern ? (l(), o(m, {
195
199
  key: 8,
196
200
  code: "",
197
201
  truncate: ""
198
202
  }, {
199
- default: n(() => [
200
- u(x, null, {
201
- default: n(() => t[14] || (t[14] = [
203
+ default: a(() => [
204
+ p(B, null, {
205
+ default: a(() => t[14] || (t[14] = [
202
206
  r("Pattern:")
203
207
  ])),
204
208
  _: 1
205
209
  }),
206
- r(" " + d(e.pattern), 1)
210
+ r(" " + n(e.value.pattern), 1)
207
211
  ]),
208
212
  _: 1
209
- })) : m("", !0),
210
- o.$props.enum ? (i(), l(p, { key: 9 }, {
211
- default: n(() => t[15] || (t[15] = [
213
+ })) : u("", !0),
214
+ e.$props.enum ? (l(), o(m, { key: 9 }, {
215
+ default: a(() => t[15] || (t[15] = [
212
216
  r("enum")
213
217
  ])),
214
218
  _: 1
215
- })) : m("", !0),
216
- e.default !== void 0 ? (i(), l(p, {
219
+ })) : u("", !0),
220
+ e.value.default !== void 0 ? (l(), o(m, {
217
221
  key: 10,
218
222
  truncate: ""
219
223
  }, {
220
- prefix: n(() => t[16] || (t[16] = [
224
+ prefix: a(() => t[16] || (t[16] = [
221
225
  r("default:")
222
226
  ])),
223
- default: n(() => [
224
- r(" " + d(w(e)), 1)
227
+ default: a(() => [
228
+ r(" " + n($(e.value)), 1)
225
229
  ]),
226
230
  _: 1
227
- })) : m("", !0)
228
- ], 64)) : (i(), s(a, { key: 6 }, [
229
- (e == null ? void 0 : e.nullable) === !0 ? (i(), l(p, { key: 0 }, {
230
- default: n(() => t[17] || (t[17] = [
231
+ })) : u("", !0)
232
+ ], 64)) : (l(), i(s, { key: 6 }, [
233
+ ((P = e.value) == null ? void 0 : P.nullable) === !0 ? (l(), o(m, { key: 0 }, {
234
+ default: a(() => t[17] || (t[17] = [
231
235
  r(" nullable ")
232
236
  ])),
233
237
  _: 1
234
- })) : m("", !0)
238
+ })) : u("", !0)
235
239
  ], 64)),
236
- e != null && e.writeOnly ? (i(), s("div", D, " write-only ")) : e != null && e.readOnly ? (i(), s("div", F, " read-only ")) : m("", !0),
237
- o.required ? (i(), s("div", O, " required ")) : m("", !0),
238
- o.withExamples ? (i(), l(V, {
240
+ (j = e.value) != null && j.writeOnly ? (l(), i("div", X, " write-only ")) : (I = e.value) != null && I.readOnly ? (l(), i("div", Y, " read-only ")) : u("", !0),
241
+ e.required ? (l(), i("div", Z, " required ")) : u("", !0),
242
+ e.withExamples ? (l(), o(R, {
239
243
  key: 10,
240
- examples: e == null ? void 0 : e.examples,
241
- example: (e == null ? void 0 : e.example) || ((y = e == null ? void 0 : e.items) == null ? void 0 : y.example),
242
- "discriminator-type": k(q)
243
- }, null, 8, ["examples", "example", "discriminator-type"])) : m("", !0)
244
+ examples: (M = e.value) == null ? void 0 : M.examples,
245
+ example: ((V = e.value) == null ? void 0 : V.example) || ((C = (A = e.value) == null ? void 0 : A.items) == null ? void 0 : C.example),
246
+ "discriminator-type": g(O)
247
+ }, null, 8, ["examples", "example", "discriminator-type"])) : u("", !0)
244
248
  ]);
245
249
  };
246
250
  }
247
251
  });
248
252
  export {
249
- Q as default
253
+ ae as default
250
254
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./SectionHeader.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-2f429af7"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-b460b827"]]);
5
5
  export {
6
- f as default
6
+ m as default
7
7
  };
@@ -1 +1 @@
1
- {"version":3,"file":"SpecificationExtension.vue.d.ts","sourceRoot":"","sources":["../../../src/components/SpecificationExtension/SpecificationExtension.vue"],"names":[],"mappings":"AAsEA,KAAK,WAAW,GAAG;IACjB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAA;CAC3C,CAAC;;AA2GF,wBAMG"}
1
+ {"version":3,"file":"SpecificationExtension.vue.d.ts","sourceRoot":"","sources":["../../../src/components/SpecificationExtension/SpecificationExtension.vue"],"names":[],"mappings":"AAkFA,KAAK,WAAW,GAAG;IACjB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAA;CAC3C,CAAC;;AAyHF,wBAMG"}
@@ -1,40 +1,49 @@
1
- import { defineComponent as d, computed as s, createElementBlock as u, createCommentVNode as v, openBlock as n, Fragment as g, renderList as E, createBlock as c, unref as _, withCtx as x, resolveDynamicComponent as C, mergeProps as h } from "vue";
2
- import { ScalarErrorBoundary as k } from "@scalar/components";
3
- import { usePluginManager as y } from "../../plugins/hooks/usePluginManager.js";
4
- const B = {
1
+ import { defineComponent as E, computed as c, createElementBlock as l, createCommentVNode as _, openBlock as r, Fragment as k, renderList as y, createBlock as o, unref as C, withCtx as h, resolveDynamicComponent as s, mergeProps as p } from "vue";
2
+ import { ScalarErrorBoundary as B } from "@scalar/components";
3
+ import { usePluginManager as b } from "../../plugins/hooks/usePluginManager.js";
4
+ const N = {
5
5
  key: 0,
6
6
  class: "text-base"
7
- }, j = /* @__PURE__ */ d({
7
+ }, O = /* @__PURE__ */ E({
8
8
  __name: "SpecificationExtension",
9
9
  props: {
10
10
  value: {}
11
11
  },
12
- setup(m) {
13
- const { getSpecificationExtensions: i } = y();
14
- function l(e) {
15
- return Object.keys(e ?? {}).filter(
16
- (t) => t.startsWith("x-")
12
+ setup(i) {
13
+ const { getSpecificationExtensions: f } = b();
14
+ function d(t) {
15
+ return Object.keys(t ?? {}).filter(
16
+ (n) => n.startsWith("x-")
17
17
  );
18
18
  }
19
- function p(e) {
20
- return e.flatMap((t) => i(t)).filter((t) => t.component);
19
+ function v(t) {
20
+ return t.flatMap((n) => f(n)).filter((n) => n.component);
21
21
  }
22
- const f = s(() => l(m.value)), r = s(
23
- () => p(f.value)
22
+ const g = c(() => d(i.value)), a = c(
23
+ () => v(g.value)
24
24
  );
25
- return (e, t) => typeof e.value == "object" && r.value.length ? (n(), u("div", B, [
26
- (n(!0), u(g, null, E(r.value, (o) => (n(), c(_(k), null, {
27
- default: x(() => {
28
- var a;
25
+ return (t, n) => typeof t.value == "object" && a.value.length ? (r(), l("div", N, [
26
+ (r(!0), l(k, null, y(a.value, (e) => (r(), o(C(B), null, {
27
+ default: h(() => {
28
+ var u, m;
29
29
  return [
30
- (n(), c(C(o.component), h({ ref_for: !0 }, { [o.name]: (a = e.value) == null ? void 0 : a[o.name] }), null, 16))
30
+ e.renderer ? (r(), o(s(e.renderer), p({
31
+ key: 0,
32
+ ref_for: !0
33
+ }, {
34
+ [e.name]: (u = t.value) == null ? void 0 : u[e.name],
35
+ component: e.component
36
+ }), null, 16)) : (r(), o(s(e.component), p({
37
+ key: 1,
38
+ ref_for: !0
39
+ }, { [e.name]: (m = t.value) == null ? void 0 : m[e.name] }), null, 16))
31
40
  ];
32
41
  }),
33
42
  _: 2
34
43
  }, 1024))), 256))
35
- ])) : v("", !0);
44
+ ])) : _("", !0);
36
45
  }
37
46
  });
38
47
  export {
39
- j as default
48
+ O as default
40
49
  };
@@ -1,6 +1,8 @@
1
1
  import type { ApiClientConfiguration } from '@scalar/types/api-reference';
2
+ import type { Spec } from '@scalar/types/legacy';
2
3
  type __VLS_Props = {
3
4
  configuration: Partial<ApiClientConfiguration>;
5
+ parsedSpec: Spec;
4
6
  };
5
7
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, HTMLDivElement>;
6
8
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"ApiClientModal.vue.d.ts","sourceRoot":"","sources":["../../../src/features/ApiClientModal/ApiClientModal.vue"],"names":[],"mappings":"AA8GA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAYzE,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,OAAO,CAAC,sBAAsB,CAAC,CAAA;CAC/C,CAAC;;AAqIF,wBAOG"}
1
+ {"version":3,"file":"ApiClientModal.vue.d.ts","sourceRoot":"","sources":["../../../src/features/ApiClientModal/ApiClientModal.vue"],"names":[],"mappings":"AAkIA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AACzE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAYhD,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,OAAO,CAAC,sBAAsB,CAAC,CAAA;IAC9C,UAAU,EAAE,IAAI,CAAA;CACjB,CAAC;;AA+JF,wBAOG"}
@@ -1,51 +1,73 @@
1
- import { defineComponent as h, ref as v, onMounted as d, watch as E, onBeforeUnmount as C, createElementBlock as g, openBlock as x } from "vue";
2
- import { useActiveEntities as S, useWorkspace as _ } from "@scalar/api-client/store";
3
- import { mutateServerDiff as k, mutateSecuritySchemeDiff as b } from "@scalar/api-client/views/Request/libs";
4
- import { watchDebounced as A } from "@vueuse/core";
5
- import B from "microdiff";
6
- import { useApiClient as D } from "./useApiClient.js";
1
+ import { defineComponent as h, ref as S, onMounted as E, watch as b, onBeforeUnmount as x, createElementBlock as M, openBlock as g } from "vue";
2
+ import { useActiveEntities as k, useWorkspace as A } from "@scalar/api-client/store";
3
+ import { mutateSecuritySchemeDiff as C } from "@scalar/api-client/views/Request/libs";
4
+ import { getServersFromOpenApiDocument as U } from "@scalar/oas-utils/transforms";
5
+ import { watchDebounced as B } from "@vueuse/core";
6
+ import D from "microdiff";
7
+ import { useApiClient as _ } from "./useApiClient.js";
7
8
  import { useNavState as y } from "../../hooks/useNavState.js";
8
9
  import { useExampleStore as I } from "../../legacy/stores/useExampleStore.js";
9
- const F = /* @__PURE__ */ h({
10
+ const G = /* @__PURE__ */ h({
10
11
  __name: "ApiClientModal",
11
12
  props: {
12
- configuration: {}
13
+ configuration: {},
14
+ parsedSpec: {}
13
15
  },
14
16
  setup(i) {
15
- const n = v(null), { client: o, init: p } = D(), { selectedExampleKey: f, operationId: u } = I(), c = S(), a = _(), { isIntersectionEnabled: l } = y();
16
- return d(() => {
17
- n.value && p({
18
- el: n.value,
17
+ const c = S(null), { client: o, init: v } = _(), { selectedExampleKey: d, operationId: l } = I(), s = k(), r = A(), { isIntersectionEnabled: m } = y();
18
+ return E(() => {
19
+ c.value && v({
20
+ el: c.value,
19
21
  configuration: i.configuration,
20
- store: a
22
+ store: r
21
23
  });
22
- }), A(
24
+ }), B(
23
25
  () => i.configuration,
24
- (e, r) => {
25
- var m;
26
- if (!r)
26
+ (e, a) => {
27
+ var f;
28
+ if (!a || !s.activeCollection.value)
27
29
  return;
28
- const s = B(r, e);
29
- s.some(
30
+ const n = s.activeCollection.value, p = D(a, e);
31
+ if (p.some(
30
32
  (t) => t.path[0] === "url" || t.path[0] === "content" || t.path[1] === "url" || t.path[1] === "content"
31
- ) ? (m = o.value) == null || m.updateConfig(e) : s.forEach((t) => {
32
- t.path[0] === "servers" ? k(t, c, a) : t.path[0] === "authentication" && b(t, c, a);
33
- }), l.value = !1, setTimeout(() => {
34
- l.value = !0;
33
+ ))
34
+ (f = o.value) == null || f.updateConfig(e);
35
+ else if (p.forEach((t) => {
36
+ t.path[0] === "authentication" && C(t, s, r);
37
+ }), e.servers || a.servers) {
38
+ n.servers.forEach((u) => {
39
+ r.serverMutators.delete(u, n.uid);
40
+ });
41
+ const t = U(
42
+ e.servers ?? i.parsedSpec.servers,
43
+ {
44
+ baseServerURL: e.baseServerURL
45
+ }
46
+ );
47
+ t.forEach((u) => {
48
+ r.serverMutators.add(u, n.uid);
49
+ }), t.length && r.collectionMutators.edit(
50
+ n.uid,
51
+ "selectedServerUid",
52
+ t[t.length - 1].uid
53
+ );
54
+ }
55
+ m.value = !1, setTimeout(() => {
56
+ m.value = !0;
35
57
  }, 1e3);
36
58
  },
37
59
  { deep: !0, debounce: 300 }
38
- ), E(f, (e) => {
39
- o.value && e && u.value && o.value.updateExample(e, u.value);
40
- }), C(() => {
60
+ ), b(d, (e) => {
61
+ o.value && e && l.value && o.value.updateExample(e, l.value);
62
+ }), x(() => {
41
63
  var e;
42
64
  return (e = o.value) == null ? void 0 : e.app.unmount();
43
- }), (e, r) => (x(), g("div", {
65
+ }), (e, a) => (g(), M("div", {
44
66
  ref_key: "el",
45
- ref: n
67
+ ref: c
46
68
  }, null, 512));
47
69
  }
48
70
  });
49
71
  export {
50
- F as default
72
+ G as default
51
73
  };