Skip to content

Commit 8c955dd

Browse files
committed
feat: ✨ update api references to new api
1 parent 6f458aa commit 8c955dd

19 files changed

+579
-2174
lines changed

.eslintrc.cjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const config = {
3838
},
3939
],
4040
},
41-
ignorePatterns: ["*.cjs", "next.config.mjs"],
41+
ignorePatterns: ["*.cjs", "next.config.mjs", "scripts"],
4242
env: {
4343
es2022: true,
4444
node: true,

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

+7-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import type { Metadata } from "next";
99
import { notFound } from "next/navigation";
1010

1111
import { source } from "@/app/source";
12+
import { openapiAnteaterAPI } from "@/app/source";
1213

1314
export default async function Page({
1415
params,
@@ -26,7 +27,12 @@ export default async function Page({
2627
<DocsTitle>{page.data.title}</DocsTitle>
2728
<DocsDescription>{page.data.description}</DocsDescription>
2829
<DocsBody>
29-
<MDX components={{ ...defaultMdxComponents }} />
30+
<MDX
31+
components={{
32+
...defaultMdxComponents,
33+
APIPage: openapiAnteaterAPI.APIPage,
34+
}}
35+
/>
3036
</DocsBody>
3137
</DocsPage>
3238
);

app/source.ts

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { loader } from "fumadocs-core/source";
22
import { createMDXSource } from "fumadocs-mdx";
3+
import { attachFile, createOpenAPI } from "fumadocs-openapi/server";
34
import { icons } from "lucide-react";
45
import { createElement } from "react";
56

@@ -27,4 +28,9 @@ export const source = loader({
2728
});
2829
}
2930
},
31+
pageTree: {
32+
attachFile,
33+
},
3034
});
35+
36+
export const openapiAnteaterAPI = createOpenAPI({});

content/docs/developer/anteaterapi/graphql-api.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ title: GraphQL API
44

55
The GraphQL API allows for access to the same resources that can be accessed through the REST API.
66

7-
You can try using the GraphQL API through [Apollo Sandbox](/sandbox) (also available through the navbar), which is a lightweight web-based IDE for GraphQL queries. The Sandbox also contains up-to-date documentation on the different queries available, so you can develop and test all of your queries from within a single page.
7+
You can try using the GraphQL API through [Apollo Sandbox](https://studio.apollographql.com/sandbox/explorer?endpoint=https://anteaterapi.com/v2/graphql) (also available through the navbar), which is a lightweight web-based IDE for GraphQL queries. The Sandbox also contains up-to-date documentation on the different queries available, so you can develop and test all of your queries from within a single page.

content/docs/developer/anteaterapi/meta.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
"api-versioning",
88
"rest-api",
99
"graphql-api",
10-
"[Sandbox](https://studio.apollographql.com/sandbox/explorer?endpoint=https://api-next.peterportal.org/v1/graphql)"
10+
"[Sandbox](https://studio.apollographql.com/sandbox/explorer?endpoint=https://anteaterapi.com/v2/graphql)"
1111
]
1212
}
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,42 @@
11
---
22
title: Calendar
3+
full: true
4+
_openapi:
5+
toc:
6+
- depth: 2
7+
title: Retrieve term calendar
8+
url: "#retrieve-term-calendar"
9+
- depth: 2
10+
title: List all calendars
11+
url: "#list-all-calendars"
12+
- depth: 2
13+
title: Retrieve current week
14+
url: "#retrieve-current-week"
15+
structuredData:
16+
headings:
17+
- content: Retrieve term calendar
18+
id: retrieve-term-calendar
19+
- content: List all calendars
20+
id: list-all-calendars
21+
- content: Retrieve current week
22+
id: retrieve-current-week
23+
contents:
24+
- content: Retrieves key dates for the provided term.
25+
heading: retrieve-term-calendar
26+
- content: Retrieves all data for all terms that are currently available.
27+
heading: list-all-calendars
28+
- content: >-
29+
Retrieves week data for the provided date, or today if one is not
30+
provided.
31+
heading: retrieve-current-week
332
---
433

5-
import { Tabs, Tab } from "fumadocs-ui/components/tabs";
6-
7-
The calendar endpoint allows users to fetch important dates for the given quarter, such as when instruction begins and ends, and when final exams begin and end.
8-
9-
## Query parameters
10-
11-
#### `year` string <span style={{ color: "#ff86b4" }}>Required</span>
12-
13-
The year to query.
14-
15-
#### `quarter` Fall | Winter | Spring | Summer1 | Summer10wk | Summer2 <span style={{ color: "#ff86b4" }}>Required</span>
16-
17-
The quarter to query. Case-sensitive.
18-
19-
<Tabs items={["cURL"]}>
20-
<Tab value="cURL">
21-
```bash curl
22-
"https://api-next.peterportal.org/v1/rest/calendar?year=2023&quarter=Spring"
23-
```
24-
</Tab>
25-
</Tabs>
26-
27-
### Response
28-
29-
<Tabs items={['Example response', "Payload schema"]}>
30-
<Tab value='Example response'>
31-
```json
32-
{
33-
"instructionStart": "2023-04-03T00:00:00.000Z",
34-
"instructionEnd": "2023-06-09T00:00:00.000Z",
35-
"finalsStart": "2023-06-10T00:00:00.000Z",
36-
"finalsEnd": "2023-06-15T00:00:00.000Z"
37-
}
38-
```
39-
</Tab>
40-
<Tab value='Payload schema'>
41-
```typescript
42-
// https://github.com/icssc/peterportal-api-next/blob/main/packages/peterportal-api-next-types/types/calendar.ts
43-
type QuarterDates = {
44-
instructionStart: string;
45-
instructionEnd: string;
46-
finalsStart: string;
47-
finalsEnd: string;
48-
};
49-
```
50-
</Tab>
51-
</Tabs>
34+
<APIPage
35+
document={"https://anteaterapi.com/openapi.json"}
36+
operations={[
37+
{ method: "get", path: "/v2/rest/calendar" },
38+
{ method: "get", path: "/v2/rest/calendar/all" },
39+
{ method: "get", path: "/v2/rest/week" },
40+
]}
41+
hasHead={true}
42+
/>

0 commit comments

Comments
 (0)