@scalar/api-reference 1.29.3 → 1.30.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 (38) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +13 -114
  3. package/dist/browser/standalone.js +1864 -1773
  4. package/dist/browser/webpack-stats.json +1 -1
  5. package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
  6. package/dist/components/Content/Schema/Schema.vue.js +2 -2
  7. package/dist/components/Content/Schema/Schema.vue2.js +118 -84
  8. package/dist/components/Content/Schema/SchemaDiscriminator.vue.d.ts +13 -0
  9. package/dist/components/Content/Schema/SchemaDiscriminator.vue.d.ts.map +1 -0
  10. package/dist/components/Content/Schema/SchemaDiscriminator.vue.js +49 -0
  11. package/dist/components/Content/Schema/SchemaDiscriminator.vue2.js +4 -0
  12. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
  13. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +3 -3
  14. package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +123 -119
  15. package/dist/components/Content/Schema/helpers/schema-discriminator.d.ts +9 -1
  16. package/dist/components/Content/Schema/helpers/schema-discriminator.d.ts.map +1 -1
  17. package/dist/components/Content/Schema/helpers/schema-discriminator.js +45 -0
  18. package/dist/components/Section/SectionHeaderTag.vue.d.ts.map +1 -1
  19. package/dist/components/Section/SectionHeaderTag.vue.js +2 -2
  20. package/dist/features/ApiClientModal/useApiClient.d.ts +28 -8
  21. package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -1
  22. package/dist/features/Operation/components/callbacks/Callback.vue.d.ts +14 -0
  23. package/dist/features/Operation/components/callbacks/Callback.vue.d.ts.map +1 -0
  24. package/dist/features/Operation/components/callbacks/Callback.vue.js +7 -0
  25. package/dist/features/Operation/components/callbacks/Callback.vue2.js +62 -0
  26. package/dist/features/Operation/components/callbacks/Callbacks.vue.d.ts +10 -0
  27. package/dist/features/Operation/components/callbacks/Callbacks.vue.d.ts.map +1 -0
  28. package/dist/features/Operation/components/callbacks/Callbacks.vue.js +30 -0
  29. package/dist/features/Operation/components/callbacks/Callbacks.vue2.js +4 -0
  30. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts +2 -2
  31. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
  32. package/dist/features/Operation/layouts/ModernLayout.vue.js +1 -1
  33. package/dist/features/Operation/layouts/ModernLayout.vue2.js +86 -74
  34. package/dist/features/Operation/types/schemas.d.ts +3 -0
  35. package/dist/features/Operation/types/schemas.d.ts.map +1 -0
  36. package/dist/index.js +1 -1
  37. package/dist/style.css +1 -1
  38. package/package.json +8 -8
@@ -0,0 +1,30 @@
1
+ import { defineComponent as p, createElementBlock as l, openBlock as e, createElementVNode as k, Fragment as t, renderList as n, createBlock as d } from "vue";
2
+ import b from "./Callback.vue.js";
3
+ const f = { class: "mt-6 gap-3" }, g = /* @__PURE__ */ p({
4
+ __name: "Callbacks",
5
+ props: {
6
+ callbacks: {},
7
+ collection: {},
8
+ schemas: {}
9
+ },
10
+ setup(h) {
11
+ return (c, o) => (e(), l("div", f, [
12
+ o[0] || (o[0] = k("div", { class: "text-c-1 my-3 text-lg font-medium" }, "Callbacks", -1)),
13
+ (e(!0), l(t, null, n(c.callbacks, (a, r) => (e(), l(t, { key: r }, [
14
+ (e(!0), l(t, null, n(a, (s, m) => (e(), l(t, null, [
15
+ (e(!0), l(t, null, n(s, (u, i) => (e(), d(b, {
16
+ callback: u,
17
+ collection: c.collection,
18
+ method: i,
19
+ name: r,
20
+ schemas: c.schemas,
21
+ url: m
22
+ }, null, 8, ["callback", "collection", "method", "name", "schemas", "url"]))), 256))
23
+ ], 64))), 256))
24
+ ], 64))), 128))
25
+ ]));
26
+ }
27
+ });
28
+ export {
29
+ g as default
30
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./Callbacks.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -1,6 +1,6 @@
1
1
  import type { Collection, Operation, Server } from '@scalar/oas-utils/entities/spec';
2
- import type { OpenAPIV2, OpenAPIV3, OpenAPIV3_1 } from '@scalar/openapi-types';
3
2
  import type { TransformedOperation } from '@scalar/types/legacy';
3
+ import type { Schemas } from '../../../features/Operation/types/schemas';
4
4
  type __VLS_Props = {
5
5
  id?: string;
6
6
  collection: Collection;
@@ -8,7 +8,7 @@ type __VLS_Props = {
8
8
  operation: Operation;
9
9
  /** @deprecated Use `operation` instead */
10
10
  transformedOperation: TransformedOperation;
11
- schemas?: OpenAPIV2.DefinitionsObject | Record<string, OpenAPIV3.SchemaObject> | Record<string, OpenAPIV3_1.SchemaObject> | unknown;
11
+ schemas?: Schemas;
12
12
  };
13
13
  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, {}, any>;
14
14
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"ModernLayout.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/layouts/ModernLayout.vue"],"names":[],"mappings":"AAiJA,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,MAAM,EACP,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAC9E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AA6BhE,KAAK,WAAW,GAAG;IACjB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,UAAU,EAAE,UAAU,CAAA;IACtB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;IACpB,0CAA0C;IAC1C,oBAAoB,EAAE,oBAAoB,CAAA;IAC1C,OAAO,CAAC,EACJ,SAAS,CAAC,iBAAiB,GAC3B,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,YAAY,CAAC,GACtC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,YAAY,CAAC,GACxC,OAAO,CAAA;CACZ,CAAC;;AA2OF,wBAOG"}
1
+ {"version":3,"file":"ModernLayout.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/layouts/ModernLayout.vue"],"names":[],"mappings":"AAuJA,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,MAAM,EACP,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAgBhE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAA;AAejE,KAAK,WAAW,GAAG;IACjB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,UAAU,EAAE,UAAU,CAAA;IACtB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;IACpB,0CAA0C;IAC1C,oBAAoB,EAAE,oBAAoB,CAAA;IAC1C,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAC;;AA2PF,wBAOG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./ModernLayout.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-5fb2c298"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-af49b015"]]);
5
5
  export {
6
6
  m as default
7
7
  };
@@ -1,22 +1,23 @@
1
- import { defineComponent as b, useId as O, computed as S, createBlock as p, openBlock as m, unref as e, withCtx as a, createVNode as r, createCommentVNode as y, createElementVNode as t, normalizeClass as d, createTextVNode as f, toDisplayString as u } from "vue";
2
- import { ScalarMarkdown as C, ScalarErrorBoundary as c } from "@scalar/components";
3
- import k from "../../../components/OperationPath.vue.js";
1
+ import { defineComponent as y, useId as O, computed as S, createBlock as t, openBlock as n, unref as o, withCtx as r, createVNode as a, createCommentVNode as c, createElementVNode as i, normalizeClass as f, createTextVNode as u, toDisplayString as h } from "vue";
2
+ import { ScalarMarkdown as k, ScalarErrorBoundary as l } from "@scalar/components";
3
+ import C from "../../../components/OperationPath.vue.js";
4
4
  import { useConfig as B } from "../../../hooks/useConfig.js";
5
- import { getOperationStability as h, getOperationStabilityColor as _, isOperationDeprecated as E } from "../../../libs/openapi.js";
6
- import N from "../components/OperationParameters.vue.js";
7
- import V from "../components/OperationResponses.vue.js";
8
- import w from "../../../components/Section/Section.vue.js";
9
- import I from "../../../components/Section/SectionContent.vue.js";
10
- import R from "../../../components/Badge/Badge.vue.js";
11
- import T from "../../../components/Section/SectionHeader.vue.js";
5
+ import { getOperationStability as b, getOperationStabilityColor as E, isOperationDeprecated as N } from "../../../libs/openapi.js";
6
+ import V from "../components/callbacks/Callbacks.vue.js";
7
+ import _ from "../components/OperationParameters.vue.js";
8
+ import w from "../components/OperationResponses.vue.js";
9
+ import I from "../../../components/Section/Section.vue.js";
10
+ import R from "../../../components/Section/SectionContent.vue.js";
11
+ import T from "../../../components/Badge/Badge.vue.js";
12
+ import $ from "../../../components/Section/SectionHeader.vue.js";
12
13
  import q from "../../../components/Anchor/Anchor.vue.js";
13
14
  import D from "../../../components/Section/SectionHeaderTag.vue.js";
14
15
  import H from "../../../components/Section/SectionColumns.vue.js";
15
16
  import g from "../../../components/Section/SectionColumn.vue.js";
16
17
  import L from "../../ExampleRequest/ExampleRequest.vue.js";
17
18
  import M from "../../TestRequestButton/TestRequestButton.vue.js";
18
- import $ from "../../ExampleResponses/ExampleResponses.vue.js";
19
- const z = { class: "operation-details" }, A = { class: "examples" }, ie = /* @__PURE__ */ b({
19
+ import z from "../../ExampleResponses/ExampleResponses.vue.js";
20
+ const A = { class: "operation-details" }, P = { class: "examples" }, se = /* @__PURE__ */ y({
20
21
  __name: "ModernLayout",
21
22
  props: {
22
23
  id: {},
@@ -26,43 +27,43 @@ const z = { class: "operation-details" }, A = { class: "examples" }, ie = /* @__
26
27
  transformedOperation: {},
27
28
  schemas: {}
28
29
  },
29
- setup(n) {
30
- const i = O(), v = B(), l = S(() => n.operation.summary || n.operation.path);
31
- return (o, P) => (m(), p(e(w), {
32
- id: o.id,
33
- "aria-labelledby": e(i),
34
- label: l.value,
30
+ setup(s) {
31
+ const p = O(), v = B(), m = S(() => s.operation.summary || s.operation.path);
32
+ return (e, j) => (n(), t(o(I), {
33
+ id: e.id,
34
+ "aria-labelledby": o(p),
35
+ label: m.value,
35
36
  tabindex: "-1"
36
37
  }, {
37
- default: a(() => [
38
- r(e(I), {
39
- loading: e(v).isLoading
38
+ default: r(() => [
39
+ a(o(R), {
40
+ loading: o(v).isLoading
40
41
  }, {
41
- default: a(() => [
42
- e(h)(o.operation) ? (m(), p(e(R), {
42
+ default: r(() => [
43
+ o(b)(e.operation) ? (n(), t(o(T), {
43
44
  key: 0,
44
- class: d(e(_)(o.operation))
45
+ class: f(o(E)(e.operation))
45
46
  }, {
46
- default: a(() => [
47
- f(u(e(h)(o.operation)), 1)
47
+ default: r(() => [
48
+ u(h(o(b)(e.operation)), 1)
48
49
  ]),
49
50
  _: 1
50
- }, 8, ["class"])) : y("", !0),
51
- t("div", {
52
- class: d(e(E)(o.operation) ? "deprecated" : "")
51
+ }, 8, ["class"])) : c("", !0),
52
+ i("div", {
53
+ class: f(o(N)(e.operation) ? "deprecated" : "")
53
54
  }, [
54
- r(e(T), null, {
55
- default: a(() => [
56
- r(e(q), {
57
- id: o.id ?? ""
55
+ a(o($), null, {
56
+ default: r(() => [
57
+ a(o(q), {
58
+ id: e.id ?? ""
58
59
  }, {
59
- default: a(() => [
60
- r(e(D), {
61
- id: e(i),
60
+ default: r(() => [
61
+ a(o(D), {
62
+ id: o(p),
62
63
  level: 3
63
64
  }, {
64
- default: a(() => [
65
- f(u(l.value), 1)
65
+ default: r(() => [
66
+ u(h(m.value), 1)
66
67
  ]),
67
68
  _: 1
68
69
  }, 8, ["id"])
@@ -73,61 +74,72 @@ const z = { class: "operation-details" }, A = { class: "examples" }, ie = /* @__
73
74
  _: 1
74
75
  })
75
76
  ], 2),
76
- r(e(H), null, {
77
- default: a(() => [
78
- r(e(g), null, {
79
- default: a(() => [
80
- t("div", z, [
81
- r(e(C), {
82
- value: o.operation.description,
77
+ a(o(H), null, {
78
+ default: r(() => [
79
+ a(o(g), null, {
80
+ default: r(() => [
81
+ i("div", A, [
82
+ a(o(k), {
83
+ value: e.operation.description,
83
84
  withImages: ""
84
85
  }, null, 8, ["value"]),
85
- r(N, {
86
- operation: o.operation,
87
- schemas: o.schemas
86
+ a(_, {
87
+ operation: e.operation,
88
+ schemas: e.schemas
88
89
  }, null, 8, ["operation", "schemas"]),
89
- r(V, {
90
- operation: o.transformedOperation,
91
- schemas: o.schemas
92
- }, null, 8, ["operation", "schemas"])
90
+ a(w, {
91
+ operation: e.transformedOperation,
92
+ schemas: e.schemas
93
+ }, null, 8, ["operation", "schemas"]),
94
+ a(o(l), null, {
95
+ default: r(() => [
96
+ e.operation.callbacks ? (n(), t(V, {
97
+ key: 0,
98
+ callbacks: e.operation.callbacks,
99
+ collection: e.collection,
100
+ schemas: e.schemas
101
+ }, null, 8, ["callbacks", "collection", "schemas"])) : c("", !0)
102
+ ]),
103
+ _: 1
104
+ })
93
105
  ])
94
106
  ]),
95
107
  _: 1
96
108
  }),
97
- r(e(g), null, {
98
- default: a(() => [
99
- t("div", A, [
100
- r(e(c), null, {
101
- default: a(() => [
102
- r(e(L), {
103
- collection: o.collection,
109
+ a(o(g), null, {
110
+ default: r(() => [
111
+ i("div", P, [
112
+ a(o(l), null, {
113
+ default: r(() => [
114
+ a(o(L), {
115
+ collection: e.collection,
104
116
  fallback: "",
105
- operation: o.operation,
106
- server: o.server,
107
- transformedOperation: o.transformedOperation
117
+ operation: e.operation,
118
+ server: e.server,
119
+ transformedOperation: e.transformedOperation
108
120
  }, {
109
- header: a(() => {
110
- var s;
121
+ header: r(() => {
122
+ var d;
111
123
  return [
112
- r(k, {
124
+ a(C, {
113
125
  class: "example-path",
114
- deprecated: (s = o.transformedOperation.information) == null ? void 0 : s.deprecated,
115
- path: o.transformedOperation.path
126
+ deprecated: (d = e.transformedOperation.information) == null ? void 0 : d.deprecated,
127
+ path: e.transformedOperation.path
116
128
  }, null, 8, ["deprecated", "path"])
117
129
  ];
118
130
  }),
119
- footer: a(() => [
120
- r(e(M), { operation: o.operation }, null, 8, ["operation"])
131
+ footer: r(() => [
132
+ a(o(M), { operation: e.operation }, null, 8, ["operation"])
121
133
  ]),
122
134
  _: 1
123
135
  }, 8, ["collection", "operation", "server", "transformedOperation"])
124
136
  ]),
125
137
  _: 1
126
138
  }),
127
- r(e(c), null, {
128
- default: a(() => [
129
- r(e($), {
130
- responses: o.operation.responses,
139
+ a(o(l), null, {
140
+ default: r(() => [
141
+ a(o(z), {
142
+ responses: e.operation.responses,
131
143
  style: { "margin-top": "12px" }
132
144
  }, null, 8, ["responses"])
133
145
  ]),
@@ -149,5 +161,5 @@ const z = { class: "operation-details" }, A = { class: "examples" }, ie = /* @__
149
161
  }
150
162
  });
151
163
  export {
152
- ie as default
164
+ se as default
153
165
  };
@@ -0,0 +1,3 @@
1
+ import type { OpenAPIV2, OpenAPIV3, OpenAPIV3_1 } from '@scalar/openapi-types';
2
+ export type Schemas = OpenAPIV2.DefinitionsObject | Record<string, OpenAPIV3.SchemaObject> | Record<string, OpenAPIV3_1.SchemaObject> | unknown;
3
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/types/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAE9E,MAAM,MAAM,OAAO,GACf,SAAS,CAAC,iBAAiB,GAC3B,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,YAAY,CAAC,GACtC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,YAAY,CAAC,GACxC,OAAO,CAAA"}