@stainless-api/docs-ui 0.1.0-beta.72 → 0.1.0-beta.74

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 (135) hide show
  1. package/dist/{chunk-BN_g-Awi.js → chunk-BYypO7fO.js} +3 -3
  2. package/dist/components/MaskedInput.d.ts +1 -1
  3. package/dist/components/MaskedInput.js +1 -1
  4. package/dist/components/breadcrumbs.d.ts +24 -1
  5. package/dist/components/breadcrumbs.js +62 -7
  6. package/dist/components/icons.d.ts +12 -12
  7. package/dist/components/icons.js +883 -1
  8. package/dist/components/index.d.ts +16 -14
  9. package/dist/components/index.js +72 -18
  10. package/dist/components/method.d.ts +58 -1
  11. package/dist/components/method.js +95 -8
  12. package/dist/components/overview.d.ts +38 -1
  13. package/dist/components/overview.js +137 -9
  14. package/dist/components/primitives.d.ts +104 -1
  15. package/dist/components/primitives.js +250 -6
  16. package/dist/components/properties.d.ts +53 -1
  17. package/dist/components/properties.js +138 -7
  18. package/dist/components/sdk-sidebar.d.ts +14 -1
  19. package/dist/components/sdk-sidebar.js +50 -8
  20. package/dist/components/sdk.d.ts +121 -1
  21. package/dist/components/sdk.js +404 -8
  22. package/dist/components/snippets.d.ts +70 -13
  23. package/dist/components/snippets.js +182 -7
  24. package/dist/components/stl-sidebar.d.ts +57 -1
  25. package/dist/components/stl-sidebar.js +105 -3
  26. package/dist/contexts/component-generics.d.ts +29 -1
  27. package/dist/contexts/component-generics.js +31 -1
  28. package/dist/contexts/component-types.d.ts +4 -15
  29. package/dist/contexts/component.d.ts +7 -17
  30. package/dist/contexts/component.js +22 -28
  31. package/dist/contexts/docs.d.ts +61 -1
  32. package/dist/contexts/docs.js +89 -1
  33. package/dist/contexts/index.d.ts +13 -14
  34. package/dist/contexts/index.js +44 -6
  35. package/dist/contexts/markdown.d.ts +21 -1
  36. package/dist/contexts/markdown.js +47 -2
  37. package/dist/contexts/navigation.d.ts +28 -1
  38. package/dist/contexts/navigation.js +22 -1
  39. package/dist/contexts/use-components.d.ts +1 -13
  40. package/dist/contexts/use-components.js +6 -2
  41. package/dist/{index-W4Td2Hl7.d.ts → index-PdnFhQF9.d.ts} +1 -1
  42. package/dist/index.d.ts +4 -14
  43. package/dist/index.js +7 -30
  44. package/dist/languages/cli.d.ts +38 -14
  45. package/dist/languages/cli.js +166 -20
  46. package/dist/languages/csharp.d.ts +42 -14
  47. package/dist/languages/csharp.js +283 -8
  48. package/dist/languages/go.d.ts +40 -14
  49. package/dist/languages/go.js +303 -8
  50. package/dist/languages/http.d.ts +46 -14
  51. package/dist/languages/http.js +390 -19
  52. package/dist/languages/index.d.ts +50 -14
  53. package/dist/languages/index.js +30 -28
  54. package/dist/languages/java.d.ts +43 -14
  55. package/dist/languages/java.js +403 -8
  56. package/dist/languages/python.d.ts +40 -14
  57. package/dist/languages/python.js +269 -8
  58. package/dist/languages/ruby.d.ts +40 -14
  59. package/dist/languages/ruby.js +387 -8
  60. package/dist/languages/terraform.d.ts +48 -14
  61. package/dist/languages/terraform.js +243 -8
  62. package/dist/languages/typescript.d.ts +40 -14
  63. package/dist/languages/typescript.js +449 -8
  64. package/dist/markdown/index.d.ts +1 -2
  65. package/dist/markdown/index.js +1 -28
  66. package/dist/markdown/printer.d.ts +2 -2
  67. package/dist/markdown/printer.js +6 -30
  68. package/dist/markdown/utils.d.ts +3 -3
  69. package/dist/routing.d.ts +61 -2
  70. package/dist/routing.js +204 -2
  71. package/dist/spec.d.ts +4 -4
  72. package/dist/spec.js +2 -2
  73. package/dist/style.js +176 -1
  74. package/dist/use-strict-context-L0c8JKg4.js +16 -0
  75. package/dist/utils.d.ts +1 -1
  76. package/dist/utils.js +53 -2
  77. package/package.json +3 -3
  78. package/dist/breadcrumbs-46Qjx1Pd.d.ts +0 -25
  79. package/dist/breadcrumbs-BZ4wBC9-.d.ts +0 -25
  80. package/dist/breadcrumbs-BiBfNqBI.js +0 -63
  81. package/dist/cli-hduQ5XS1.js +0 -166
  82. package/dist/component-BU8BTbqz.js +0 -23
  83. package/dist/component-generics-Bw4ZOyEG.d.ts +0 -30
  84. package/dist/component-generics-D-WarFUb.d.ts +0 -30
  85. package/dist/component-generics-POFirVVb.js +0 -45
  86. package/dist/components-9NMl1791.js +0 -72
  87. package/dist/contexts-_NNW5yqC.js +0 -44
  88. package/dist/csharp-sn5CJu9t.js +0 -283
  89. package/dist/docs-Cu9Yl6-y.d.ts +0 -66
  90. package/dist/docs-YgoQ3bzY.js +0 -81
  91. package/dist/docs-xb5wYGjM.d.ts +0 -66
  92. package/dist/go-BoaAVmP0.js +0 -303
  93. package/dist/http-B3qTyMc3.js +0 -389
  94. package/dist/icons-BYKn5X8E.js +0 -885
  95. package/dist/index-BOmn7DHa.d.ts +0 -428
  96. package/dist/index-BvcPmB0r.d.ts +0 -428
  97. package/dist/java-BiLRuLuD.js +0 -403
  98. package/dist/languages-vUhD5Hu_.js +0 -30
  99. package/dist/markdown-BszOPZhh.d.ts +0 -22
  100. package/dist/markdown-Cq3XEhrR.js +0 -49
  101. package/dist/markdown-plMAoN22.d.ts +0 -22
  102. package/dist/method-C4PgTWAu.d.ts +0 -59
  103. package/dist/method-D6R_farj.d.ts +0 -59
  104. package/dist/method-DjzVBzZe.js +0 -96
  105. package/dist/navigation-HiZWRl34.d.ts +0 -29
  106. package/dist/navigation-MrP4Ubbg.d.ts +0 -29
  107. package/dist/navigation-aoYZ_tl4.js +0 -24
  108. package/dist/overview-CTeKhpQq.d.ts +0 -39
  109. package/dist/overview-Yf1PTJNi.d.ts +0 -39
  110. package/dist/overview-ocTARt-j.js +0 -138
  111. package/dist/primitives-CNG-fEhQ.js +0 -250
  112. package/dist/primitives-K7NijV36.d.ts +0 -105
  113. package/dist/primitives-WGxdBJDS.d.ts +0 -105
  114. package/dist/properties-Bu4nW9JD.d.ts +0 -54
  115. package/dist/properties-Bynmj9_H.d.ts +0 -54
  116. package/dist/properties-DQU0NBzb.js +0 -138
  117. package/dist/python-nqOBH7GS.js +0 -269
  118. package/dist/routing-C64k4fmX.js +0 -205
  119. package/dist/routing-pAL4V4hv.d.ts +0 -61
  120. package/dist/ruby-BBc8HdIt.js +0 -387
  121. package/dist/sdk-BSdgEEJw.js +0 -405
  122. package/dist/sdk-BVCk1ox2.d.ts +0 -122
  123. package/dist/sdk-Dm0S-XQE.d.ts +0 -122
  124. package/dist/sdk-sidebar-B1ehT_xI.d.ts +0 -15
  125. package/dist/sdk-sidebar-BDn8S1xS.js +0 -50
  126. package/dist/sdk-sidebar-Dqeu7C1-.d.ts +0 -15
  127. package/dist/snippets-CLpNVNlA.js +0 -181
  128. package/dist/stl-sidebar-BTTErIJs.d.ts +0 -58
  129. package/dist/stl-sidebar-C7GNALtk.d.ts +0 -58
  130. package/dist/stl-sidebar-DC5UOJiT.js +0 -106
  131. package/dist/style-DJIYkFhO.js +0 -178
  132. package/dist/terraform-DVx2ea2h.js +0 -243
  133. package/dist/typescript-Cmk-jBBw.js +0 -449
  134. package/dist/use-components-BUz3GbO4.js +0 -7
  135. package/dist/utils-DPbkW1Tz.js +0 -54
@@ -1,405 +0,0 @@
1
- import { d as useSnippetIds, f as useSnippetResponse, i as useDeclaration, l as useSettings, m as useSpec, n as useAvailableLanguages, r as useContentPanelLayout, s as useLanguage } from "./docs-YgoQ3bzY.js";
2
- import { n as useNavigation } from "./navigation-aoYZ_tl4.js";
3
- import { n as useLanguageComponents } from "./contexts-_NNW5yqC.js";
4
- import { t as useComponents } from "./use-components-BUz3GbO4.js";
5
- import { t as style_default } from "./style-DJIYkFhO.js";
6
- import { l as getLanguageSnippet, p as parseStainlessPath, s as generateRoute, t as LanguageNames } from "./routing-C64k4fmX.js";
7
- import { a as JavaIcon, c as PythonIcon, d as TypescriptIcon, i as GoIcon, l as RubyIcon, n as CSharpIcon, o as KotlinIcon, r as CurlIcon, s as PowershellIcon, t as CLIIcon, u as TerraformIcon } from "./icons-BYKn5X8E.js";
8
- import * as React$1 from "react";
9
- import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
10
- import clsx from "clsx";
11
- import { BookOpen, Copy, Github } from "lucide-react";
12
- import { Button, Callout } from "@stainless-api/ui-primitives";
13
-
14
- //#region src/components/sdk.tsx
15
- const PropertyModelContext = React$1.createContext({});
16
- function usePropertyModel() {
17
- return React$1.useContext(PropertyModelContext);
18
- }
19
- const ReferenceNestingContext = React$1.createContext([]);
20
- function useReferenceNesting() {
21
- return React$1.useContext(ReferenceNestingContext);
22
- }
23
- const SDKSnippetLanguages = {
24
- "node.default": { name: "TypeScript" },
25
- "typescript.default": { name: "TypeScript" },
26
- "python.default": { name: "Python" },
27
- "go.default": { name: "Go" },
28
- "java.default": { name: "Java" },
29
- "kotlin.default": { name: "Kotlin" },
30
- "http.curl": { name: "cURL" },
31
- "http.powershell": { name: "Powershell" },
32
- "terraform.default": { name: "Terraform" },
33
- "ruby.default": { name: "Ruby" },
34
- "csharp.default": { name: "C#" },
35
- "php.default": { name: "PHP" },
36
- "cli.default": { name: "CLI tool" }
37
- };
38
- function SDKChildren({ paths, expand, depth }) {
39
- const Docs = useComponents();
40
- return /* @__PURE__ */ jsx("div", {
41
- className: style_default.Properties,
42
- children: paths.map((path, i) => /* @__PURE__ */ jsx(Docs.SDKDeclaration, {
43
- path,
44
- expand,
45
- depth
46
- }, i))
47
- });
48
- }
49
- function normalizeDeclaration(raw, http) {
50
- if (raw.kind === "JavaDeclProperty" && raw.type.kind === "JavaTypeString" && raw.constraints?.format === "binary") return {
51
- ...raw,
52
- type: {
53
- kind: "JavaTypeReference",
54
- typeName: "InputStream"
55
- }
56
- };
57
- if (http?.kind === "HttpDeclProperty" && http.type.kind === "HttpTypeString" && http.constraints?.format === "binary") switch (raw.kind) {
58
- case "CLISchemaProperty":
59
- case "CLIFlag":
60
- case "HttpDeclProperty": return {
61
- ...raw,
62
- type: {
63
- kind: "HttpTypeBinary",
64
- contentType: []
65
- }
66
- };
67
- case "RubyDeclProperty": return {
68
- ...raw,
69
- type: {
70
- kind: "RubyTypeBinary",
71
- contentType: []
72
- }
73
- };
74
- }
75
- return raw;
76
- }
77
- function SDKDeclaration({ path, expand, depth = 0 }) {
78
- const Lang = useLanguageComponents();
79
- const Docs = useComponents();
80
- const decl = normalizeDeclaration(useDeclaration(path, true), useDeclaration(path.replace(/ > \(schema\)$/, "") + " > (schema)", false, "http"));
81
- const settings = useSettings();
82
- const model = usePropertyModel();
83
- const nesting = useReferenceNesting();
84
- const { selectedPath } = useNavigation();
85
- if (decl.kind.endsWith("Reference")) {
86
- const refId = "type" in decl && decl.type !== void 0 && typeof decl.type !== "string" && "$ref" in decl.type ? decl.type["$ref"] : void 0;
87
- if (refId && refId !== path && !nesting.includes(refId)) return /* @__PURE__ */ jsx(ReferenceNestingContext.Provider, {
88
- value: [...nesting, refId],
89
- children: /* @__PURE__ */ jsx(SDKDeclaration, {
90
- path: refId,
91
- expand,
92
- depth
93
- })
94
- });
95
- }
96
- const parsedPath = selectedPath ? parseStainlessPath(selectedPath) : null;
97
- const modelPropSetting = settings?.properties?.includeModelProperties;
98
- const inlineModelProps = modelPropSetting === "method-page" ? Boolean(parsedPath?.method) : modelPropSetting !== false;
99
- const isUnion = "childrenParentSchema" in decl && decl.childrenParentSchema && decl.kind !== "CLIFlag" && decl.kind !== "CLISchemaProperty" && ["enum", "union"].includes(decl.childrenParentSchema);
100
- const id = model?.propertyPath ? `${model.propertyPath} + ${path}` : path;
101
- const shouldExpand = selectedPath?.startsWith(path) && nesting.length < 1 || settings?.properties?.expandDepth && depth <= settings?.properties?.expandDepth && !isUnion || expand;
102
- const hasChildren = "children" in decl && (decl.children?.length ?? 0) > 0 && !decl.children?.includes(path) && !(isUnion && decl.childrenParentSchema === "enum" && decl.children?.length === 1) && (inlineModelProps || !("modelPath" in decl));
103
- const content = /* @__PURE__ */ jsx(Lang.Property, {
104
- decl,
105
- children: ({ ...props }) => /* @__PURE__ */ jsx(Docs.Property, {
106
- id,
107
- expand: shouldExpand,
108
- constraints: "constraints" in decl && decl.kind !== "CLIFlag" && decl.kind !== "CLISchemaProperty" && /* @__PURE__ */ jsx(Docs.SDKConstraints, { constraints: decl["constraints"] }),
109
- declaration: /* @__PURE__ */ jsx(Lang.Declaration, { decl }),
110
- title: "title" in decl ? decl.title : void 0,
111
- description: "docstring" in decl ? decl["docstring"] : void 0,
112
- deprecated: decl.deprecated,
113
- ...props,
114
- children: hasChildren && /* @__PURE__ */ jsxs(Fragment$1, { children: [isUnion && /* @__PURE__ */ jsx("div", {
115
- className: style_default.PropertyAnnotation,
116
- children: "Accepts one of the following:"
117
- }), /* @__PURE__ */ jsx(Docs.SDKChildren, {
118
- paths: decl.children ?? [],
119
- depth: depth + 1
120
- })] })
121
- })
122
- });
123
- if ("modelPath" in decl) {
124
- const value = {
125
- modelPath: decl.modelPath,
126
- propertyPath: decl.stainlessPath
127
- };
128
- return /* @__PURE__ */ jsx(PropertyModelContext.Provider, {
129
- value,
130
- children: content
131
- });
132
- }
133
- return content;
134
- }
135
- function SDKConstraints({ constraints }) {
136
- if (constraints) return /* @__PURE__ */ jsx("div", {
137
- className: style_default.PropertyConstraints,
138
- children: Object.entries(constraints).map(([name, value]) => name === "format" && value === "binary" ? null : /* @__PURE__ */ jsxs("div", {
139
- className: style_default.PropertyConstraint,
140
- children: [/* @__PURE__ */ jsx("span", {
141
- className: style_default.PropertyConstraintName,
142
- children: name
143
- }), /* @__PURE__ */ jsx("span", {
144
- className: style_default.PropertyConstraintValue,
145
- children: value
146
- })]
147
- }, name))
148
- });
149
- }
150
- const snippetIcons = {
151
- "node.default": TypescriptIcon,
152
- "typescript.default": TypescriptIcon,
153
- "go.default": GoIcon,
154
- "python.default": PythonIcon,
155
- "terraform.default": TerraformIcon,
156
- "http.curl": CurlIcon,
157
- "http.powershell": PowershellIcon,
158
- "ruby.default": RubyIcon,
159
- "java.default": JavaIcon,
160
- "kotlin.default": KotlinIcon,
161
- "csharp.default": CSharpIcon,
162
- "cli.default": CLIIcon,
163
- "php.default": CSharpIcon
164
- };
165
- function SDKIcon({ language }) {
166
- const LangIcon = snippetIcons[language];
167
- if (!LangIcon) return null;
168
- return /* @__PURE__ */ jsx(LangIcon, { className: clsx(style_default.Icon, language.split(".").shift()) });
169
- }
170
- function SDKRequestTitle({ snippetLanguage }) {
171
- const languageName = SDKSnippetLanguages[snippetLanguage]?.name;
172
- return /* @__PURE__ */ jsxs("span", {
173
- className: style_default.SnippetRequestTitleLanguage,
174
- children: [
175
- /* @__PURE__ */ jsx(SDKIcon, { language: snippetLanguage }),
176
- " ",
177
- languageName
178
- ]
179
- });
180
- }
181
- function SDKExample({ method, transformRequestSnippet }) {
182
- const Docs = useComponents();
183
- const language = useLanguage();
184
- const snippetLanguage = getLanguageSnippet(language);
185
- if ((useSnippetIds(method.stainlessPath, language)?.filter((id) => id !== "default")?.length ?? 0) >= 2) return /* @__PURE__ */ jsx(Docs.MultiSnippets, {
186
- requestTitle: /* @__PURE__ */ jsx(Docs.SDKRequestTitle, { snippetLanguage }),
187
- method
188
- });
189
- return /* @__PURE__ */ jsx(Docs.Snippet, {
190
- requestTitle: /* @__PURE__ */ jsx(Docs.SDKRequestTitle, { snippetLanguage }),
191
- method,
192
- transformRequestSnippet
193
- });
194
- }
195
- function SDKMethodHeader({ method }) {
196
- const Docs = useComponents();
197
- const Lang = useLanguageComponents();
198
- const decl = useDeclaration(method.stainlessPath, true);
199
- return /* @__PURE__ */ jsx(Docs.MethodHeader, {
200
- level: "h1",
201
- title: method.summary || method.title,
202
- signature: /* @__PURE__ */ jsx(Lang.MethodSignature, { decl }),
203
- badges: method.deprecated && /* @__PURE__ */ jsx(Docs.Badge, {
204
- id: "deprecated",
205
- children: "Deprecated"
206
- }),
207
- children: /* @__PURE__ */ jsx(Docs.MethodRoute, {
208
- httpMethod: method.httpMethod,
209
- endpoint: method.endpoint.split(" ", 2).at(-1)
210
- })
211
- });
212
- }
213
- function useStreamingResponse(method) {
214
- const tsDecl = useDeclaration(method.stainlessPath, false, "typescript");
215
- if (tsDecl?.kind === "TSDeclFunction" && tsDecl.overloads) {
216
- for (const e of tsDecl.overloads) if (e.returns.kind === "TSTypeReference" && (e.returns.$ref === "$.typescript.Stream" || e.returns.$ref === "$.node.Stream") && e.returns.typeParameters?.[0]?.kind === "TSTypeReference") {
217
- const id = e.returns.typeParameters?.[0].$ref;
218
- if (id) return id;
219
- }
220
- }
221
- }
222
- function SDKMethodInfo({ method }) {
223
- const Docs = useComponents();
224
- const Lang = useLanguageComponents();
225
- const decl = useDeclaration(method.stainlessPath, true);
226
- const streamingResponse = useStreamingResponse(method);
227
- const spec = useSpec();
228
- const language = useLanguage();
229
- if (Lang.MethodInfo) return /* @__PURE__ */ jsx(Lang.MethodInfo, { decl });
230
- function shouldExpand(items) {
231
- if (items.length > 1) return false;
232
- const item = items[0];
233
- if (!item) return false;
234
- const decl = spec?.decls?.[language]?.[item];
235
- return decl && "children" in decl && decl.children && decl.children.length > 0;
236
- }
237
- const responseChildren = "responseChildren" in decl && decl.responseChildren && decl.responseChildren.length > 0 ? [...decl.responseChildren] : [];
238
- if (streamingResponse) responseChildren.push(streamingResponse);
239
- return /* @__PURE__ */ jsx(Docs.MethodInfo, {
240
- parameters: "paramsChildren" in decl && Array.isArray(decl.paramsChildren) && decl.paramsChildren.length > 0 && /* @__PURE__ */ jsx(Docs.SDKChildren, {
241
- expand: shouldExpand(decl.paramsChildren),
242
- paths: decl.paramsChildren
243
- }),
244
- returns: responseChildren.length > 0 && /* @__PURE__ */ jsx(Docs.SDKChildren, {
245
- expand: shouldExpand(responseChildren),
246
- paths: responseChildren
247
- })
248
- });
249
- }
250
- function SDKMethodNotImplemented({ method }) {
251
- const Docs = useComponents();
252
- const languages = useAvailableLanguages(method?.stainlessPath);
253
- const language = useLanguage();
254
- const { basePath } = useNavigation();
255
- const availableLanguageLinks = languages.flatMap((lang) => {
256
- const url = generateRoute(basePath ?? "/", lang, method.stainlessPath);
257
- return url ? [{
258
- url,
259
- label: LanguageNames[lang] ?? lang
260
- }] : [];
261
- });
262
- return /* @__PURE__ */ jsxs("div", {
263
- className: style_default.Method,
264
- children: [/* @__PURE__ */ jsx(Docs.MethodHeader, {
265
- level: "h1",
266
- title: method.summary || method.title,
267
- children: /* @__PURE__ */ jsx(Docs.MethodRoute, {
268
- httpMethod: method.httpMethod,
269
- endpoint: method.endpoint.split(" ", 2).at(-1)
270
- })
271
- }), /* @__PURE__ */ jsxs(Callout, {
272
- variant: "warning",
273
- children: [
274
- "The method ",
275
- /* @__PURE__ */ jsx("code", { children: method.name }),
276
- " is not implemented in ",
277
- LanguageNames[language] ?? language,
278
- basePath && availableLanguageLinks.length > 0 ? /* @__PURE__ */ jsxs(Fragment$1, { children: [", but it is available in the following languages:", /* @__PURE__ */ jsx("ul", { children: availableLanguageLinks.map(({ url, label }) => {
279
- return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx("a", {
280
- href: url,
281
- children: label
282
- }) }, url);
283
- }) })] }) : "."
284
- ]
285
- })]
286
- });
287
- }
288
- function SDKMethod({ method, transformRequestSnippet }) {
289
- const Docs = useComponents();
290
- const decl = useDeclaration(method?.stainlessPath, false);
291
- const layout = useContentPanelLayout();
292
- const defaultResponses = useSnippetResponse(method.stainlessPath);
293
- if (!decl) return /* @__PURE__ */ jsx(SDKMethodNotImplemented, { method });
294
- return /* @__PURE__ */ jsxs(Docs.Method, {
295
- id: method.stainlessPath,
296
- header: /* @__PURE__ */ jsx(Docs.SDKMethodHeader, { method }),
297
- className: clsx({
298
- [style_default.MethodSinglePane]: layout === "single-pane",
299
- [style_default.MethodDoublePane]: layout === "double-pane"
300
- }),
301
- children: [
302
- /* @__PURE__ */ jsxs("div", {
303
- className: style_default.MethodContentColumn,
304
- children: [/* @__PURE__ */ jsx(Docs.MethodDescription, { description: method.description }), /* @__PURE__ */ jsx(Docs.SDKMethodInfo, { method })]
305
- }),
306
- /* @__PURE__ */ jsx("div", {
307
- className: clsx(style_default.MethodExample, "not-content", "stl-ui-not-prose"),
308
- children: /* @__PURE__ */ jsx(Docs.SDKExample, {
309
- method,
310
- transformRequestSnippet
311
- })
312
- }),
313
- /* @__PURE__ */ jsxs("div", {
314
- className: style_default.MethodResponseColumn,
315
- children: [/* @__PURE__ */ jsx("h5", { children: "Returns Examples" }), /* @__PURE__ */ jsx(Docs.SnippetResponse, { responses: defaultResponses })]
316
- })
317
- ]
318
- });
319
- }
320
- function SDKModel({ model }) {
321
- const Docs = useComponents();
322
- if (!useDeclaration(`${model.stainlessPath} > (schema)`, true)) return null;
323
- return /* @__PURE__ */ jsx("div", {
324
- className: style_default.Model,
325
- tabIndex: 0,
326
- children: /* @__PURE__ */ jsx("div", {
327
- className: style_default.ResourceContentProperties,
328
- children: /* @__PURE__ */ jsx(Docs.SDKDeclaration, { path: `${model.stainlessPath} > (schema)` })
329
- })
330
- });
331
- }
332
- function SDKReference({ stainlessPath, children }) {
333
- const Docs = useComponents();
334
- if (!stainlessPath || !stainlessPath.endsWith("(schema)")) return children;
335
- return /* @__PURE__ */ jsx("span", {
336
- className: style_default.TypeReference,
337
- children: /* @__PURE__ */ jsx(Docs.Link, {
338
- stainlessPath,
339
- children
340
- })
341
- });
342
- }
343
- function SDKLanguageBlock({ language, version, install, links }) {
344
- const Docs = useComponents();
345
- const lang = `${language}.default`;
346
- return /* @__PURE__ */ jsxs("div", {
347
- className: style_default.LanguageBlock,
348
- children: [
349
- /* @__PURE__ */ jsxs("div", {
350
- className: style_default.LanguageBlockContent,
351
- children: [/* @__PURE__ */ jsx("div", {
352
- className: style_default.LanguageBlockContentIcon,
353
- children: /* @__PURE__ */ jsx(Docs.SDKIcon, {
354
- language: lang,
355
- size: 24
356
- })
357
- }), /* @__PURE__ */ jsxs("div", {
358
- className: style_default.LanguageBlockContentInfo,
359
- children: [/* @__PURE__ */ jsx("div", {
360
- className: style_default.LanguageBlockContentInfoLanguage,
361
- children: Docs.SDKSnippetLanguages[lang].name
362
- }), /* @__PURE__ */ jsx("div", {
363
- className: style_default.LanguageBlockContentInfoVersion,
364
- children: version
365
- })]
366
- })]
367
- }),
368
- /* @__PURE__ */ jsxs("div", {
369
- className: style_default.LanguageBlockInstall,
370
- "data-stldocs-copy-parent": true,
371
- children: [
372
- /* @__PURE__ */ jsx("pre", {
373
- "data-stldocs-copy-content": true,
374
- children: install
375
- }),
376
- " ",
377
- /* @__PURE__ */ jsx(Button, {
378
- variant: "ghost",
379
- size: "sm",
380
- "data-stldocs-snippet-copy": true,
381
- children: /* @__PURE__ */ jsx(Copy, {
382
- size: 16,
383
- className: style_default.Icon
384
- })
385
- })
386
- ]
387
- }),
388
- /* @__PURE__ */ jsxs("div", {
389
- className: style_default.LanguageBlockLinks,
390
- children: [/* @__PURE__ */ jsx(Button, {
391
- href: links.repo,
392
- variant: "outline",
393
- children: /* @__PURE__ */ jsx(Button.Icon, { icon: Github })
394
- }), /* @__PURE__ */ jsxs(Button, {
395
- href: links.docs,
396
- variant: "outline",
397
- children: [/* @__PURE__ */ jsx(Button.Icon, { icon: BookOpen }), /* @__PURE__ */ jsx(Button.Label, { children: "Read Docs" })]
398
- })]
399
- })
400
- ]
401
- });
402
- }
403
-
404
- //#endregion
405
- export { usePropertyModel as _, SDKDeclaration as a, SDKLanguageBlock as c, SDKMethodInfo as d, SDKMethodNotImplemented as f, SDKSnippetLanguages as g, SDKRequestTitle as h, SDKConstraints as i, SDKMethod as l, SDKReference as m, ReferenceNestingContext as n, SDKExample as o, SDKModel as p, SDKChildren as r, SDKIcon as s, PropertyModelContext as t, SDKMethodHeader as u, useReferenceNesting as v, useStreamingResponse as y };
@@ -1,122 +0,0 @@
1
- import { c as ID, d as Method, f as Model, g as SnippetLanguage, o as HasStainlessPath, t as BaseDeclaration } from "./index-W4Td2Hl7.js";
2
- import { t as DocsLanguage } from "./routing-pAL4V4hv.js";
3
- import * as React$1 from "react";
4
- import * as react_jsx_runtime0 from "react/jsx-runtime";
5
-
6
- //#region src/components/sdk.d.ts
7
- type PropertyModelContextType = {
8
- modelPath?: string;
9
- propertyPath?: string;
10
- };
11
- declare const PropertyModelContext: React$1.Context<PropertyModelContextType>;
12
- declare function usePropertyModel(): PropertyModelContextType;
13
- type ReferenceNestingContextType = string[];
14
- declare const ReferenceNestingContext: React$1.Context<ReferenceNestingContextType>;
15
- declare function useReferenceNesting(): ReferenceNestingContextType;
16
- type SDKSnippetLanguagesType = Record<SnippetLanguage, {
17
- name: string;
18
- }>;
19
- declare const SDKSnippetLanguages: SDKSnippetLanguagesType;
20
- type TransformRequestSnippetFn = ({
21
- snippet,
22
- language
23
- }: {
24
- snippet: string;
25
- language: DocsLanguage;
26
- }) => string;
27
- type SDKChildrenProps = {
28
- paths: ID[];
29
- expand?: boolean;
30
- depth?: number;
31
- };
32
- declare function SDKChildren({
33
- paths,
34
- expand,
35
- depth
36
- }: SDKChildrenProps): react_jsx_runtime0.JSX.Element;
37
- type SDKDeclarationProps = {
38
- path: string;
39
- expand?: boolean;
40
- depth?: number;
41
- };
42
- declare function SDKDeclaration({
43
- path,
44
- expand,
45
- depth
46
- }: SDKDeclarationProps): react_jsx_runtime0.JSX.Element;
47
- type SDKConstraintsProps = {
48
- constraints?: Record<string, unknown>;
49
- };
50
- declare function SDKConstraints({
51
- constraints
52
- }: SDKConstraintsProps): react_jsx_runtime0.JSX.Element | undefined;
53
- type SDKIconProps = {
54
- language: SnippetLanguage;
55
- size?: number;
56
- };
57
- declare function SDKIcon({
58
- language
59
- }: SDKIconProps): react_jsx_runtime0.JSX.Element | null;
60
- type SDKRequestTitleProps = {
61
- snippetLanguage: SnippetLanguage;
62
- };
63
- declare function SDKRequestTitle({
64
- snippetLanguage
65
- }: SDKRequestTitleProps): react_jsx_runtime0.JSX.Element;
66
- type SDKExampleProps = {
67
- method: Partial<Method> & HasStainlessPath;
68
- transformRequestSnippet?: TransformRequestSnippetFn;
69
- };
70
- declare function SDKExample({
71
- method,
72
- transformRequestSnippet
73
- }: SDKExampleProps): react_jsx_runtime0.JSX.Element;
74
- type SDKMethodProps = {
75
- method: Method;
76
- transformRequestSnippet?: TransformRequestSnippetFn;
77
- };
78
- declare function SDKMethodHeader({
79
- method
80
- }: SDKMethodProps): react_jsx_runtime0.JSX.Element;
81
- declare function useStreamingResponse(method: BaseDeclaration): ID | undefined;
82
- declare function SDKMethodInfo({
83
- method
84
- }: SDKMethodProps): react_jsx_runtime0.JSX.Element;
85
- declare function SDKMethodNotImplemented({
86
- method
87
- }: SDKMethodProps): react_jsx_runtime0.JSX.Element;
88
- declare function SDKMethod({
89
- method,
90
- transformRequestSnippet
91
- }: SDKMethodProps): react_jsx_runtime0.JSX.Element;
92
- type SDKModelProps = {
93
- model: Model;
94
- };
95
- declare function SDKModel({
96
- model
97
- }: SDKModelProps): react_jsx_runtime0.JSX.Element | null;
98
- type SDKReferenceProps = {
99
- stainlessPath: string;
100
- children?: React$1.ReactNode;
101
- };
102
- declare function SDKReference({
103
- stainlessPath,
104
- children
105
- }: SDKReferenceProps): string | number | bigint | boolean | Iterable<React$1.ReactNode> | Promise<string | number | bigint | boolean | React$1.ReactPortal | React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | Iterable<React$1.ReactNode> | null | undefined> | react_jsx_runtime0.JSX.Element | null | undefined;
106
- type SDKLanguageBlockProps = {
107
- language: DocsLanguage;
108
- version: string;
109
- install: string;
110
- links: {
111
- repo: string;
112
- docs: string;
113
- };
114
- };
115
- declare function SDKLanguageBlock({
116
- language,
117
- version,
118
- install,
119
- links
120
- }: SDKLanguageBlockProps): react_jsx_runtime0.JSX.Element;
121
- //#endregion
122
- export { SDKSnippetLanguagesType as C, useStreamingResponse as D, useReferenceNesting as E, SDKSnippetLanguages as S, usePropertyModel as T, SDKModel as _, SDKChildren as a, SDKRequestTitle as b, SDKDeclaration as c, SDKLanguageBlock as d, SDKMethod as f, SDKMethodProps as g, SDKMethodNotImplemented as h, ReferenceNestingContextType as i, SDKExample as l, SDKMethodInfo as m, PropertyModelContextType as n, SDKConstraints as o, SDKMethodHeader as p, ReferenceNestingContext as r, SDKConstraintsProps as s, PropertyModelContext as t, SDKIcon as u, SDKModelProps as v, TransformRequestSnippetFn as w, SDKRequestTitleProps as x, SDKReference as y };
@@ -1,122 +0,0 @@
1
- import { c as ID, d as Method, f as Model, g as SnippetLanguage, o as HasStainlessPath, t as BaseDeclaration } from "./index-W4Td2Hl7.js";
2
- import { t as DocsLanguage } from "./routing-pAL4V4hv.js";
3
- import * as React$1 from "react";
4
- import * as react_jsx_runtime38 from "react/jsx-runtime";
5
-
6
- //#region src/components/sdk.d.ts
7
- type PropertyModelContextType = {
8
- modelPath?: string;
9
- propertyPath?: string;
10
- };
11
- declare const PropertyModelContext: React$1.Context<PropertyModelContextType>;
12
- declare function usePropertyModel(): PropertyModelContextType;
13
- type ReferenceNestingContextType = string[];
14
- declare const ReferenceNestingContext: React$1.Context<ReferenceNestingContextType>;
15
- declare function useReferenceNesting(): ReferenceNestingContextType;
16
- type SDKSnippetLanguagesType = Record<SnippetLanguage, {
17
- name: string;
18
- }>;
19
- declare const SDKSnippetLanguages: SDKSnippetLanguagesType;
20
- type TransformRequestSnippetFn = ({
21
- snippet,
22
- language
23
- }: {
24
- snippet: string;
25
- language: DocsLanguage;
26
- }) => string;
27
- type SDKChildrenProps = {
28
- paths: ID[];
29
- expand?: boolean;
30
- depth?: number;
31
- };
32
- declare function SDKChildren({
33
- paths,
34
- expand,
35
- depth
36
- }: SDKChildrenProps): react_jsx_runtime38.JSX.Element;
37
- type SDKDeclarationProps = {
38
- path: string;
39
- expand?: boolean;
40
- depth?: number;
41
- };
42
- declare function SDKDeclaration({
43
- path,
44
- expand,
45
- depth
46
- }: SDKDeclarationProps): react_jsx_runtime38.JSX.Element;
47
- type SDKConstraintsProps = {
48
- constraints?: Record<string, unknown>;
49
- };
50
- declare function SDKConstraints({
51
- constraints
52
- }: SDKConstraintsProps): react_jsx_runtime38.JSX.Element | undefined;
53
- type SDKIconProps = {
54
- language: SnippetLanguage;
55
- size?: number;
56
- };
57
- declare function SDKIcon({
58
- language
59
- }: SDKIconProps): react_jsx_runtime38.JSX.Element | null;
60
- type SDKRequestTitleProps = {
61
- snippetLanguage: SnippetLanguage;
62
- };
63
- declare function SDKRequestTitle({
64
- snippetLanguage
65
- }: SDKRequestTitleProps): react_jsx_runtime38.JSX.Element;
66
- type SDKExampleProps = {
67
- method: Partial<Method> & HasStainlessPath;
68
- transformRequestSnippet?: TransformRequestSnippetFn;
69
- };
70
- declare function SDKExample({
71
- method,
72
- transformRequestSnippet
73
- }: SDKExampleProps): react_jsx_runtime38.JSX.Element;
74
- type SDKMethodProps = {
75
- method: Method;
76
- transformRequestSnippet?: TransformRequestSnippetFn;
77
- };
78
- declare function SDKMethodHeader({
79
- method
80
- }: SDKMethodProps): react_jsx_runtime38.JSX.Element;
81
- declare function useStreamingResponse(method: BaseDeclaration): ID | undefined;
82
- declare function SDKMethodInfo({
83
- method
84
- }: SDKMethodProps): react_jsx_runtime38.JSX.Element;
85
- declare function SDKMethodNotImplemented({
86
- method
87
- }: SDKMethodProps): react_jsx_runtime38.JSX.Element;
88
- declare function SDKMethod({
89
- method,
90
- transformRequestSnippet
91
- }: SDKMethodProps): react_jsx_runtime38.JSX.Element;
92
- type SDKModelProps = {
93
- model: Model;
94
- };
95
- declare function SDKModel({
96
- model
97
- }: SDKModelProps): react_jsx_runtime38.JSX.Element | null;
98
- type SDKReferenceProps = {
99
- stainlessPath: string;
100
- children?: React$1.ReactNode;
101
- };
102
- declare function SDKReference({
103
- stainlessPath,
104
- children
105
- }: SDKReferenceProps): string | number | bigint | boolean | Iterable<React$1.ReactNode> | Promise<string | number | bigint | boolean | React$1.ReactPortal | React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | Iterable<React$1.ReactNode> | null | undefined> | react_jsx_runtime38.JSX.Element | null | undefined;
106
- type SDKLanguageBlockProps = {
107
- language: DocsLanguage;
108
- version: string;
109
- install: string;
110
- links: {
111
- repo: string;
112
- docs: string;
113
- };
114
- };
115
- declare function SDKLanguageBlock({
116
- language,
117
- version,
118
- install,
119
- links
120
- }: SDKLanguageBlockProps): react_jsx_runtime38.JSX.Element;
121
- //#endregion
122
- export { SDKSnippetLanguagesType as C, useStreamingResponse as D, useReferenceNesting as E, SDKSnippetLanguages as S, usePropertyModel as T, SDKModel as _, SDKChildren as a, SDKRequestTitle as b, SDKDeclaration as c, SDKLanguageBlock as d, SDKMethod as f, SDKMethodProps as g, SDKMethodNotImplemented as h, ReferenceNestingContextType as i, SDKExample as l, SDKMethodInfo as m, PropertyModelContextType as n, SDKConstraints as o, SDKMethodHeader as p, ReferenceNestingContext as r, SDKConstraintsProps as s, PropertyModelContext as t, SDKIcon as u, SDKModelProps as v, TransformRequestSnippetFn as w, SDKRequestTitleProps as x, SDKReference as y };
@@ -1,15 +0,0 @@
1
- import { m as Resource } from "./index-W4Td2Hl7.js";
2
- import * as react_jsx_runtime34 from "react/jsx-runtime";
3
-
4
- //#region src/components/sdk-sidebar.d.ts
5
- type SDKSidebarProps = {
6
- resources: Resource[];
7
- };
8
- /**
9
- * Given some SDKJSON.Resources, calls into StlSidebar with the appropriate sidebar entries.
10
- */
11
- declare function SDKSidebar({
12
- resources
13
- }: SDKSidebarProps): react_jsx_runtime34.JSX.Element;
14
- //#endregion
15
- export { SDKSidebarProps as n, SDKSidebar as t };