@stainless-api/docs 0.1.0-beta.86 → 0.1.0-beta.87

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/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # @stainless-api/docs
2
2
 
3
+ ## 0.1.0-beta.87
4
+
5
+ ### Patch Changes
6
+
7
+ - b62eb05: improved support for webhooks and functions
8
+ - Updated dependencies [b62eb05]
9
+ - Updated dependencies [d42dd8f]
10
+ - @stainless-api/ui-primitives@0.1.0-beta.46
11
+ - @stainless-api/docs-ui@0.1.0-beta.65
12
+ - @stainless-api/docs-search@0.1.0-beta.18
13
+
3
14
  ## 0.1.0-beta.86
4
15
 
5
16
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stainless-api/docs",
3
- "version": "0.1.0-beta.86",
3
+ "version": "0.1.0-beta.87",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -58,9 +58,9 @@
58
58
  "vite-plugin-prebundle-workers": "^0.2.0",
59
59
  "web-worker": "^1.5.0",
60
60
  "yaml": "^2.8.2",
61
- "@stainless-api/docs-search": "0.1.0-beta.17",
62
- "@stainless-api/docs-ui": "0.1.0-beta.64",
63
- "@stainless-api/ui-primitives": "0.1.0-beta.45"
61
+ "@stainless-api/docs-search": "0.1.0-beta.18",
62
+ "@stainless-api/docs-ui": "0.1.0-beta.65",
63
+ "@stainless-api/ui-primitives": "0.1.0-beta.46"
64
64
  },
65
65
  "devDependencies": {
66
66
  "@astrojs/check": "^0.9.6",
@@ -2,16 +2,26 @@ import { StlSidebarEntry } from '@stainless-api/docs-ui/components';
2
2
  import { SidebarEntry } from '../pagination/util';
3
3
  import { ReactNode } from 'react';
4
4
  import { Badge, getHttpMethod } from '@stainless-api/ui-primitives';
5
+ import { FunctionIcon } from '@stainless-api/ui-primitives/icons';
5
6
 
6
7
  export function convertAstroSidebarToStl(entries: SidebarEntry[]): StlSidebarEntry[] {
7
8
  return entries.map((entry): StlSidebarEntry => {
8
9
  if (entry.type === 'link') {
9
10
  let icon: ReactNode | undefined;
10
11
 
11
- const httpMethod = getHttpMethod(entry.attrs['data-stldocs-method']);
12
+ const methodAttr = entry.attrs['data-stldocs-method'];
13
+ const httpMethod = getHttpMethod(methodAttr);
12
14
  if (httpMethod) {
13
15
  icon = <Badge.HTTP method={httpMethod} iconOnly size="sm" />;
14
16
  }
17
+ // Support empty string as method to show generic "Function" badge
18
+ else if (methodAttr === '') {
19
+ icon = (
20
+ <Badge size="sm" icon={<FunctionIcon />} intent="info">
21
+ {''}
22
+ </Badge>
23
+ );
24
+ }
15
25
 
16
26
  return {
17
27
  type: 'link',