@mintlify/msft-sdk 1.1.65 → 1.1.66

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.
@@ -1,34 +1,36 @@
1
1
  import { jsx as e, jsxs as c } from "react/jsx-runtime";
2
- import { useContext as f, useState as x, useMemo as u } from "react";
2
+ import { useContext as x, useState as f, useMemo as u } from "react";
3
3
  import { useDebouncedApiPlaygroundInputs as d } from "./hooks/usePlaygroundInputsStore.js";
4
- import { CodeExampleLabelContext as h } from "../contexts/CodeExampleLabelContext.js";
4
+ import { CodeExampleLabelContext as E } from "../contexts/CodeExampleLabelContext.js";
5
5
  import { ApiReferenceContext2 as g } from "../contexts/ConfigContext.js";
6
- import R from "../components/Api/ErrorBoundary.js";
7
- import { clsx as v } from "clsx";
8
- import { RequestExample as C } from "./components/Example/RequestExample.js";
9
- import { ResponseExample as D } from "./components/Example/ResponseExample.js";
10
- import { initialApiPlaygroundInputs as E } from "./constants/index.js";
11
- const q = ({ className: t, isModal: r = !1, apiReferenceData: m, noInputs: n = !1 }) => {
12
- const { apiReferenceData2: a } = f(g), i = m || a, o = d(100), [p, s] = x(), l = u(
13
- () => v(
6
+ import D from "../components/Api/ErrorBoundary.js";
7
+ import { clsx as h } from "clsx";
8
+ import { RequestExample as R } from "./components/Example/RequestExample.js";
9
+ import { ResponseExample as A } from "./components/Example/ResponseExample.js";
10
+ import { initialApiPlaygroundInputs as C } from "./constants/index.js";
11
+ const j = ({ className: o, isModal: i = !1, apiReferenceData: a, noInputs: n = !1 }) => {
12
+ const { apiReferenceData2: m } = x(g), t = a || m, r = d(100), [p, l] = f();
13
+ console.log("[DEBUG] ApiExamples - Props apiReferenceData:", a), console.log("[DEBUG] ApiExamples - Context apiReferenceData2FromContext:", m), console.log("[DEBUG] ApiExamples - Final apiReferenceData2:", t), console.log("[DEBUG] ApiExamples - noInputs:", n), console.log("[DEBUG] ApiExamples - isModal:", i);
14
+ const s = u(
15
+ () => h(
14
16
  "mint:w-full mint:xl:w-[28rem] mint:gap-6 mint:grid mint:grid-rows-[repeat(auto-fit,minmax(0,min-content))] mint:grid-rows mint:relative mint:max-h-[calc(100%-32px)] mint:min-h-[18rem]",
15
- t
17
+ o
16
18
  ),
17
- [t, r]
19
+ [o, i]
18
20
  );
19
- return /* @__PURE__ */ e(h.Provider, { value: { selectedLabel: p, setSelectedLabel: s }, children: /* @__PURE__ */ e("div", { className: l, children: /* @__PURE__ */ c(R, { children: [
21
+ return /* @__PURE__ */ e(E.Provider, { value: { selectedLabel: p, setSelectedLabel: l }, children: /* @__PURE__ */ e("div", { className: s, children: /* @__PURE__ */ c(D, { children: [
20
22
  /* @__PURE__ */ e(
21
- C,
23
+ R,
22
24
  {
23
- apiReferenceData: i,
24
- inputs: n ? E : o,
25
+ apiReferenceData: t,
26
+ inputs: n ? C : r,
25
27
  maxHeight: "mint:max-h-[40vh]"
26
28
  }
27
29
  ),
28
- /* @__PURE__ */ e(D, { apiReferenceData: i, maxHeight: "mint:max-h-[40vh]" })
30
+ /* @__PURE__ */ e(A, { apiReferenceData: t, maxHeight: "mint:max-h-[40vh]" })
29
31
  ] }) }) });
30
32
  };
31
33
  export {
32
- q as ApiExamples,
33
- q as default
34
+ j as ApiExamples,
35
+ j as default
34
36
  };
@@ -1,96 +1,92 @@
1
- import { jsxs as t, jsx as e } from "react/jsx-runtime";
2
- import { useContext as w, useState as P, useEffect as b } from "react";
3
- import { useSelectedBaseUrl as v } from "./hooks/useSelectedBaseUrl.js";
4
- import { SendPill as U } from "../api-playground/ApiPlayground/components/SendPill.js";
5
- import { PageContext as E } from "../contexts/ConfigContext.js";
6
- import { useApiPlaygroundDisplay as I } from "../hooks/useApiPlaygroundDisplay.js";
7
- import { ApiExamples as C } from "./ApiExamples.js";
8
- import { ApiFields as S } from "./ApiFields.js";
9
- import { EndpointHeader as N } from "./EndpointHeader.js";
10
- import { Playground as A } from "./Playground.js";
11
- import { ApiPlaygroundContext as k } from "./contexts/ApiPlaygroundContext.js";
1
+ import { jsxs as n, jsx as r } from "react/jsx-runtime";
2
+ import { useContext as P, useState as w, useEffect as b } from "react";
3
+ import { useSelectedBaseUrl as U } from "./hooks/useSelectedBaseUrl.js";
4
+ import { SendPill as v } from "../api-playground/ApiPlayground/components/SendPill.js";
5
+ import { PageContext as C } from "../contexts/ConfigContext.js";
6
+ import { useApiPlaygroundDisplay as E } from "../hooks/useApiPlaygroundDisplay.js";
7
+ import { ApiFields as I } from "./ApiFields.js";
8
+ import { EndpointHeader as S } from "./EndpointHeader.js";
9
+ import { Playground as k } from "./Playground.js";
10
+ import { ApiPlaygroundContext as A } from "./contexts/ApiPlaygroundContext.js";
12
11
  import { Classes as B } from "./types/index.js";
13
- import { cn as L } from "../utils/cn.js";
14
- const J = ({
12
+ import { cn as N } from "../utils/cn.js";
13
+ const z = ({
15
14
  apiReferenceData: c,
16
- operation: f,
17
- children: u
15
+ operation: u,
16
+ children: f
18
17
  }) => {
19
- const { path: g, method: a, baseUrlOptions: o } = f, { pageMetadata: x } = w(E), d = I(), [l, m] = P(!1), s = d === "simple", { selectedBaseUrlIndex: h, setSelectedBaseUrlIndex: y, baseUrl: p } = v();
18
+ const { path: g, method: o, baseUrlOptions: i } = u, { pageMetadata: y } = P(C), d = E(), [s, l] = w(!1), m = d === "simple", { selectedBaseUrlIndex: h, setSelectedBaseUrlIndex: x, baseUrl: p } = U();
20
19
  b(() => {
21
20
  if (typeof window > "u") return;
22
21
  new URLSearchParams(window.location.search).has("playground") && requestAnimationFrame(() => {
23
- m(!0);
22
+ l(!0);
24
23
  });
25
24
  }, []);
26
- const r = (i) => {
27
- if (m(i), !(typeof window > "u"))
28
- if (i) {
29
- const n = new URL(window.location.href);
30
- n.searchParams.set("playground", "open"), window.history.replaceState({}, "", n);
25
+ const t = (a) => {
26
+ if (l(a), !(typeof window > "u"))
27
+ if (a) {
28
+ const e = new URL(window.location.href);
29
+ e.searchParams.set("playground", "open"), window.history.replaceState({}, "", e);
31
30
  } else {
32
- const n = new URL(window.location.href);
33
- n.searchParams.delete("playground"), window.history.replaceState({}, "", n);
31
+ const e = new URL(window.location.href);
32
+ e.searchParams.delete("playground"), window.history.replaceState({}, "", e);
34
33
  }
35
34
  };
36
- return /* @__PURE__ */ t(
37
- k.Provider,
35
+ return /* @__PURE__ */ n(
36
+ A.Provider,
38
37
  {
39
38
  value: {
40
- isPlaygroundExpanded: l,
41
- setIsPlaygroundExpanded: r
39
+ isPlaygroundExpanded: s,
40
+ setIsPlaygroundExpanded: t
42
41
  },
43
42
  children: [
44
- /* @__PURE__ */ t("div", { className: "mint:flex mint:flex-col mint:gap-8", id: "api-playground-2-operation-page", children: [
45
- /* @__PURE__ */ t("div", { className: "mint:flex mint:w-full mint:flex-col mint:space-y-4", children: [
46
- /* @__PURE__ */ e("div", { className: "mint:flex mint:items-center mint:gap-3 mint:border mint:border-gray-200 mint:dark:border-[#2d2d2d] mint:rounded-2xl mint:p-1.5", children: /* @__PURE__ */ t("div", { className: "mint:flex mint:items-center mint:gap-0 mint:flex-1 mint:bg-white mint:dark:bg-[#1a1a1a] mint:border mint:border-gray-200 mint:dark:border-[#2d2d2d] mint:rounded-2xl", children: [
47
- /* @__PURE__ */ e(
48
- N,
49
- {
50
- baseUrl: p,
51
- baseUrlOptions: o,
52
- selectedBaseUrlIndex: h,
53
- setSelectedBaseUrlIndex: y,
54
- display: d,
55
- path: g,
56
- method: a,
57
- onBaseUrlChange: () => {
58
- },
59
- isInPlaygroundModal: !1
60
- }
61
- ),
62
- s ? null : /* @__PURE__ */ e(
63
- U,
64
- {
65
- label: "Try it",
66
- method: a,
67
- onClick: () => r(!0)
68
- }
69
- )
70
- ] }) }),
71
- /* @__PURE__ */ e("div", { className: "mint:mt-8 mint:lg:mt-0 mint:flex mint:flex-col mint:gap-6 mint:xl:hidden mint:max-h-[30rem]", children: /* @__PURE__ */ e(C, { noInputs: !0 }) })
72
- ] }),
73
- /* @__PURE__ */ t(
43
+ /* @__PURE__ */ n("div", { className: "mint:flex mint:flex-col mint:gap-8", id: "api-playground-2-operation-page", children: [
44
+ /* @__PURE__ */ r("div", { className: "mint:flex mint:items-center mint:gap-3 mint:border mint:border-gray-200 mint:dark:border-[#2d2d2d] mint:rounded-2xl mint:p-1.5", children: /* @__PURE__ */ n("div", { className: "mint:flex mint:items-center mint:gap-0 mint:flex-1 mint:bg-white mint:dark:bg-[#1a1a1a] mint:border mint:border-gray-200 mint:dark:border-[#2d2d2d] mint:rounded-2xl", children: [
45
+ /* @__PURE__ */ r(
46
+ S,
47
+ {
48
+ baseUrl: p,
49
+ baseUrlOptions: i,
50
+ selectedBaseUrlIndex: h,
51
+ setSelectedBaseUrlIndex: x,
52
+ display: d,
53
+ path: g,
54
+ method: o,
55
+ onBaseUrlChange: () => {
56
+ },
57
+ isInPlaygroundModal: !1
58
+ }
59
+ ),
60
+ m ? null : /* @__PURE__ */ r(
61
+ v,
62
+ {
63
+ label: "Try it",
64
+ method: o,
65
+ onClick: () => t(!0)
66
+ }
67
+ )
68
+ ] }) }),
69
+ /* @__PURE__ */ n(
74
70
  "div",
75
71
  {
76
- className: L(
72
+ className: N(
77
73
  B.Content,
78
74
  "mint:relative"
79
75
  ),
80
76
  children: [
81
- u,
82
- /* @__PURE__ */ e(S, { pageMetadata: x })
77
+ f,
78
+ /* @__PURE__ */ r(I, { pageMetadata: y })
83
79
  ]
84
80
  }
85
81
  )
86
82
  ] }),
87
- !s && /* @__PURE__ */ e(
88
- A,
83
+ !m && /* @__PURE__ */ r(
84
+ k,
89
85
  {
90
- isPlaygroundExpanded: l,
91
- setIsPlaygroundExpanded: r,
86
+ isPlaygroundExpanded: s,
87
+ setIsPlaygroundExpanded: t,
92
88
  baseUrl: p,
93
- baseUrlOptions: o,
89
+ baseUrlOptions: i,
94
90
  apiReferenceData: c
95
91
  }
96
92
  )
@@ -99,5 +95,5 @@ const J = ({
99
95
  );
100
96
  };
101
97
  export {
102
- J as OperationPage
98
+ z as OperationPage
103
99
  };
@@ -1,145 +1,146 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import { useState as V, useEffect as B } from "react";
3
- import { generateRequest as w } from "../../generators/generateRequest.js";
4
- import { generateSnippet as x } from "../../generators/generateSnippet.js";
5
- import { getFirstExampleValue as C } from "../../schemaGraph/processExamples.js";
6
- import { CodeGroupSelect as G } from "../../../components/content-components/CodeGroupSelect/index.js";
7
- import { CodeSnippets as P } from "../../../components/content-components/code-snippets.js";
8
- import { langToPresetMap as b } from "../../../constants/snippetPresets.js";
9
- const X = ({
10
- baseUrl: s,
1
+ import { jsx as h } from "react/jsx-runtime";
2
+ import { useState as j, useEffect as V } from "react";
3
+ import { generateRequest as S } from "../../generators/generateRequest.js";
4
+ import { generateSnippet as T } from "../../generators/generateSnippet.js";
5
+ import { getFirstExampleValue as g } from "../../schemaGraph/processExamples.js";
6
+ import { CodeGroupSelect as k } from "../../../components/content-components/CodeGroupSelect/index.js";
7
+ import { CodeSnippets as w } from "../../../components/content-components/code-snippets.js";
8
+ import { langToPresetMap as C } from "../../../constants/snippetPresets.js";
9
+ const z = ({
10
+ baseUrl: r,
11
11
  apiReferenceData: t,
12
- inputs: o,
13
- requestExampleLanguages: c,
14
- requiredOnly: n,
15
- maxHeight: r,
16
- selectedSecurityOptionIndex: f,
17
- selectedRequestBodyContentTypeIndex: p
12
+ inputs: e,
13
+ requestExampleLanguages: n,
14
+ requiredOnly: p,
15
+ maxHeight: o,
16
+ selectedSecurityOptionIndex: c,
17
+ selectedRequestBodyContentTypeIndex: l
18
18
  }) => {
19
- var l, e, j;
20
- const m = (l = t.dependencies) == null ? void 0 : l.requestBody;
19
+ var u, s, G;
20
+ console.log("[DEBUG] GeneratedRequestExample - baseUrl:", r), console.log("[DEBUG] GeneratedRequestExample - apiReferenceData:", t), console.log("[DEBUG] GeneratedRequestExample - requestExampleLanguages:", n);
21
+ const m = (u = t.dependencies) == null ? void 0 : u.requestBody;
21
22
  if (!m)
22
- return /* @__PURE__ */ a(
23
- k,
23
+ return console.log("[DEBUG] GeneratedRequestExample - No requestBody, using SingleRequest"), /* @__PURE__ */ h(
24
+ q,
24
25
  {
25
26
  apiReferenceData: t,
26
- baseUrl: s,
27
- inputs: o,
28
- requestExampleLanguages: c,
29
- requiredOnly: n,
30
- maxHeight: r,
31
- selectedSecurityOptionIndex: f
27
+ baseUrl: r,
28
+ inputs: e,
29
+ requestExampleLanguages: n,
30
+ requiredOnly: p,
31
+ maxHeight: o,
32
+ selectedSecurityOptionIndex: c
32
33
  }
33
34
  );
34
- const i = C(
35
+ const i = g(
35
36
  m.content,
36
- p
37
+ l
37
38
  );
38
39
  if (!i) return null;
39
- const h = Object.entries(m.content).map(
40
- ([S, T]) => ({
41
- contentType: S,
42
- examples: T.examples
40
+ const a = Object.entries(m.content).map(
41
+ ([B, x]) => ({
42
+ contentType: B,
43
+ examples: x.examples
43
44
  })
44
- ), M = (e = h[p]) == null ? void 0 : e.examples, u = (j = h[p]) == null ? void 0 : j.contentType;
45
- return Object.keys(M).length > 1 ? /* @__PURE__ */ a(
46
- v,
45
+ ), E = (s = a[l]) == null ? void 0 : s.examples, f = (G = a[l]) == null ? void 0 : G.contentType;
46
+ return Object.keys(E).length > 1 ? /* @__PURE__ */ h(
47
+ N,
47
48
  {
48
49
  apiReferenceData: t,
49
- selectedBodyContentType: u,
50
- baseUrl: s,
51
- inputs: o,
52
- examples: M,
53
- requiredOnly: n,
54
- maxHeight: r,
55
- selectedSecurityOptionIndex: f
50
+ selectedBodyContentType: f,
51
+ baseUrl: r,
52
+ inputs: e,
53
+ examples: E,
54
+ requiredOnly: p,
55
+ maxHeight: o,
56
+ selectedSecurityOptionIndex: c
56
57
  }
57
- ) : /* @__PURE__ */ a(
58
- k,
58
+ ) : /* @__PURE__ */ h(
59
+ q,
59
60
  {
60
61
  apiReferenceData: t,
61
- selectedBodyContentType: u,
62
- baseUrl: s,
63
- inputs: o,
62
+ selectedBodyContentType: f,
63
+ baseUrl: r,
64
+ inputs: e,
64
65
  exampleValue: i,
65
- requestExampleLanguages: c,
66
- requiredOnly: n,
67
- maxHeight: r,
68
- selectedSecurityOptionIndex: f
66
+ requestExampleLanguages: n,
67
+ requiredOnly: p,
68
+ maxHeight: o,
69
+ selectedSecurityOptionIndex: c
69
70
  }
70
71
  );
71
- }, k = ({
72
- baseUrl: s,
72
+ }, q = ({
73
+ baseUrl: r,
73
74
  apiReferenceData: t,
74
- inputs: o,
75
- selectedBodyContentType: c,
76
- exampleValue: n,
77
- requestExampleLanguages: r,
78
- requiredOnly: f,
79
- maxHeight: p,
75
+ inputs: e,
76
+ selectedBodyContentType: n,
77
+ exampleValue: p,
78
+ requestExampleLanguages: o,
79
+ requiredOnly: c,
80
+ maxHeight: l,
80
81
  selectedSecurityOptionIndex: m
81
82
  }) => {
82
- const i = w({
83
- baseUrl: s,
83
+ const i = S({
84
+ baseUrl: r,
84
85
  apiReferenceData: t,
85
- inputs: o,
86
- selectedBodyContentType: c,
87
- exampleData: n,
88
- requiredOnly: f,
86
+ inputs: e,
87
+ selectedBodyContentType: n,
88
+ exampleData: p,
89
+ requiredOnly: c,
89
90
  selectedSecurityOptionIndex: m
90
- }), h = r == null ? void 0 : r.reduce((u, l) => {
91
- const e = b[l];
92
- return e && u.push(e), u;
93
- }, []), M = x({
91
+ }), a = o == null ? void 0 : o.reduce((f, u) => {
92
+ const s = C[u];
93
+ return s && f.push(s), f;
94
+ }, []), E = T({
94
95
  apiReferenceData: t,
95
- pathInputs: o.path,
96
+ pathInputs: e.path,
96
97
  request: i,
97
- snippetPresets: h
98
+ snippetPresets: a
98
99
  });
99
- return /* @__PURE__ */ a(P, { snippets: M, dropdown: !0, maxHeight: p, showCopyButton: !1, noMargins: !0 });
100
- }, v = ({
101
- baseUrl: s,
100
+ return /* @__PURE__ */ h(w, { snippets: E, dropdown: !0, maxHeight: l, showCopyButton: !1, noMargins: !0 });
101
+ }, N = ({
102
+ baseUrl: r,
102
103
  apiReferenceData: t,
103
- inputs: o,
104
- selectedBodyContentType: c,
105
- examples: n,
106
- requiredOnly: r,
107
- maxHeight: f,
108
- selectedSecurityOptionIndex: p
104
+ inputs: e,
105
+ selectedBodyContentType: n,
106
+ examples: p,
107
+ requiredOnly: o,
108
+ maxHeight: c,
109
+ selectedSecurityOptionIndex: l
109
110
  }) => {
110
- const [m, i] = V({}), [h, M] = V(null);
111
- return B(() => {
112
- const u = o.path, l = {};
111
+ const [m, i] = j({}), [a, E] = j(null);
112
+ return V(() => {
113
+ const f = e.path, u = {};
113
114
  try {
114
- for (const [e, { value: j }] of Object.entries(n)) {
115
- if (!j) continue;
116
- const S = w({
117
- baseUrl: s,
115
+ for (const [s, { value: G }] of Object.entries(p)) {
116
+ if (!G) continue;
117
+ const B = S({
118
+ baseUrl: r,
118
119
  apiReferenceData: t,
119
- inputs: o,
120
- selectedBodyContentType: c,
121
- exampleData: j,
122
- requiredOnly: r,
123
- selectedSecurityOptionIndex: p
120
+ inputs: e,
121
+ selectedBodyContentType: n,
122
+ exampleData: G,
123
+ requiredOnly: o,
124
+ selectedSecurityOptionIndex: l
124
125
  });
125
- x({
126
+ T({
126
127
  apiReferenceData: t,
127
- pathInputs: u,
128
- request: S,
128
+ pathInputs: f,
129
+ request: B,
129
130
  isMultipleRequest: !0
130
- }).forEach((E) => {
131
- l[E.filename] = {
132
- ...l[E.filename],
133
- [e]: E
131
+ }).forEach((M) => {
132
+ u[M.filename] = {
133
+ ...u[M.filename],
134
+ [s]: M
134
135
  };
135
136
  });
136
137
  }
137
- i(l);
138
- } catch (e) {
139
- console.error(e), M(e);
138
+ i(u);
139
+ } catch (s) {
140
+ console.error(s), E(s);
140
141
  }
141
- }, [s, t, o, c, n, r, p]), h || Object.keys(m).length === 0 ? null : /* @__PURE__ */ a(G, { snippets: m, maxHeight: f });
142
+ }, [r, t, e, n, p, o, l]), a || Object.keys(m).length === 0 ? null : /* @__PURE__ */ h(k, { snippets: m, maxHeight: c });
142
143
  };
143
144
  export {
144
- X as GeneratedRequestExample
145
+ z as GeneratedRequestExample
145
146
  };
@@ -2,9 +2,9 @@ import { jsx as r } from "react/jsx-runtime";
2
2
  import { generateResponseExampleMap as i } from "../../generators/generateResponseExampleMap.js";
3
3
  import { useSelectedResponseContentType as u } from "../../hooks/useSelectedResponseContentType.js";
4
4
  import { mapResponseExamples as d } from "../../schemaGraph/utils.js";
5
- import { CodeGroupSelect as j } from "../../../components/content-components/CodeGroupSelect/index.js";
6
- import { CodeSnippets as b } from "../../../components/content-components/code-snippets.js";
7
- const C = ({
5
+ import { CodeGroupSelect as f } from "../../../components/content-components/CodeGroupSelect/index.js";
6
+ import { CodeSnippets as j } from "../../../components/content-components/code-snippets.js";
7
+ const x = ({
8
8
  apiReferenceData: t,
9
9
  maxHeight: n
10
10
  }) => {
@@ -20,10 +20,10 @@ const C = ({
20
20
  const a = Object.values(s).flatMap(
21
21
  (m) => Object.values(m)
22
22
  );
23
- return /* @__PURE__ */ r(b, { snippets: a, maxHeight: n, noMargins: !0 });
23
+ return /* @__PURE__ */ r(j, { snippets: a, maxHeight: n, showCopyButton: !1, noMargins: !0 });
24
24
  }
25
- return /* @__PURE__ */ r(j, { snippets: s, maxHeight: n });
25
+ return /* @__PURE__ */ r(f, { snippets: s, maxHeight: n });
26
26
  };
27
27
  export {
28
- C as GeneratedResponseExample
28
+ x as GeneratedResponseExample
29
29
  };
@@ -1,32 +1,32 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
2
  import { memo as O } from "react";
3
- import { initialApiPlaygroundInputs as j } from "../../constants/index.js";
4
- import { generateSnippetMap as w } from "../../generators/generateSnippetMap.js";
5
- import { useSelectedBaseUrl as B } from "../../hooks/useSelectedBaseUrl.js";
6
- import { useSelectedRequestBodyContentType as L } from "../../hooks/useSelectedRequestBodyContentType.js";
7
- import { useSelectedSecurityOption as T } from "../../hooks/useSelectedSecurityOption.js";
8
- import { CodeGroupSelect as k } from "../../../components/content-components/CodeGroupSelect/index.js";
9
- import { CodeSnippet as P } from "../../../components/content-components/code-snippet.js";
10
- import { CodeSnippets as v } from "../../../components/content-components/code-snippets.js";
11
- import { CodeBlock as h } from "../../../components/content-components/code-block.js";
12
- import { CodeGroup as b } from "../../../components/content-components/code-group.js";
13
- import { shikiLangToDisplayLang as G } from "../../../constants/snippetPresets.js";
3
+ import { initialApiPlaygroundInputs as T } from "../../constants/index.js";
4
+ import { generateSnippetMap as j } from "../../generators/generateSnippetMap.js";
5
+ import { useSelectedBaseUrl as w } from "../../hooks/useSelectedBaseUrl.js";
6
+ import { useSelectedRequestBodyContentType as G } from "../../hooks/useSelectedRequestBodyContentType.js";
7
+ import { useSelectedSecurityOption as L } from "../../hooks/useSelectedSecurityOption.js";
8
+ import { CodeGroupSelect as U } from "../../../components/content-components/CodeGroupSelect/index.js";
9
+ import { CodeSnippet as k } from "../../../components/content-components/code-snippet.js";
10
+ import { CodeSnippets as P } from "../../../components/content-components/code-snippets.js";
11
+ import { CodeBlock as b } from "../../../components/content-components/code-block.js";
12
+ import { CodeGroup as h } from "../../../components/content-components/code-group.js";
13
+ import { shikiLangToDisplayLang as v } from "../../../constants/snippetPresets.js";
14
14
  import { useApiPlaygroundDisplay as I } from "../../../hooks/useApiPlaygroundDisplay.js";
15
- import { GeneratedRequestExample as E } from "./GeneratedRequestExample.js";
15
+ import { GeneratedRequestExample as B } from "./GeneratedRequestExample.js";
16
16
  const N = O(
17
17
  ({
18
18
  apiReferenceData: e,
19
- inputs: u = j,
20
- maxHeight: i
19
+ inputs: p = T,
20
+ maxHeight: u
21
21
  }) => {
22
- var g, f, y, S, q, x;
23
- const n = (g = e.operation) == null ? void 0 : g.requestExamples, { selectedRequestBodyContentTypeIndex: p } = L(), { selectedSecurityOptionIndex: a } = T(), M = I(), m = (f = e.operation) == null ? void 0 : f.requestExampleLanguages, d = (y = e.operation) == null ? void 0 : y.requiredOnlyExamples, { baseUrl: s } = B();
24
- switch ((S = e.operation) == null ? void 0 : S.requestExampleType) {
22
+ var g, y, f, S, q, E, x;
23
+ const n = (g = e.operation) == null ? void 0 : g.requestExamples, { selectedRequestBodyContentTypeIndex: a } = G(), { selectedSecurityOptionIndex: i } = L(), M = I(), m = (y = e.operation) == null ? void 0 : y.requestExampleLanguages, d = (f = e.operation) == null ? void 0 : f.requiredOnlyExamples, { baseUrl: s } = w();
24
+ switch (console.log("[DEBUG] RequestExample - requestExampleType:", (S = e.operation) == null ? void 0 : S.requestExampleType), console.log("[DEBUG] RequestExample - baseUrl:", s), console.log("[DEBUG] RequestExample - apiReferenceData.operation:", e.operation), (q = e.operation) == null ? void 0 : q.requestExampleType) {
25
25
  case "mdx":
26
26
  if (!n) return null;
27
27
  const C = n.some((o) => o.dropdown ?? !1);
28
- return /* @__PURE__ */ r(b, { isSmallText: !0, dropdown: C, noMargins: !0, className: i, children: n.map((o, t) => /* @__PURE__ */ r(
29
- h,
28
+ return /* @__PURE__ */ r(h, { isSmallText: !0, dropdown: C, noMargins: !0, className: u, children: n.map((o, t) => /* @__PURE__ */ r(
29
+ b,
30
30
  {
31
31
  language: o.language,
32
32
  fileName: o.filename,
@@ -35,54 +35,54 @@ const N = O(
35
35
  `${o.filename}-${o.language}-${t}`
36
36
  )) });
37
37
  case "webhook":
38
- return (q = n == null ? void 0 : n[0]) != null && q.code ? /* @__PURE__ */ r(b, { isSmallText: !0, noMargins: !0, hideCodeSnippetFeedbackButton: !0, children: /* @__PURE__ */ r(h, { language: "json", filename: "Example Request Body", children: /* @__PURE__ */ r(P, { language: "json", children: (x = n[0]) == null ? void 0 : x.code }) }) }) : null;
38
+ return (E = n == null ? void 0 : n[0]) != null && E.code ? /* @__PURE__ */ r(h, { isSmallText: !0, noMargins: !0, hideCodeSnippetFeedbackButton: !0, children: /* @__PURE__ */ r(b, { language: "json", filename: "Example Request Body", children: /* @__PURE__ */ r(k, { language: "json", children: (x = n[0]) == null ? void 0 : x.code }) }) }) : null;
39
39
  case "codeSamples":
40
40
  if (!e.operation.codeSamples) return null;
41
- const c = w({
41
+ const c = j({
42
42
  apiReferenceData: e,
43
43
  codeSamples: e.operation.codeSamples,
44
44
  baseUrl: s,
45
45
  apiPlaygroundMode: M,
46
46
  requestExampleLanguages: m,
47
47
  requiredOnly: d,
48
- inputs: u,
49
- selectedSecurityOptionIndex: a,
50
- selectedRequestBodyContentTypeIndex: p
48
+ inputs: p,
49
+ selectedSecurityOptionIndex: i,
50
+ selectedRequestBodyContentTypeIndex: a
51
51
  });
52
52
  if (Object.values(c).every((o) => Object.keys(o).length <= 1)) {
53
53
  let t = Object.values(c).flatMap((l) => Object.values(l));
54
54
  return new Set(t.map((l) => l.filename)).size !== t.length && (t = t.map((l) => ({
55
55
  ...l,
56
- filename: G[l.language] ?? l.language
57
- }))), /* @__PURE__ */ r(v, { snippets: t, noMargins: !0, dropdown: !0 });
56
+ filename: v[l.language] ?? l.language
57
+ }))), /* @__PURE__ */ r(P, { snippets: t, noMargins: !0, dropdown: !0 });
58
58
  }
59
- return /* @__PURE__ */ r(k, { snippets: c });
59
+ return /* @__PURE__ */ r(U, { snippets: c });
60
60
  case "generated":
61
61
  return s ? /* @__PURE__ */ r(
62
- E,
62
+ B,
63
63
  {
64
64
  apiReferenceData: e,
65
65
  baseUrl: s,
66
- inputs: u,
67
- selectedSecurityOptionIndex: a,
66
+ inputs: p,
67
+ selectedSecurityOptionIndex: i,
68
68
  requestExampleLanguages: m,
69
69
  requiredOnly: d,
70
- selectedRequestBodyContentTypeIndex: p,
71
- maxHeight: i
70
+ selectedRequestBodyContentTypeIndex: a,
71
+ maxHeight: u
72
72
  }
73
73
  ) : null;
74
74
  case "examples":
75
75
  return !e.operation.prefillPlaygroundExamples || !s ? null : /* @__PURE__ */ r(
76
- E,
76
+ B,
77
77
  {
78
78
  apiReferenceData: e,
79
79
  baseUrl: s,
80
- inputs: u,
81
- selectedSecurityOptionIndex: a,
80
+ inputs: p,
81
+ selectedSecurityOptionIndex: i,
82
82
  requestExampleLanguages: m,
83
83
  requiredOnly: d,
84
- selectedRequestBodyContentTypeIndex: p,
85
- maxHeight: i
84
+ selectedRequestBodyContentTypeIndex: a,
85
+ maxHeight: u
86
86
  }
87
87
  );
88
88
  default: