Skip to content

Commit af31f10

Browse files
authored
feat: fixup openapi and related scripts & styles (#79)
1 parent 965929b commit af31f10

File tree

14 files changed

+93
-1010
lines changed

14 files changed

+93
-1010
lines changed

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
OPENAI_API_KEY=your_openai_api_key # Only used for generating embeddings or AI search
2-
NEXT_PUBLIC_SITE_URL=https://docs.recall.com # Only for production
2+
NEXT_PUBLIC_SITE_URL=https://docs.recall.network # Only for production
33
NEXT_PUBLIC_GA_ID=your_google_analytics_id # Only for production

app/[[...slug]]/page.tsx

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { ImageZoom, type ImageZoomProps } from "fumadocs-ui/components/image-zoo
44
import { Step, Steps } from "fumadocs-ui/components/steps";
55
import { Tab, Tabs } from "fumadocs-ui/components/tabs";
66
import { TypeTable } from "fumadocs-ui/components/type-table";
7+
import Image, { type ImageProps } from "next/image";
78
import { notFound } from "next/navigation";
89
import { HTMLAttributes } from "react";
910

@@ -26,23 +27,8 @@ const defaultMdxComponents = {
2627
Tab,
2728
Tabs,
2829
TypeTable,
29-
img: (props: ImageZoomProps) => {
30-
// Don't apply ImageZoom to images inside Card components
31-
// This prevents the unwanted zoom behavior on partner logos and other card images
32-
if (
33-
props.className?.includes("object-contain") ||
34-
props.alt?.includes("Network") ||
35-
props.alt?.includes("Protocol") ||
36-
props.alt?.includes("Terminal") ||
37-
props.alt?.includes("Lit") ||
38-
props.alt?.includes("Rhinestone") ||
39-
props.alt?.includes("Lilypad")
40-
) {
41-
// eslint-disable-next-line @next/next/no-img-element, jsx-a11y/alt-text
42-
return <img {...(props as any)} />;
43-
}
44-
return <ImageZoom {...props} />;
45-
},
30+
ImageNoZoom: (props: ImageProps) => <Image {...props} />,
31+
img: (props: ImageZoomProps) => <ImageZoom {...props} />,
4632
Card: (props: CardProps) => <Card {...props} />,
4733
Cards: (props: HTMLAttributes<HTMLDivElement>) => <Cards {...props} />,
4834
Callout: (props: CalloutProps) => <Callout {...props} />,
@@ -54,9 +40,15 @@ export default async function Page(props: { params: Promise<{ slug?: string[] }>
5440
if (!page) notFound();
5541

5642
const MDX = page.data.body;
57-
// Don't show the TOC or edit button on the root page
43+
// Don't show the TOC or edit button on the root page, or the auto-generated API reference pages
5844
const isRootPage = !params.slug || params.slug.length === 0;
59-
const isApiPage = params.slug?.[0] === "reference";
45+
const isApiReferencePage = params.slug?.[0] === "api-reference";
46+
// Ignore the `api-reference/endpoints` page since it's manually written, so we want the TOC
47+
const isApiReferenceRootPage =
48+
params.slug?.length === 2 &&
49+
params.slug?.[0] === "api-reference" &&
50+
params.slug?.[1] === "endpoints";
51+
const isApiPage = isApiReferencePage && !isApiReferenceRootPage;
6052
const githubPath = `docs/${page.file.path}`;
6153
const githubInfo = {
6254
repo: "docs",

docs/api-reference/endpoints/agent.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Agent
3-
description: Agent management endpoints
3+
description: Agent management endpoints for a single agent to interact with
44
full: true
55
_openapi:
66
toc: []
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
title: Agents
3+
description: Agent endpoints for querying or creating agents
4+
full: true
5+
_openapi:
6+
toc: []
7+
structuredData:
8+
headings: []
9+
contents:
10+
- content: Retrieve a list of agents based on querystring parameters
11+
- content: >-
12+
Retrieve the information for the given agent ID including owner information
13+
- content: Retrieve all competitions associated with the specified agent
14+
---
15+
16+
{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}
17+
18+
<APIPage
19+
document={"specs/competitions.json"}
20+
operations={[
21+
{ path: "/api/agents", method: "get" },
22+
{ path: "/api/agents/{agentId}", method: "get" },
23+
{ path: "/api/agents/{agentId}/competitions", method: "get" },
24+
]}
25+
webhooks={[]}
26+
hasHead={true}
27+
/>

docs/api-reference/endpoints/auth.mdx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,30 @@
11
---
22
title: Auth
3-
description: Authentication endpoints
3+
description: Authentication endpoints for verifying agent wallet ownership
44
full: true
55
_openapi:
66
toc: []
77
structuredData:
88
headings: []
99
contents:
10-
- content: >-
11-
Generates a new nonce and stores it in the session for SIWE message verification
1210
- content: >
1311
Generates a new nonce for agent wallet verification. The nonce is stored in the
1412
1513
database and must be included in the wallet verification message.
1614
1715
1816
Requires agent authentication via API key.
19-
- content: >-
20-
Verifies the SIWE message and signature, creates a session, and returns agent info
2117
- content: >-
2218
Verify wallet ownership for an authenticated agent via custom message signature
23-
- content: Clears the session data and destroys the session cookie
2419
---
2520

2621
{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}
2722

2823
<APIPage
2924
document={"specs/competitions.json"}
3025
operations={[
31-
{ path: "/api/auth/nonce", method: "get" },
3226
{ path: "/api/auth/agent/nonce", method: "get" },
33-
{ path: "/api/auth/login", method: "post" },
3427
{ path: "/api/auth/verify", method: "post" },
35-
{ path: "/api/auth/logout", method: "post" },
3628
]}
3729
webhooks={[]}
3830
hasHead={true}

docs/api-reference/endpoints/competition.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Competition
3-
description: Competition endpoints
3+
description: Get information about or interact with a competition
44
full: true
55
_openapi:
66
toc: []

docs/api-reference/endpoints/health.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Health
3-
description: Health check endpoints
3+
description: Health check endpoints to ensure the API is running
44
full: true
55
_openapi:
66
toc: []

docs/api-reference/endpoints/index.mdx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
---
22
title: Endpoints
3-
description: Trading competition API endpoints and usage
3+
description: Learn how to use Recall's Competition API endpoints for agent management and trading
44
---
55

6-
This reference documents the endpoints available in the multi-chain trading simulator API used for
7-
Recall trading competitions.
6+
This reference documents the endpoints available in Recall's Competition API used. It is primarily
7+
focused on:
8+
9+
- Creating and managing agents
10+
- Joining and leaving competitions (as an agent)
11+
- Fetching token prices and executing (paper) trades
12+
- Getting agent leaderboard rankings or per-competition results
813

914
<Callout type="warning">
1015

@@ -32,13 +37,13 @@ calls work and get ready for competitions.
3237
<Callout type="info">
3338

3439
You can also use
35-
[our sandbox server's Swagger page](https://api.competitions.recall.network/sandbox/api/docs/#/) to
40+
[our sandbox server's Swagger page](https://sandbox-api-competitions.recall.network/api/docs/#/) to
3641
learn more about the trading competition API.
3742

3843
</Callout>
3944

4045
```
41-
https://api.competitions.recall.network/sandbox
46+
https://sandbox-api-competitions.recall.network
4247
```
4348

4449
## Production competition server URL

docs/api-reference/endpoints/price.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Price
3-
description: Price information endpoints
3+
description: Price information endpoints for fetching token prices
44
full: true
55
_openapi:
66
toc: []

docs/api-reference/endpoints/trade.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Trade
3-
description: Trading endpoints
3+
description: Trading endpoints for executing trades as part of a competition
44
full: true
55
_openapi:
66
toc: []

0 commit comments

Comments
 (0)