Skip to content

Commit d6065f0

Browse files
committed
chore(dev-hub)-llm-improvements
1 parent ca3f4c3 commit d6065f0

File tree

11 files changed

+643
-81
lines changed

11 files changed

+643
-81
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
title: Get the list of supported chain ids
3+
full: true
4+
_openapi:
5+
method: GET
6+
route: /v1/chains
7+
toc: []
8+
structuredData:
9+
headings: []
10+
contents:
11+
- content: Get the list of supported chain ids
12+
---
13+
14+
{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}
15+
16+
Get the list of supported chain ids
17+
18+
<APIPage document={"https://fortuna.dourolabs.app/docs/openapi.json"} operations={[{"path":"/v1/chains","method":"get"}]} webhooks={[]} hasHead={false} />
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
title: Returns the logs of all requests captured by the keeper.
3+
full: true
4+
_openapi:
5+
method: GET
6+
route: /v1/logs
7+
toc: []
8+
structuredData:
9+
headings: []
10+
contents:
11+
- content: >-
12+
Returns the logs of all requests captured by the keeper.
13+
14+
15+
This endpoint allows you to filter the logs by a specific network ID,
16+
a query string (which can be a transaction hash, sender address, or
17+
sequence number), and a time range.
18+
19+
This is useful for debugging and monitoring the requests made to the
20+
Entropy contracts on various chains.
21+
---
22+
23+
{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}
24+
25+
Returns the logs of all requests captured by the keeper.
26+
27+
This endpoint allows you to filter the logs by a specific network ID, a query string (which can be a transaction hash, sender address, or sequence number), and a time range.
28+
This is useful for debugging and monitoring the requests made to the Entropy contracts on various chains.
29+
30+
<APIPage document={"https://fortuna.dourolabs.app/docs/openapi.json"} operations={[{"path":"/v1/logs","method":"get"}]} webhooks={[]} hasHead={false} />
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
title: Reveal the random value for a given sequence number and blockchain.
3+
full: true
4+
_openapi:
5+
method: GET
6+
route: /v1/chains/{chain_id}/revelations/{sequence}
7+
toc: []
8+
structuredData:
9+
headings: []
10+
contents:
11+
- content: >-
12+
Reveal the random value for a given sequence number and blockchain.
13+
14+
15+
Given a sequence number, retrieve the corresponding random value that
16+
this provider has committed to.
17+
18+
This endpoint will not return the random value unless someone has
19+
requested the sequence number on-chain.
20+
21+
22+
Every blockchain supported by this service has a distinct sequence of
23+
random numbers and chain_id.
24+
25+
Callers must pass the appropriate chain_id to ensure they fetch the
26+
correct random number.
27+
---
28+
29+
{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}
30+
31+
Reveal the random value for a given sequence number and blockchain.
32+
33+
Given a sequence number, retrieve the corresponding random value that this provider has committed to.
34+
This endpoint will not return the random value unless someone has requested the sequence number on-chain.
35+
36+
Every blockchain supported by this service has a distinct sequence of random numbers and chain_id.
37+
Callers must pass the appropriate chain_id to ensure they fetch the correct random number.
38+
39+
<APIPage document={"https://fortuna.dourolabs.app/docs/openapi.json"} operations={[{"path":"/v1/chains/{chain_id}/revelations/{sequence}","method":"get"}]} webhooks={[]} hasHead={false} />

apps/developer-hub/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
"test:format": "prettier --check .",
1818
"test:lint:eslint": "eslint . --max-warnings 0",
1919
"test:lint:stylelint": "stylelint 'src/**/*.scss' --max-warnings 0",
20-
"test:types": "tsc"
20+
"test:types": "tsc",
21+
"generate:docs": "bun ./scripts/generate-docs.ts"
2122
},
2223
"dependencies": {
2324
"@phosphor-icons/react": "catalog:",
@@ -28,7 +29,8 @@
2829
"clsx": "catalog:",
2930
"fumadocs-core": "catalog:",
3031
"fumadocs-mdx": "catalog:",
31-
"fumadocs-typescript": "^4.0.8",
32+
"fumadocs-openapi": "catalog:",
33+
"fumadocs-typescript": "catalog:",
3234
"fumadocs-ui": "catalog:",
3335
"katex": "catalog:",
3436
"next": "catalog:",
@@ -42,6 +44,7 @@
4244
"remark-gfm": "^4.0.1",
4345
"remark-math": "^6.0.0",
4446
"remark-mdx": "^3.1.1",
47+
"shiki": "catalog:",
4548
"viem": "catalog:",
4649
"zod": "catalog:",
4750
"zod-validation-error": "catalog:"
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { generateFiles } from 'fumadocs-openapi';
2+
3+
import { openapi } from '../src/lib/openapi';
4+
5+
// const schemas = await openapi.getSchemas();
6+
7+
// const fortunaSchema = schemas[fortunaOpenApiUrl];
8+
// const fortunaStagingSchema = schemas[fortunaStagingOpenApiUrl];
9+
10+
void generateFiles({
11+
per: 'operation',
12+
groupBy: 'route',
13+
input: openapi,
14+
output: './content/docs/openapi/(generated)',
15+
includeDescription: true,
16+
addGeneratedComment: true,
17+
});

apps/developer-hub/src/config/layout.config.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ export const baseOptions: BaseLayoutProps = {
1717

1818
export const docsOptions: DocsLayoutProps = {
1919
...baseOptions,
20-
tree: source.pageTree,
20+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any
21+
tree: source.pageTree as any,
2122
sidebar: {
2223
tabs: false,
2324
collapsible: false,
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { createOpenAPI } from 'fumadocs-openapi/server';
2+
3+
4+
export const fortunaOpenApiUrl = 'https://fortuna.dourolabs.app/docs/openapi.json';
5+
export const fortunaStagingOpenApiUrl = 'https://fortuna-staging.dourolabs.app/docs/openapi.json';
6+
7+
export const openapi = createOpenAPI({
8+
input: [fortunaOpenApiUrl, fortunaStagingOpenApiUrl],
9+
});

apps/developer-hub/src/lib/source.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ import {
2222
} from "@phosphor-icons/react/dist/ssr";
2323
import type { InferMetaType, InferPageType } from "fumadocs-core/source";
2424
import { loader } from "fumadocs-core/source";
25+
import { transformerOpenAPI } from 'fumadocs-openapi/server';
2526
import { createElement } from "react";
2627

28+
2729
import { docs } from "../../.source";
2830

2931
const icons: Record<string, React.ComponentType> = {
@@ -54,6 +56,10 @@ export const source = loader({
5456
return icon ? createElement(icons[icon] ?? FolderSimpleDashed) : undefined;
5557
},
5658
source: docs.toFumadocsSource(),
59+
pageTree: {
60+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
61+
transformers: [transformerOpenAPI()],
62+
},
5763
});
5864

5965
export type Page = InferPageType<typeof source>;

apps/developer-hub/src/mdx-components.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
import { InfoBox } from "@pythnetwork/component-library/InfoBox";
2+
import type { ApiPageProps } from 'fumadocs-openapi/ui';
3+
import { APIPage} from 'fumadocs-openapi/ui';
24
import { Tab, Tabs } from "fumadocs-ui/components/tabs";
35
import defaultMdxComponents from "fumadocs-ui/mdx";
46
import type { MDXComponents } from "mdx/types";
57

8+
import { openapi } from './lib/openapi';
9+
10+
611
export function getMDXComponents(components?: MDXComponents): MDXComponents {
712
return {
813
...defaultMdxComponents,
14+
APIPage: (props: ApiPageProps) => <APIPage {...openapi.getAPIPageProps(props)} />,
915
Tabs,
1016
Tab,
1117
...components,

0 commit comments

Comments
 (0)