@stainless-api/docs-ui 0.1.0-beta.9 → 0.1.0-beta.91
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-BaNU4WsC.d.ts +25 -0
- package/dist/chunk-pbuEa-1d.js +13 -0
- package/dist/component-generics-D9XaPlr8.d.ts +30 -0
- package/dist/component-generics-DYxBWv1v.js +42 -0
- package/dist/components/MaskedInput.d.ts +14 -0
- package/dist/components/MaskedInput.js +74 -0
- package/dist/components/breadcrumbs.d.ts +2 -0
- package/dist/components/breadcrumbs.js +61 -0
- package/dist/components/icons.d.ts +72 -0
- package/dist/components/icons.js +953 -0
- package/dist/components/index.d.ts +10 -0
- package/dist/components/index.js +72 -0
- package/dist/components/method.d.ts +2 -0
- package/dist/components/method.js +94 -0
- package/dist/components/overview.d.ts +2 -0
- package/dist/components/overview.js +139 -0
- package/dist/components/primitives.d.ts +2 -0
- package/dist/components/primitives.js +250 -0
- package/dist/components/properties.d.ts +2 -0
- package/dist/components/properties.js +143 -0
- package/dist/components/sdk-sidebar.d.ts +2 -0
- package/dist/components/sdk-sidebar.js +49 -0
- package/dist/components/sdk.d.ts +2 -0
- package/dist/components/sdk.js +487 -0
- package/dist/components/snippets.d.ts +2 -0
- package/dist/components/snippets.js +183 -0
- package/dist/components/stl-sidebar.d.ts +2 -0
- package/dist/components/stl-sidebar.js +111 -0
- package/dist/contexts/component-generics.d.ts +2 -0
- package/dist/contexts/component-generics.js +2 -0
- package/dist/contexts/component-types.d.ts +7 -0
- package/dist/contexts/component-types.js +0 -0
- package/dist/contexts/component.d.ts +20 -0
- package/dist/contexts/component.js +21 -0
- package/dist/contexts/docs.d.ts +2 -0
- package/dist/contexts/docs.js +89 -0
- package/dist/contexts/index.d.ts +6 -0
- package/dist/contexts/index.js +43 -0
- package/dist/contexts/markdown.d.ts +2 -0
- package/dist/contexts/markdown.js +62 -0
- package/dist/contexts/navigation.d.ts +2 -0
- package/dist/contexts/navigation.js +21 -0
- package/dist/contexts/use-components.d.ts +6 -0
- package/dist/contexts/use-components.js +5 -0
- package/dist/docs-D0qzNoXq.d.ts +62 -0
- package/dist/index-DFr9Mesr.d.ts +1776 -0
- package/dist/index-Dt9uPKZP.d.ts +464 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +7 -7542
- package/dist/languages/cli.d.ts +2 -0
- package/dist/languages/cli.js +164 -0
- package/dist/languages/csharp.d.ts +2 -0
- package/dist/languages/csharp.js +281 -0
- package/dist/languages/go.d.ts +2 -0
- package/dist/languages/go.js +301 -0
- package/dist/languages/http.d.ts +2 -0
- package/dist/languages/http.js +381 -0
- package/dist/languages/index.d.ts +2 -0
- package/dist/languages/index.js +30 -0
- package/dist/languages/java.d.ts +2 -0
- package/dist/languages/java.js +401 -0
- package/dist/languages/php.d.ts +2 -0
- package/dist/languages/php.js +310 -0
- package/dist/languages/python.d.ts +2 -0
- package/dist/languages/python.js +267 -0
- package/dist/languages/ruby.d.ts +2 -0
- package/dist/languages/ruby.js +385 -0
- package/dist/languages/terraform.d.ts +2 -0
- package/dist/languages/terraform.js +258 -0
- package/dist/languages/typescript.d.ts +2 -0
- package/dist/languages/typescript.js +447 -0
- package/dist/markdown/index.d.ts +11 -0
- package/dist/markdown/index.js +86 -0
- package/dist/markdown/md.d.ts +15 -0
- package/dist/markdown/md.js +39 -0
- package/dist/markdown/printer.d.ts +13 -0
- package/dist/markdown/printer.js +73 -0
- package/dist/markdown/utils.d.ts +28 -0
- package/dist/markdown/utils.js +31 -0
- package/dist/markdown-B30HO-Vy.d.ts +33 -0
- package/dist/method-BKJnP-rW.d.ts +59 -0
- package/dist/navigation-DGl8lR6w.d.ts +29 -0
- package/dist/overview-iH1evPEF.d.ts +39 -0
- package/dist/primitives-BHt-BuLf.d.ts +107 -0
- package/dist/properties-CCbMRhSX.d.ts +54 -0
- package/dist/routing-yTSG7nWM.d.ts +61 -0
- package/dist/routing.d.ts +2 -0
- package/dist/routing.js +174 -150
- package/dist/sdk-BengV7mg.d.ts +128 -0
- package/dist/sdk-sidebar-CRqLm3YO.d.ts +15 -0
- package/dist/spec.d.ts +65 -0
- package/dist/spec.js +165 -0
- package/dist/stl-sidebar-Pra9uCYo.d.ts +58 -0
- package/dist/style.d.ts +178 -0
- package/dist/style.js +178 -0
- package/dist/styles/main.css +765 -755
- package/dist/styles/primitives.css +359 -442
- package/dist/styles/resets.css +25 -41
- package/dist/styles/search.css +187 -270
- package/dist/styles/sidebar.css +155 -69
- package/dist/styles/variables.css +23 -89
- package/dist/styles.css +3171 -0
- package/dist/utils.d.ts +20 -0
- package/dist/utils.js +52 -0
- package/package.json +75 -22
- 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 -146
- package/src/components/overview.tsx +0 -160
- 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 -403
- package/src/components/sidebar.tsx +0 -99
- package/src/components/snippets.tsx +0 -180
- 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 -182
- package/src/search/state.ts +0 -64
- package/src/search/types.ts +0 -116
- package/src/style.ts +0 -196
- package/src/styles/main.css +0 -986
- package/src/styles/primitives.css +0 -580
- package/src/styles/resets.css +0 -39
- package/src/styles/search.css +0 -341
- 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 -41
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { c as ID, h as Resource, s as HttpAST, v as Spec } from "./index-DFr9Mesr.js";
|
|
2
|
+
|
|
3
|
+
//#region src/utils.d.ts
|
|
4
|
+
declare namespace utils_d_exports {
|
|
5
|
+
export { AssertExhaustive, HttpBodyEncoding, flatResources, getBodyParams, getResourceFromSpec, isResourceEmpty };
|
|
6
|
+
}
|
|
7
|
+
declare function flatResources(resources: Record<string, Resource> | undefined, parents: Resource[]): {
|
|
8
|
+
resource: Resource;
|
|
9
|
+
parents: Resource[];
|
|
10
|
+
}[];
|
|
11
|
+
declare function getResourceFromSpec(stainlessPath: string | string[], spec: Spec): Resource | null;
|
|
12
|
+
declare function isResourceEmpty(resource: Resource): boolean;
|
|
13
|
+
type HttpBodyEncoding = 'json' | 'form-data' | 'unknown';
|
|
14
|
+
declare function getBodyParams(decl: HttpAST.HttpDeclFunction): {
|
|
15
|
+
params: ID[];
|
|
16
|
+
encoding: HttpBodyEncoding;
|
|
17
|
+
} | null;
|
|
18
|
+
type AssertExhaustive<T extends never> = T;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { AssertExhaustive, HttpBodyEncoding, flatResources, getBodyParams, getResourceFromSpec, isResourceEmpty, utils_d_exports as t };
|
package/dist/utils.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { t as __exportAll } from "./chunk-pbuEa-1d.js";
|
|
2
|
+
import { parseStainlessPath } from "./routing.js";
|
|
3
|
+
//#region src/utils.ts
|
|
4
|
+
var utils_exports = /* @__PURE__ */ __exportAll({
|
|
5
|
+
flatResources: () => flatResources,
|
|
6
|
+
getBodyParams: () => getBodyParams,
|
|
7
|
+
getResourceFromSpec: () => getResourceFromSpec,
|
|
8
|
+
isResourceEmpty: () => isResourceEmpty
|
|
9
|
+
});
|
|
10
|
+
function flatResources(resources, parents) {
|
|
11
|
+
return Object.keys(resources ?? {}).flatMap((key) => {
|
|
12
|
+
const resource = resources[key];
|
|
13
|
+
return [{
|
|
14
|
+
resource,
|
|
15
|
+
parents
|
|
16
|
+
}, ...resource.subresources ? flatResources(resource.subresources, [...parents, resource]) : []];
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function getResourceFromSpec(stainlessPath, spec) {
|
|
20
|
+
if (typeof stainlessPath === "string") {
|
|
21
|
+
const parsed = parseStainlessPath(stainlessPath);
|
|
22
|
+
if (!parsed?.resource) return null;
|
|
23
|
+
stainlessPath = parsed.resource;
|
|
24
|
+
}
|
|
25
|
+
return stainlessPath.slice(1).reduce((acc, cur) => acc?.subresources?.[cur], spec.resources[stainlessPath[0]]) ?? null;
|
|
26
|
+
}
|
|
27
|
+
function isResourceEmpty(resource) {
|
|
28
|
+
return !(Object.values(resource.methods).length > 0 || Object.values(resource.models).length > 0 || Object.values(resource.subresources).length > 0);
|
|
29
|
+
}
|
|
30
|
+
function getBodyParams(decl) {
|
|
31
|
+
if (!decl.bodyParamsChildren) return null;
|
|
32
|
+
const keys = Object.keys(decl.bodyParamsChildren);
|
|
33
|
+
if (keys.length > 1) console.warn("multiple bodyParams content types in " + decl.stainlessPath + ":", keys);
|
|
34
|
+
const jsonKey = keys.find((e) => /[/+]json(;|$)/.test(e));
|
|
35
|
+
if (jsonKey) return {
|
|
36
|
+
params: decl.bodyParamsChildren[jsonKey],
|
|
37
|
+
encoding: "json"
|
|
38
|
+
};
|
|
39
|
+
const formDataKey = keys.find((e) => /^multipart\/form-data(;|$)/.test(e));
|
|
40
|
+
if (formDataKey) return {
|
|
41
|
+
params: decl.bodyParamsChildren[formDataKey],
|
|
42
|
+
encoding: "form-data"
|
|
43
|
+
};
|
|
44
|
+
const firstKey = keys[0];
|
|
45
|
+
if (firstKey) return {
|
|
46
|
+
params: decl.bodyParamsChildren[firstKey],
|
|
47
|
+
encoding: "unknown"
|
|
48
|
+
};
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
//#endregion
|
|
52
|
+
export { flatResources, getBodyParams, getResourceFromSpec, isResourceEmpty, utils_exports as t };
|
package/package.json
CHANGED
|
@@ -1,39 +1,92 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stainless-api/docs-ui",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.1.0-beta.
|
|
4
|
+
"version": "0.1.0-beta.91",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
8
8
|
"type": "module",
|
|
9
9
|
"files": [
|
|
10
|
-
"dist"
|
|
11
|
-
"src"
|
|
10
|
+
"dist"
|
|
12
11
|
],
|
|
12
|
+
"peerDependencies": {
|
|
13
|
+
"react": ">=19.0.0",
|
|
14
|
+
"react-dom": ">=19.0.0"
|
|
15
|
+
},
|
|
13
16
|
"dependencies": {
|
|
14
|
-
"@
|
|
15
|
-
"@markdoc/markdoc": "^0.5.2",
|
|
16
|
-
"ai": "4.3.19",
|
|
17
|
+
"@markdoc/markdoc": "^0.5.7",
|
|
17
18
|
"clsx": "^2.1.1",
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"react": "^19.1.1",
|
|
22
|
-
"react-dom": "^19.1.1",
|
|
23
|
-
"@stainless-api/ui-primitives": "0.1.0-beta.10"
|
|
19
|
+
"htmlparser2": "^11.0.0",
|
|
20
|
+
"lucide-react": "^0.577.0",
|
|
21
|
+
"@stainless-api/ui-primitives": "0.1.0-beta.51"
|
|
24
22
|
},
|
|
25
23
|
"devDependencies": {
|
|
26
|
-
"@
|
|
27
|
-
"@types/
|
|
28
|
-
"@types/react
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
24
|
+
"@tsdown/css": "^0.21.7",
|
|
25
|
+
"@types/node": "24.12.0",
|
|
26
|
+
"@types/react": "19.2.14",
|
|
27
|
+
"@types/react-dom": "^19.2.3",
|
|
28
|
+
"dotenv": "17.4.0",
|
|
29
|
+
"react": "^19.2.4",
|
|
30
|
+
"react-dom": "^19.2.4",
|
|
31
|
+
"tsdown": "^0.21.7",
|
|
32
|
+
"typescript": "6.0.2",
|
|
33
|
+
"@stainless/eslint-config": "0.1.0-beta.1",
|
|
34
|
+
"@stainless/sdk-json": "^0.1.0-beta.9"
|
|
35
|
+
},
|
|
36
|
+
"exports": {
|
|
37
|
+
".": {
|
|
38
|
+
"default": "./dist/index.js"
|
|
39
|
+
},
|
|
40
|
+
"./routing": {
|
|
41
|
+
"default": "./dist/routing.js"
|
|
42
|
+
},
|
|
43
|
+
"./utils": {
|
|
44
|
+
"default": "./dist/utils.js"
|
|
45
|
+
},
|
|
46
|
+
"./components": {
|
|
47
|
+
"default": "./dist/components/index.js"
|
|
48
|
+
},
|
|
49
|
+
"./components/scripts/*": {
|
|
50
|
+
"default": "./dist/components/scripts/*.js"
|
|
51
|
+
},
|
|
52
|
+
"./components/*": {
|
|
53
|
+
"default": "./dist/components/*.js"
|
|
54
|
+
},
|
|
55
|
+
"./languages": {
|
|
56
|
+
"default": "./dist/languages/index.js"
|
|
57
|
+
},
|
|
58
|
+
"./languages/*": {
|
|
59
|
+
"default": "./dist/languages/*.js"
|
|
60
|
+
},
|
|
61
|
+
"./contexts": {
|
|
62
|
+
"default": "./dist/contexts/index.js"
|
|
63
|
+
},
|
|
64
|
+
"./contexts/*": {
|
|
65
|
+
"default": "./dist/contexts/*.js"
|
|
66
|
+
},
|
|
67
|
+
"./style": {
|
|
68
|
+
"default": "./dist/style.js"
|
|
69
|
+
},
|
|
70
|
+
"./styles/*": {
|
|
71
|
+
"default": "./dist/styles/*"
|
|
72
|
+
},
|
|
73
|
+
"./styles.css": {
|
|
74
|
+
"default": "./dist/styles.css"
|
|
75
|
+
},
|
|
76
|
+
"./markdown": {
|
|
77
|
+
"default": "./dist/markdown/index.js"
|
|
78
|
+
},
|
|
79
|
+
"./markdown/*": {
|
|
80
|
+
"default": "./dist/markdown/*.js"
|
|
81
|
+
},
|
|
82
|
+
"./spec": {
|
|
83
|
+
"default": "./dist/spec.js"
|
|
84
|
+
}
|
|
33
85
|
},
|
|
34
86
|
"scripts": {
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"lint": "eslint ."
|
|
87
|
+
"build": "tsdown",
|
|
88
|
+
"clean": "rm -rf dist",
|
|
89
|
+
"lint": "eslint --flag unstable_native_nodejs_ts_config .",
|
|
90
|
+
"check:types": "tsc --noEmit"
|
|
38
91
|
}
|
|
39
92
|
}
|