@stainless-api/docs-ui 0.1.0-beta.1 → 0.1.0-beta.10

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 (187) hide show
  1. package/dist/components/breadcrumbs.d.ts +11 -0
  2. package/dist/components/breadcrumbs.js +52 -0
  3. package/dist/components/breadcrumbs.js.map +1 -0
  4. package/dist/components/chat.d.ts +6 -0
  5. package/dist/components/chat.js +80 -0
  6. package/dist/components/chat.js.map +1 -0
  7. package/dist/components/dropdown.d.ts +17 -0
  8. package/dist/components/dropdown.js +18 -0
  9. package/dist/components/dropdown.js.map +1 -0
  10. package/dist/components/icons.d.ts +27 -0
  11. package/dist/components/icons.js +34 -0
  12. package/dist/components/icons.js.map +1 -0
  13. package/dist/components/index.d.ts +9 -0
  14. package/dist/components/index.js +10 -0
  15. package/dist/components/index.js.map +1 -0
  16. package/dist/components/method.d.ts +41 -0
  17. package/dist/components/method.js +44 -0
  18. package/dist/components/method.js.map +1 -0
  19. package/dist/components/overview.d.ts +21 -0
  20. package/dist/components/overview.js +49 -0
  21. package/dist/components/overview.js.map +1 -0
  22. package/dist/components/primitives.d.ts +60 -0
  23. package/dist/components/primitives.js +117 -0
  24. package/dist/components/primitives.js.map +1 -0
  25. package/dist/components/properties.d.ts +24 -0
  26. package/dist/components/properties.js +24 -0
  27. package/dist/components/properties.js.map +1 -0
  28. package/dist/components/scripts/dropdown.d.ts +5 -0
  29. package/dist/components/scripts/dropdown.js +64 -0
  30. package/dist/components/scripts/dropdown.js.map +1 -0
  31. package/dist/components/sdk.d.ts +78 -0
  32. package/dist/components/sdk.js +153 -0
  33. package/dist/components/sdk.js.map +1 -0
  34. package/dist/components/sidebar.d.ts +22 -0
  35. package/dist/components/sidebar.js +30 -0
  36. package/dist/components/sidebar.js.map +1 -0
  37. package/dist/components/snippets.d.ts +28 -0
  38. package/dist/components/snippets.js +76 -0
  39. package/dist/components/snippets.js.map +1 -0
  40. package/dist/contexts/component-generics.d.ts +25 -0
  41. package/dist/contexts/component-generics.js +24 -0
  42. package/dist/contexts/component-generics.js.map +1 -0
  43. package/dist/contexts/component-types.d.ts +4 -0
  44. package/dist/contexts/component-types.js +2 -0
  45. package/dist/contexts/component-types.js.map +1 -0
  46. package/dist/contexts/component.d.ts +14 -0
  47. package/dist/contexts/component.js +14 -0
  48. package/dist/contexts/component.js.map +1 -0
  49. package/dist/contexts/docs.d.ts +34 -0
  50. package/dist/contexts/docs.js +43 -0
  51. package/dist/contexts/docs.js.map +1 -0
  52. package/dist/contexts/index.d.ts +7 -0
  53. package/dist/contexts/index.js +15 -0
  54. package/dist/contexts/index.js.map +1 -0
  55. package/dist/contexts/markdown.d.ts +13 -0
  56. package/dist/contexts/markdown.js +29 -0
  57. package/dist/contexts/markdown.js.map +1 -0
  58. package/dist/contexts/navigation.d.ts +19 -0
  59. package/dist/contexts/navigation.js +14 -0
  60. package/dist/contexts/navigation.js.map +1 -0
  61. package/dist/contexts/search.d.ts +13 -0
  62. package/dist/contexts/search.js +15 -0
  63. package/dist/contexts/search.js.map +1 -0
  64. package/dist/contexts/use-components.d.ts +1 -0
  65. package/dist/contexts/use-components.js +3 -0
  66. package/dist/contexts/use-components.js.map +1 -0
  67. package/dist/index.d.ts +6 -0
  68. package/dist/index.js +7 -7542
  69. package/dist/index.js.map +1 -0
  70. package/dist/languages/go.d.ts +21 -0
  71. package/dist/languages/go.js +116 -0
  72. package/dist/languages/go.js.map +1 -0
  73. package/dist/languages/http.d.ts +25 -0
  74. package/dist/languages/http.js +130 -0
  75. package/dist/languages/http.js.map +1 -0
  76. package/dist/languages/index.d.ts +37 -0
  77. package/dist/languages/index.js +10 -0
  78. package/dist/languages/index.js.map +1 -0
  79. package/dist/languages/java.d.ts +23 -0
  80. package/dist/languages/java.js +120 -0
  81. package/dist/languages/java.js.map +1 -0
  82. package/dist/languages/python.d.ts +22 -0
  83. package/dist/languages/python.js +104 -0
  84. package/dist/languages/python.js.map +1 -0
  85. package/dist/languages/ruby.d.ts +22 -0
  86. package/dist/languages/ruby.js +125 -0
  87. package/dist/languages/ruby.js.map +1 -0
  88. package/dist/languages/typescript.d.ts +22 -0
  89. package/dist/languages/typescript.js +134 -0
  90. package/dist/languages/typescript.js.map +1 -0
  91. package/dist/markdown/index.d.ts +6 -0
  92. package/dist/markdown/index.js +80 -0
  93. package/dist/markdown/index.js.map +1 -0
  94. package/dist/markdown/md.d.ts +11 -0
  95. package/dist/markdown/md.js +34 -0
  96. package/dist/markdown/md.js.map +1 -0
  97. package/dist/markdown/utils.d.ts +17 -0
  98. package/dist/markdown/utils.js +30 -0
  99. package/dist/markdown/utils.js.map +1 -0
  100. package/dist/mcp.js +678 -576
  101. package/dist/routing.d.ts +44 -0
  102. package/dist/routing.js +149 -160
  103. package/dist/routing.js.map +1 -0
  104. package/dist/search/form.d.ts +13 -0
  105. package/dist/search/form.js +55 -0
  106. package/dist/search/form.js.map +1 -0
  107. package/dist/search/index.d.ts +1 -0
  108. package/dist/search/index.js +2 -0
  109. package/dist/search/index.js.map +1 -0
  110. package/dist/search/indexer.d.ts +31 -0
  111. package/dist/search/indexer.js +212 -0
  112. package/dist/search/indexer.js.map +1 -0
  113. package/dist/search/mcp.d.ts +8 -0
  114. package/dist/search/mcp.js +43 -0
  115. package/dist/search/mcp.js.map +1 -0
  116. package/dist/search/printer.d.ts +6 -0
  117. package/dist/search/printer.js +43 -0
  118. package/dist/search/printer.js.map +1 -0
  119. package/dist/search/providers/algolia.d.ts +8 -0
  120. package/dist/search/providers/algolia.js +64 -0
  121. package/dist/search/providers/algolia.js.map +1 -0
  122. package/dist/search/providers/fuse.d.ts +10 -0
  123. package/dist/search/providers/fuse.js +14 -0
  124. package/dist/search/providers/fuse.js.map +1 -0
  125. package/dist/search/providers/pagefind.d.ts +2 -0
  126. package/dist/search/providers/pagefind.js +19 -0
  127. package/dist/search/providers/pagefind.js.map +1 -0
  128. package/dist/search/providers/walker.d.ts +5 -0
  129. package/dist/search/providers/walker.js +23 -0
  130. package/dist/search/providers/walker.js.map +1 -0
  131. package/dist/search/results.d.ts +21 -0
  132. package/dist/search/results.js +58 -0
  133. package/dist/search/results.js.map +1 -0
  134. package/dist/search/state.d.ts +29 -0
  135. package/dist/search/state.js +38 -0
  136. package/dist/search/state.js.map +1 -0
  137. package/dist/search/types.d.ts +79 -0
  138. package/dist/search/types.js +24 -0
  139. package/dist/search/types.js.map +1 -0
  140. package/dist/style.d.ts +179 -0
  141. package/dist/style.js +179 -0
  142. package/dist/style.js.map +1 -0
  143. package/dist/styles/primitives.css +1 -0
  144. package/dist/types/sdkjson.d.ts +1 -0
  145. package/dist/types/sdkjson.js +2 -0
  146. package/dist/types/sdkjson.js.map +1 -0
  147. package/dist/types/stainless-alias/lib/json-spec-v2/GoAST.d.ts +120 -0
  148. package/dist/types/stainless-alias/lib/json-spec-v2/GoAST.js +2 -0
  149. package/dist/types/stainless-alias/lib/json-spec-v2/GoAST.js.map +1 -0
  150. package/dist/types/stainless-alias/lib/json-spec-v2/HttpAST.d.ts +100 -0
  151. package/dist/types/stainless-alias/lib/json-spec-v2/HttpAST.js +3 -0
  152. package/dist/types/stainless-alias/lib/json-spec-v2/HttpAST.js.map +1 -0
  153. package/dist/types/stainless-alias/lib/json-spec-v2/JavaAST.d.ts +87 -0
  154. package/dist/types/stainless-alias/lib/json-spec-v2/JavaAST.js +2 -0
  155. package/dist/types/stainless-alias/lib/json-spec-v2/JavaAST.js.map +1 -0
  156. package/dist/types/stainless-alias/lib/json-spec-v2/PythonAST.d.ts +110 -0
  157. package/dist/types/stainless-alias/lib/json-spec-v2/PythonAST.js +3 -0
  158. package/dist/types/stainless-alias/lib/json-spec-v2/PythonAST.js.map +1 -0
  159. package/dist/types/stainless-alias/lib/json-spec-v2/RubyAST.d.ts +122 -0
  160. package/dist/types/stainless-alias/lib/json-spec-v2/RubyAST.js +2 -0
  161. package/dist/types/stainless-alias/lib/json-spec-v2/RubyAST.js.map +1 -0
  162. package/dist/types/stainless-alias/lib/json-spec-v2/TSAST.d.ts +146 -0
  163. package/dist/types/stainless-alias/lib/json-spec-v2/TSAST.js +3 -0
  164. package/dist/types/stainless-alias/lib/json-spec-v2/TSAST.js.map +1 -0
  165. package/dist/types/stainless-alias/lib/json-spec-v2/TerraformAST.d.ts +89 -0
  166. package/dist/types/stainless-alias/lib/json-spec-v2/TerraformAST.js +3 -0
  167. package/dist/types/stainless-alias/lib/json-spec-v2/TerraformAST.js.map +1 -0
  168. package/dist/types/stainless-alias/lib/json-spec-v2/types.d.ts +190 -0
  169. package/dist/types/stainless-alias/lib/json-spec-v2/types.js +105 -0
  170. package/dist/types/stainless-alias/lib/json-spec-v2/types.js.map +1 -0
  171. package/dist/utils.d.ts +7 -0
  172. package/dist/utils.js +27 -0
  173. package/dist/utils.js.map +1 -0
  174. package/package.json +8 -7
  175. package/src/components/method.tsx +4 -2
  176. package/src/components/overview.tsx +1 -0
  177. package/src/components/sdk.tsx +3 -2
  178. package/src/components/snippets.tsx +3 -2
  179. package/src/search/results.tsx +1 -0
  180. package/src/style.ts +0 -1
  181. package/src/styles/main.css +739 -746
  182. package/src/styles/primitives.css +435 -427
  183. package/src/styles/resets.css +33 -41
  184. package/src/styles/search.css +247 -248
  185. package/src/styles/sidebar.css +58 -60
  186. package/src/styles/snippets.css +86 -88
  187. package/src/styles/variables.css +85 -89
@@ -0,0 +1,146 @@
1
+ import type * as SDKJSON from './types';
2
+ export type TSDeclaration = TSDeclFunction | TSDeclClass | TSDeclInterface | TSDeclProperty | TSDeclTypeAlias | TSDeclReference | SDKJSON.ErrorDecl;
3
+ export type TSDeclFunction = SDKJSON.BaseDeclaration & {
4
+ kind: 'TSDeclFunction';
5
+ ident: TSIdentifier;
6
+ qualified?: string;
7
+ signature: TSFunctionSignature;
8
+ overloads?: TSFunctionSignature[];
9
+ paramsChildren?: SDKJSON.ID[];
10
+ responseChildren?: SDKJSON.ID[];
11
+ };
12
+ export type TSDeclClass = SDKJSON.BaseDeclaration & {
13
+ kind: 'TSDeclClass';
14
+ ident: TSIdentifier;
15
+ docstring?: string;
16
+ typeParameters?: TSTypeParameter[];
17
+ superClass?: TSTypeReference;
18
+ implements?: TSTypeReference[];
19
+ children: SDKJSON.ID[];
20
+ };
21
+ export type TSDeclInterface = SDKJSON.BaseDeclaration & {
22
+ kind: 'TSDeclInterface';
23
+ ident: TSIdentifier;
24
+ docstring?: string;
25
+ typeParameters?: TSTypeParameter[];
26
+ extends?: TSType[];
27
+ children: SDKJSON.ID[];
28
+ };
29
+ export type TSDeclProperty = SDKJSON.BaseDeclaration & {
30
+ kind: 'TSDeclProperty';
31
+ key: string;
32
+ docstring?: string;
33
+ type: TSType;
34
+ constraints?: SDKJSON.Constraints;
35
+ optional?: boolean;
36
+ declare?: boolean;
37
+ default?: any;
38
+ schemaType?: SDKJSON.SchemaType;
39
+ modelPath?: string;
40
+ childrenParentSchema?: SDKJSON.SchemaType;
41
+ children?: SDKJSON.ID[];
42
+ };
43
+ export type TSDeclTypeAlias = SDKJSON.BaseDeclaration & {
44
+ kind: 'TSDeclTypeAlias';
45
+ docstring?: string;
46
+ ident: TSIdentifier;
47
+ typeParameters?: TSTypeParameter[];
48
+ type: TSType;
49
+ children?: SDKJSON.ID[];
50
+ };
51
+ export type TSDeclReference = SDKJSON.BaseDeclaration & {
52
+ kind: 'TSDeclReference';
53
+ docstring?: string;
54
+ type: TSType;
55
+ children?: SDKJSON.ID[];
56
+ };
57
+ export type TSFunctionSignature = {
58
+ kind: 'TSFunctionSignature';
59
+ parameters: TSFunctionParameter[];
60
+ returns: TSType;
61
+ async?: boolean;
62
+ typeParameters?: TSTypeParameter[];
63
+ docstring?: string;
64
+ };
65
+ export type TSFunctionParameter = {
66
+ kind: 'TSFunctionParameter';
67
+ ident: TSIdentifier;
68
+ type: TSType;
69
+ optional?: boolean;
70
+ };
71
+ export type TSTypeParameter = {
72
+ kind: 'TSTypeParameter';
73
+ name: TSIdentifier;
74
+ constraint?: TSType;
75
+ default?: TSType;
76
+ };
77
+ export type TSPropertyKey = TSIdentifier;
78
+ export type TSIdentifier = string;
79
+ export type TSType = TSTypeReference | TSTypeObject | TSTypeArray | TSTypeString | TSTypeNumber | TSTypeBoolean | TSTypeNull | TSTypeUndefined | TSTypeVoid | TSTypeAny | TSTypeUnknown | TSTypeNever | TSTypeLiteral | TSTypeUnion | TSTypeIntersection | TSTypeInterface;
80
+ export type TSTypeReference = SDKJSON.BaseType & {
81
+ kind: 'TSTypeReference';
82
+ ident: TSIdentifier;
83
+ typeParameters?: TSType[];
84
+ schemaType?: SDKJSON.SchemaType;
85
+ $ref?: SDKJSON.ID;
86
+ };
87
+ export type TSTypeObject = SDKJSON.BaseType & {
88
+ kind: 'TSTypeObject';
89
+ members: {
90
+ ident: TSIdentifier;
91
+ type: TSType;
92
+ optional?: boolean;
93
+ }[];
94
+ };
95
+ export type TSTypeArray = SDKJSON.BaseType & {
96
+ kind: 'TSTypeArray';
97
+ elementType: TSType;
98
+ };
99
+ export type TSTypeUnion = SDKJSON.BaseType & {
100
+ kind: 'TSTypeUnion';
101
+ types: TSType[];
102
+ };
103
+ export type TSTypeIntersection = SDKJSON.BaseType & {
104
+ kind: 'TSTypeIntersection';
105
+ types: TSType[];
106
+ };
107
+ export type TSTypeInterface = SDKJSON.BaseType & {
108
+ kind: 'TSTypeInterface';
109
+ members: {
110
+ ident: TSIdentifier;
111
+ type: TSType;
112
+ optional?: boolean;
113
+ }[];
114
+ extends?: TSTypeReference[];
115
+ };
116
+ export type TSTypeLiteral = SDKJSON.BaseType & {
117
+ kind: 'TSTypeLiteral';
118
+ literal: string | boolean | number;
119
+ };
120
+ export type TSTypeString = SDKJSON.BaseType & {
121
+ kind: 'TSTypeString';
122
+ };
123
+ export type TSTypeNumber = SDKJSON.BaseType & {
124
+ kind: 'TSTypeNumber';
125
+ };
126
+ export type TSTypeBoolean = SDKJSON.BaseType & {
127
+ kind: 'TSTypeBoolean';
128
+ };
129
+ export type TSTypeNull = SDKJSON.BaseType & {
130
+ kind: 'TSTypeNull';
131
+ };
132
+ export type TSTypeUndefined = SDKJSON.BaseType & {
133
+ kind: 'TSTypeUndefined';
134
+ };
135
+ export type TSTypeVoid = SDKJSON.BaseType & {
136
+ kind: 'TSTypeVoid';
137
+ };
138
+ export type TSTypeAny = SDKJSON.BaseType & {
139
+ kind: 'TSTypeAny';
140
+ };
141
+ export type TSTypeUnknown = SDKJSON.BaseType & {
142
+ kind: 'TSTypeUnknown';
143
+ };
144
+ export type TSTypeNever = SDKJSON.BaseType & {
145
+ kind: 'TSTypeNever';
146
+ };
@@ -0,0 +1,3 @@
1
+ // This is loosely based upon the Babel AST for TypeScript.
2
+ export {};
3
+ //# sourceMappingURL=TSAST.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TSAST.js","sourceRoot":"","sources":["../../../../../src/types/stainless-alias/lib/json-spec-v2/TSAST.ts"],"names":[],"mappings":"AAAA,2DAA2D"}
@@ -0,0 +1,89 @@
1
+ import type { Configurability, TerraformValidators } from '~/templates/TerraformSDK/terraform-types';
2
+ import type * as SDKJSON from './types';
3
+ export type TerraformNode = TerraformDeclaration;
4
+ export type TerraformDeclaration = TerraformDeclServiceNode | TerraformDeclSource | TerraformDeclAttribute | SDKJSON.ErrorDecl;
5
+ export type TerraformDeclServiceNode = SDKJSON.BaseDeclaration & {
6
+ kind: 'TerraformDeclServiceNode';
7
+ resource?: SDKJSON.ID;
8
+ dataSource?: SDKJSON.ID;
9
+ listDataSource?: SDKJSON.ID;
10
+ };
11
+ export type TerraformDeclSource = SDKJSON.BaseDeclaration & {
12
+ kind: 'TerraformDeclSource';
13
+ name: string;
14
+ type: 'resource' | 'datasource-plural' | 'datasource-single';
15
+ methodName: string;
16
+ required: SDKJSON.ID[];
17
+ optional: SDKJSON.ID[];
18
+ computed: SDKJSON.ID[];
19
+ };
20
+ export type PrimitiveNumberProps = {
21
+ oneof?: number[];
22
+ default: number | null;
23
+ minimum: number | null;
24
+ maximum: number | null;
25
+ };
26
+ export type Primitive = {
27
+ category: 'primitive';
28
+ } & ({
29
+ type: 'Bool';
30
+ default: boolean | null;
31
+ } | ({
32
+ type: 'Float64';
33
+ } & PrimitiveNumberProps) | ({
34
+ type: 'Int64';
35
+ } & PrimitiveNumberProps) | ({
36
+ type: 'Number';
37
+ } & PrimitiveNumberProps) | {
38
+ type: 'Time';
39
+ default: string | null;
40
+ } | {
41
+ type: 'String';
42
+ oneof?: string[];
43
+ default: string | null;
44
+ });
45
+ export type Dynamic = {
46
+ category: 'dynamic';
47
+ type: 'Dynamic';
48
+ allowedSubtypes: Primitive['type'][];
49
+ };
50
+ export type Unknown = {
51
+ category: 'unknown';
52
+ type: 'unknown';
53
+ };
54
+ export type Collection = {
55
+ category: 'collection';
56
+ type: 'List' | 'Map' | 'Set';
57
+ elementType: AttributeType;
58
+ };
59
+ export type Nested = {
60
+ category: 'nested';
61
+ type: 'ListNested' | 'MapNested' | 'SetNested' | 'SingleNested';
62
+ modelTypeName: string;
63
+ validators: TerraformValidators;
64
+ };
65
+ type MethodNames = 'create' | 'read' | 'list' | 'update' | 'delete';
66
+ export type Timeouts = {
67
+ propertyName: string;
68
+ block: boolean;
69
+ type: 'resource' | 'datasource';
70
+ timeouts: {
71
+ [key in MethodNames]: number | undefined;
72
+ };
73
+ };
74
+ export type AttributeType = Nested | Collection | Dynamic | Primitive | Unknown;
75
+ export type PathExpr = Readonly<{
76
+ path: string;
77
+ container?: Collection['type'] | Nested['type'];
78
+ }>;
79
+ export type PathExpression = readonly PathExpr[];
80
+ export type TerraformDeclAttribute = SDKJSON.BaseDeclaration & {
81
+ kind: 'TerraformDeclAttribute';
82
+ name: string;
83
+ docstring?: string;
84
+ type: AttributeType;
85
+ children: SDKJSON.ID[];
86
+ configurability: Configurability;
87
+ requiresReplace?: boolean;
88
+ };
89
+ export {};
@@ -0,0 +1,3 @@
1
+ // placeholder for now
2
+ export {};
3
+ //# sourceMappingURL=TerraformAST.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TerraformAST.js","sourceRoot":"","sources":["../../../../../src/types/stainless-alias/lib/json-spec-v2/TerraformAST.ts"],"names":[],"mappings":"AAAA,sBAAsB"}
@@ -0,0 +1,190 @@
1
+ import type { DiagnosticExport } from '@pkg/diagnostics/src/base';
2
+ import type { ResponseContentObject, SchemaObject } from '@pkg/openapi';
3
+ import type { Config, SupportedLanguage } from '@pkg/stainless-config';
4
+ import type { HTTPMethod } from '@pkg/stainless-config/src/util';
5
+ import type { HttpDeclaration, HttpDeclProperty, HttpDeclReference, HttpType } from '~/lib/json-spec-v2/HttpAST';
6
+ import type { RubyDeclaration, RubyDeclProperty, RubyDeclReference, RubyType } from '~/lib/json-spec-v2/RubyAST';
7
+ import type { SDKSchema, SDKSchemaType } from '~/lib/sdk-spec/generic-sdk-wrappers';
8
+ import type { GoDeclaration, GoDeclConst, GoDeclProperty, GoDeclReference, GoType } from './GoAST';
9
+ import type { JavaDeclaration, JavaDeclProperty, JavaDeclReference, JavaType } from './JavaAST';
10
+ import type { PythonDeclaration, PythonDeclProperty, PythonDeclReference, PythonType } from './PythonAST';
11
+ import type { TerraformDeclaration } from './TerraformAST';
12
+ import type { TSDeclaration, TSDeclProperty, TSDeclReference, TSType } from './TSAST';
13
+ export type HasOASRef = {
14
+ oasRef?: string;
15
+ };
16
+ export type HasConfigRef = {
17
+ configRef: string;
18
+ };
19
+ export type HasStainlessPath = {
20
+ stainlessPath: string;
21
+ };
22
+ export type ID = string & {
23
+ _isId: null;
24
+ };
25
+ export type SchemaType = SDKSchemaType;
26
+ export declare const constraints: readonly ["minLength", "maxLength", "format", "minimum", "exclusiveMinimum", "maximum", "exclusiveMaximum", "multipleOf"];
27
+ export type Constraints = Pick<SchemaObject, (typeof constraints)[number]>;
28
+ export declare function constraintsFromSchema(rawSchema: SchemaObject): {
29
+ [k: string]: any;
30
+ } | undefined;
31
+ export declare const SpecLanguages: readonly ["node", "go", "python", "terraform", "http", "typescript", "ruby", "java", "kotlin"];
32
+ export type SpecLanguage = (typeof SpecLanguages)[number];
33
+ export declare function isSpecLanguage(language: string): language is SpecLanguage;
34
+ export declare const SnippetLanguages: readonly ["node.default", "go.default", "python.default", "terraform.default", "http.curl", "http.powershell", "typescript.default", "ruby.default", "java.default", "kotlin.default"];
35
+ export type SnippetLanguage<lang extends SpecLanguage = SpecLanguage> = (typeof SnippetLanguages)[number] & `${lang}.${string}`;
36
+ /**
37
+ * A literal property path from Spec down to a given node
38
+ */
39
+ export type Path = (string | number)[];
40
+ /**
41
+ * A literal property path from Spec down to a given node
42
+ */
43
+ export type PathLike = string | (string | number)[];
44
+ export type Node = Spec | Resource | Method | Model;
45
+ /**
46
+ * Checks if thing is an Node.
47
+ * Not a sound check, it should only be called on values within an
48
+ * tree, and it only works because no node has a property
49
+ * of type Record<string, string>.
50
+ */
51
+ export declare function isNode(thing: any): thing is Node;
52
+ export type DeclRefType = HttpDeclReference | TSDeclReference | PythonDeclReference | GoDeclReference | GoDeclConst | RubyDeclReference | JavaDeclReference;
53
+ export type Type = HttpType | TSType | PythonType | GoType | RubyType | JavaType;
54
+ export type PropertyType = HttpDeclProperty | TSDeclProperty | PythonDeclProperty | GoDeclProperty | RubyDeclProperty | JavaDeclProperty;
55
+ export type Spec = {
56
+ name: string;
57
+ kind: 'spec';
58
+ security_schemes: {
59
+ type: 'http_bearer' | 'query' | 'header' | 'oauth2' | 'http_basic' | 'http_digest';
60
+ description?: string;
61
+ name: string;
62
+ title: string;
63
+ header: string | undefined;
64
+ example: string | undefined;
65
+ }[];
66
+ resources: Record<string, Resource>;
67
+ diagnostics: Diagnostics;
68
+ docs?: Config['docs'];
69
+ metadata: {
70
+ [lang in SpecLanguage]?: {
71
+ repo_url?: string;
72
+ code_url?: string;
73
+ package_title?: string;
74
+ version?: string;
75
+ install?: string;
76
+ };
77
+ };
78
+ readme: {
79
+ [lang in SpecLanguage]?: string;
80
+ };
81
+ decls: {
82
+ [lang in SpecLanguage]?: Record<string, LanguageDeclNodes[lang]>;
83
+ };
84
+ snippets: {
85
+ [key in SnippetLanguage]?: Record<string, string>;
86
+ };
87
+ };
88
+ export type Resource = (HasConfigRef & HasStainlessPath) & {
89
+ kind: 'resource';
90
+ name: string;
91
+ title: string;
92
+ configRef: string;
93
+ description?: string;
94
+ models: Record<string, Model>;
95
+ methods: Record<string, Method>;
96
+ subresources?: Record<string, Resource>;
97
+ } & {
98
+ [key in SpecLanguage]?: {
99
+ Name: string;
100
+ QualifiedName: string;
101
+ };
102
+ };
103
+ export type Method = (HasStainlessPath & HasOASRef) & {
104
+ kind: 'http_method';
105
+ name: string;
106
+ title: string;
107
+ configRef: string | undefined;
108
+ description?: string;
109
+ summary?: string;
110
+ httpMethod: string;
111
+ endpoint: string;
112
+ deprecated?: string | boolean;
113
+ exampleResponses?: Record<string, ResponseContentObject>;
114
+ security: Record<string, string[]>[] | undefined;
115
+ 'x-api-token-group'?: string[];
116
+ } & {
117
+ [key in SpecLanguage]?: {
118
+ Name: string;
119
+ QualifiedName: string;
120
+ };
121
+ };
122
+ export type StainlessMethodInfo = StainlessHttpMethodInfo | StainlessAliasMethodInfo | StainlessWebhookUnwrapMethodInfo;
123
+ export type StainlessHttpMethodInfo = {
124
+ kind: 'http_method_info';
125
+ httpMethod: HTTPMethod;
126
+ path: string;
127
+ };
128
+ export type StainlessAliasMethodInfo = {
129
+ kind: 'alias_method_info';
130
+ httpMethod: HTTPMethod;
131
+ path: string;
132
+ };
133
+ export type StainlessWebhookUnwrapMethodInfo = {
134
+ kind: 'webhook_unwrap_method_info';
135
+ };
136
+ export type Parameter = (HasOASRef & HasStainlessPath) & {
137
+ kind: 'parameter';
138
+ key: string;
139
+ name: string;
140
+ location: string;
141
+ description?: string;
142
+ isRequired?: boolean;
143
+ isPositional: boolean;
144
+ };
145
+ export type Model = (HasOASRef & HasConfigRef & HasStainlessPath) & {
146
+ kind: 'model';
147
+ name: string;
148
+ title: string;
149
+ isImplicit: boolean;
150
+ stainlessPath: string;
151
+ configRef: string;
152
+ loading?: boolean;
153
+ };
154
+ export type BaseDeclaration = {
155
+ stainlessPath: string;
156
+ oasRef?: string;
157
+ configRef?: string;
158
+ loading?: boolean;
159
+ deprecated?: boolean | string;
160
+ snippet?: string;
161
+ };
162
+ export type BaseType = {
163
+ oasRef?: string;
164
+ };
165
+ export type Diagnostics = Record<string, DiagnosticExport[]>;
166
+ export type Diagnostic = DiagnosticExport;
167
+ export type LanguageDeclNodes = {
168
+ node: TSDeclaration;
169
+ typescript: TSDeclaration;
170
+ go: GoDeclaration;
171
+ python: PythonDeclaration;
172
+ terraform: TerraformDeclaration;
173
+ java: JavaDeclaration;
174
+ kotlin: JavaDeclaration;
175
+ ruby: RubyDeclaration;
176
+ http: HttpDeclaration;
177
+ };
178
+ export type ErrorDecl = BaseDeclaration & {
179
+ kind: 'ErrorDecl';
180
+ error: Error;
181
+ message: string;
182
+ };
183
+ export type DeclarationNode = LanguageDeclNodes[SpecLanguage];
184
+ export declare function declare<T extends BaseDeclaration>(map: Map<string, T>, stainlessPath: string, generator: () => Omit<T, 'stainlessPath'>): ID;
185
+ export declare function declareAll<T extends BaseDeclaration>(map: Map<string, T>, items: Array<{
186
+ stainlessPath: string;
187
+ generator: () => Omit<T, 'stainlessPath'>;
188
+ }>): ID[];
189
+ export declare function schemaChildrenParent(schema: SDKSchema): SDKSchemaType | undefined;
190
+ export declare function processReadme(content: string, language: SupportedLanguage, languageSnippets: Record<string, any>): any;
@@ -0,0 +1,105 @@
1
+ import { getLogger } from '@pkg/logger';
2
+ import * as GlobalSnippets from '~/templates/common/docs';
3
+ import { ctx } from '~/templates/context';
4
+ export const constraints = [
5
+ 'minLength',
6
+ 'maxLength',
7
+ 'format',
8
+ 'minimum',
9
+ 'exclusiveMinimum',
10
+ 'maximum',
11
+ 'exclusiveMaximum',
12
+ 'multipleOf',
13
+ ];
14
+ export function constraintsFromSchema(rawSchema) {
15
+ const items = Object.entries(rawSchema).filter(([name]) => constraints.includes(name));
16
+ return items.length ? Object.fromEntries(items) : undefined;
17
+ }
18
+ export const SpecLanguages = [
19
+ 'node',
20
+ 'go',
21
+ 'python',
22
+ 'terraform',
23
+ 'http',
24
+ 'typescript',
25
+ 'ruby',
26
+ 'java',
27
+ 'kotlin',
28
+ ];
29
+ export function isSpecLanguage(language) {
30
+ return SpecLanguages.includes(language);
31
+ }
32
+ export const SnippetLanguages = [
33
+ 'node.default',
34
+ 'go.default',
35
+ 'python.default',
36
+ 'terraform.default',
37
+ 'http.curl',
38
+ 'http.powershell',
39
+ 'typescript.default',
40
+ 'ruby.default',
41
+ 'java.default',
42
+ 'kotlin.default',
43
+ ];
44
+ /**
45
+ * Checks if thing is an Node.
46
+ * Not a sound check, it should only be called on values within an
47
+ * tree, and it only works because no node has a property
48
+ * of type Record<string, string>.
49
+ */
50
+ export function isNode(thing) {
51
+ return typeof thing?.kind === 'string';
52
+ }
53
+ export function declare(map, stainlessPath, generator) {
54
+ if (map.has(stainlessPath)) {
55
+ return stainlessPath;
56
+ }
57
+ try {
58
+ const decl = generator();
59
+ decl.stainlessPath = stainlessPath;
60
+ map.set(stainlessPath, decl);
61
+ return stainlessPath;
62
+ }
63
+ catch (error) {
64
+ const errorDecl = {
65
+ kind: 'ErrorDecl',
66
+ stainlessPath,
67
+ error: error instanceof Error ? error : new Error(String(error)),
68
+ message: `Error generating declaration: ${error instanceof Error ? error.message : String(error)}`,
69
+ };
70
+ map.set(stainlessPath, errorDecl);
71
+ getLogger().error(`Error generating declaration for ${stainlessPath}:`, error);
72
+ return stainlessPath;
73
+ }
74
+ }
75
+ export function declareAll(map, items) {
76
+ if (items.length === 0) {
77
+ return [];
78
+ }
79
+ return items.map(({ stainlessPath, generator }) => declare(map, stainlessPath, generator));
80
+ }
81
+ // Populates the `childrenParentSchema` property on property declarations, used in the API Docs product
82
+ // for e.g. determining if children are members of a union. This is a temporary hack and we should
83
+ // instead have a richer intermediate metadata object that includes this and other data.
84
+ export function schemaChildrenParent(schema) {
85
+ switch (schema.type) {
86
+ case 'array':
87
+ case 'map':
88
+ return schemaChildrenParent(schema.items.schema);
89
+ case 'object':
90
+ case 'intersection':
91
+ case 'union':
92
+ case 'enum':
93
+ return schema.type;
94
+ default:
95
+ return;
96
+ }
97
+ }
98
+ export function processReadme(content, language, languageSnippets) {
99
+ const snippets = {
100
+ ...languageSnippets,
101
+ ...GlobalSnippets,
102
+ };
103
+ return ctx.withLanguage(language, () => content.replace(/SDK_(\w+)/g, (_, key) => snippets[key]?.() ?? `SDK_${key}`));
104
+ }
105
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/types/stainless-alias/lib/json-spec-v2/types.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,7 @@
1
+ import type { SDKJSON } from './types/sdkjson';
2
+ export declare function flatResources(resources: Record<string, SDKJSON.Resource>, parents: SDKJSON.Resource[]): {
3
+ resource: SDKJSON.Resource;
4
+ parents: SDKJSON.Resource[];
5
+ }[];
6
+ export declare function getResourceFromSpec(stainlessPath: string | string[], spec: SDKJSON.Spec): SDKJSON.Resource | null;
7
+ export declare function isResourceEmpty(resource: SDKJSON.Resource): boolean;
package/dist/utils.js ADDED
@@ -0,0 +1,27 @@
1
+ import { parseStainlessPath } from './routing';
2
+ export function flatResources(resources, parents) {
3
+ return Object.keys(resources)
4
+ .toSorted()
5
+ .flatMap((key) => {
6
+ const resource = resources[key];
7
+ return [
8
+ { resource, parents },
9
+ ...(resource.subresources ? flatResources(resource.subresources, [...parents, resource]) : []),
10
+ ];
11
+ });
12
+ }
13
+ export function getResourceFromSpec(stainlessPath, spec) {
14
+ if (typeof stainlessPath === 'string') {
15
+ const parsed = parseStainlessPath(stainlessPath);
16
+ if (!parsed?.resource)
17
+ return null;
18
+ stainlessPath = parsed.resource;
19
+ }
20
+ return stainlessPath.reduce((accum, cur, index) => (index === 0 ? accum?.[cur] : accum?.subresources?.[cur]), spec.resources);
21
+ }
22
+ export function isResourceEmpty(resource) {
23
+ return !(Object.values(resource.methods).length > 0 ||
24
+ Object.values(resource.models).length > 0 ||
25
+ Object.values(resource.subresources).length > 0);
26
+ }
27
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/C,MAAM,UAAU,aAAa,CAC3B,SAA2C,EAC3C,OAA2B;IAE3B,OAAO,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC;SAC1B,QAAQ,EAAE;SACV,OAAO,CAAC,CAAC,GAAoB,EAAE,EAAE;QAChC,MAAM,QAAQ,GAAG,SAAS,CAAC,GAAG,CAAE,CAAC;QACjC,OAAO;YACL,EAAE,QAAQ,EAAE,OAAO,EAAE;YACrB,GAAG,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,aAAa,CAAC,QAAQ,CAAC,YAAY,EAAE,CAAC,GAAG,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;SAC/F,CAAC;IACJ,CAAC,CAAC,CAAC;AACP,CAAC;AAED,MAAM,UAAU,mBAAmB,CACjC,aAAgC,EAChC,IAAkB;IAElB,IAAI,OAAO,aAAa,KAAK,QAAQ,EAAE,CAAC;QACtC,MAAM,MAAM,GAAG,kBAAkB,CAAC,aAAa,CAAC,CAAC;QACjD,IAAI,CAAC,MAAM,EAAE,QAAQ;YAAE,OAAO,IAAI,CAAC;QACnC,aAAa,GAAG,MAAM,CAAC,QAAQ,CAAC;IAClC,CAAC;IAED,OAAO,aAAa,CAAC,MAAM,CACzB,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,YAAY,EAAE,CAAC,GAAG,CAAC,CAAC,EAChF,IAAI,CAAC,SAAS,CACf,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,QAA0B;IACxD,OAAO,CAAC,CACN,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC;QAC1C,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC;QACzC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,MAAM,GAAG,CAAC,CAChD,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@stainless-api/docs-ui",
3
- "version": "0.1.0-beta.1",
3
+ "private": false,
4
+ "version": "0.1.0-beta.10",
4
5
  "publishConfig": {
5
6
  "access": "public"
6
7
  },
@@ -17,17 +18,17 @@
17
18
  "fuse.js": "^7.1.0",
18
19
  "htmlparser2": "^10.0.0",
19
20
  "lucide-react": "^0.544.0",
20
- "react": "^19.1.1",
21
- "react-dom": "^19.1.1"
21
+ "react": "^19.2.0",
22
+ "react-dom": "^19.2.0",
23
+ "@stainless-api/ui-primitives": "0.1.0-beta.11"
22
24
  },
23
25
  "devDependencies": {
24
26
  "@types/node": "^24.4.0",
25
- "@types/react": "^19.1.13",
26
- "@types/react-dom": "^19.1.9",
27
- "dotenv": "17.2.2",
27
+ "@types/react": "^19.2.2",
28
+ "@types/react-dom": "^19.2.2",
29
+ "dotenv": "17.2.3",
28
30
  "esbuild": "^0.25.4",
29
31
  "tsx": "^4.20.3",
30
- "@stainless-api/ui-primitives": "0.1.0-beta.1",
31
32
  "@stainless/eslint-config": "0.0.0"
32
33
  },
33
34
  "scripts": {
@@ -42,15 +42,17 @@ export function MethodIconBadge({ httpMethod, showName }: MethodIconProps) {
42
42
 
43
43
  export type MethodHeaderProps = {
44
44
  title: ReactNode;
45
+ level?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5';
45
46
  signature?: ReactNode;
46
47
  badges?: ReactNode;
47
48
  children?: ReactNode;
48
49
  };
49
50
 
50
- export function MethodHeader({ title, badges, signature, children }: MethodHeaderProps) {
51
+ export function MethodHeader({ title, badges, signature, children, level }: MethodHeaderProps) {
52
+ const Heading = level ?? 'h5';
51
53
  return (
52
54
  <div className={style.MethodHeader}>
53
- <h5 className={style.MethodTitle}>{title}</h5>
55
+ <Heading className={style.MethodTitle}>{title}</Heading>
54
56
  {badges && <div className={style.MethodBadges}>{badges}</div>}
55
57
  {signature}
56
58
  {children}
@@ -58,6 +58,7 @@ export function SDKMethodSummary({ method }: SDKMethodSummaryProps) {
58
58
 
59
59
  return (
60
60
  <Docs.MethodHeader
61
+ level="h5"
61
62
  title={<Docs.Link stainlessPath={method.stainlessPath}>{method.summary ?? method.title}</Docs.Link>}
62
63
  signature={<Lang.MethodSignature decl={decl} />}
63
64
  badges={method.deprecated && <Docs.Badge id="deprecated">Deprecated</Docs.Badge>}
@@ -243,6 +243,7 @@ export function SDKMethodHeader({ method }: SDKMethodProps) {
243
243
 
244
244
  return (
245
245
  <Docs.MethodHeader
246
+ level="h1"
246
247
  title={method.summary ?? method.title}
247
248
  signature={<Lang.MethodSignature decl={decl} />}
248
249
  badges={method.deprecated && <Docs.Badge id="deprecated">Deprecated</Docs.Badge>}
@@ -383,9 +384,9 @@ export function SDKLanguageBlock({ language, version, install, links }: SDKLangu
383
384
 
384
385
  <div className={style.LanguageBlockInstall} data-stldocs-copy-parent>
385
386
  <pre data-stldocs-copy-content>{install}</pre>{' '}
386
- <button data-stldocs-snippet-copy>
387
+ <Button variant="ghost" size="sm" data-stldocs-snippet-copy>
387
388
  <Copy size={16} className={style.Icon} />
388
- </button>
389
+ </Button>
389
390
  </div>
390
391
 
391
392
  <div className={style.LanguageBlockLinks}>