@stainless-api/docs-ui 0.1.0-beta.6 → 0.1.0-beta.61
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/dist/breadcrumbs-BVskoBYz.d.ts +25 -0
- package/dist/breadcrumbs-C9LLJyuJ.d.ts +25 -0
- package/dist/breadcrumbs-CqA6kow2.js +63 -0
- package/dist/chunk-BN_g-Awi.js +18 -0
- package/dist/cli-0bJ66S1r.js +157 -0
- package/dist/component-CjJJYIxG.js +23 -0
- package/dist/component-generics-BC_P155r.d.ts +30 -0
- package/dist/component-generics-BkwbbxJF.d.ts +30 -0
- package/dist/component-generics-POFirVVb.js +45 -0
- package/dist/components/MaskedInput.d.ts +14 -0
- package/dist/components/MaskedInput.js +76 -0
- package/dist/components/breadcrumbs.d.ts +2 -0
- package/dist/components/breadcrumbs.js +9 -0
- package/dist/components/icons.d.ts +60 -0
- package/dist/components/icons.js +3 -0
- package/dist/components/index.d.ts +10 -0
- package/dist/components/index.js +18 -0
- package/dist/components/method.d.ts +2 -0
- package/dist/components/method.js +10 -0
- package/dist/components/overview.d.ts +2 -0
- package/dist/components/overview.js +11 -0
- package/dist/components/primitives.d.ts +2 -0
- package/dist/components/primitives.js +8 -0
- package/dist/components/properties.d.ts +2 -0
- package/dist/components/properties.js +9 -0
- package/dist/components/sdk.d.ts +2 -0
- package/dist/components/sdk.js +10 -0
- package/dist/components/sidebar.d.ts +2 -0
- package/dist/components/sidebar.js +9 -0
- package/dist/components/snippets.d.ts +3 -0
- package/dist/components/snippets.js +9 -0
- package/dist/components-FEHnQBJC.js +70 -0
- package/dist/contexts/component-generics.d.ts +2 -0
- package/dist/contexts/component-generics.js +3 -0
- package/dist/contexts/component-types.d.ts +16 -0
- package/dist/contexts/component-types.js +0 -0
- package/dist/contexts/component.d.ts +29 -0
- package/dist/contexts/component.js +28 -0
- package/dist/contexts/docs.d.ts +2 -0
- package/dist/contexts/docs.js +3 -0
- package/dist/contexts/index.d.ts +22 -0
- package/dist/contexts/index.js +7 -0
- package/dist/contexts/markdown.d.ts +2 -0
- package/dist/contexts/markdown.js +4 -0
- package/dist/contexts/navigation.d.ts +2 -0
- package/dist/contexts/navigation.js +3 -0
- package/dist/contexts/use-components.d.ts +14 -0
- package/dist/contexts/use-components.js +4 -0
- package/dist/contexts-CeV_L_Iy.js +39 -0
- package/dist/csharp-Dl2RIiYP.js +283 -0
- package/dist/docs--qWFuJCM.d.ts +46 -0
- package/dist/docs-DSFRsmbQ.d.ts +46 -0
- package/dist/docs-Di94viZV.js +54 -0
- package/dist/go-DuKdRGqU.js +303 -0
- package/dist/http-C7bu4oCl.js +331 -0
- package/dist/icons-BYKn5X8E.js +885 -0
- package/dist/index-C0qvL4yP.d.ts +15 -0
- package/dist/index-DE1vA8T2.d.ts +302 -0
- package/dist/index-DsFyACw9.d.ts +15 -0
- package/dist/index-FDM-j9s-.d.ts +302 -0
- package/dist/index-zNpvNvtN.d.ts +1691 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +30 -7542
- package/dist/java-DSyzO-6F.js +403 -0
- package/dist/languages/cli.d.ts +11 -0
- package/dist/languages/cli.js +20 -0
- package/dist/languages/csharp.d.ts +11 -0
- package/dist/languages/csharp.js +9 -0
- package/dist/languages/go.d.ts +11 -0
- package/dist/languages/go.js +9 -0
- package/dist/languages/http.d.ts +11 -0
- package/dist/languages/http.js +19 -0
- package/dist/languages/index.d.ts +11 -0
- package/dist/languages/index.js +27 -0
- package/dist/languages/java.d.ts +11 -0
- package/dist/languages/java.js +9 -0
- package/dist/languages/python.d.ts +11 -0
- package/dist/languages/python.js +9 -0
- package/dist/languages/ruby.d.ts +11 -0
- package/dist/languages/ruby.js +9 -0
- package/dist/languages/typescript.d.ts +11 -0
- package/dist/languages/typescript.js +9 -0
- package/dist/languages-BO5YJ6cy.js +28 -0
- package/dist/markdown/index.d.ts +12 -0
- package/dist/markdown/index.js +105 -0
- package/dist/markdown/md.d.ts +15 -0
- package/dist/markdown/md.js +41 -0
- package/dist/markdown/printer.d.ts +13 -0
- package/dist/markdown/printer.js +98 -0
- package/dist/markdown/utils.d.ts +21 -0
- package/dist/markdown/utils.js +31 -0
- package/dist/markdown-B517MrZh.d.ts +22 -0
- package/dist/markdown-C7Tb41LZ.d.ts +22 -0
- package/dist/markdown-D2JWyRws.js +49 -0
- package/dist/method-BaQEZVlw.d.ts +59 -0
- package/dist/method-Dln4ZTIB.d.ts +59 -0
- package/dist/method-jTnA0G8m.js +90 -0
- package/dist/navigation-XhIgqXwM.d.ts +29 -0
- package/dist/navigation-aoYZ_tl4.js +24 -0
- package/dist/navigation-rKdts-BR.d.ts +29 -0
- package/dist/overview-B3kgyac2.d.ts +39 -0
- package/dist/overview-BnagZfH1.js +139 -0
- package/dist/overview-Dp-gGl3v.d.ts +39 -0
- package/dist/primitives-B6zu2rrx.d.ts +105 -0
- package/dist/primitives-DQLc9kN7.js +250 -0
- package/dist/primitives-VtUGoYwX.d.ts +105 -0
- package/dist/properties-Bun4nfUE.d.ts +54 -0
- package/dist/properties-DGL2J11L.js +131 -0
- package/dist/properties-ZOIqpkET.d.ts +54 -0
- package/dist/python-D8ABqtn1.js +269 -0
- package/dist/routing-Ce0_tBW6.js +197 -0
- package/dist/routing-CtbZJru_.d.ts +54 -0
- package/dist/routing.d.ts +2 -0
- package/dist/routing.js +3 -180
- package/dist/ruby-261jvCjl.js +387 -0
- package/dist/sdk-BebFnWYL.d.ts +118 -0
- package/dist/sdk-CIxaNoAs.d.ts +118 -0
- package/dist/sdk-GGpyGTao.js +338 -0
- package/dist/sidebar-BWno0E4w.js +85 -0
- package/dist/sidebar-CLsIJZZf.d.ts +36 -0
- package/dist/sidebar-D4m_pVpS.d.ts +36 -0
- package/dist/snippets-CwVjwsAo.d.ts +53 -0
- package/dist/snippets-Ym3mnHO3.d.ts +53 -0
- package/dist/snippets-kI8eNs1F.js +164 -0
- package/dist/spec.d.ts +65 -0
- package/dist/spec.js +167 -0
- package/dist/style-LwfvXElj.js +170 -0
- package/dist/style.d.ts +169 -0
- package/dist/style.js +3 -0
- package/dist/styles/main.css +722 -755
- package/dist/styles/main.js +0 -0
- package/dist/styles/primitives.css +322 -459
- package/dist/styles/primitives.js +0 -0
- package/dist/styles/resets.css +32 -41
- package/dist/styles/resets.js +0 -0
- package/dist/styles/search.css +192 -270
- package/dist/styles/search.js +0 -0
- package/dist/styles/sidebar.css +56 -61
- package/dist/styles/sidebar.js +0 -0
- package/dist/styles/variables.css +26 -89
- package/dist/styles/variables.js +0 -0
- package/dist/styles.css +3145 -0
- package/dist/styles.mjs +1 -0
- package/dist/typescript-D924WidI.js +449 -0
- package/dist/use-components-BUz3GbO4.js +7 -0
- package/dist/utils-D01mAUfQ.js +32 -0
- package/dist/utils.d.ts +14 -0
- package/dist/utils.js +3 -0
- package/package.json +73 -21
- package/dist/mcp.js +0 -16003
- package/dist/styles/snippets.css +0 -132
- package/src/components/breadcrumbs.tsx +0 -94
- package/src/components/chat.tsx +0 -154
- package/src/components/dropdown.tsx +0 -91
- package/src/components/icons.tsx +0 -584
- package/src/components/index.ts +0 -9
- package/src/components/method.tsx +0 -144
- package/src/components/overview.tsx +0 -159
- package/src/components/primitives.tsx +0 -284
- package/src/components/properties.tsx +0 -130
- package/src/components/scripts/dropdown.ts +0 -78
- package/src/components/sdk.tsx +0 -402
- package/src/components/sidebar.tsx +0 -99
- package/src/components/snippets.tsx +0 -179
- package/src/contexts/component-generics.tsx +0 -48
- package/src/contexts/component-types.tsx +0 -5
- package/src/contexts/component.tsx +0 -32
- package/src/contexts/docs.tsx +0 -75
- package/src/contexts/index.tsx +0 -17
- package/src/contexts/markdown.tsx +0 -43
- package/src/contexts/navigation.tsx +0 -44
- package/src/contexts/search.tsx +0 -28
- package/src/contexts/use-components.tsx +0 -4
- package/src/index.ts +0 -6
- package/src/languages/go.tsx +0 -281
- package/src/languages/http.tsx +0 -321
- package/src/languages/index.ts +0 -26
- package/src/languages/java.tsx +0 -358
- package/src/languages/python.tsx +0 -255
- package/src/languages/ruby.tsx +0 -320
- package/src/languages/typescript.tsx +0 -393
- package/src/markdown/index.ts +0 -107
- package/src/markdown/md.ts +0 -45
- package/src/markdown/utils.ts +0 -49
- package/src/routing.ts +0 -238
- package/src/search/form.tsx +0 -127
- package/src/search/index.tsx +0 -1
- package/src/search/indexer.ts +0 -246
- package/src/search/mcp.ts +0 -61
- package/src/search/printer.tsx +0 -86
- package/src/search/providers/algolia.ts +0 -88
- package/src/search/providers/fuse.ts +0 -19
- package/src/search/providers/pagefind.ts +0 -17
- package/src/search/providers/walker.ts +0 -30
- package/src/search/results.tsx +0 -181
- package/src/search/state.ts +0 -64
- package/src/search/types.ts +0 -116
- package/src/style.ts +0 -197
- package/src/styles/main.css +0 -993
- package/src/styles/primitives.css +0 -573
- package/src/styles/resets.css +0 -47
- package/src/styles/search.css +0 -342
- package/src/styles/sidebar.css +0 -87
- package/src/styles/snippets.css +0 -132
- package/src/styles/variables.css +0 -90
- package/src/utils.ts +0 -41
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
import { a as useLanguage, l as useSpec, n as useContentPanelLayout, r as useDeclaration, s as useSettings } from "./docs-Di94viZV.js";
|
|
2
|
+
import { n as useNavigation } from "./navigation-aoYZ_tl4.js";
|
|
3
|
+
import { n as useLanguageComponents } from "./contexts-CeV_L_Iy.js";
|
|
4
|
+
import { t as useComponents } from "./use-components-BUz3GbO4.js";
|
|
5
|
+
import { t as style_default } from "./style-LwfvXElj.js";
|
|
6
|
+
import { c as getLanguageSnippet, t as LanguageNames } from "./routing-Ce0_tBW6.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 SDKDeclaration({ path, expand, depth = 0 }) {
|
|
50
|
+
const Lang = useLanguageComponents();
|
|
51
|
+
const Docs = useComponents();
|
|
52
|
+
const decl = useDeclaration(path, true);
|
|
53
|
+
const settings = useSettings();
|
|
54
|
+
const model = usePropertyModel();
|
|
55
|
+
const nesting = useReferenceNesting();
|
|
56
|
+
const { selectedPath } = useNavigation();
|
|
57
|
+
if (decl.kind.endsWith("Reference")) {
|
|
58
|
+
const refId = "type" in decl && decl.type !== void 0 && typeof decl.type !== "string" && "$ref" in decl.type ? decl.type["$ref"] : void 0;
|
|
59
|
+
if (refId && refId !== path && !nesting.includes(refId)) return /* @__PURE__ */ jsx(ReferenceNestingContext.Provider, {
|
|
60
|
+
value: [...nesting, refId],
|
|
61
|
+
children: /* @__PURE__ */ jsx(SDKDeclaration, {
|
|
62
|
+
path: refId,
|
|
63
|
+
expand,
|
|
64
|
+
depth
|
|
65
|
+
})
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
const isUnion = "childrenParentSchema" in decl && decl.childrenParentSchema && ["enum", "union"].includes(decl.childrenParentSchema);
|
|
69
|
+
const id = model?.propertyPath ? `${model.propertyPath} + ${path}` : path;
|
|
70
|
+
const shouldExpand = selectedPath?.startsWith(path) && nesting.length < 1 || settings?.properties?.expandDepth && depth <= settings?.properties?.expandDepth && !isUnion || expand;
|
|
71
|
+
const hasChildren = "children" in decl && (decl.children?.length ?? 0) > 0 && !decl.children?.includes(path) && !(isUnion && decl.childrenParentSchema === "enum" && decl.children?.length === 1) && (settings?.properties?.includeModelProperties !== false || !("modelPath" in decl));
|
|
72
|
+
const content = /* @__PURE__ */ jsx(Lang.Property, {
|
|
73
|
+
decl,
|
|
74
|
+
children: ({ ...props }) => /* @__PURE__ */ jsx(Docs.Property, {
|
|
75
|
+
id,
|
|
76
|
+
expand: shouldExpand,
|
|
77
|
+
constraints: "constraints" in decl && /* @__PURE__ */ jsx(Docs.SDKConstraints, { constraints: decl["constraints"] }),
|
|
78
|
+
declaration: /* @__PURE__ */ jsx(Lang.Declaration, { decl }),
|
|
79
|
+
title: "title" in decl ? decl.title : void 0,
|
|
80
|
+
description: "docstring" in decl ? decl["docstring"] : void 0,
|
|
81
|
+
deprecated: decl.deprecated,
|
|
82
|
+
...props,
|
|
83
|
+
children: hasChildren && /* @__PURE__ */ jsxs(Fragment$1, { children: [isUnion && /* @__PURE__ */ jsx("div", {
|
|
84
|
+
className: style_default.PropertyAnnotation,
|
|
85
|
+
children: "Accepts one of the following:"
|
|
86
|
+
}), /* @__PURE__ */ jsx(Docs.SDKChildren, {
|
|
87
|
+
paths: decl.children ?? [],
|
|
88
|
+
depth: depth + 1
|
|
89
|
+
})] })
|
|
90
|
+
})
|
|
91
|
+
});
|
|
92
|
+
if ("modelPath" in decl) {
|
|
93
|
+
const value = {
|
|
94
|
+
modelPath: decl.modelPath,
|
|
95
|
+
propertyPath: decl.stainlessPath
|
|
96
|
+
};
|
|
97
|
+
return /* @__PURE__ */ jsx(PropertyModelContext.Provider, {
|
|
98
|
+
value,
|
|
99
|
+
children: content
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
return content;
|
|
103
|
+
}
|
|
104
|
+
function SDKConstraints({ constraints }) {
|
|
105
|
+
if (constraints) return /* @__PURE__ */ jsx("div", {
|
|
106
|
+
className: style_default.PropertyConstraints,
|
|
107
|
+
children: Object.entries(constraints).map(([name, value]) => /* @__PURE__ */ jsxs("div", {
|
|
108
|
+
className: style_default.PropertyConstraint,
|
|
109
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
110
|
+
className: style_default.PropertyConstraintName,
|
|
111
|
+
children: name
|
|
112
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
113
|
+
className: style_default.PropertyConstraintValue,
|
|
114
|
+
children: value
|
|
115
|
+
})]
|
|
116
|
+
}, name))
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
const snippetIcons = {
|
|
120
|
+
"node.default": TypescriptIcon,
|
|
121
|
+
"typescript.default": TypescriptIcon,
|
|
122
|
+
"go.default": GoIcon,
|
|
123
|
+
"python.default": PythonIcon,
|
|
124
|
+
"terraform.default": TerraformIcon,
|
|
125
|
+
"http.curl": CurlIcon,
|
|
126
|
+
"http.powershell": PowershellIcon,
|
|
127
|
+
"ruby.default": RubyIcon,
|
|
128
|
+
"java.default": JavaIcon,
|
|
129
|
+
"kotlin.default": KotlinIcon,
|
|
130
|
+
"csharp.default": CSharpIcon,
|
|
131
|
+
"cli.default": CLIIcon,
|
|
132
|
+
"php.default": CSharpIcon
|
|
133
|
+
};
|
|
134
|
+
function SDKIcon({ language }) {
|
|
135
|
+
const LangIcon = snippetIcons[language];
|
|
136
|
+
if (!LangIcon) return null;
|
|
137
|
+
return /* @__PURE__ */ jsx(LangIcon, { className: clsx(style_default.Icon, language.split(".").shift()) });
|
|
138
|
+
}
|
|
139
|
+
function SDKRequestTitle({ snippetLanguage }) {
|
|
140
|
+
const languageName = SDKSnippetLanguages[snippetLanguage]?.name;
|
|
141
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
142
|
+
className: style_default.SnippetRequestTitleLanguage,
|
|
143
|
+
children: [
|
|
144
|
+
/* @__PURE__ */ jsx(SDKIcon, { language: snippetLanguage }),
|
|
145
|
+
" ",
|
|
146
|
+
languageName
|
|
147
|
+
]
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
function SDKExample({ method, transformRequestSnippet }) {
|
|
151
|
+
const Docs = useComponents();
|
|
152
|
+
const snippetLanguage = getLanguageSnippet(useLanguage());
|
|
153
|
+
return /* @__PURE__ */ jsx(Docs.Snippet, {
|
|
154
|
+
requestTitle: /* @__PURE__ */ jsx(Docs.SDKRequestTitle, { snippetLanguage }),
|
|
155
|
+
method,
|
|
156
|
+
transformRequestSnippet
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
function SDKMethodHeader({ method }) {
|
|
160
|
+
const Docs = useComponents();
|
|
161
|
+
const Lang = useLanguageComponents();
|
|
162
|
+
const decl = useDeclaration(method.stainlessPath, true);
|
|
163
|
+
return /* @__PURE__ */ jsx(Docs.MethodHeader, {
|
|
164
|
+
level: "h1",
|
|
165
|
+
title: method.summary ?? method.title,
|
|
166
|
+
signature: /* @__PURE__ */ jsx(Lang.MethodSignature, { decl }),
|
|
167
|
+
badges: method.deprecated && /* @__PURE__ */ jsx(Docs.Badge, {
|
|
168
|
+
id: "deprecated",
|
|
169
|
+
children: "Deprecated"
|
|
170
|
+
}),
|
|
171
|
+
children: /* @__PURE__ */ jsx(Docs.MethodRoute, {
|
|
172
|
+
httpMethod: method.httpMethod,
|
|
173
|
+
endpoint: method.endpoint.split(" ", 2).at(-1)
|
|
174
|
+
})
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
function SDKMethodInfo({ method }) {
|
|
178
|
+
const Docs = useComponents();
|
|
179
|
+
const Lang = useLanguageComponents();
|
|
180
|
+
const decl = useDeclaration(method.stainlessPath, true);
|
|
181
|
+
const spec = useSpec();
|
|
182
|
+
const language = useLanguage();
|
|
183
|
+
if (Lang.MethodInfo) return /* @__PURE__ */ jsx(Lang.MethodInfo, { decl });
|
|
184
|
+
function shouldExpand(items) {
|
|
185
|
+
if (items.length > 1) return false;
|
|
186
|
+
const item = items[0];
|
|
187
|
+
if (!item) return false;
|
|
188
|
+
const decl = spec?.decls?.[language]?.[item];
|
|
189
|
+
return decl && "children" in decl && decl.children && decl.children.length > 0;
|
|
190
|
+
}
|
|
191
|
+
return /* @__PURE__ */ jsx(Docs.MethodInfo, {
|
|
192
|
+
parameters: "paramsChildren" in decl && Array.isArray(decl.paramsChildren) && decl.paramsChildren.length > 0 && /* @__PURE__ */ jsx(Docs.SDKChildren, {
|
|
193
|
+
expand: shouldExpand(decl.paramsChildren),
|
|
194
|
+
paths: decl.paramsChildren
|
|
195
|
+
}),
|
|
196
|
+
returns: "responseChildren" in decl && decl.responseChildren && decl.responseChildren.length > 0 && /* @__PURE__ */ jsx(Docs.SDKChildren, {
|
|
197
|
+
expand: shouldExpand(decl.responseChildren),
|
|
198
|
+
paths: decl.responseChildren
|
|
199
|
+
})
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
function SDKMethod({ method, transformRequestSnippet }) {
|
|
203
|
+
const Docs = useComponents();
|
|
204
|
+
const decl = useDeclaration(method?.stainlessPath, false);
|
|
205
|
+
const layout = useContentPanelLayout();
|
|
206
|
+
const language = useLanguage();
|
|
207
|
+
if (!decl) return /* @__PURE__ */ jsxs("div", {
|
|
208
|
+
className: style_default.Method,
|
|
209
|
+
children: [/* @__PURE__ */ jsx(Docs.MethodHeader, {
|
|
210
|
+
level: "h1",
|
|
211
|
+
title: method.summary ?? method.title,
|
|
212
|
+
children: /* @__PURE__ */ jsx(Docs.MethodRoute, {
|
|
213
|
+
httpMethod: method.httpMethod,
|
|
214
|
+
endpoint: method.endpoint.split(" ", 2).at(-1)
|
|
215
|
+
})
|
|
216
|
+
}), /* @__PURE__ */ jsxs(Callout, {
|
|
217
|
+
variant: "warning",
|
|
218
|
+
children: [
|
|
219
|
+
"The method ",
|
|
220
|
+
/* @__PURE__ */ jsx("code", { children: method.name }),
|
|
221
|
+
" is not implemented in ",
|
|
222
|
+
LanguageNames[language] ?? language,
|
|
223
|
+
"."
|
|
224
|
+
]
|
|
225
|
+
})]
|
|
226
|
+
});
|
|
227
|
+
return /* @__PURE__ */ jsxs(Docs.Method, {
|
|
228
|
+
id: method.stainlessPath,
|
|
229
|
+
header: /* @__PURE__ */ jsx(Docs.SDKMethodHeader, { method }),
|
|
230
|
+
className: clsx({
|
|
231
|
+
[style_default.MethodSinglePane]: layout === "single-pane",
|
|
232
|
+
[style_default.MethodDoublePane]: layout === "double-pane"
|
|
233
|
+
}),
|
|
234
|
+
children: [
|
|
235
|
+
/* @__PURE__ */ jsxs("div", {
|
|
236
|
+
className: style_default.MethodContentColumn,
|
|
237
|
+
children: [/* @__PURE__ */ jsx(Docs.MethodDescription, { description: method.description }), /* @__PURE__ */ jsx(Docs.SDKMethodInfo, { method })]
|
|
238
|
+
}),
|
|
239
|
+
/* @__PURE__ */ jsx("div", {
|
|
240
|
+
className: clsx(style_default.MethodExample, "not-content", "stl-ui-not-prose"),
|
|
241
|
+
children: /* @__PURE__ */ jsx(Docs.SDKExample, {
|
|
242
|
+
method,
|
|
243
|
+
transformRequestSnippet
|
|
244
|
+
})
|
|
245
|
+
}),
|
|
246
|
+
/* @__PURE__ */ jsxs("div", {
|
|
247
|
+
className: style_default.MethodResponseColumn,
|
|
248
|
+
children: [/* @__PURE__ */ jsx("h5", { children: "Returns Examples" }), /* @__PURE__ */ jsx(Docs.SnippetResponse, { responses: method.exampleResponses })]
|
|
249
|
+
})
|
|
250
|
+
]
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
function SDKModel({ model }) {
|
|
254
|
+
const Docs = useComponents();
|
|
255
|
+
if (!useDeclaration(`${model.stainlessPath} > (schema)`, true)) return null;
|
|
256
|
+
return /* @__PURE__ */ jsx("div", {
|
|
257
|
+
className: style_default.Model,
|
|
258
|
+
tabIndex: 0,
|
|
259
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
260
|
+
className: style_default.ResourceContentProperties,
|
|
261
|
+
children: /* @__PURE__ */ jsx(Docs.SDKDeclaration, { path: `${model.stainlessPath} > (schema)` })
|
|
262
|
+
})
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
function SDKReference({ stainlessPath, children }) {
|
|
266
|
+
const Docs = useComponents();
|
|
267
|
+
if (!stainlessPath || !stainlessPath.endsWith("(schema)")) return children;
|
|
268
|
+
return /* @__PURE__ */ jsx("span", {
|
|
269
|
+
className: style_default.TypeReference,
|
|
270
|
+
children: /* @__PURE__ */ jsx(Docs.Link, {
|
|
271
|
+
stainlessPath,
|
|
272
|
+
children
|
|
273
|
+
})
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
function SDKLanguageBlock({ language, version, install, links }) {
|
|
277
|
+
const Docs = useComponents();
|
|
278
|
+
const lang = `${language}.default`;
|
|
279
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
280
|
+
className: style_default.LanguageBlock,
|
|
281
|
+
children: [
|
|
282
|
+
/* @__PURE__ */ jsxs("div", {
|
|
283
|
+
className: style_default.LanguageBlockContent,
|
|
284
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
285
|
+
className: style_default.LanguageBlockContentIcon,
|
|
286
|
+
children: /* @__PURE__ */ jsx(Docs.SDKIcon, {
|
|
287
|
+
language: lang,
|
|
288
|
+
size: 24
|
|
289
|
+
})
|
|
290
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
291
|
+
className: style_default.LanguageBlockContentInfo,
|
|
292
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
293
|
+
className: style_default.LanguageBlockContentInfoLanguage,
|
|
294
|
+
children: Docs.SDKSnippetLanguages[lang].name
|
|
295
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
296
|
+
className: style_default.LanguageBlockContentInfoVersion,
|
|
297
|
+
children: version
|
|
298
|
+
})]
|
|
299
|
+
})]
|
|
300
|
+
}),
|
|
301
|
+
/* @__PURE__ */ jsxs("div", {
|
|
302
|
+
className: style_default.LanguageBlockInstall,
|
|
303
|
+
"data-stldocs-copy-parent": true,
|
|
304
|
+
children: [
|
|
305
|
+
/* @__PURE__ */ jsx("pre", {
|
|
306
|
+
"data-stldocs-copy-content": true,
|
|
307
|
+
children: install
|
|
308
|
+
}),
|
|
309
|
+
" ",
|
|
310
|
+
/* @__PURE__ */ jsx(Button, {
|
|
311
|
+
variant: "ghost",
|
|
312
|
+
size: "sm",
|
|
313
|
+
"data-stldocs-snippet-copy": true,
|
|
314
|
+
children: /* @__PURE__ */ jsx(Copy, {
|
|
315
|
+
size: 16,
|
|
316
|
+
className: style_default.Icon
|
|
317
|
+
})
|
|
318
|
+
})
|
|
319
|
+
]
|
|
320
|
+
}),
|
|
321
|
+
/* @__PURE__ */ jsxs("div", {
|
|
322
|
+
className: style_default.LanguageBlockLinks,
|
|
323
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
324
|
+
href: links.repo,
|
|
325
|
+
variant: "outline",
|
|
326
|
+
children: /* @__PURE__ */ jsx(Button.Icon, { icon: Github })
|
|
327
|
+
}), /* @__PURE__ */ jsxs(Button, {
|
|
328
|
+
href: links.docs,
|
|
329
|
+
variant: "outline",
|
|
330
|
+
children: [/* @__PURE__ */ jsx(Button.Icon, { icon: BookOpen }), /* @__PURE__ */ jsx(Button.Label, { children: "Read Docs" })]
|
|
331
|
+
})]
|
|
332
|
+
})
|
|
333
|
+
]
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
//#endregion
|
|
338
|
+
export { useReferenceNesting as _, SDKDeclaration as a, SDKLanguageBlock as c, SDKMethodInfo as d, SDKModel as f, usePropertyModel as g, SDKSnippetLanguages as h, SDKConstraints as i, SDKMethod as l, SDKRequestTitle as m, ReferenceNestingContext as n, SDKExample as o, SDKReference as p, SDKChildren as r, SDKIcon as s, PropertyModelContext as t, SDKMethodHeader as u };
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { n as useNavigation } from "./navigation-aoYZ_tl4.js";
|
|
2
|
+
import { t as useComponents } from "./use-components-BUz3GbO4.js";
|
|
3
|
+
import { t as style_default } from "./style-LwfvXElj.js";
|
|
4
|
+
import { r as isResourceEmpty } from "./utils-D01mAUfQ.js";
|
|
5
|
+
import "react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { ChevronDown, ChevronRight } from "lucide-react";
|
|
8
|
+
import { Badge, getHttpMethod } from "@stainless-api/ui-primitives";
|
|
9
|
+
|
|
10
|
+
//#region src/components/sidebar.tsx
|
|
11
|
+
function SidebarExpander({ open, summary, children }) {
|
|
12
|
+
return /* @__PURE__ */ jsxs("details", {
|
|
13
|
+
className: style_default.SidebarExpander,
|
|
14
|
+
open,
|
|
15
|
+
children: [/* @__PURE__ */ jsxs("summary", {
|
|
16
|
+
className: style_default.ExpanderSummary,
|
|
17
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
18
|
+
className: style_default.ExpanderSummaryContent,
|
|
19
|
+
children: summary
|
|
20
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
21
|
+
className: style_default.ExpanderSummaryIcon,
|
|
22
|
+
children: [/* @__PURE__ */ jsx(ChevronRight, {
|
|
23
|
+
size: 16,
|
|
24
|
+
strokeWidth: 1,
|
|
25
|
+
className: style_default.Icon
|
|
26
|
+
}), /* @__PURE__ */ jsx(ChevronDown, {
|
|
27
|
+
size: 16,
|
|
28
|
+
strokeWidth: 1,
|
|
29
|
+
className: style_default.Icon
|
|
30
|
+
})]
|
|
31
|
+
})]
|
|
32
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
33
|
+
className: style_default.ExpanderContent,
|
|
34
|
+
children
|
|
35
|
+
})]
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
function SidebarMethod({ method }) {
|
|
39
|
+
const Docs = useComponents();
|
|
40
|
+
const { selectedPath } = useNavigation();
|
|
41
|
+
const httpMethod = getHttpMethod(method.httpMethod);
|
|
42
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
43
|
+
className: style_default.SidebarMethod,
|
|
44
|
+
"data-selected": method.stainlessPath === selectedPath,
|
|
45
|
+
children: [httpMethod && /* @__PURE__ */ jsx(Badge.HTTP, {
|
|
46
|
+
method: httpMethod,
|
|
47
|
+
iconOnly: true
|
|
48
|
+
}), /* @__PURE__ */ jsx(Docs.Link, {
|
|
49
|
+
stainlessPath: method.stainlessPath,
|
|
50
|
+
children: method.title
|
|
51
|
+
})]
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
function SidebarResource({ resource }) {
|
|
55
|
+
const Docs = useComponents();
|
|
56
|
+
const { selectedPath } = useNavigation();
|
|
57
|
+
const subresources = Object.values(resource.subresources ?? {}).map((sub) => /* @__PURE__ */ jsx(SidebarResource, { resource: sub }, sub.stainlessPath));
|
|
58
|
+
const methods = Object.values(resource.methods).map((method) => /* @__PURE__ */ jsx(SidebarMethod, { method }, method.stainlessPath));
|
|
59
|
+
const hasChildren = subresources.length > 0 || methods.length > 0;
|
|
60
|
+
const title = /* @__PURE__ */ jsx("div", {
|
|
61
|
+
className: style_default.SidebarResourceTitle,
|
|
62
|
+
children: /* @__PURE__ */ jsx(Docs.Link, {
|
|
63
|
+
stainlessPath: resource.stainlessPath,
|
|
64
|
+
children: resource.title
|
|
65
|
+
})
|
|
66
|
+
});
|
|
67
|
+
return /* @__PURE__ */ jsx("div", {
|
|
68
|
+
className: style_default.SidebarResource,
|
|
69
|
+
"data-selected": resource.stainlessPath === selectedPath,
|
|
70
|
+
children: hasChildren ? /* @__PURE__ */ jsxs(SidebarExpander, {
|
|
71
|
+
summary: title,
|
|
72
|
+
open: true,
|
|
73
|
+
children: [methods, subresources]
|
|
74
|
+
}) : title
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function Sidebar({ resources }) {
|
|
78
|
+
return /* @__PURE__ */ jsx("div", {
|
|
79
|
+
className: `${style_default.Root} ${style_default.Sidebar}`,
|
|
80
|
+
children: resources.filter((resource) => !isResourceEmpty(resource)).map((resource) => /* @__PURE__ */ jsx(SidebarResource, { resource }, resource.stainlessPath))
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
//#endregion
|
|
85
|
+
export { SidebarResource as i, SidebarExpander as n, SidebarMethod as r, Sidebar as t };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { f as Resource, l as Method } from "./index-zNpvNvtN.js";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import * as react_jsx_runtime32 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/components/sidebar.d.ts
|
|
6
|
+
type SidebarExpanderProps = {
|
|
7
|
+
open?: boolean;
|
|
8
|
+
summary: React$1.ReactNode;
|
|
9
|
+
children?: React$1.ReactNode;
|
|
10
|
+
};
|
|
11
|
+
declare function SidebarExpander({
|
|
12
|
+
open,
|
|
13
|
+
summary,
|
|
14
|
+
children
|
|
15
|
+
}: SidebarExpanderProps): react_jsx_runtime32.JSX.Element;
|
|
16
|
+
type SidebarMethodProps = {
|
|
17
|
+
method: Method;
|
|
18
|
+
};
|
|
19
|
+
declare function SidebarMethod({
|
|
20
|
+
method
|
|
21
|
+
}: SidebarMethodProps): react_jsx_runtime32.JSX.Element;
|
|
22
|
+
type SidebarResourceProps = {
|
|
23
|
+
resource: Resource;
|
|
24
|
+
};
|
|
25
|
+
declare function SidebarResource({
|
|
26
|
+
resource
|
|
27
|
+
}: SidebarResourceProps): react_jsx_runtime32.JSX.Element;
|
|
28
|
+
type SidebarProps = {
|
|
29
|
+
resources: Resource[];
|
|
30
|
+
selectedPath?: string;
|
|
31
|
+
};
|
|
32
|
+
declare function Sidebar({
|
|
33
|
+
resources
|
|
34
|
+
}: SidebarProps): react_jsx_runtime32.JSX.Element;
|
|
35
|
+
//#endregion
|
|
36
|
+
export { SidebarProps as a, SidebarMethodProps as i, SidebarExpander as n, SidebarResource as o, SidebarMethod as r, SidebarResourceProps as s, Sidebar as t };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { f as Resource, l as Method } from "./index-zNpvNvtN.js";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import * as react_jsx_runtime63 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/components/sidebar.d.ts
|
|
6
|
+
type SidebarExpanderProps = {
|
|
7
|
+
open?: boolean;
|
|
8
|
+
summary: React$1.ReactNode;
|
|
9
|
+
children?: React$1.ReactNode;
|
|
10
|
+
};
|
|
11
|
+
declare function SidebarExpander({
|
|
12
|
+
open,
|
|
13
|
+
summary,
|
|
14
|
+
children
|
|
15
|
+
}: SidebarExpanderProps): react_jsx_runtime63.JSX.Element;
|
|
16
|
+
type SidebarMethodProps = {
|
|
17
|
+
method: Method;
|
|
18
|
+
};
|
|
19
|
+
declare function SidebarMethod({
|
|
20
|
+
method
|
|
21
|
+
}: SidebarMethodProps): react_jsx_runtime63.JSX.Element;
|
|
22
|
+
type SidebarResourceProps = {
|
|
23
|
+
resource: Resource;
|
|
24
|
+
};
|
|
25
|
+
declare function SidebarResource({
|
|
26
|
+
resource
|
|
27
|
+
}: SidebarResourceProps): react_jsx_runtime63.JSX.Element;
|
|
28
|
+
type SidebarProps = {
|
|
29
|
+
resources: Resource[];
|
|
30
|
+
selectedPath?: string;
|
|
31
|
+
};
|
|
32
|
+
declare function Sidebar({
|
|
33
|
+
resources
|
|
34
|
+
}: SidebarProps): react_jsx_runtime63.JSX.Element;
|
|
35
|
+
//#endregion
|
|
36
|
+
export { SidebarProps as a, SidebarMethodProps as i, SidebarExpander as n, SidebarResource as o, SidebarMethod as r, SidebarResourceProps as s, Sidebar as t };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { l as Method } from "./index-zNpvNvtN.js";
|
|
2
|
+
import { C as TransformRequestSnippetFn } from "./sdk-CIxaNoAs.js";
|
|
3
|
+
import * as React$1 from "react";
|
|
4
|
+
import * as react_jsx_runtime47 from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/components/snippets.d.ts
|
|
7
|
+
type SnippetCodeProps = {
|
|
8
|
+
content: string;
|
|
9
|
+
signature?: string;
|
|
10
|
+
language?: string;
|
|
11
|
+
};
|
|
12
|
+
declare function SnippetCode({
|
|
13
|
+
content,
|
|
14
|
+
language
|
|
15
|
+
}: SnippetCodeProps): react_jsx_runtime47.JSX.Element;
|
|
16
|
+
type SnippetProps = {
|
|
17
|
+
method: Method;
|
|
18
|
+
requestTitle?: React$1.ReactNode;
|
|
19
|
+
transformRequestSnippet?: TransformRequestSnippetFn;
|
|
20
|
+
};
|
|
21
|
+
type SnippetContainerProps = {
|
|
22
|
+
method: Method;
|
|
23
|
+
children: React$1.ReactNode;
|
|
24
|
+
signature?: string;
|
|
25
|
+
};
|
|
26
|
+
declare function SnippetContainer({
|
|
27
|
+
children
|
|
28
|
+
}: SnippetContainerProps): react_jsx_runtime47.JSX.Element;
|
|
29
|
+
type SnippetRequestContainerProps = {
|
|
30
|
+
children?: React$1.ReactNode;
|
|
31
|
+
signature?: string;
|
|
32
|
+
};
|
|
33
|
+
declare function SnippetRequestContainer({
|
|
34
|
+
children
|
|
35
|
+
}: SnippetRequestContainerProps): react_jsx_runtime47.JSX.Element;
|
|
36
|
+
declare function Snippet({
|
|
37
|
+
requestTitle,
|
|
38
|
+
method,
|
|
39
|
+
transformRequestSnippet
|
|
40
|
+
}: SnippetProps): react_jsx_runtime47.JSX.Element | null;
|
|
41
|
+
declare function SnippetButtons({
|
|
42
|
+
content
|
|
43
|
+
}: {
|
|
44
|
+
content: string;
|
|
45
|
+
}): react_jsx_runtime47.JSX.Element;
|
|
46
|
+
declare function SnippetFooter(): React$1.ReactNode;
|
|
47
|
+
declare function SnippetResponse({
|
|
48
|
+
responses
|
|
49
|
+
}: {
|
|
50
|
+
responses: Method['exampleResponses'];
|
|
51
|
+
}): react_jsx_runtime47.JSX.Element | null;
|
|
52
|
+
//#endregion
|
|
53
|
+
export { SnippetContainer as a, SnippetProps as c, SnippetResponse as d, SnippetCodeProps as i, SnippetRequestContainer as l, SnippetButtons as n, SnippetContainerProps as o, SnippetCode as r, SnippetFooter as s, Snippet as t, SnippetRequestContainerProps as u };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { l as Method } from "./index-zNpvNvtN.js";
|
|
2
|
+
import { C as TransformRequestSnippetFn } from "./sdk-BebFnWYL.js";
|
|
3
|
+
import * as React$1 from "react";
|
|
4
|
+
import * as react_jsx_runtime67 from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/components/snippets.d.ts
|
|
7
|
+
type SnippetCodeProps = {
|
|
8
|
+
content: string;
|
|
9
|
+
signature?: string;
|
|
10
|
+
language?: string;
|
|
11
|
+
};
|
|
12
|
+
declare function SnippetCode({
|
|
13
|
+
content,
|
|
14
|
+
language
|
|
15
|
+
}: SnippetCodeProps): react_jsx_runtime67.JSX.Element;
|
|
16
|
+
type SnippetProps = {
|
|
17
|
+
method: Method;
|
|
18
|
+
requestTitle?: React$1.ReactNode;
|
|
19
|
+
transformRequestSnippet?: TransformRequestSnippetFn;
|
|
20
|
+
};
|
|
21
|
+
type SnippetContainerProps = {
|
|
22
|
+
method: Method;
|
|
23
|
+
children: React$1.ReactNode;
|
|
24
|
+
signature?: string;
|
|
25
|
+
};
|
|
26
|
+
declare function SnippetContainer({
|
|
27
|
+
children
|
|
28
|
+
}: SnippetContainerProps): react_jsx_runtime67.JSX.Element;
|
|
29
|
+
type SnippetRequestContainerProps = {
|
|
30
|
+
children?: React$1.ReactNode;
|
|
31
|
+
signature?: string;
|
|
32
|
+
};
|
|
33
|
+
declare function SnippetRequestContainer({
|
|
34
|
+
children
|
|
35
|
+
}: SnippetRequestContainerProps): react_jsx_runtime67.JSX.Element;
|
|
36
|
+
declare function Snippet({
|
|
37
|
+
requestTitle,
|
|
38
|
+
method,
|
|
39
|
+
transformRequestSnippet
|
|
40
|
+
}: SnippetProps): react_jsx_runtime67.JSX.Element | null;
|
|
41
|
+
declare function SnippetButtons({
|
|
42
|
+
content
|
|
43
|
+
}: {
|
|
44
|
+
content: string;
|
|
45
|
+
}): react_jsx_runtime67.JSX.Element;
|
|
46
|
+
declare function SnippetFooter(): React$1.ReactNode;
|
|
47
|
+
declare function SnippetResponse({
|
|
48
|
+
responses
|
|
49
|
+
}: {
|
|
50
|
+
responses: Method['exampleResponses'];
|
|
51
|
+
}): react_jsx_runtime67.JSX.Element | null;
|
|
52
|
+
//#endregion
|
|
53
|
+
export { SnippetContainer as a, SnippetProps as c, SnippetResponse as d, SnippetCodeProps as i, SnippetRequestContainer as l, SnippetButtons as n, SnippetContainerProps as o, SnippetCode as r, SnippetFooter as s, Snippet as t, SnippetRequestContainerProps as u };
|