@scalar/api-reference 1.25.31 → 1.25.32
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.
- package/CHANGELOG.md +17 -0
- package/dist/browser/standalone.js +4955 -4943
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiReferenceLayout.vue.js +1 -1
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue.d.ts.map +1 -1
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue.js +2 -2
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue2.js +11 -13
- package/dist/components/Content/Operation/Operation.vue.d.ts.map +1 -1
- package/dist/components/Content/Operation/Operation.vue.js +2 -2
- package/dist/components/Content/Operation/Operation.vue2.js +21 -18
- package/dist/components/Content/Operation/OperationAccordion.vue.d.ts.map +1 -1
- package/dist/components/Content/Operation/OperationAccordion.vue.js +2 -2
- package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts +6 -0
- package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts.map +1 -1
- package/dist/features/ExampleRequest/ExampleRequest.vue.js +1 -1
- package/dist/features/ExampleRequest/ExampleRequest.vue2.js +123 -101
- package/dist/hooks/useReactiveSpec.d.ts.map +1 -1
- package/dist/hooks/useReactiveSpec.js +31 -26
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +7 -7
|
@@ -2,7 +2,7 @@ import o from "./ApiReferenceLayout.vue2.js";
|
|
|
2
2
|
/* empty css */
|
|
3
3
|
/* empty css */
|
|
4
4
|
import t from "../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
-
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
5
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-080d0f80"]]);
|
|
6
6
|
export {
|
|
7
7
|
m as default
|
|
8
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClientLibraries.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/ClientLibraries/ClientLibraries.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"ClientLibraries.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/ClientLibraries/ClientLibraries.vue"],"names":[],"mappings":";AAqHA,wBAKG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./ClientLibraries.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const i = /* @__PURE__ */ r(o, [["__scopeId", "data-v-7df7ca7f"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
i as default
|
|
7
7
|
};
|
|
@@ -1,22 +1,20 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as a, unref as t, openBlock as l, createElementBlock as s, createElementVNode as o, createVNode as d, toDisplayString as i, createCommentVNode as p, pushScopeId as _, popScopeId as m } from "vue";
|
|
2
2
|
import f from "./ClientSelector.vue.js";
|
|
3
3
|
import { useHttpClientStore as h } from "../../../stores/useHttpClientStore.js";
|
|
4
|
-
const
|
|
4
|
+
const u = (e) => (_("data-v-7df7ca7f"), e = e(), m(), e), C = { key: 0 }, v = /* @__PURE__ */ u(() => /* @__PURE__ */ o("div", { class: "client-libraries-heading" }, "Client Libraries", -1)), S = {
|
|
5
5
|
class: "selected-client card-footer",
|
|
6
6
|
muted: ""
|
|
7
|
-
}, N = /* @__PURE__ */
|
|
7
|
+
}, N = /* @__PURE__ */ a({
|
|
8
8
|
__name: "ClientLibraries",
|
|
9
9
|
setup(e) {
|
|
10
|
-
const { availableTargets:
|
|
11
|
-
return (
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
], 64)) : m("", !0)
|
|
19
|
-
]));
|
|
10
|
+
const { availableTargets: r, httpTargetTitle: c, httpClientTitle: n } = h();
|
|
11
|
+
return (g, b) => t(r).length ? (l(), s("div", C, [
|
|
12
|
+
v,
|
|
13
|
+
o("div", null, [
|
|
14
|
+
d(f)
|
|
15
|
+
]),
|
|
16
|
+
o("div", S, i(t(n)) + " " + i(t(c)), 1)
|
|
17
|
+
])) : p("", !0);
|
|
20
18
|
}
|
|
21
19
|
});
|
|
22
20
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Operation.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Operation/Operation.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Operation.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Operation/Operation.vue"],"names":[],"mappings":"AAoFA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;;SAoBzD,MAAM;eACA,oBAAoB;;SAD1B,MAAM;eACA,oBAAoB;;AAiPjC,wBAMG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./Operation.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-d485e1e4"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
a as default
|
|
7
7
|
};
|
|
@@ -3,35 +3,35 @@ import h from "./EndpointDetails.vue.js";
|
|
|
3
3
|
import _ from "./EndpointPath.vue.js";
|
|
4
4
|
import C from "./TestRequestButton.vue.js";
|
|
5
5
|
import S from "../../Section/Section.vue.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
6
|
+
import k from "../../Section/SectionContent.vue.js";
|
|
7
|
+
import B from "../../Section/SectionColumns.vue.js";
|
|
8
8
|
import d from "../../Section/SectionColumn.vue.js";
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
const
|
|
9
|
+
import E from "../../Badge/Badge.vue.js";
|
|
10
|
+
import N from "../../Section/SectionHeader.vue.js";
|
|
11
|
+
import V from "../../Anchor/Anchor.vue.js";
|
|
12
|
+
import b from "../../../features/ExampleRequest/ExampleRequest.vue.js";
|
|
13
|
+
import g from "../../../features/ExampleResponses/ExampleResponses.vue.js";
|
|
14
|
+
const v = { class: "examples" }, I = /* @__PURE__ */ f({
|
|
15
15
|
__name: "Operation",
|
|
16
16
|
props: {
|
|
17
17
|
id: {},
|
|
18
18
|
operation: {}
|
|
19
19
|
},
|
|
20
|
-
setup(
|
|
21
|
-
return (e,
|
|
20
|
+
setup(y) {
|
|
21
|
+
return (e, R) => (i(), p(t(S), {
|
|
22
22
|
id: e.id,
|
|
23
23
|
label: e.operation.name
|
|
24
24
|
}, {
|
|
25
25
|
default: r(() => [
|
|
26
|
-
o(t(
|
|
26
|
+
o(t(k), null, {
|
|
27
27
|
default: r(() => [
|
|
28
|
-
o(t(
|
|
28
|
+
o(t(B), null, {
|
|
29
29
|
default: r(() => [
|
|
30
30
|
o(t(d), null, {
|
|
31
31
|
default: r(() => {
|
|
32
32
|
var a, n;
|
|
33
33
|
return [
|
|
34
|
-
(a = e.operation.information) != null && a.deprecated ? (i(), p(t(
|
|
34
|
+
(a = e.operation.information) != null && a.deprecated ? (i(), p(t(E), { key: 0 }, {
|
|
35
35
|
default: r(() => [
|
|
36
36
|
l(" Deprecated ")
|
|
37
37
|
]),
|
|
@@ -40,9 +40,9 @@ const y = { class: "examples" }, I = /* @__PURE__ */ f({
|
|
|
40
40
|
m("div", {
|
|
41
41
|
class: u((n = e.operation.information) != null && n.deprecated ? "deprecated" : "")
|
|
42
42
|
}, [
|
|
43
|
-
o(t(
|
|
43
|
+
o(t(N), { level: 3 }, {
|
|
44
44
|
default: r(() => [
|
|
45
|
-
o(t(
|
|
45
|
+
o(t(V), {
|
|
46
46
|
id: e.id ?? ""
|
|
47
47
|
}, {
|
|
48
48
|
default: r(() => [
|
|
@@ -61,8 +61,11 @@ const y = { class: "examples" }, I = /* @__PURE__ */ f({
|
|
|
61
61
|
}),
|
|
62
62
|
o(t(d), null, {
|
|
63
63
|
default: r(() => [
|
|
64
|
-
m("div",
|
|
65
|
-
o(t(
|
|
64
|
+
m("div", v, [
|
|
65
|
+
o(t(b), {
|
|
66
|
+
fallback: "",
|
|
67
|
+
operation: e.operation
|
|
68
|
+
}, {
|
|
66
69
|
header: r(() => {
|
|
67
70
|
var a;
|
|
68
71
|
return [
|
|
@@ -78,7 +81,7 @@ const y = { class: "examples" }, I = /* @__PURE__ */ f({
|
|
|
78
81
|
]),
|
|
79
82
|
_: 1
|
|
80
83
|
}, 8, ["operation"]),
|
|
81
|
-
o(t(
|
|
84
|
+
o(t(g), {
|
|
82
85
|
operation: e.operation,
|
|
83
86
|
style: { "margin-top": "12px" }
|
|
84
87
|
}, null, 8, ["operation"])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OperationAccordion.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Operation/OperationAccordion.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OperationAccordion.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Operation/OperationAccordion.vue"],"names":[],"mappings":"AA0NA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;;SAiBzD,MAAM;eACA,oBAAoB;;SAD1B,MAAM;eACA,oBAAoB;;AA2QjC,wBAMG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./OperationAccordion.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-79ac1ab2"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import type { TransformedOperation } from '@scalar/types/legacy';
|
|
2
2
|
declare function __VLS_template(): {
|
|
3
3
|
header?(_: {}): any;
|
|
4
|
+
header?(_: {}): any;
|
|
5
|
+
footer?(_: {}): any;
|
|
4
6
|
footer?(_: {}): any;
|
|
5
7
|
};
|
|
6
8
|
declare const __VLS_component: import("vue").DefineComponent<__VLS_TypePropsToOption<{
|
|
7
9
|
operation: TransformedOperation;
|
|
10
|
+
/** Show a simplified card if no example are available */
|
|
11
|
+
fallback?: boolean;
|
|
8
12
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
|
|
9
13
|
operation: TransformedOperation;
|
|
14
|
+
/** Show a simplified card if no example are available */
|
|
15
|
+
fallback?: boolean;
|
|
10
16
|
}>>>, {}, {}>;
|
|
11
17
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
12
18
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExampleRequest.vue.d.ts","sourceRoot":"","sources":["../../../src/features/ExampleRequest/ExampleRequest.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ExampleRequest.vue.d.ts","sourceRoot":"","sources":["../../../src/features/ExampleRequest/ExampleRequest.vue"],"names":[],"mappings":"AAoYA,OAAO,KAAK,EAGV,oBAAoB,EACrB,MAAM,sBAAsB,CAAA;AA+O7B,iBAAS,cAAc;oBAuQM,GAAG;oBAEH,GAAG;oBADH,GAAG;oBAEH,GAAG;EAmC/B;AACD,QAAA,MAAM,eAAe;eA/fR,oBAAoB;IAC/B,yDAAyD;eAC9C,OAAO;;eAFP,oBAAoB;IAC/B,yDAAyD;eAC9C,OAAO;aAmgBlB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC;AAEN,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./ExampleRequest.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-db770e2d"]]);
|
|
5
5
|
export {
|
|
6
6
|
r as default
|
|
7
7
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarCodeBlock as
|
|
3
|
-
import { createHash as
|
|
4
|
-
import { getRequestFromOperation as
|
|
5
|
-
import { asyncComputed as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
1
|
+
import { defineComponent as M, ref as O, computed as d, watch as P, inject as Y, onServerPrefetch as D, useSSRContext as z, unref as a, openBlock as m, createBlock as h, withCtx as i, createVNode as c, createElementBlock as v, Fragment as B, createTextVNode as H, toDisplayString as g, createElementVNode as K, renderSlot as f, createCommentVNode as C } from "vue";
|
|
2
|
+
import { ScalarCodeBlock as G } from "@scalar/components";
|
|
3
|
+
import { createHash as Q, ssrState as W } from "@scalar/oas-utils/helpers";
|
|
4
|
+
import { getRequestFromOperation as X } from "@scalar/oas-utils/spec-getters";
|
|
5
|
+
import { asyncComputed as Z } from "@vueuse/core";
|
|
6
|
+
import ee from "./ExamplePicker.vue.js";
|
|
7
|
+
import te from "./TextSelect.vue.js";
|
|
8
8
|
/* empty css */
|
|
9
|
-
import { GLOBAL_SECURITY_SYMBOL as
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import { getSecretCredentialsFromAuthentication as
|
|
15
|
-
import
|
|
9
|
+
import { GLOBAL_SECURITY_SYMBOL as oe } from "../../helpers/provideSymbols.js";
|
|
10
|
+
import N from "../../components/Card/Card.vue.js";
|
|
11
|
+
import ae from "../../components/Card/CardHeader.vue.js";
|
|
12
|
+
import R from "../../components/HttpMethod/HttpMethod.vue.js";
|
|
13
|
+
import $ from "../../components/Card/CardContent.vue.js";
|
|
14
|
+
import { getSecretCredentialsFromAuthentication as re, getRequestFromAuthentication as se } from "../../legacy/helpers/getRequestFromAuthentication.js";
|
|
15
|
+
import ne from "../../components/Card/CardFooter.vue.js";
|
|
16
16
|
import { getExampleCode as le } from "../../helpers/getExampleCode.js";
|
|
17
17
|
import { useHttpClientStore as ie } from "../../stores/useHttpClientStore.js";
|
|
18
18
|
import { useServerStore as ce } from "../../legacy/stores/useServerStore.js";
|
|
@@ -22,98 +22,99 @@ import { getUrlFromServerState as pe } from "../../legacy/helpers/getUrlFromServ
|
|
|
22
22
|
const de = { class: "request-header" }, fe = { class: "code-snippet" }, ye = {
|
|
23
23
|
key: 0,
|
|
24
24
|
class: "request-card-footer-addon"
|
|
25
|
-
},
|
|
25
|
+
}, he = { class: "request-header" }, Ae = /* @__PURE__ */ M({
|
|
26
26
|
__name: "ExampleRequest",
|
|
27
27
|
props: {
|
|
28
|
-
operation: {}
|
|
28
|
+
operation: {},
|
|
29
|
+
fallback: { type: Boolean }
|
|
29
30
|
},
|
|
30
|
-
setup(
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
)}`,
|
|
34
|
-
httpClient:
|
|
35
|
-
setHttpClient:
|
|
31
|
+
setup(j) {
|
|
32
|
+
const s = j, S = `components-Content-Operation-Example-Request${Q(
|
|
33
|
+
s.operation.path + s.operation.httpVerb + s.operation.operationId
|
|
34
|
+
)}`, k = O(), {
|
|
35
|
+
httpClient: n,
|
|
36
|
+
setHttpClient: F,
|
|
36
37
|
availableTargets: x,
|
|
37
|
-
httpTargetTitle:
|
|
38
|
-
httpClientTitle:
|
|
39
|
-
} = ie(), { server:
|
|
38
|
+
httpTargetTitle: T,
|
|
39
|
+
httpClientTitle: w
|
|
40
|
+
} = ie(), { server: A } = ce(), { authentication: E } = ue(), u = d(() => {
|
|
40
41
|
var t;
|
|
41
42
|
const e = ["x-custom-examples", "x-codeSamples", "x-code-samples"];
|
|
42
43
|
for (const o of e)
|
|
43
|
-
if ((t =
|
|
44
|
-
return
|
|
44
|
+
if ((t = s.operation.information) != null && t[o])
|
|
45
|
+
return s.operation.information[o] ?? [];
|
|
45
46
|
return [];
|
|
46
|
-
}),
|
|
47
|
+
}), r = O(
|
|
47
48
|
// Default to first custom example
|
|
48
|
-
|
|
49
|
+
u.value.length ? {
|
|
49
50
|
targetKey: "customExamples",
|
|
50
51
|
clientKey: 0
|
|
51
52
|
} : (
|
|
52
53
|
// Otherwise use the globally selected HTTP client
|
|
53
54
|
{
|
|
54
|
-
targetKey:
|
|
55
|
-
clientKey:
|
|
55
|
+
targetKey: n.targetKey,
|
|
56
|
+
clientKey: n.clientKey
|
|
56
57
|
}
|
|
57
58
|
)
|
|
58
59
|
);
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
targetKey:
|
|
62
|
-
clientKey:
|
|
60
|
+
P(n, () => {
|
|
61
|
+
r.value = {
|
|
62
|
+
targetKey: n.targetKey,
|
|
63
|
+
clientKey: n.clientKey
|
|
63
64
|
};
|
|
64
65
|
});
|
|
65
|
-
const
|
|
66
|
+
const b = d(
|
|
66
67
|
() => {
|
|
67
68
|
var e, t, o, l;
|
|
68
69
|
return Object.keys(
|
|
69
|
-
((l = (o = (t = (e =
|
|
70
|
+
((l = (o = (t = (e = s.operation.information) == null ? void 0 : e.requestBody) == null ? void 0 : t.content) == null ? void 0 : o["application/json"]) == null ? void 0 : l.examples) ?? {}
|
|
70
71
|
).length > 1;
|
|
71
72
|
}
|
|
72
|
-
),
|
|
73
|
-
async function
|
|
74
|
-
var l,
|
|
75
|
-
if (
|
|
76
|
-
return ((l =
|
|
73
|
+
), y = Y(oe);
|
|
74
|
+
async function q() {
|
|
75
|
+
var l, p;
|
|
76
|
+
if (r.value.targetKey === "customExamples")
|
|
77
|
+
return ((l = u.value[r.value.clientKey]) == null ? void 0 : l.source) ?? "";
|
|
77
78
|
const e = me(
|
|
78
79
|
{
|
|
79
|
-
url: pe(
|
|
80
|
+
url: pe(A)
|
|
80
81
|
},
|
|
81
|
-
|
|
82
|
-
|
|
82
|
+
X(
|
|
83
|
+
s.operation,
|
|
83
84
|
{
|
|
84
85
|
replaceVariables: !0
|
|
85
86
|
},
|
|
86
|
-
|
|
87
|
+
k.value
|
|
87
88
|
),
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
((
|
|
89
|
+
se(
|
|
90
|
+
E,
|
|
91
|
+
((p = s.operation.information) == null ? void 0 : p.security) ?? (y == null ? void 0 : y())
|
|
91
92
|
)
|
|
92
|
-
), t =
|
|
93
|
+
), t = n.clientKey, o = n.targetKey;
|
|
93
94
|
return await le(e, o, t) ?? "";
|
|
94
95
|
}
|
|
95
|
-
const
|
|
96
|
+
const _ = Z(async () => {
|
|
96
97
|
try {
|
|
97
|
-
return await
|
|
98
|
+
return await q();
|
|
98
99
|
} catch (e) {
|
|
99
100
|
return console.error("[generateSnippet]", e), "";
|
|
100
101
|
}
|
|
101
|
-
},
|
|
102
|
-
|
|
103
|
-
const e =
|
|
104
|
-
e.payload.data[
|
|
102
|
+
}, W[S] ?? "");
|
|
103
|
+
D(async () => {
|
|
104
|
+
const e = z();
|
|
105
|
+
e.payload.data[S] = await q();
|
|
105
106
|
});
|
|
106
|
-
const
|
|
107
|
+
const J = d(() => {
|
|
107
108
|
var t, o;
|
|
108
109
|
const e = (
|
|
109
110
|
// Specified language
|
|
110
|
-
((t =
|
|
111
|
+
((t = r.value) == null ? void 0 : t.targetKey) === "customExamples" ? ((o = u.value[r.value.clientKey]) == null ? void 0 : o.lang) ?? "plaintext" : (
|
|
111
112
|
// Or language for the globally selected HTTP client
|
|
112
|
-
|
|
113
|
+
n.targetKey
|
|
113
114
|
)
|
|
114
115
|
);
|
|
115
|
-
return e === "shell" &&
|
|
116
|
-
}),
|
|
116
|
+
return e === "shell" && _.value.includes("curl") ? "curl" : e === "Objective-C" ? "objc" : e;
|
|
117
|
+
}), U = d(() => {
|
|
117
118
|
const e = x.value.map((t) => ({
|
|
118
119
|
value: t.key,
|
|
119
120
|
label: t.title,
|
|
@@ -125,10 +126,10 @@ const de = { class: "request-header" }, fe = { class: "code-snippet" }, ye = {
|
|
|
125
126
|
label: o.title
|
|
126
127
|
}))
|
|
127
128
|
}));
|
|
128
|
-
return
|
|
129
|
+
return u.value.length && e.unshift({
|
|
129
130
|
value: "customExamples",
|
|
130
131
|
label: "Examples",
|
|
131
|
-
options:
|
|
132
|
+
options: u.value.map((t, o) => ({
|
|
132
133
|
value: JSON.stringify({
|
|
133
134
|
targetKey: "customExamples",
|
|
134
135
|
clientKey: o
|
|
@@ -137,88 +138,109 @@ const de = { class: "request-header" }, fe = { class: "code-snippet" }, ye = {
|
|
|
137
138
|
}))
|
|
138
139
|
}), e;
|
|
139
140
|
});
|
|
140
|
-
function
|
|
141
|
+
function L(e) {
|
|
141
142
|
const t = JSON.parse(e);
|
|
142
|
-
t.targetKey === "customExamples" ?
|
|
143
|
+
t.targetKey === "customExamples" ? r.value = t : F(t);
|
|
143
144
|
}
|
|
144
|
-
return (e, t) =>
|
|
145
|
+
return (e, t) => a(x).length || u.value.length ? (m(), h(a(N), {
|
|
145
146
|
key: 0,
|
|
146
147
|
class: "dark-mode"
|
|
147
148
|
}, {
|
|
148
|
-
default:
|
|
149
|
-
|
|
150
|
-
actions:
|
|
151
|
-
|
|
149
|
+
default: i(() => [
|
|
150
|
+
c(a(ae), { muted: "" }, {
|
|
151
|
+
actions: i(() => [
|
|
152
|
+
c(te, {
|
|
152
153
|
class: "request-client-picker",
|
|
153
|
-
modelValue: JSON.stringify(
|
|
154
|
-
options:
|
|
155
|
-
"onUpdate:modelValue":
|
|
154
|
+
modelValue: JSON.stringify(r.value),
|
|
155
|
+
options: U.value,
|
|
156
|
+
"onUpdate:modelValue": L
|
|
156
157
|
}, {
|
|
157
|
-
default:
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
], 64)) : (
|
|
161
|
-
|
|
158
|
+
default: i(() => [
|
|
159
|
+
r.value.targetKey === "customExamples" ? (m(), v(B, { key: 0 }, [
|
|
160
|
+
H(g(u.value[r.value.clientKey].label ?? "Example"), 1)
|
|
161
|
+
], 64)) : (m(), v(B, { key: 1 }, [
|
|
162
|
+
H(g(a(T)) + " " + g(a(w)), 1)
|
|
162
163
|
], 64))
|
|
163
164
|
]),
|
|
164
165
|
_: 1
|
|
165
166
|
}, 8, ["modelValue", "options"])
|
|
166
167
|
]),
|
|
167
|
-
default:
|
|
168
|
-
|
|
169
|
-
|
|
168
|
+
default: i(() => [
|
|
169
|
+
K("div", de, [
|
|
170
|
+
c(a(R), {
|
|
170
171
|
as: "span",
|
|
171
172
|
class: "request-method",
|
|
172
173
|
method: e.operation.httpVerb
|
|
173
174
|
}, null, 8, ["method"]),
|
|
174
|
-
|
|
175
|
+
f(e.$slots, "header", {}, void 0, !0)
|
|
175
176
|
])
|
|
176
177
|
]),
|
|
177
178
|
_: 3
|
|
178
179
|
}),
|
|
179
|
-
|
|
180
|
+
c(a($), {
|
|
180
181
|
borderless: "",
|
|
181
182
|
class: "request-editor-section custom-scroll",
|
|
182
183
|
frameless: ""
|
|
183
184
|
}, {
|
|
184
|
-
default:
|
|
185
|
-
|
|
186
|
-
|
|
185
|
+
default: i(() => [
|
|
186
|
+
K("div", fe, [
|
|
187
|
+
c(a(G), {
|
|
187
188
|
class: "bg-b-2",
|
|
188
|
-
content:
|
|
189
|
-
hideCredentials:
|
|
190
|
-
lang:
|
|
189
|
+
content: a(_),
|
|
190
|
+
hideCredentials: a(re)(a(E)),
|
|
191
|
+
lang: J.value,
|
|
191
192
|
lineNumbers: ""
|
|
192
193
|
}, null, 8, ["content", "hideCredentials", "lang"])
|
|
193
194
|
])
|
|
194
195
|
]),
|
|
195
196
|
_: 1
|
|
196
197
|
}),
|
|
197
|
-
|
|
198
|
+
b.value || e.$slots.footer ? (m(), h(a(ne), {
|
|
198
199
|
key: 0,
|
|
199
200
|
class: "request-card-footer",
|
|
200
201
|
contrast: ""
|
|
201
202
|
}, {
|
|
202
|
-
default:
|
|
203
|
-
var o, l,
|
|
203
|
+
default: i(() => {
|
|
204
|
+
var o, l, p, V;
|
|
204
205
|
return [
|
|
205
|
-
|
|
206
|
-
|
|
206
|
+
b.value ? (m(), v("div", ye, [
|
|
207
|
+
c(ee, {
|
|
207
208
|
class: "request-example-selector",
|
|
208
|
-
examples: ((
|
|
209
|
-
"onUpdate:modelValue": t[0] || (t[0] = (
|
|
209
|
+
examples: ((V = (p = (l = (o = e.operation.information) == null ? void 0 : o.requestBody) == null ? void 0 : l.content) == null ? void 0 : p["application/json"]) == null ? void 0 : V.examples) ?? [],
|
|
210
|
+
"onUpdate:modelValue": t[0] || (t[0] = (I) => k.value = I)
|
|
210
211
|
}, null, 8, ["examples"])
|
|
211
|
-
])) :
|
|
212
|
-
|
|
212
|
+
])) : C("", !0),
|
|
213
|
+
f(e.$slots, "footer", {}, void 0, !0)
|
|
213
214
|
];
|
|
214
215
|
}),
|
|
215
216
|
_: 3
|
|
216
|
-
})) :
|
|
217
|
+
})) : C("", !0)
|
|
217
218
|
]),
|
|
218
219
|
_: 3
|
|
219
|
-
})) :
|
|
220
|
+
})) : e.fallback ? (m(), h(a(N), {
|
|
221
|
+
key: 1,
|
|
222
|
+
class: "dark-mode"
|
|
223
|
+
}, {
|
|
224
|
+
default: i(() => [
|
|
225
|
+
c(a($), { class: "request-card-simple" }, {
|
|
226
|
+
default: i(() => [
|
|
227
|
+
K("div", he, [
|
|
228
|
+
c(a(R), {
|
|
229
|
+
as: "span",
|
|
230
|
+
class: "request-method",
|
|
231
|
+
method: e.operation.httpVerb
|
|
232
|
+
}, null, 8, ["method"]),
|
|
233
|
+
f(e.$slots, "header", {}, void 0, !0)
|
|
234
|
+
]),
|
|
235
|
+
f(e.$slots, "footer", {}, void 0, !0)
|
|
236
|
+
]),
|
|
237
|
+
_: 3
|
|
238
|
+
})
|
|
239
|
+
]),
|
|
240
|
+
_: 3
|
|
241
|
+
})) : C("", !0);
|
|
220
242
|
}
|
|
221
243
|
});
|
|
222
244
|
export {
|
|
223
|
-
|
|
245
|
+
Ae as default
|
|
224
246
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useReactiveSpec.d.ts","sourceRoot":"","sources":["../../src/hooks/useReactiveSpec.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAC7D,OAAO,EAAE,KAAK,gBAAgB,EAAiC,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"useReactiveSpec.d.ts","sourceRoot":"","sources":["../../src/hooks/useReactiveSpec.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAC7D,OAAO,EAAE,KAAK,gBAAgB,EAAiC,MAAM,KAAK,CAAA;AAuD1E;;GAEG;AACH,wBAAgB,eAAe,CAAC,EAC9B,UAAU,EACV,KAAK,GACN,EAAE;IACD,UAAU,CAAC,EAAE,gBAAgB,CAAC,iBAAiB,CAAC,CAAA;IAChD,KAAK,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;CACjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwDA"}
|