@scalar/api-reference 1.28.9 → 1.28.10

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 (29) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/browser/standalone.js +1191 -1149
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/ApiReferenceLayout.vue.js +2 -2
  5. package/dist/components/ApiReferenceLayout.vue2.js +1 -1
  6. package/dist/components/Content/Models/Models.vue.d.ts.map +1 -1
  7. package/dist/components/Content/Models/Models.vue.js +2 -2
  8. package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
  9. package/dist/components/Content/Schema/Schema.vue.js +4 -4
  10. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
  11. package/dist/components/Content/Schema/SchemaProperty.vue.js +1 -1
  12. package/dist/components/Content/Schema/SchemaProperty.vue2.js +96 -114
  13. package/dist/components/Content/Schema/SchemaPropertyExamples.vue.d.ts +8 -0
  14. package/dist/components/Content/Schema/SchemaPropertyExamples.vue.d.ts.map +1 -0
  15. package/dist/components/Content/Schema/SchemaPropertyExamples.vue.js +7 -0
  16. package/dist/components/Content/Schema/SchemaPropertyExamples.vue2.js +71 -0
  17. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts +2 -0
  18. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
  19. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +1 -1
  20. package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +139 -130
  21. package/dist/features/ApiClientModal/useApiClient.d.ts +40 -14
  22. package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -1
  23. package/dist/features/ExampleResponses/ExampleResponses.vue.d.ts.map +1 -1
  24. package/dist/features/ExampleResponses/ExampleResponses.vue.js +2 -2
  25. package/dist/features/ExampleResponses/ExampleResponses.vue2.js +86 -85
  26. package/dist/helpers/get-request.d.ts.map +1 -1
  27. package/dist/index.js +1 -1
  28. package/dist/style.css +1 -1
  29. package/package.json +7 -7
@@ -1,175 +1,176 @@
1
- import { defineComponent as M, useId as N, ref as S, computed as d, openBlock as o, createBlock as t, unref as l, withCtx as u, createVNode as v, createElementBlock as x, createCommentVNode as f, createTextVNode as E, withDirectives as F, createElementVNode as R, vModelCheckbox as I, Fragment as T, renderList as O, toDisplayString as A } from "vue";
2
- import { ScalarIcon as D, ScalarCodeBlock as P, ScalarMarkdown as U } from "@scalar/components";
3
- import { normalizeMimeTypeObject as H } from "@scalar/oas-utils/helpers";
1
+ import { defineComponent as M, useId as N, ref as E, computed as v, openBlock as o, createBlock as r, unref as s, withCtx as u, createVNode as x, createElementBlock as f, createCommentVNode as k, createTextVNode as g, withDirectives as O, createElementVNode as R, vModelCheckbox as F, Fragment as C, renderList as I, toDisplayString as A } from "vue";
2
+ import { ScalarIcon as D, ScalarCodeBlock as K, ScalarMarkdown as P } from "@scalar/components";
3
+ import { normalizeMimeTypeObject as U, getObjectKeys as H } from "@scalar/oas-utils/helpers";
4
4
  import { useClipboard as J } from "@scalar/use-hooks/useClipboard";
5
- import K from "../../components/ScreenReader.vue.js";
6
- import V from "./ExampleResponse.vue.js";
7
- import L from "../../components/Card/Card.vue.js";
8
- import W from "../../components/Card/CardTabHeader.vue.js";
9
- import q from "../../components/Card/CardTab.vue.js";
10
- import G from "../../components/Card/CardContent.vue.js";
11
- import Q from "../../components/Card/CardFooter.vue.js";
12
- import X from "../ExampleRequest/ExamplePicker.vue.js";
13
- const Y = {
5
+ import L from "../../components/ScreenReader.vue.js";
6
+ import T from "./ExampleResponse.vue.js";
7
+ import W from "../../components/Card/Card.vue.js";
8
+ import q from "../../components/Card/CardTabHeader.vue.js";
9
+ import G from "../../components/Card/CardTab.vue.js";
10
+ import Q from "../../components/Card/CardContent.vue.js";
11
+ import X from "../../components/Card/CardFooter.vue.js";
12
+ import Y from "../ExampleRequest/ExamplePicker.vue.js";
13
+ const Z = {
14
14
  key: 1,
15
15
  class: "scalar-card-checkbox"
16
- }, Z = ["aria-controls"], $ = { class: "scalar-card-container custom-scroll" }, z = {
16
+ }, $ = ["aria-controls"], z = { class: "scalar-card-container custom-scroll" }, ee = {
17
17
  key: 1,
18
18
  class: "response-description"
19
- }, me = /* @__PURE__ */ M({
19
+ }, de = /* @__PURE__ */ M({
20
20
  __name: "ExampleResponses",
21
21
  props: {
22
22
  responses: {}
23
23
  },
24
- setup(g) {
25
- const c = N(), { copyToClipboard: _ } = J(), p = S(), b = d(() => Object.keys(g.responses ?? {}).sort()), k = d(
26
- () => !!s.value.examples
27
- ), C = S(0), i = d(() => {
24
+ setup(w) {
25
+ const n = N(), { copyToClipboard: V } = J(), p = E(), h = v(() => Object.keys(w.responses ?? {}).sort()), y = v(
26
+ () => !!l.value.examples
27
+ ), j = E(0), i = v(() => {
28
28
  var a;
29
- const e = b.value[C.value];
30
- return (a = g.responses) == null ? void 0 : a[e];
31
- }), s = d(() => {
32
- var a;
33
- const e = H(
34
- (a = i.value) == null ? void 0 : a.content
35
- );
29
+ const e = h.value[j.value];
30
+ return (a = w.responses) == null ? void 0 : a[e];
31
+ }), l = v(() => {
32
+ var m;
33
+ const e = U(
34
+ (m = i.value) == null ? void 0 : m.content
35
+ ), a = H(e ?? {});
36
36
  return (
37
37
  // OpenAPI 3.x
38
- (e == null ? void 0 : e["application/json"]) ?? (e == null ? void 0 : e["application/xml"]) ?? (e == null ? void 0 : e["text/plain"]) ?? (e == null ? void 0 : e["text/html"]) ?? (e == null ? void 0 : e["*/*"]) ?? // Swagger 2.0
38
+ (e == null ? void 0 : e["application/json"]) ?? (e == null ? void 0 : e["application/xml"]) ?? (e == null ? void 0 : e["text/plain"]) ?? (e == null ? void 0 : e["text/html"]) ?? (e == null ? void 0 : e["*/*"]) ?? // Take the first key - in the future we may want to use the selected content type
39
+ (e == null ? void 0 : e[a[0]]) ?? // Swagger 2.0
39
40
  i.value
40
41
  );
41
- }), j = () => {
42
- if (!k.value)
43
- return s.value.example;
44
- if (Array.isArray(s.value.examples))
45
- return s.value.examples[0];
46
- const e = Object.keys(s.value.examples)[0];
47
- return s.value.examples[e];
48
- }, y = d(() => ({
49
- ...s.value,
50
- example: k.value && p.value ? s.value.examples[p.value].value ?? s.value.examples[p.value] : j()
42
+ }), _ = () => {
43
+ if (!y.value)
44
+ return l.value.example;
45
+ if (Array.isArray(l.value.examples))
46
+ return l.value.examples[0];
47
+ const e = Object.keys(l.value.examples)[0];
48
+ return l.value.examples[e];
49
+ }, b = v(() => ({
50
+ ...l.value,
51
+ example: y.value && p.value ? l.value.examples[p.value].value ?? l.value.examples[p.value] : _()
51
52
  })), B = (e) => {
52
- C.value = e, p.value = void 0;
53
- }, h = S(!1);
54
- return (e, a) => b.value.length ? (o(), t(l(L), {
53
+ j.value = e, p.value = void 0;
54
+ }, S = E(!1);
55
+ return (e, a) => h.value.length ? (o(), r(s(W), {
55
56
  key: 0,
56
57
  "aria-label": "Example Responses",
57
58
  role: "region"
58
59
  }, {
59
60
  default: u(() => {
60
- var w;
61
+ var m;
61
62
  return [
62
- v(l(W), {
63
+ x(s(q), {
63
64
  muted: "",
64
65
  x: "as",
65
66
  onChange: B
66
67
  }, {
67
68
  actions: u(() => {
68
- var r, m;
69
+ var t, d;
69
70
  return [
70
- (r = s.value) != null && r.example ? (o(), x("button", {
71
+ (t = l.value) != null && t.example ? (o(), f("button", {
71
72
  key: 0,
72
73
  class: "code-copy",
73
74
  type: "button",
74
75
  onClick: a[0] || (a[0] = () => {
75
- var n;
76
- return l(_)((n = s.value) == null ? void 0 : n.example);
76
+ var c;
77
+ return s(V)((c = l.value) == null ? void 0 : c.example);
77
78
  })
78
79
  }, [
79
- v(l(D), {
80
+ x(s(D), {
80
81
  icon: "Clipboard",
81
82
  width: "12px"
82
83
  })
83
- ])) : f("", !0),
84
- (m = s.value) != null && m.schema ? (o(), x("label", Y, [
85
- a[4] || (a[4] = E(" Show Schema ")),
86
- F(R("input", {
87
- "onUpdate:modelValue": a[1] || (a[1] = (n) => h.value = n),
88
- "aria-controls": l(c),
84
+ ])) : k("", !0),
85
+ (d = l.value) != null && d.schema ? (o(), f("label", Z, [
86
+ a[4] || (a[4] = g(" Show Schema ")),
87
+ O(R("input", {
88
+ "onUpdate:modelValue": a[1] || (a[1] = (c) => S.value = c),
89
+ "aria-controls": s(n),
89
90
  class: "scalar-card-checkbox-input",
90
91
  type: "checkbox"
91
- }, null, 8, Z), [
92
- [I, h.value]
92
+ }, null, 8, $), [
93
+ [F, S.value]
93
94
  ]),
94
95
  a[5] || (a[5] = R("span", { class: "scalar-card-checkbox-checkmark" }, null, -1))
95
- ])) : f("", !0)
96
+ ])) : k("", !0)
96
97
  ];
97
98
  }),
98
99
  default: u(() => [
99
- (o(!0), x(T, null, O(b.value, (r) => (o(), t(l(q), {
100
- key: r,
101
- "aria-controls": l(c)
100
+ (o(!0), f(C, null, I(h.value, (t) => (o(), r(s(G), {
101
+ key: t,
102
+ "aria-controls": s(n)
102
103
  }, {
103
104
  default: u(() => [
104
- v(K, null, {
105
+ x(L, null, {
105
106
  default: u(() => a[3] || (a[3] = [
106
- E("Status:")
107
+ g("Status:")
107
108
  ])),
108
109
  _: 1
109
110
  }),
110
- E(" " + A(r), 1)
111
+ g(" " + A(t), 1)
111
112
  ]),
112
113
  _: 2
113
114
  }, 1032, ["aria-controls"]))), 128))
114
115
  ]),
115
116
  _: 1
116
117
  }),
117
- R("div", $, [
118
- v(l(G), { muted: "" }, {
118
+ R("div", z, [
119
+ x(s(Q), { muted: "" }, {
119
120
  default: u(() => {
120
- var r;
121
+ var t;
121
122
  return [
122
- (r = s.value) != null && r.schema ? (o(), x(T, { key: 0 }, [
123
- h.value && y.value ? (o(), t(l(P), {
123
+ (t = l.value) != null && t.schema ? (o(), f(C, { key: 0 }, [
124
+ S.value && b.value ? (o(), r(s(K), {
124
125
  key: 0,
125
- id: l(c),
126
+ id: s(n),
126
127
  class: "-outline-offset-2",
127
- content: y.value,
128
+ content: b.value,
128
129
  lang: "json"
129
- }, null, 8, ["id", "content"])) : (o(), t(V, {
130
+ }, null, 8, ["id", "content"])) : (o(), r(T, {
130
131
  key: 1,
131
- id: l(c),
132
- response: y.value
132
+ id: s(n),
133
+ response: b.value
133
134
  }, null, 8, ["id", "response"]))
134
- ], 64)) : (o(), t(V, {
135
+ ], 64)) : (o(), r(T, {
135
136
  key: 1,
136
- id: l(c),
137
- response: y.value
137
+ id: s(n),
138
+ response: b.value
138
139
  }, null, 8, ["id", "response"]))
139
140
  ];
140
141
  }),
141
142
  _: 1
142
143
  })
143
144
  ]),
144
- (w = i.value) != null && w.description || k.value ? (o(), t(l(Q), {
145
+ (m = i.value) != null && m.description || y.value ? (o(), r(s(X), {
145
146
  key: 0,
146
147
  class: "response-card-footer",
147
148
  muted: ""
148
149
  }, {
149
150
  default: u(() => {
150
- var r, m;
151
+ var t, d;
151
152
  return [
152
- k.value ? (o(), t(l(X), {
153
+ y.value ? (o(), r(s(Y), {
153
154
  key: 0,
154
155
  class: "response-example-selector",
155
- examples: (r = s.value) == null ? void 0 : r.examples,
156
- "onUpdate:modelValue": a[2] || (a[2] = (n) => p.value = n)
157
- }, null, 8, ["examples"])) : (m = i.value) != null && m.description ? (o(), x("div", z, [
158
- v(l(U), {
156
+ examples: (t = l.value) == null ? void 0 : t.examples,
157
+ "onUpdate:modelValue": a[2] || (a[2] = (c) => p.value = c)
158
+ }, null, 8, ["examples"])) : (d = i.value) != null && d.description ? (o(), f("div", ee, [
159
+ x(s(P), {
159
160
  class: "markdown",
160
161
  value: i.value.description
161
162
  }, null, 8, ["value"])
162
- ])) : f("", !0)
163
+ ])) : k("", !0)
163
164
  ];
164
165
  }),
165
166
  _: 1
166
- })) : f("", !0)
167
+ })) : k("", !0)
167
168
  ];
168
169
  }),
169
170
  _: 1
170
- })) : f("", !0);
171
+ })) : k("", !0);
171
172
  }
172
173
  });
173
174
  export {
174
- me as default
175
+ de as default
175
176
  };
@@ -1 +1 @@
1
- {"version":3,"file":"get-request.d.ts","sourceRoot":"","sources":["../../src/helpers/get-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAE9D,6CAA6C;AAC7C,eAAO,MAAM,UAAU,aAAc,cAAc,CAAC,UAAU,CAAC,QAAQ,MAAM,UAAU,MAAM;yBAE4vT,KAAK;;;kDAA2H,KAAK,8CAA8C,KAAK;wCAA6E,KAAK;8BAA6D,KAAK;+BAAyD,KAAK;;;;;;mBAAwR,CAAC;;;;;;;;;;;;;mBAA8f,CAAC;eAAyC,CAAC;cAA6B,CAAC;eAA8B,CAAC;aAA4B,CAAC;gBAA8H,CAAC;iBAAoD,CAAC;mBAAkC,CAAC;;;;;kCAAiM,eAAe;aAD77W,CAAA"}
1
+ {"version":3,"file":"get-request.d.ts","sourceRoot":"","sources":["../../src/helpers/get-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAE9D,6CAA6C;AAC7C,eAAO,MAAM,UAAU,aAAc,cAAc,CAAC,UAAU,CAAC,QAAQ,MAAM,UAAU,MAAM;yBAEoyT,KAAK;;;kDAA2H,KAAK,8CAA8C,KAAK;wCAA6E,KAAK;8BAA6D,KAAK;+BAAyD,KAAK;;;;;;mBAAwR,CAAC;;;;;;;;;;;;;mBAA8f,CAAC;eAAyC,CAAC;cAA6B,CAAC;eAA8B,CAAC;aAA4B,CAAC;gBAA8H,CAAC;iBAAoD,CAAC;mBAAkC,CAAC;;;;;kCAAiM,eAAe;aADr+W,CAAA"}