@stainless-api/docs-ui 0.1.0-beta.29 → 0.1.0-beta.30
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-D5viAm7a.d.ts → breadcrumbs-wJ7A9MGt.d.ts} +2 -2
- package/dist/{component-generics-BnrVqdQj.d.ts → component-generics--y1IC_M-.d.ts} +2 -1
- package/dist/{component-generics-Df4EDvxk.js → component-generics-D3ybuN5r.js} +5 -1
- package/dist/components/breadcrumbs.d.ts +1 -1
- package/dist/components/breadcrumbs.js +13 -14
- package/dist/components/chat.d.ts +3 -3
- package/dist/components/chat.js +64 -50
- package/dist/components/icons.d.ts +10 -10
- package/dist/components/icons.js +1 -1
- package/dist/components/index.d.ts +11 -12
- package/dist/components/index.js +14 -15
- package/dist/components/method.d.ts +1 -1
- package/dist/components/method.js +13 -14
- package/dist/components/overview.d.ts +1 -1
- package/dist/components/overview.js +13 -14
- package/dist/components/primitives.d.ts +1 -1
- package/dist/components/primitives.js +13 -14
- package/dist/components/properties.d.ts +1 -1
- package/dist/components/properties.js +13 -14
- package/dist/components/sdk.d.ts +2 -2
- package/dist/components/sdk.js +13 -14
- package/dist/components/sidebar.d.ts +1 -1
- package/dist/components/sidebar.js +13 -14
- package/dist/components/snippets.d.ts +3 -3
- package/dist/components/snippets.js +13 -14
- package/dist/contexts/component-generics.d.ts +1 -1
- package/dist/contexts/component-generics.js +1 -1
- package/dist/contexts/component-types.d.ts +11 -12
- package/dist/contexts/component-types.js +0 -1
- package/dist/contexts/component.d.ts +14 -14
- package/dist/contexts/component.js +13 -14
- package/dist/contexts/docs.d.ts +1 -1
- package/dist/contexts/docs.js +1 -1
- package/dist/contexts/index.d.ts +18 -19
- package/dist/contexts/index.js +13 -14
- package/dist/contexts/markdown.d.ts +1 -1
- package/dist/contexts/markdown.js +2 -2
- package/dist/contexts/navigation.d.ts +2 -2
- package/dist/contexts/navigation.js +1 -1
- package/dist/contexts/search.d.ts +3 -3
- package/dist/contexts/search.js +13 -14
- package/dist/contexts/use-components.d.ts +10 -11
- package/dist/contexts/use-components.js +2 -2
- package/dist/contexts-CMNI3ctP.js +3799 -0
- package/dist/{docs-DhNaW0DE.d.ts → docs-BvahWQ28.d.ts} +2 -1
- package/dist/{docs-Cj25B-Sh.js → docs-CopwX9a7.js} +5 -1
- package/dist/icons-yb-Jhkmg.js +753 -0
- package/dist/{index-d8_VR8Z5.d.ts → index-BmPNhnpe.d.ts} +6 -6
- package/dist/{index-BXO3gZup.d.ts → index-D5NMSAld.d.ts} +26 -25
- package/dist/index-rVFBdVz8.d.ts +15 -0
- package/dist/index.d.ts +20 -21
- package/dist/index.js +15 -7700
- package/dist/languages/go.d.ts +11 -12
- package/dist/languages/go.js +13 -14
- package/dist/languages/http.d.ts +11 -12
- package/dist/languages/http.js +13 -14
- package/dist/languages/index.d.ts +11 -12
- package/dist/languages/index.js +13 -14
- package/dist/languages/java.d.ts +11 -12
- package/dist/languages/java.js +13 -14
- package/dist/languages/python.d.ts +11 -12
- package/dist/languages/python.js +13 -14
- package/dist/languages/ruby.d.ts +11 -12
- package/dist/languages/ruby.js +13 -14
- package/dist/languages/typescript.d.ts +11 -12
- package/dist/languages/typescript.js +13 -14
- package/dist/markdown/index.d.ts +3 -3
- package/dist/markdown/index.js +13 -14
- package/dist/markdown/md.js +1 -1
- package/dist/markdown/utils.d.ts +3 -3
- package/dist/markdown/utils.js +1 -1
- package/dist/{markdown-DunIdqFE.js → markdown-BmpyokB7.js} +9 -5
- package/dist/{markdown-DN8KaRR2.d.ts → markdown-w5UpIiGc.d.ts} +2 -1
- package/dist/{method-c3XDArUn.d.ts → method-CLpRObBV.d.ts} +7 -6
- package/dist/{navigation-BSn6PX-7.d.ts → navigation-Blr3LaES.d.ts} +3 -2
- package/dist/{navigation-CuCg3le8.js → navigation-CGr5_w6z.js} +5 -1
- package/dist/{overview-D21weqVJ.d.ts → overview-DBnqhjAg.d.ts} +6 -6
- package/dist/{primitives-iB9fIrMF.d.ts → primitives-BFubD3w8.d.ts} +9 -8
- package/dist/{properties-Ba6F_GGj.d.ts → properties-DeQRa6VK.d.ts} +4 -4
- package/dist/{routing-C8oZYLsf.js → routing-8itEXLx6.js} +1 -1
- package/dist/{routing-BE6Vrs-z.d.ts → routing-DNN8R6bZ.d.ts} +1 -1
- package/dist/routing.d.ts +1 -1
- package/dist/routing.js +3 -180
- package/dist/{sdk-D2x2l6JH.d.ts → sdk-BVQyp5Dw.d.ts} +14 -13
- package/dist/search/index.d.ts +6 -6
- package/dist/search/index.js +233 -110
- package/dist/search/providers/algolia.d.ts +2 -2
- package/dist/search/providers/algolia.js +13 -14
- package/dist/search/providers/fuse.d.ts +2 -2
- package/dist/search/providers/fuse.js +13 -14
- package/dist/search/providers/pagefind.d.ts +2 -2
- package/dist/search/providers/pagefind.js +1 -1
- package/dist/search/providers/walker.d.ts +2 -2
- package/dist/search/providers/walker.js +13 -14
- package/dist/search/types.d.ts +2 -2
- package/dist/search/types.js +1 -1
- package/dist/{search-KMqOU2tz.d.ts → search-CPp6HpUy.d.ts} +3 -2
- package/dist/{sidebar-B1X4gmY2.d.ts → sidebar-BoPLeaxp.d.ts} +5 -4
- package/dist/{snippets-BApdMOXp.d.ts → snippets-DLHH_Voi.d.ts} +7 -6
- package/dist/{style-BWu-Pqcm.d.ts → style-BEMLtSIK.d.ts} +0 -10
- package/dist/{style-CkbsakoF.js → style-CPgcT0Fw.js} +1 -11
- package/dist/style.d.ts +1 -1
- package/dist/style.js +1 -1
- package/dist/styles/main.css +51 -20
- package/dist/styles/main.js +0 -0
- package/dist/styles/primitives.css +1 -0
- package/dist/styles/primitives.js +0 -0
- package/dist/styles/resets.css +1 -0
- package/dist/styles/resets.js +0 -0
- package/dist/styles/search.css +1 -0
- package/dist/styles/search.js +0 -0
- package/dist/styles/sidebar.css +1 -0
- package/dist/styles/sidebar.js +0 -0
- package/dist/styles/snippets.css +1 -0
- package/dist/styles/snippets.js +0 -0
- package/dist/styles/variables.css +2 -0
- package/dist/styles/variables.js +0 -0
- package/dist/{types-BLgvxY4i.d.ts → types-DNSz4kuM.d.ts} +1 -1
- package/dist/{use-components-DI-AbT-D.js → use-components-BHEwm0mE.js} +1 -1
- package/dist/{utils-BhYTrLot.js → utils-2FmcHPHp.js} +2 -2
- package/dist/{utils-B9JL_XWH.d.ts → utils-DVi3gJLL.d.ts} +2 -2
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +2 -2
- package/package.json +63 -10
- package/dist/components/dropdown.d.ts +0 -2
- package/dist/components/dropdown.js +0 -4
- package/dist/components/scripts/dropdown.d.ts +0 -12
- package/dist/components/scripts/dropdown.js +0 -50
- package/dist/contexts-DO0sMzym.js +0 -2581
- package/dist/dropdown-Dv9VAYCW.d.ts +0 -42
- package/dist/dropdown-kUhwBigR.js +0 -38
- package/dist/icons--8QR-PrL.js +0 -222
- package/dist/index-BW6OPqAo.d.ts +0 -16
- package/dist/mcp.cjs +0 -983418
- package/src/components/breadcrumbs.tsx +0 -94
- package/src/components/chat.tsx +0 -157
- package/src/components/icons.tsx +0 -584
- package/src/components/index.ts +0 -8
- package/src/components/method.tsx +0 -145
- package/src/components/overview.tsx +0 -172
- package/src/components/primitives.tsx +0 -301
- package/src/components/properties.tsx +0 -132
- package/src/components/sdk.tsx +0 -408
- package/src/components/sidebar.tsx +0 -99
- package/src/components/snippets.tsx +0 -197
- package/src/contexts/component-generics.tsx +0 -43
- package/src/contexts/component-types.tsx +0 -5
- package/src/contexts/component.tsx +0 -32
- package/src/contexts/docs.tsx +0 -86
- package/src/contexts/index.tsx +0 -20
- package/src/contexts/markdown.tsx +0 -44
- package/src/contexts/navigation.tsx +0 -44
- package/src/contexts/search.tsx +0 -27
- package/src/contexts/use-components.tsx +0 -4
- package/src/hooks/use-strict-context.tsx +0 -16
- package/src/index.ts +0 -6
- package/src/languages/go.tsx +0 -281
- package/src/languages/http.tsx +0 -329
- package/src/languages/index.ts +0 -26
- package/src/languages/java.tsx +0 -358
- package/src/languages/python.tsx +0 -258
- package/src/languages/ruby.tsx +0 -327
- package/src/languages/typescript.tsx +0 -399
- package/src/markdown/index.ts +0 -112
- package/src/markdown/md.ts +0 -45
- package/src/markdown/utils.ts +0 -52
- package/src/routing.ts +0 -238
- package/src/search/form.tsx +0 -130
- package/src/search/index.tsx +0 -1
- package/src/search/indexer.ts +0 -248
- package/src/search/mcp.ts +0 -156
- 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 -32
- package/src/search/results.tsx +0 -183
- package/src/search/state.ts +0 -64
- package/src/search/types.ts +0 -116
- package/src/style.ts +0 -185
- package/src/styles/main.css +0 -989
- package/src/styles/primitives.css +0 -392
- package/src/styles/resets.css +0 -39
- package/src/styles/search.css +0 -359
- package/src/styles/sidebar.css +0 -85
- package/src/styles/snippets.css +0 -130
- package/src/styles/variables.css +0 -86
- package/src/utils.ts +0 -40
- /package/dist/{chunk-Bp6m_JJh.js → chunk-DsStOjWQ.js} +0 -0
- /package/dist/{md-Dg8aOyMA.js → md-DxiV1_vy.js} +0 -0
- /package/dist/{pagefind-ChrPfuVv.js → pagefind-BaK1krMe.js} +0 -0
- /package/dist/{types-DFN4M1Sp.js → types-__XoFvJ_.js} +0 -0
- /package/dist/{utils-ByZH9QWT.js → utils-BCfb0F9R.js} +0 -0
- /package/dist/{utils-DlayebL1.d.ts → utils-D43p_yTd.d.ts} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime7 from "react/jsx-runtime";
|
|
2
2
|
import * as SDKJSON from "@stainless/sdk-json";
|
|
3
3
|
|
|
4
4
|
//#region src/components/overview.d.ts
|
|
@@ -9,31 +9,31 @@ type SDKResourceProps = {
|
|
|
9
9
|
declare function SDKResourceHeader({
|
|
10
10
|
resource,
|
|
11
11
|
parents
|
|
12
|
-
}: SDKResourceProps):
|
|
12
|
+
}: SDKResourceProps): react_jsx_runtime7.JSX.Element | null;
|
|
13
13
|
type SDKMethodSummaryProps = {
|
|
14
14
|
method: SDKJSON.Method;
|
|
15
15
|
};
|
|
16
16
|
declare function SDKMethodSummary({
|
|
17
17
|
method
|
|
18
|
-
}: SDKMethodSummaryProps):
|
|
18
|
+
}: SDKMethodSummaryProps): react_jsx_runtime7.JSX.Element;
|
|
19
19
|
declare function SDKResource({
|
|
20
20
|
resource,
|
|
21
21
|
parents,
|
|
22
22
|
showModels
|
|
23
23
|
}: SDKResourceProps & {
|
|
24
24
|
showModels?: boolean;
|
|
25
|
-
}):
|
|
25
|
+
}): react_jsx_runtime7.JSX.Element;
|
|
26
26
|
type SDKOverviewProps = {
|
|
27
27
|
resource: SDKJSON.Resource;
|
|
28
28
|
};
|
|
29
29
|
declare function SDKOverview({
|
|
30
30
|
resource
|
|
31
|
-
}: SDKOverviewProps):
|
|
31
|
+
}: SDKOverviewProps): react_jsx_runtime7.JSX.Element;
|
|
32
32
|
type SDKRootProps = {
|
|
33
33
|
stainlessPath: string;
|
|
34
34
|
};
|
|
35
35
|
declare function SDKRoot({
|
|
36
36
|
stainlessPath
|
|
37
|
-
}: SDKRootProps):
|
|
37
|
+
}: SDKRootProps): react_jsx_runtime7.JSX.Element | null;
|
|
38
38
|
//#endregion
|
|
39
39
|
export { SDKResource as a, SDKRoot as c, SDKOverviewProps as i, SDKRootProps as l, SDKMethodSummaryProps as n, SDKResourceHeader as o, SDKOverview as r, SDKResourceProps as s, SDKMethodSummary as t };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React$1 from "react";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
4
|
|
|
4
5
|
//#region src/components/primitives.d.ts
|
|
5
6
|
type JoinProps = {
|
|
@@ -11,7 +12,7 @@ declare function Join({
|
|
|
11
12
|
items,
|
|
12
13
|
limit,
|
|
13
14
|
children
|
|
14
|
-
}: JoinProps):
|
|
15
|
+
}: JoinProps): react_jsx_runtime0.JSX.Element[];
|
|
15
16
|
type ExpanderProps = {
|
|
16
17
|
id?: string;
|
|
17
18
|
open?: boolean;
|
|
@@ -27,19 +28,19 @@ declare function Expander({
|
|
|
27
28
|
virtual,
|
|
28
29
|
muted,
|
|
29
30
|
children
|
|
30
|
-
}: ExpanderProps):
|
|
31
|
+
}: ExpanderProps): react_jsx_runtime0.JSX.Element;
|
|
31
32
|
declare function VirtualExpander({
|
|
32
33
|
id,
|
|
33
34
|
open: isOpen,
|
|
34
35
|
muted,
|
|
35
36
|
summary,
|
|
36
37
|
children
|
|
37
|
-
}: Omit<ExpanderProps, 'virtual'>):
|
|
38
|
+
}: Omit<ExpanderProps, 'virtual'>): react_jsx_runtime0.JSX.Element;
|
|
38
39
|
declare function Markdown({
|
|
39
40
|
content
|
|
40
41
|
}: {
|
|
41
42
|
content: string;
|
|
42
|
-
}): "" |
|
|
43
|
+
}): "" | react_jsx_runtime0.JSX.Element | undefined;
|
|
43
44
|
type BadgeProps = {
|
|
44
45
|
id: string;
|
|
45
46
|
children?: ReactNode;
|
|
@@ -47,7 +48,7 @@ type BadgeProps = {
|
|
|
47
48
|
declare function Badge({
|
|
48
49
|
id,
|
|
49
50
|
children
|
|
50
|
-
}: BadgeProps):
|
|
51
|
+
}: BadgeProps): react_jsx_runtime0.JSX.Element;
|
|
51
52
|
type TooltipProps = {
|
|
52
53
|
content: ReactNode;
|
|
53
54
|
children: ReactNode;
|
|
@@ -55,7 +56,7 @@ type TooltipProps = {
|
|
|
55
56
|
declare function Tooltip({
|
|
56
57
|
content,
|
|
57
58
|
children
|
|
58
|
-
}: TooltipProps): 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> |
|
|
59
|
+
}: TooltipProps): 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;
|
|
59
60
|
type LinkProps = {
|
|
60
61
|
stainlessPath: string;
|
|
61
62
|
scroll?: boolean;
|
|
@@ -66,7 +67,7 @@ declare function Link({
|
|
|
66
67
|
scroll,
|
|
67
68
|
children,
|
|
68
69
|
...props
|
|
69
|
-
}: LinkProps): 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> |
|
|
70
|
+
}: LinkProps): 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;
|
|
70
71
|
type InputProps = {
|
|
71
72
|
left?: ReactNode;
|
|
72
73
|
right?: ReactNode;
|
|
@@ -93,6 +94,6 @@ declare function ListView<TItem>({
|
|
|
93
94
|
itemDelegate,
|
|
94
95
|
onSelectListItem,
|
|
95
96
|
...rest
|
|
96
|
-
}: ListViewProps<TItem>):
|
|
97
|
+
}: ListViewProps<TItem>): react_jsx_runtime0.JSX.Element;
|
|
97
98
|
//#endregion
|
|
98
99
|
export { Join as a, ListViewProps as c, ToggleButtonProps as d, Tooltip as f, InputProps as i, Markdown as l, Expander as n, Link as o, VirtualExpander as p, Input as r, ListView as s, Badge as t, ToggleButton as u };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as react0 from "react";
|
|
2
1
|
import { ReactNode } from "react";
|
|
2
|
+
import * as react_jsx_runtime24 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/properties.d.ts
|
|
5
5
|
type PropertyToggleProps = {
|
|
@@ -7,13 +7,13 @@ type PropertyToggleProps = {
|
|
|
7
7
|
};
|
|
8
8
|
declare function PropertyToggle({
|
|
9
9
|
target
|
|
10
|
-
}: PropertyToggleProps):
|
|
10
|
+
}: PropertyToggleProps): react_jsx_runtime24.JSX.Element;
|
|
11
11
|
type PropertyDescriptionProps = {
|
|
12
12
|
description?: string;
|
|
13
13
|
};
|
|
14
14
|
declare function PropertyDescription({
|
|
15
15
|
description
|
|
16
|
-
}: PropertyDescriptionProps):
|
|
16
|
+
}: PropertyDescriptionProps): react_jsx_runtime24.JSX.Element | undefined;
|
|
17
17
|
type PropertyProps = {
|
|
18
18
|
id?: string;
|
|
19
19
|
name?: ReactNode;
|
|
@@ -41,6 +41,6 @@ declare function Property({
|
|
|
41
41
|
additional,
|
|
42
42
|
constraints,
|
|
43
43
|
children
|
|
44
|
-
}: PropertyProps):
|
|
44
|
+
}: PropertyProps): react_jsx_runtime24.JSX.Element;
|
|
45
45
|
//#endregion
|
|
46
46
|
export { PropertyToggle as a, PropertyProps as i, PropertyDescription as n, PropertyToggleProps as o, PropertyDescriptionProps as r, Property as t };
|
|
@@ -8,7 +8,7 @@ declare const Languages: readonly ["http", "node", "python", "go", "typescript",
|
|
|
8
8
|
declare const SupportedLanguageSyntaxes: string[];
|
|
9
9
|
type DocsLanguage = (typeof Languages)[number];
|
|
10
10
|
declare const LanguageNames: Record<DocsLanguage, string>;
|
|
11
|
-
declare function getLanguageSnippet(language: DocsLanguage): "
|
|
11
|
+
declare function getLanguageSnippet(language: DocsLanguage): "http.curl" | "node.default" | "go.default" | "python.default" | "terraform.default" | "typescript.default" | "ruby.default" | "java.default" | "kotlin.default";
|
|
12
12
|
declare function isSupportedLanguage(language: string): language is DocsLanguage;
|
|
13
13
|
type ParsedStainlessPath = ReturnType<typeof parseStainlessPath>;
|
|
14
14
|
declare function parseStainlessPath(stainlessPath: string): {
|
package/dist/routing.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as RouteEntry, b as updateHistory, c as expandToElement, d as generateRouteList, f as getLanguageSnippet, g as parseStainlessPath, h as parseRoute, i as ParsedStainlessPath, l as findNavigationPath, m as isSupportedLanguage, n as LanguageNames, o as SpecTreeEntry, p as getResource, r as Languages, s as SupportedLanguageSyntaxes, t as DocsLanguage, u as generateRoute, v as scrollToPath, x as walkTree, y as trimStainlessPath } from "./routing-
|
|
1
|
+
import { a as RouteEntry, b as updateHistory, c as expandToElement, d as generateRouteList, f as getLanguageSnippet, g as parseStainlessPath, h as parseRoute, i as ParsedStainlessPath, l as findNavigationPath, m as isSupportedLanguage, n as LanguageNames, o as SpecTreeEntry, p as getResource, r as Languages, s as SupportedLanguageSyntaxes, t as DocsLanguage, u as generateRoute, v as scrollToPath, x as walkTree, y as trimStainlessPath } from "./routing-DNN8R6bZ.js";
|
|
2
2
|
export { DocsLanguage, LanguageNames, Languages, ParsedStainlessPath, RouteEntry, SpecTreeEntry, SupportedLanguageSyntaxes, expandToElement, findNavigationPath, generateRoute, generateRouteList, getLanguageSnippet, getResource, isSupportedLanguage, parseRoute, parseStainlessPath, scrollToPath, trimStainlessPath, updateHistory, walkTree };
|
package/dist/routing.js
CHANGED
|
@@ -1,180 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
"node",
|
|
5
|
-
"python",
|
|
6
|
-
"go",
|
|
7
|
-
"typescript",
|
|
8
|
-
"terraform",
|
|
9
|
-
"ruby",
|
|
10
|
-
"java",
|
|
11
|
-
"kotlin"
|
|
12
|
-
];
|
|
13
|
-
var SupportedLanguageSyntaxes = [
|
|
14
|
-
"http",
|
|
15
|
-
"javascript",
|
|
16
|
-
"python",
|
|
17
|
-
"go",
|
|
18
|
-
"typescript",
|
|
19
|
-
"terraform",
|
|
20
|
-
"ruby",
|
|
21
|
-
"java",
|
|
22
|
-
"kotlin"
|
|
23
|
-
];
|
|
24
|
-
var LanguageNames = {
|
|
25
|
-
http: "HTTP",
|
|
26
|
-
node: "TypeScript",
|
|
27
|
-
typescript: "TypeScript",
|
|
28
|
-
python: "Python",
|
|
29
|
-
go: "Go",
|
|
30
|
-
ruby: "Ruby",
|
|
31
|
-
java: "Java",
|
|
32
|
-
kotlin: "Kotlin",
|
|
33
|
-
terraform: "Terraform"
|
|
34
|
-
};
|
|
35
|
-
function getLanguageSnippet(language) {
|
|
36
|
-
return language === "http" ? "http.curl" : `${language}.default`;
|
|
37
|
-
}
|
|
38
|
-
function isSupportedLanguage(language) {
|
|
39
|
-
return Languages.includes(language);
|
|
40
|
-
}
|
|
41
|
-
var DefaultLanguage = "http";
|
|
42
|
-
var StainlessPathPattern = /(\(resource\) (?<resource>[^\s]+))( > (\(method\) (?<method>[^\s]+)|\(model\) (?<model>[^\s]+))?)?/;
|
|
43
|
-
function parseStainlessPath(stainlessPath) {
|
|
44
|
-
const match = stainlessPath.match(StainlessPathPattern);
|
|
45
|
-
if (!match?.groups) return null;
|
|
46
|
-
return {
|
|
47
|
-
resource: match.groups.resource?.split(".") ?? null,
|
|
48
|
-
method: match.groups.method ?? null,
|
|
49
|
-
model: match.groups.model ?? null,
|
|
50
|
-
routable: match.groups.model ? match[1] : match[0]
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
function trimStainlessPath(stainlessPath) {
|
|
54
|
-
return stainlessPath.replace(/ > \([^\s]+\)$/, "");
|
|
55
|
-
}
|
|
56
|
-
function getResource(stainlessPath) {
|
|
57
|
-
const parsed = parseStainlessPath(stainlessPath);
|
|
58
|
-
return parsed?.resource?.[0];
|
|
59
|
-
}
|
|
60
|
-
function parseRoute(basePath, route) {
|
|
61
|
-
if (!route.startsWith(basePath)) return { stainlessPath: "", language: DefaultLanguage };
|
|
62
|
-
if (basePath && route.startsWith(basePath)) route = route.slice(basePath.length);
|
|
63
|
-
let stainlessPath = "";
|
|
64
|
-
let elements = route.slice(1).split("/");
|
|
65
|
-
let language = DefaultLanguage;
|
|
66
|
-
if (elements[0] && Languages.includes(elements[0])) {
|
|
67
|
-
language = elements[0];
|
|
68
|
-
elements = elements.slice(1);
|
|
69
|
-
}
|
|
70
|
-
while (elements.length > 0) {
|
|
71
|
-
const element = elements.shift();
|
|
72
|
-
switch (element) {
|
|
73
|
-
case "resources":
|
|
74
|
-
stainlessPath += `(resource) ${elements.shift()}`;
|
|
75
|
-
break;
|
|
76
|
-
case "subresources":
|
|
77
|
-
stainlessPath += `.${elements.shift()}`;
|
|
78
|
-
break;
|
|
79
|
-
case "methods":
|
|
80
|
-
stainlessPath += ` > (method) ${elements.shift()}`;
|
|
81
|
-
break;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
return { stainlessPath, language };
|
|
85
|
-
}
|
|
86
|
-
function generateRoute(basePath, language, stainlessPath) {
|
|
87
|
-
const parsedPath = parseStainlessPath(stainlessPath);
|
|
88
|
-
if (!parsedPath) return null;
|
|
89
|
-
const path = [basePath.endsWith("/") ? basePath.slice(0, -1) : basePath];
|
|
90
|
-
if (language && language !== DefaultLanguage) path.push(language);
|
|
91
|
-
const resources = parsedPath.resource.flatMap((name, index) => [
|
|
92
|
-
index > 0 ? "subresources" : "resources",
|
|
93
|
-
name
|
|
94
|
-
]);
|
|
95
|
-
const resourcePath = parsedPath.model ? resources.slice(0, 2) : resources;
|
|
96
|
-
path.push(...resourcePath);
|
|
97
|
-
if (parsedPath.method) path.push("methods", parsedPath.method);
|
|
98
|
-
return stainlessPath.length > parsedPath.routable.length ? `${path.join("/")}#${encodeURIComponent(stainlessPath)}` : path.join("/");
|
|
99
|
-
}
|
|
100
|
-
function* walkResource(resource, path, includeModels) {
|
|
101
|
-
yield { data: resource, path };
|
|
102
|
-
for (const data of Object.values(resource.methods)) {
|
|
103
|
-
yield { data, path: [...path, "methods", data.name] };
|
|
104
|
-
}
|
|
105
|
-
if (includeModels)
|
|
106
|
-
for (const data of Object.values(resource.models)) {
|
|
107
|
-
yield { data, path: [...path, "models", data.name] };
|
|
108
|
-
}
|
|
109
|
-
for (const data of Object.values(resource.subresources ?? {})) {
|
|
110
|
-
yield* walkResource(data, [...path, "subresources", data.name]);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
function* walkTree(spec, includeModels) {
|
|
114
|
-
for (const data of Object.values(spec.resources)) {
|
|
115
|
-
yield* walkResource(data, ["resources", data.name], includeModels);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
function generateRouteList({
|
|
119
|
-
spec,
|
|
120
|
-
languages,
|
|
121
|
-
excludeLanguages = []
|
|
122
|
-
}) {
|
|
123
|
-
const entries = Array.from(walkTree(spec));
|
|
124
|
-
const langs = languages ?? spec.docs?.languages ?? ["http"];
|
|
125
|
-
return langs.filter((lang) => Languages.includes(lang) && lang !== "terraform").filter((lang) => !excludeLanguages?.includes(lang)).flatMap(
|
|
126
|
-
(language) => entries.map(({ path, data: { title, kind, stainlessPath } }) => ({
|
|
127
|
-
title,
|
|
128
|
-
kind,
|
|
129
|
-
language,
|
|
130
|
-
stainlessPath,
|
|
131
|
-
slug: (language === "http" ? path : [language, ...path]).join("/")
|
|
132
|
-
}))
|
|
133
|
-
);
|
|
134
|
-
}
|
|
135
|
-
function findNavigationPath(items, target) {
|
|
136
|
-
for (const item of Object.values(items)) {
|
|
137
|
-
if (item.stainlessPath === target) return [item.stainlessPath];
|
|
138
|
-
if (item.kind === "http_method") continue;
|
|
139
|
-
const path = findNavigationPath(
|
|
140
|
-
[...Object.values(item.methods ?? {}), ...Object.values(item.subresources ?? {})],
|
|
141
|
-
target
|
|
142
|
-
);
|
|
143
|
-
if (path) return [item.stainlessPath, ...path];
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
function expandToElement(el) {
|
|
147
|
-
while (el) {
|
|
148
|
-
if (el instanceof HTMLDetailsElement) el.open = true;
|
|
149
|
-
el = el.parentElement;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
function scrollToPath(stainlessPath) {
|
|
153
|
-
const el = document.getElementById(stainlessPath);
|
|
154
|
-
if (el) {
|
|
155
|
-
expandToElement(el);
|
|
156
|
-
el.scrollIntoView({ behavior: "smooth" });
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
function updateHistory(basePath, language, stainlessPath) {
|
|
160
|
-
const path = generateRoute(basePath, language, stainlessPath);
|
|
161
|
-
window.history.pushState({ stainlessPath, language }, "", path);
|
|
162
|
-
}
|
|
163
|
-
export {
|
|
164
|
-
LanguageNames,
|
|
165
|
-
Languages,
|
|
166
|
-
SupportedLanguageSyntaxes,
|
|
167
|
-
expandToElement,
|
|
168
|
-
findNavigationPath,
|
|
169
|
-
generateRoute,
|
|
170
|
-
generateRouteList,
|
|
171
|
-
getLanguageSnippet,
|
|
172
|
-
getResource,
|
|
173
|
-
isSupportedLanguage,
|
|
174
|
-
parseRoute,
|
|
175
|
-
parseStainlessPath,
|
|
176
|
-
scrollToPath,
|
|
177
|
-
trimStainlessPath,
|
|
178
|
-
updateHistory,
|
|
179
|
-
walkTree
|
|
180
|
-
};
|
|
1
|
+
import { _ as walkTree, a as findNavigationPath, c as getLanguageSnippet, d as parseRoute, f as parseStainlessPath, g as updateHistory, h as trimStainlessPath, i as expandToElement, l as getResource, m as scrollToPath, n as Languages, o as generateRoute, r as SupportedLanguageSyntaxes, s as generateRouteList, t as LanguageNames, u as isSupportedLanguage } from "./routing-8itEXLx6.js";
|
|
2
|
+
|
|
3
|
+
export { LanguageNames, Languages, SupportedLanguageSyntaxes, expandToElement, findNavigationPath, generateRoute, generateRouteList, getLanguageSnippet, getResource, isSupportedLanguage, parseRoute, parseStainlessPath, scrollToPath, trimStainlessPath, updateHistory, walkTree };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { t as DocsLanguage } from "./routing-
|
|
1
|
+
import { t as DocsLanguage } from "./routing-DNN8R6bZ.js";
|
|
2
2
|
import * as React$1 from "react";
|
|
3
|
+
import * as react_jsx_runtime12 from "react/jsx-runtime";
|
|
3
4
|
import * as SDKJSON from "@stainless/sdk-json";
|
|
4
5
|
|
|
5
6
|
//#region src/components/sdk.d.ts
|
|
@@ -33,7 +34,7 @@ declare function SDKChildren({
|
|
|
33
34
|
paths,
|
|
34
35
|
expand,
|
|
35
36
|
depth
|
|
36
|
-
}: SDKChildrenProps):
|
|
37
|
+
}: SDKChildrenProps): react_jsx_runtime12.JSX.Element;
|
|
37
38
|
type SDKDeclarationProps = {
|
|
38
39
|
path: string;
|
|
39
40
|
expand?: boolean;
|
|
@@ -43,26 +44,26 @@ declare function SDKDeclaration({
|
|
|
43
44
|
path,
|
|
44
45
|
expand,
|
|
45
46
|
depth
|
|
46
|
-
}: SDKDeclarationProps):
|
|
47
|
+
}: SDKDeclarationProps): react_jsx_runtime12.JSX.Element;
|
|
47
48
|
type SDKConstraintsProps = {
|
|
48
49
|
constraints?: Record<string, any>;
|
|
49
50
|
};
|
|
50
51
|
declare function SDKConstraints({
|
|
51
52
|
constraints
|
|
52
|
-
}: SDKConstraintsProps):
|
|
53
|
+
}: SDKConstraintsProps): react_jsx_runtime12.JSX.Element | undefined;
|
|
53
54
|
type SDKIconProps = {
|
|
54
55
|
language: SDKJSON.SnippetLanguage;
|
|
55
56
|
size?: number;
|
|
56
57
|
};
|
|
57
58
|
declare function SDKIcon({
|
|
58
59
|
language
|
|
59
|
-
}: SDKIconProps):
|
|
60
|
+
}: SDKIconProps): react_jsx_runtime12.JSX.Element | null;
|
|
60
61
|
type SDKRequestTitleProps = {
|
|
61
62
|
snippetLanguage: SDKJSON.SnippetLanguage;
|
|
62
63
|
};
|
|
63
64
|
declare function SDKRequestTitle({
|
|
64
65
|
snippetLanguage
|
|
65
|
-
}: SDKRequestTitleProps):
|
|
66
|
+
}: SDKRequestTitleProps): react_jsx_runtime12.JSX.Element;
|
|
66
67
|
type SDKExampleProps = {
|
|
67
68
|
method: SDKJSON.Method;
|
|
68
69
|
transformRequestSnippet?: TransformRequestSnippetFn;
|
|
@@ -70,27 +71,27 @@ type SDKExampleProps = {
|
|
|
70
71
|
declare function SDKExample({
|
|
71
72
|
method,
|
|
72
73
|
transformRequestSnippet
|
|
73
|
-
}: SDKExampleProps):
|
|
74
|
+
}: SDKExampleProps): react_jsx_runtime12.JSX.Element;
|
|
74
75
|
type SDKMethodProps = {
|
|
75
76
|
method: SDKJSON.Method;
|
|
76
77
|
transformRequestSnippet?: TransformRequestSnippetFn;
|
|
77
78
|
};
|
|
78
79
|
declare function SDKMethodHeader({
|
|
79
80
|
method
|
|
80
|
-
}: SDKMethodProps):
|
|
81
|
+
}: SDKMethodProps): react_jsx_runtime12.JSX.Element;
|
|
81
82
|
declare function SDKMethodInfo({
|
|
82
83
|
method
|
|
83
|
-
}: SDKMethodProps):
|
|
84
|
+
}: SDKMethodProps): react_jsx_runtime12.JSX.Element;
|
|
84
85
|
declare function SDKMethod({
|
|
85
86
|
method,
|
|
86
87
|
transformRequestSnippet
|
|
87
|
-
}: SDKMethodProps):
|
|
88
|
+
}: SDKMethodProps): react_jsx_runtime12.JSX.Element | undefined;
|
|
88
89
|
type SDKModelProps = {
|
|
89
90
|
model: SDKJSON.Model;
|
|
90
91
|
};
|
|
91
92
|
declare function SDKModel({
|
|
92
93
|
model
|
|
93
|
-
}: SDKModelProps):
|
|
94
|
+
}: SDKModelProps): react_jsx_runtime12.JSX.Element | null;
|
|
94
95
|
type SDKReferenceProps = {
|
|
95
96
|
stainlessPath: string;
|
|
96
97
|
children?: React$1.ReactNode;
|
|
@@ -98,7 +99,7 @@ type SDKReferenceProps = {
|
|
|
98
99
|
declare function SDKReference({
|
|
99
100
|
stainlessPath,
|
|
100
101
|
children
|
|
101
|
-
}: 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> |
|
|
102
|
+
}: 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_runtime12.JSX.Element | null | undefined;
|
|
102
103
|
type SDKLanguageBlockProps = {
|
|
103
104
|
language: DocsLanguage;
|
|
104
105
|
version: string;
|
|
@@ -113,6 +114,6 @@ declare function SDKLanguageBlock({
|
|
|
113
114
|
version,
|
|
114
115
|
install,
|
|
115
116
|
links
|
|
116
|
-
}: SDKLanguageBlockProps):
|
|
117
|
+
}: SDKLanguageBlockProps): react_jsx_runtime12.JSX.Element;
|
|
117
118
|
//#endregion
|
|
118
119
|
export { TransformRequestSnippetFn as C, SDKSnippetLanguagesType as S, useReferenceNesting as T, SDKModelProps as _, SDKChildren as a, SDKRequestTitleProps as b, SDKDeclaration as c, SDKLanguageBlock as d, SDKMethod as f, SDKModel as g, SDKMethodProps 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, SDKReference as v, usePropertyModel as w, SDKSnippetLanguages as x, SDKRequestTitle as y };
|
package/dist/search/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "../routing-
|
|
2
|
-
import { c as QueryKindsType, l as ResultData } from "../types-
|
|
3
|
-
import * as
|
|
1
|
+
import "../routing-DNN8R6bZ.js";
|
|
2
|
+
import { c as QueryKindsType, l as ResultData } from "../types-DNSz4kuM.js";
|
|
3
|
+
import * as react_jsx_runtime84 from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region src/search/form.d.ts
|
|
6
|
-
declare function SearchForm():
|
|
6
|
+
declare function SearchForm(): react_jsx_runtime84.JSX.Element;
|
|
7
7
|
type SearchFilterProps = {
|
|
8
8
|
results: ResultData;
|
|
9
9
|
filterKind: QueryKindsType;
|
|
@@ -13,7 +13,7 @@ declare function SearchFilter({
|
|
|
13
13
|
results,
|
|
14
14
|
filterKind,
|
|
15
15
|
onChange
|
|
16
|
-
}: SearchFilterProps):
|
|
16
|
+
}: SearchFilterProps): react_jsx_runtime84.JSX.Element;
|
|
17
17
|
type SearchModalProps = {
|
|
18
18
|
id?: string;
|
|
19
19
|
open?: boolean;
|
|
@@ -21,6 +21,6 @@ type SearchModalProps = {
|
|
|
21
21
|
declare function SearchModal({
|
|
22
22
|
id,
|
|
23
23
|
open: isOpen
|
|
24
|
-
}: SearchModalProps):
|
|
24
|
+
}: SearchModalProps): react_jsx_runtime84.JSX.Element;
|
|
25
25
|
//#endregion
|
|
26
26
|
export { SearchFilter, SearchFilterProps, SearchForm, SearchModal, SearchModalProps };
|